{ "version": 3, "sources": [ "../node_modules/requirejs/require.js", "lib/base64.min.js", "lib/browserdetect.js", "lib/detectmobilebrowser.js", "lib/jquery.xdomainrequest.js", "lib/modernizr.js", "lib/ex.es3.min.js", "lib/BaseComponent.js", "lib/KeyCodes.js", "lib/HTTPStatusCode.js", "lib/jquery-plugins.js", "lib/ba-tiny-pubsub.js", "lib/manifesto.js", "lib/manifold.js", "lib/Utils.js", "lib/xss.min.js", "lib/fetch.umd.js", "UVDataProvider.js", "URLDataProvider.js", "lib/vocabulary.js", "modules/uv-shared-module/BaseEvents.js", "modules/uv-shared-module/Panel.js", "modules/uv-shared-module/BaseView.js", "modules/uv-shared-module/Position.js", "Utils.js", "modules/uv-shared-module/CenterPanel.js", "lib/IIIFAVComponent.js", "modules/uv-avcenterpanel-module/AVCenterPanel.js", "modules/uv-shared-module/InformationArgs.js", "modules/uv-shared-module/InformationType.js", "modules/uv-shared-module/LoginWarningMessages.js", "modules/uv-shared-module/Auth09.js", "modules/uv-shared-module/Auth1.js", "modules/uv-shared-module/Dialogue.js", "modules/uv-dialogues-module/AuthDialogue.js", "modules/uv-dialogues-module/ClickThroughDialogue.js", "modules/uv-dialogues-module/LoginDialogue.js", "modules/uv-shared-module/StringValue.js", "modules/uv-shared-module/MetricType.js", "modules/uv-dialogues-module/RestrictedDialogue.js", "modules/uv-shared-module/GenericDialogue.js", "modules/uv-shared-module/Shell.js", "SynchronousRequire.js", "modules/uv-shared-module/BaseExtension.js", "lib/GalleryComponent.js", "modules/uv-contentleftpanel-module/GalleryView.js", "modules/uv-shared-module/BaseExpandPanel.js", "modules/uv-shared-module/LeftPanel.js", "extensions/uv-seadragon-extension/Mode.js", "modules/uv-shared-module/ThumbsView.js", "extensions/uv-seadragon-extension/Events.js", "modules/uv-contentleftpanel-module/ThumbsView.js", "modules/uv-contentleftpanel-module/TreeView.js", "modules/uv-contentleftpanel-module/ContentLeftPanel.js", "modules/uv-shared-module/DownloadOption.js", "modules/uv-dialogues-module/DownloadDialogue.js", "extensions/uv-av-extension/DownloadDialogue.js", "modules/uv-shared-module/FooterPanel.js", "modules/uv-avmobilefooterpanel-module/MobileFooter.js", "modules/uv-shared-module/Information.js", "modules/uv-shared-module/InformationAction.js", "modules/uv-shared-module/InformationFactory.js", "modules/uv-shared-module/HeaderPanel.js", "lib/IIIFMetadataComponent.js", "modules/uv-shared-module/RightPanel.js", "modules/uv-moreinforightpanel-module/MoreInfoRightPanel.js", "modules/uv-dialogues-module/SettingsDialogue.js", "extensions/uv-av-extension/SettingsDialogue.js", "modules/uv-dialogues-module/ShareDialogue.js", "extensions/uv-av-extension/ShareDialogue.js", "extensions/uv-av-extension/Extension.js", "modules/uv-filelinkcenterpanel-module/FileLinkCenterPanel.js", "modules/uv-dialogues-module/HelpDialogue.js", "modules/uv-resourcesleftpanel-module/ThumbsView.js", "modules/uv-resourcesleftpanel-module/ResourcesLeftPanel.js", "extensions/uv-default-extension/SettingsDialogue.js", "extensions/uv-default-extension/ShareDialogue.js", "extensions/uv-default-extension/Extension.js", "extensions/uv-ebook-extension/Events.js", "modules/uv-ebookleftpanel-module/EbookLeftPanel.js", "extensions/uv-ebook-extension/DownloadDialogue.js", "modules/uv-ebookcenterpanel-module/EbookCenterPanel.js", "modules/uv-ebookmobilefooterpanel-module/MobileFooter.js", "modules/uv-dialogues-module/MoreInfoDialogue.js", "extensions/uv-ebook-extension/SettingsDialogue.js", "extensions/uv-ebook-extension/ShareDialogue.js", "extensions/uv-ebook-extension/Extension.js", "modules/uv-shared-module/Bookmark.js", "extensions/uv-mediaelement-extension/DownloadDialogue.js", "extensions/uv-mediaelement-extension/Events.js", "modules/uv-mediaelementcenterpanel-module/MediaElementCenterPanel.js", "extensions/uv-mediaelement-extension/SettingsDialogue.js", "extensions/uv-mediaelement-extension/ShareDialogue.js", "extensions/uv-mediaelement-extension/Extension.js", "modules/uv-shared-module/AnnotationResults.js", "modules/uv-shared-module/Point.js", "extensions/uv-seadragon-extension/CroppedImageDimensions.js", "extensions/uv-seadragon-extension/DownloadDialogue.js", "modules/uv-dialogues-module/ExternalContentDialogue.js", "modules/uv-osdmobilefooterpanel-module/MobileFooter.js", "modules/uv-shared-module/AutoComplete.js", "modules/uv-searchfooterpanel-module/FooterPanel.js", "modules/uv-multiselectdialogue-module/MultiSelectDialogue.js", "extensions/uv-seadragon-extension/MultiSelectionArgs.js", "modules/uv-pagingheaderpanel-module/PagingHeaderPanel.js", "extensions/uv-seadragon-extension/Bounds.js", "modules/uv-seadragoncenterpanel-module/SeadragonCenterPanel.js", "extensions/uv-seadragon-extension/SettingsDialogue.js", "extensions/uv-seadragon-extension/ShareDialogue.js", "extensions/uv-seadragon-extension/Extension.js", "extensions/uv-pdf-extension/DownloadDialogue.js", "extensions/uv-pdf-extension/Events.js", "modules/uv-pdfcenterpanel-module/PDFCenterPanel.js", "modules/uv-pdfheaderpanel-module/PDFHeaderPanel.js", "extensions/uv-pdf-extension/SettingsDialogue.js", "extensions/uv-pdf-extension/ShareDialogue.js", "extensions/uv-pdf-extension/Extension.js", "extensions/uv-virtex-extension/DownloadDialogue.js", "extensions/uv-virtex-extension/SettingsDialogue.js", "extensions/uv-virtex-extension/ShareDialogue.js", "modules/uv-virtexcenterpanel-module/VirtexCenterPanel.js", "extensions/uv-virtex-extension/Extension.js", "PubSub.js", "Polyfills.js", "UVComponent.js", "app.js" ], "names": [], "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjmEA;AACA;AACA;AACA,ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACvDA;AACA;AACA;AACA,ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACVA;AACA;AACA;AACA;AACA;AACA,ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AClZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1CA;AACA;AACA;AACA,ACHA;AACA;AACA;AACA,ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3oBA;AACA;AACA;AACA,ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACphBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpCA;AACA;AACA;AACA;AACA,ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AChIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC9MA;AACA;AACA;AACA,ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACrPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC9JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACthCA;AACA,ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC9kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3JA;AACA;AACA;AACA,ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC5SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACphBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AChNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC7iBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACh2BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC53BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACjUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACrIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AChZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "build.js", "sourcesContent": [ "/** vim: et:ts=4:sw=4:sts=4\n * @license RequireJS 2.2.0 Copyright jQuery Foundation and other contributors.\n * Released under MIT license, http://github.com/requirejs/requirejs/LICENSE\n */\n//Not using strict: uneven strict support in browsers, #392, and causes\n//problems with requirejs.exec()/transpiler plugins that may not be strict.\n/*jslint regexp: true, nomen: true, sloppy: true */\n/*global window, navigator, document, importScripts, setTimeout, opera */\n\nvar requirejs, require, define;\n(function (global) {\n var req, s, head, baseElement, dataMain, src,\n interactiveScript, currentlyAddingScript, mainScript, subPath,\n version = '2.2.0',\n commentRegExp = /(\\/\\*([\\s\\S]*?)\\*\\/|([^:]|^)\\/\\/(.*)$)/mg,\n cjsRequireRegExp = /[^.]\\s*require\\s*\\(\\s*[\"']([^'\"\\s]+)[\"']\\s*\\)/g,\n jsSuffixRegExp = /\\.js$/,\n currDirRegExp = /^\\.\\//,\n op = Object.prototype,\n ostring = op.toString,\n hasOwn = op.hasOwnProperty,\n isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),\n isWebWorker = !isBrowser && typeof importScripts !== 'undefined',\n //PS3 indicates loaded and complete, but need to wait for complete\n //specifically. Sequence is 'loading', 'loaded', execution,\n // then 'complete'. The UA check is unfortunate, but not sure how\n //to feature test w/o causing perf issues.\n readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?\n /^complete$/ : /^(complete|loaded)$/,\n defContextName = '_',\n //Oh the tragedy, detecting opera. See the usage of isOpera for reason.\n isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',\n contexts = {},\n cfg = {},\n globalDefQueue = [],\n useInteractive = false;\n\n //Could match something like ')//comment', do not lose the prefix to comment.\n function commentReplace(match, multi, multiText, singlePrefix) {\n return singlePrefix || '';\n }\n\n function isFunction(it) {\n return ostring.call(it) === '[object Function]';\n }\n\n function isArray(it) {\n return ostring.call(it) === '[object Array]';\n }\n\n /**\n * Helper function for iterating over an array. If the func returns\n * a true value, it will break out of the loop.\n */\n function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }\n\n /**\n * Helper function for iterating over an array backwards. If the func\n * returns a true value, it will break out of the loop.\n */\n function eachReverse(ary, func) {\n if (ary) {\n var i;\n for (i = ary.length - 1; i > -1; i -= 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }\n\n function hasProp(obj, prop) {\n return hasOwn.call(obj, prop);\n }\n\n function getOwn(obj, prop) {\n return hasProp(obj, prop) && obj[prop];\n }\n\n /**\n * Cycles over properties in an object and calls a function for each\n * property value. If the function returns a truthy value, then the\n * iteration is stopped.\n */\n function eachProp(obj, func) {\n var prop;\n for (prop in obj) {\n if (hasProp(obj, prop)) {\n if (func(obj[prop], prop)) {\n break;\n }\n }\n }\n }\n\n /**\n * Simple function to mix in properties from source into target,\n * but only if target does not already have a property of the same name.\n */\n function mixin(target, source, force, deepStringMixin) {\n if (source) {\n eachProp(source, function (value, prop) {\n if (force || !hasProp(target, prop)) {\n if (deepStringMixin && typeof value === 'object' && value &&\n !isArray(value) && !isFunction(value) &&\n !(value instanceof RegExp)) {\n\n if (!target[prop]) {\n target[prop] = {};\n }\n mixin(target[prop], value, force, deepStringMixin);\n } else {\n target[prop] = value;\n }\n }\n });\n }\n return target;\n }\n\n //Similar to Function.prototype.bind, but the 'this' object is specified\n //first, since it is easier to read/figure out what 'this' will be.\n function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }\n\n function scripts() {\n return document.getElementsByTagName('script');\n }\n\n function defaultOnError(err) {\n throw err;\n }\n\n //Allow getting a global that is expressed in\n //dot notation, like 'a.b.c'.\n function getGlobal(value) {\n if (!value) {\n return value;\n }\n var g = global;\n each(value.split('.'), function (part) {\n g = g[part];\n });\n return g;\n }\n\n /**\n * Constructs an error with a pointer to an URL with more information.\n * @param {String} id the error ID that maps to an ID on a web page.\n * @param {String} message human readable error.\n * @param {Error} [err] the original error, if there is one.\n *\n * @returns {Error}\n */\n function makeError(id, msg, err, requireModules) {\n var e = new Error(msg + '\\nhttp://requirejs.org/docs/errors.html#' + id);\n e.requireType = id;\n e.requireModules = requireModules;\n if (err) {\n e.originalError = err;\n }\n return e;\n }\n\n if (typeof define !== 'undefined') {\n //If a define is already in play via another AMD loader,\n //do not overwrite.\n return;\n }\n\n if (typeof requirejs !== 'undefined') {\n if (isFunction(requirejs)) {\n //Do not overwrite an existing requirejs instance.\n return;\n }\n cfg = requirejs;\n requirejs = undefined;\n }\n\n //Allow for a require config object\n if (typeof require !== 'undefined' && !isFunction(require)) {\n //assume it is a config object.\n cfg = require;\n require = undefined;\n }\n\n function newContext(contextName) {\n var inCheckLoaded, Module, context, handlers,\n checkLoadedTimeoutId,\n config = {\n //Defaults. Do not set a default for map\n //config to speed up normalize(), which\n //will run faster if there is no default.\n waitSeconds: 7,\n baseUrl: './',\n paths: {},\n bundles: {},\n pkgs: {},\n shim: {},\n config: {}\n },\n registry = {},\n //registry of just enabled modules, to speed\n //cycle breaking code when lots of modules\n //are registered, but not activated.\n enabledRegistry = {},\n undefEvents = {},\n defQueue = [],\n defined = {},\n urlFetched = {},\n bundlesMap = {},\n requireCounter = 1,\n unnormalizedCounter = 1;\n\n /**\n * Trims the . and .. from an array of path segments.\n * It will keep a leading path segment if a .. will become\n * the first path segment, to help with module name lookups,\n * which act like paths, but can be remapped. But the end result,\n * all paths that use this function should look normalized.\n * NOTE: this method MODIFIES the input array.\n * @param {Array} ary the array of path segments.\n */\n function trimDots(ary) {\n var i, part;\n for (i = 0; i < ary.length; i++) {\n part = ary[i];\n if (part === '.') {\n ary.splice(i, 1);\n i -= 1;\n } else if (part === '..') {\n // If at the start, or previous value is still ..,\n // keep them so that when converted to a path it may\n // still work when converted to a path, even though\n // as an ID it is less than ideal. In larger point\n // releases, may be better to just kick out an error.\n if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') {\n continue;\n } else if (i > 0) {\n ary.splice(i - 1, 2);\n i -= 2;\n }\n }\n }\n }\n\n /**\n * Given a relative module name, like ./something, normalize it to\n * a real name that can be mapped to a path.\n * @param {String} name the relative name\n * @param {String} baseName a real name that the name arg is relative\n * to.\n * @param {Boolean} applyMap apply the map config to the value. Should\n * only be done if this normalization is for a dependency ID.\n * @returns {String} normalized name\n */\n function normalize(name, baseName, applyMap) {\n var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,\n foundMap, foundI, foundStarMap, starI, normalizedBaseParts,\n baseParts = (baseName && baseName.split('/')),\n map = config.map,\n starMap = map && map['*'];\n\n //Adjust any relative paths.\n if (name) {\n name = name.split('/');\n lastIndex = name.length - 1;\n\n // If wanting node ID compatibility, strip .js from end\n // of IDs. Have to do this here, and not in nameToUrl\n // because node allows either .js or non .js to map\n // to same file.\n if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {\n name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');\n }\n\n // Starts with a '.' so need the baseName\n if (name[0].charAt(0) === '.' && baseParts) {\n //Convert baseName to array, and lop off the last part,\n //so that . matches that 'directory' and not name of the baseName's\n //module. For instance, baseName of 'one/two/three', maps to\n //'one/two/three.js', but we want the directory, 'one/two' for\n //this normalization.\n normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);\n name = normalizedBaseParts.concat(name);\n }\n\n trimDots(name);\n name = name.join('/');\n }\n\n //Apply map config if available.\n if (applyMap && map && (baseParts || starMap)) {\n nameParts = name.split('/');\n\n outerLoop: for (i = nameParts.length; i > 0; i -= 1) {\n nameSegment = nameParts.slice(0, i).join('/');\n\n if (baseParts) {\n //Find the longest baseName segment match in the config.\n //So, do joins on the biggest to smallest lengths of baseParts.\n for (j = baseParts.length; j > 0; j -= 1) {\n mapValue = getOwn(map, baseParts.slice(0, j).join('/'));\n\n //baseName segment has config, find if it has one for\n //this name.\n if (mapValue) {\n mapValue = getOwn(mapValue, nameSegment);\n if (mapValue) {\n //Match, update name to the new value.\n foundMap = mapValue;\n foundI = i;\n break outerLoop;\n }\n }\n }\n }\n\n //Check for a star map match, but just hold on to it,\n //if there is a shorter segment match later in a matching\n //config, then favor over this star map.\n if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {\n foundStarMap = getOwn(starMap, nameSegment);\n starI = i;\n }\n }\n\n if (!foundMap && foundStarMap) {\n foundMap = foundStarMap;\n foundI = starI;\n }\n\n if (foundMap) {\n nameParts.splice(0, foundI, foundMap);\n name = nameParts.join('/');\n }\n }\n\n // If the name points to a package's name, use\n // the package main instead.\n pkgMain = getOwn(config.pkgs, name);\n\n return pkgMain ? pkgMain : name;\n }\n\n function removeScript(name) {\n if (isBrowser) {\n each(scripts(), function (scriptNode) {\n if (scriptNode.getAttribute('data-requiremodule') === name &&\n scriptNode.getAttribute('data-requirecontext') === context.contextName) {\n scriptNode.parentNode.removeChild(scriptNode);\n return true;\n }\n });\n }\n }\n\n function hasPathFallback(id) {\n var pathConfig = getOwn(config.paths, id);\n if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {\n //Pop off the first array value, since it failed, and\n //retry\n pathConfig.shift();\n context.require.undef(id);\n\n //Custom require that does not do map translation, since\n //ID is \"absolute\", already mapped/resolved.\n context.makeRequire(null, {\n skipMap: true\n })([id]);\n\n return true;\n }\n }\n\n //Turns a plugin!resource to [plugin, resource]\n //with the plugin being undefined if the name\n //did not have a plugin prefix.\n function splitPrefix(name) {\n var prefix,\n index = name ? name.indexOf('!') : -1;\n if (index > -1) {\n prefix = name.substring(0, index);\n name = name.substring(index + 1, name.length);\n }\n return [prefix, name];\n }\n\n /**\n * Creates a module mapping that includes plugin prefix, module\n * name, and path. If parentModuleMap is provided it will\n * also normalize the name via require.normalize()\n *\n * @param {String} name the module name\n * @param {String} [parentModuleMap] parent module map\n * for the module name, used to resolve relative names.\n * @param {Boolean} isNormalized: is the ID already normalized.\n * This is true if this call is done for a define() module ID.\n * @param {Boolean} applyMap: apply the map config to the ID.\n * Should only be true if this map is for a dependency.\n *\n * @returns {Object}\n */\n function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {\n var url, pluginModule, suffix, nameParts,\n prefix = null,\n parentName = parentModuleMap ? parentModuleMap.name : null,\n originalName = name,\n isDefine = true,\n normalizedName = '';\n\n //If no name, then it means it is a require call, generate an\n //internal name.\n if (!name) {\n isDefine = false;\n name = '_@r' + (requireCounter += 1);\n }\n\n nameParts = splitPrefix(name);\n prefix = nameParts[0];\n name = nameParts[1];\n\n if (prefix) {\n prefix = normalize(prefix, parentName, applyMap);\n pluginModule = getOwn(defined, prefix);\n }\n\n //Account for relative paths if there is a base name.\n if (name) {\n if (prefix) {\n if (pluginModule && pluginModule.normalize) {\n //Plugin is loaded, use its normalize method.\n normalizedName = pluginModule.normalize(name, function (name) {\n return normalize(name, parentName, applyMap);\n });\n } else {\n // If nested plugin references, then do not try to\n // normalize, as it will not normalize correctly. This\n // places a restriction on resourceIds, and the longer\n // term solution is not to normalize until plugins are\n // loaded and all normalizations to allow for async\n // loading of a loader plugin. But for now, fixes the\n // common uses. Details in #1131\n normalizedName = name.indexOf('!') === -1 ?\n normalize(name, parentName, applyMap) :\n name;\n }\n } else {\n //A regular module.\n normalizedName = normalize(name, parentName, applyMap);\n\n //Normalized name may be a plugin ID due to map config\n //application in normalize. The map config values must\n //already be normalized, so do not need to redo that part.\n nameParts = splitPrefix(normalizedName);\n prefix = nameParts[0];\n normalizedName = nameParts[1];\n isNormalized = true;\n\n url = context.nameToUrl(normalizedName);\n }\n }\n\n //If the id is a plugin id that cannot be determined if it needs\n //normalization, stamp it with a unique ID so two matching relative\n //ids that may conflict can be separate.\n suffix = prefix && !pluginModule && !isNormalized ?\n '_unnormalized' + (unnormalizedCounter += 1) :\n '';\n\n return {\n prefix: prefix,\n name: normalizedName,\n parentMap: parentModuleMap,\n unnormalized: !!suffix,\n url: url,\n originalName: originalName,\n isDefine: isDefine,\n id: (prefix ?\n prefix + '!' + normalizedName :\n normalizedName) + suffix\n };\n }\n\n function getModule(depMap) {\n var id = depMap.id,\n mod = getOwn(registry, id);\n\n if (!mod) {\n mod = registry[id] = new context.Module(depMap);\n }\n\n return mod;\n }\n\n function on(depMap, name, fn) {\n var id = depMap.id,\n mod = getOwn(registry, id);\n\n if (hasProp(defined, id) &&\n (!mod || mod.defineEmitComplete)) {\n if (name === 'defined') {\n fn(defined[id]);\n }\n } else {\n mod = getModule(depMap);\n if (mod.error && name === 'error') {\n fn(mod.error);\n } else {\n mod.on(name, fn);\n }\n }\n }\n\n function onError(err, errback) {\n var ids = err.requireModules,\n notified = false;\n\n if (errback) {\n errback(err);\n } else {\n each(ids, function (id) {\n var mod = getOwn(registry, id);\n if (mod) {\n //Set error on module, so it skips timeout checks.\n mod.error = err;\n if (mod.events.error) {\n notified = true;\n mod.emit('error', err);\n }\n }\n });\n\n if (!notified) {\n req.onError(err);\n }\n }\n }\n\n /**\n * Internal method to transfer globalQueue items to this context's\n * defQueue.\n */\n function takeGlobalQueue() {\n //Push all the globalDefQueue items into the context's defQueue\n if (globalDefQueue.length) {\n each(globalDefQueue, function(queueItem) {\n var id = queueItem[0];\n if (typeof id === 'string') {\n context.defQueueMap[id] = true;\n }\n defQueue.push(queueItem);\n });\n globalDefQueue = [];\n }\n }\n\n handlers = {\n 'require': function (mod) {\n if (mod.require) {\n return mod.require;\n } else {\n return (mod.require = context.makeRequire(mod.map));\n }\n },\n 'exports': function (mod) {\n mod.usingExports = true;\n if (mod.map.isDefine) {\n if (mod.exports) {\n return (defined[mod.map.id] = mod.exports);\n } else {\n return (mod.exports = defined[mod.map.id] = {});\n }\n }\n },\n 'module': function (mod) {\n if (mod.module) {\n return mod.module;\n } else {\n return (mod.module = {\n id: mod.map.id,\n uri: mod.map.url,\n config: function () {\n return getOwn(config.config, mod.map.id) || {};\n },\n exports: mod.exports || (mod.exports = {})\n });\n }\n }\n };\n\n function cleanRegistry(id) {\n //Clean up machinery used for waiting modules.\n delete registry[id];\n delete enabledRegistry[id];\n }\n\n function breakCycle(mod, traced, processed) {\n var id = mod.map.id;\n\n if (mod.error) {\n mod.emit('error', mod.error);\n } else {\n traced[id] = true;\n each(mod.depMaps, function (depMap, i) {\n var depId = depMap.id,\n dep = getOwn(registry, depId);\n\n //Only force things that have not completed\n //being defined, so still in the registry,\n //and only if it has not been matched up\n //in the module already.\n if (dep && !mod.depMatched[i] && !processed[depId]) {\n if (getOwn(traced, depId)) {\n mod.defineDep(i, defined[depId]);\n mod.check(); //pass false?\n } else {\n breakCycle(dep, traced, processed);\n }\n }\n });\n processed[id] = true;\n }\n }\n\n function checkLoaded() {\n var err, usingPathFallback,\n waitInterval = config.waitSeconds * 1000,\n //It is possible to disable the wait interval by using waitSeconds of 0.\n expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),\n noLoads = [],\n reqCalls = [],\n stillLoading = false,\n needCycleCheck = true;\n\n //Do not bother if this call was a result of a cycle break.\n if (inCheckLoaded) {\n return;\n }\n\n inCheckLoaded = true;\n\n //Figure out the state of all the modules.\n eachProp(enabledRegistry, function (mod) {\n var map = mod.map,\n modId = map.id;\n\n //Skip things that are not enabled or in error state.\n if (!mod.enabled) {\n return;\n }\n\n if (!map.isDefine) {\n reqCalls.push(mod);\n }\n\n if (!mod.error) {\n //If the module should be executed, and it has not\n //been inited and time is up, remember it.\n if (!mod.inited && expired) {\n if (hasPathFallback(modId)) {\n usingPathFallback = true;\n stillLoading = true;\n } else {\n noLoads.push(modId);\n removeScript(modId);\n }\n } else if (!mod.inited && mod.fetched && map.isDefine) {\n stillLoading = true;\n if (!map.prefix) {\n //No reason to keep looking for unfinished\n //loading. If the only stillLoading is a\n //plugin resource though, keep going,\n //because it may be that a plugin resource\n //is waiting on a non-plugin cycle.\n return (needCycleCheck = false);\n }\n }\n }\n });\n\n if (expired && noLoads.length) {\n //If wait time expired, throw error of unloaded modules.\n err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);\n err.contextName = context.contextName;\n return onError(err);\n }\n\n //Not expired, check for a cycle.\n if (needCycleCheck) {\n each(reqCalls, function (mod) {\n breakCycle(mod, {}, {});\n });\n }\n\n //If still waiting on loads, and the waiting load is something\n //other than a plugin resource, or there are still outstanding\n //scripts, then just try back later.\n if ((!expired || usingPathFallback) && stillLoading) {\n //Something is still waiting to load. Wait for it, but only\n //if a timeout is not already in effect.\n if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {\n checkLoadedTimeoutId = setTimeout(function () {\n checkLoadedTimeoutId = 0;\n checkLoaded();\n }, 50);\n }\n }\n\n inCheckLoaded = false;\n }\n\n Module = function (map) {\n this.events = getOwn(undefEvents, map.id) || {};\n this.map = map;\n this.shim = getOwn(config.shim, map.id);\n this.depExports = [];\n this.depMaps = [];\n this.depMatched = [];\n this.pluginMaps = {};\n this.depCount = 0;\n\n /* this.exports this.factory\n this.depMaps = [],\n this.enabled, this.fetched\n */\n };\n\n Module.prototype = {\n init: function (depMaps, factory, errback, options) {\n options = options || {};\n\n //Do not do more inits if already done. Can happen if there\n //are multiple define calls for the same module. That is not\n //a normal, common case, but it is also not unexpected.\n if (this.inited) {\n return;\n }\n\n this.factory = factory;\n\n if (errback) {\n //Register for errors on this module.\n this.on('error', errback);\n } else if (this.events.error) {\n //If no errback already, but there are error listeners\n //on this module, set up an errback to pass to the deps.\n errback = bind(this, function (err) {\n this.emit('error', err);\n });\n }\n\n //Do a copy of the dependency array, so that\n //source inputs are not modified. For example\n //\"shim\" deps are passed in here directly, and\n //doing a direct modification of the depMaps array\n //would affect that config.\n this.depMaps = depMaps && depMaps.slice(0);\n\n this.errback = errback;\n\n //Indicate this module has be initialized\n this.inited = true;\n\n this.ignore = options.ignore;\n\n //Could have option to init this module in enabled mode,\n //or could have been previously marked as enabled. However,\n //the dependencies are not known until init is called. So\n //if enabled previously, now trigger dependencies as enabled.\n if (options.enabled || this.enabled) {\n //Enable this module and dependencies.\n //Will call this.check()\n this.enable();\n } else {\n this.check();\n }\n },\n\n defineDep: function (i, depExports) {\n //Because of cycles, defined callback for a given\n //export can be called more than once.\n if (!this.depMatched[i]) {\n this.depMatched[i] = true;\n this.depCount -= 1;\n this.depExports[i] = depExports;\n }\n },\n\n fetch: function () {\n if (this.fetched) {\n return;\n }\n this.fetched = true;\n\n context.startTime = (new Date()).getTime();\n\n var map = this.map;\n\n //If the manager is for a plugin managed resource,\n //ask the plugin to load it now.\n if (this.shim) {\n context.makeRequire(this.map, {\n enableBuildCallback: true\n })(this.shim.deps || [], bind(this, function () {\n return map.prefix ? this.callPlugin() : this.load();\n }));\n } else {\n //Regular dependency.\n return map.prefix ? this.callPlugin() : this.load();\n }\n },\n\n load: function () {\n var url = this.map.url;\n\n //Regular dependency.\n if (!urlFetched[url]) {\n urlFetched[url] = true;\n context.load(this.map.id, url);\n }\n },\n\n /**\n * Checks if the module is ready to define itself, and if so,\n * define it.\n */\n check: function () {\n if (!this.enabled || this.enabling) {\n return;\n }\n\n var err, cjsModule,\n id = this.map.id,\n depExports = this.depExports,\n exports = this.exports,\n factory = this.factory;\n\n if (!this.inited) {\n // Only fetch if not already in the defQueue.\n if (!hasProp(context.defQueueMap, id)) {\n this.fetch();\n }\n } else if (this.error) {\n this.emit('error', this.error);\n } else if (!this.defining) {\n //The factory could trigger another require call\n //that would result in checking this module to\n //define itself again. If already in the process\n //of doing that, skip this work.\n this.defining = true;\n\n if (this.depCount < 1 && !this.defined) {\n if (isFunction(factory)) {\n //If there is an error listener, favor passing\n //to that instead of throwing an error. However,\n //only do it for define()'d modules. require\n //errbacks should not be called for failures in\n //their callbacks (#699). However if a global\n //onError is set, use that.\n if ((this.events.error && this.map.isDefine) ||\n req.onError !== defaultOnError) {\n try {\n exports = context.execCb(id, factory, depExports, exports);\n } catch (e) {\n err = e;\n }\n } else {\n exports = context.execCb(id, factory, depExports, exports);\n }\n\n // Favor return value over exports. If node/cjs in play,\n // then will not have a return value anyway. Favor\n // module.exports assignment over exports object.\n if (this.map.isDefine && exports === undefined) {\n cjsModule = this.module;\n if (cjsModule) {\n exports = cjsModule.exports;\n } else if (this.usingExports) {\n //exports already set the defined value.\n exports = this.exports;\n }\n }\n\n if (err) {\n err.requireMap = this.map;\n err.requireModules = this.map.isDefine ? [this.map.id] : null;\n err.requireType = this.map.isDefine ? 'define' : 'require';\n return onError((this.error = err));\n }\n\n } else {\n //Just a literal value\n exports = factory;\n }\n\n this.exports = exports;\n\n if (this.map.isDefine && !this.ignore) {\n defined[id] = exports;\n\n if (req.onResourceLoad) {\n var resLoadMaps = [];\n each(this.depMaps, function (depMap) {\n resLoadMaps.push(depMap.normalizedMap || depMap);\n });\n req.onResourceLoad(context, this.map, resLoadMaps);\n }\n }\n\n //Clean up\n cleanRegistry(id);\n\n this.defined = true;\n }\n\n //Finished the define stage. Allow calling check again\n //to allow define notifications below in the case of a\n //cycle.\n this.defining = false;\n\n if (this.defined && !this.defineEmitted) {\n this.defineEmitted = true;\n this.emit('defined', this.exports);\n this.defineEmitComplete = true;\n }\n\n }\n },\n\n callPlugin: function () {\n var map = this.map,\n id = map.id,\n //Map already normalized the prefix.\n pluginMap = makeModuleMap(map.prefix);\n\n //Mark this as a dependency for this plugin, so it\n //can be traced for cycles.\n this.depMaps.push(pluginMap);\n\n on(pluginMap, 'defined', bind(this, function (plugin) {\n var load, normalizedMap, normalizedMod,\n bundleId = getOwn(bundlesMap, this.map.id),\n name = this.map.name,\n parentName = this.map.parentMap ? this.map.parentMap.name : null,\n localRequire = context.makeRequire(map.parentMap, {\n enableBuildCallback: true\n });\n\n //If current map is not normalized, wait for that\n //normalized name to load instead of continuing.\n if (this.map.unnormalized) {\n //Normalize the ID if the plugin allows it.\n if (plugin.normalize) {\n name = plugin.normalize(name, function (name) {\n return normalize(name, parentName, true);\n }) || '';\n }\n\n //prefix and name should already be normalized, no need\n //for applying map config again either.\n normalizedMap = makeModuleMap(map.prefix + '!' + name,\n this.map.parentMap);\n on(normalizedMap,\n 'defined', bind(this, function (value) {\n this.map.normalizedMap = normalizedMap;\n this.init([], function () { return value; }, null, {\n enabled: true,\n ignore: true\n });\n }));\n\n normalizedMod = getOwn(registry, normalizedMap.id);\n if (normalizedMod) {\n //Mark this as a dependency for this plugin, so it\n //can be traced for cycles.\n this.depMaps.push(normalizedMap);\n\n if (this.events.error) {\n normalizedMod.on('error', bind(this, function (err) {\n this.emit('error', err);\n }));\n }\n normalizedMod.enable();\n }\n\n return;\n }\n\n //If a paths config, then just load that file instead to\n //resolve the plugin, as it is built into that paths layer.\n if (bundleId) {\n this.map.url = context.nameToUrl(bundleId);\n this.load();\n return;\n }\n\n load = bind(this, function (value) {\n this.init([], function () { return value; }, null, {\n enabled: true\n });\n });\n\n load.error = bind(this, function (err) {\n this.inited = true;\n this.error = err;\n err.requireModules = [id];\n\n //Remove temp unnormalized modules for this module,\n //since they will never be resolved otherwise now.\n eachProp(registry, function (mod) {\n if (mod.map.id.indexOf(id + '_unnormalized') === 0) {\n cleanRegistry(mod.map.id);\n }\n });\n\n onError(err);\n });\n\n //Allow plugins to load other code without having to know the\n //context or how to 'complete' the load.\n load.fromText = bind(this, function (text, textAlt) {\n /*jslint evil: true */\n var moduleName = map.name,\n moduleMap = makeModuleMap(moduleName),\n hasInteractive = useInteractive;\n\n //As of 2.1.0, support just passing the text, to reinforce\n //fromText only being called once per resource. Still\n //support old style of passing moduleName but discard\n //that moduleName in favor of the internal ref.\n if (textAlt) {\n text = textAlt;\n }\n\n //Turn off interactive script matching for IE for any define\n //calls in the text, then turn it back on at the end.\n if (hasInteractive) {\n useInteractive = false;\n }\n\n //Prime the system by creating a module instance for\n //it.\n getModule(moduleMap);\n\n //Transfer any config to this other module.\n if (hasProp(config.config, id)) {\n config.config[moduleName] = config.config[id];\n }\n\n try {\n req.exec(text);\n } catch (e) {\n return onError(makeError('fromtexteval',\n 'fromText eval for ' + id +\n ' failed: ' + e,\n e,\n [id]));\n }\n\n if (hasInteractive) {\n useInteractive = true;\n }\n\n //Mark this as a dependency for the plugin\n //resource\n this.depMaps.push(moduleMap);\n\n //Support anonymous modules.\n context.completeLoad(moduleName);\n\n //Bind the value of that module to the value for this\n //resource ID.\n localRequire([moduleName], load);\n });\n\n //Use parentName here since the plugin's name is not reliable,\n //could be some weird string with no path that actually wants to\n //reference the parentName's path.\n plugin.load(map.name, localRequire, load, config);\n }));\n\n context.enable(pluginMap, this);\n this.pluginMaps[pluginMap.id] = pluginMap;\n },\n\n enable: function () {\n enabledRegistry[this.map.id] = this;\n this.enabled = true;\n\n //Set flag mentioning that the module is enabling,\n //so that immediate calls to the defined callbacks\n //for dependencies do not trigger inadvertent load\n //with the depCount still being zero.\n this.enabling = true;\n\n //Enable each dependency\n each(this.depMaps, bind(this, function (depMap, i) {\n var id, mod, handler;\n\n if (typeof depMap === 'string') {\n //Dependency needs to be converted to a depMap\n //and wired up to this module.\n depMap = makeModuleMap(depMap,\n (this.map.isDefine ? this.map : this.map.parentMap),\n false,\n !this.skipMap);\n this.depMaps[i] = depMap;\n\n handler = getOwn(handlers, depMap.id);\n\n if (handler) {\n this.depExports[i] = handler(this);\n return;\n }\n\n this.depCount += 1;\n\n on(depMap, 'defined', bind(this, function (depExports) {\n if (this.undefed) {\n return;\n }\n this.defineDep(i, depExports);\n this.check();\n }));\n\n if (this.errback) {\n on(depMap, 'error', bind(this, this.errback));\n } else if (this.events.error) {\n // No direct errback on this module, but something\n // else is listening for errors, so be sure to\n // propagate the error correctly.\n on(depMap, 'error', bind(this, function(err) {\n this.emit('error', err);\n }));\n }\n }\n\n id = depMap.id;\n mod = registry[id];\n\n //Skip special modules like 'require', 'exports', 'module'\n //Also, don't call enable if it is already enabled,\n //important in circular dependency cases.\n if (!hasProp(handlers, id) && mod && !mod.enabled) {\n context.enable(depMap, this);\n }\n }));\n\n //Enable each plugin that is used in\n //a dependency\n eachProp(this.pluginMaps, bind(this, function (pluginMap) {\n var mod = getOwn(registry, pluginMap.id);\n if (mod && !mod.enabled) {\n context.enable(pluginMap, this);\n }\n }));\n\n this.enabling = false;\n\n this.check();\n },\n\n on: function (name, cb) {\n var cbs = this.events[name];\n if (!cbs) {\n cbs = this.events[name] = [];\n }\n cbs.push(cb);\n },\n\n emit: function (name, evt) {\n each(this.events[name], function (cb) {\n cb(evt);\n });\n if (name === 'error') {\n //Now that the error handler was triggered, remove\n //the listeners, since this broken Module instance\n //can stay around for a while in the registry.\n delete this.events[name];\n }\n }\n };\n\n function callGetModule(args) {\n //Skip modules already defined.\n if (!hasProp(defined, args[0])) {\n getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);\n }\n }\n\n function removeListener(node, func, name, ieName) {\n //Favor detachEvent because of IE9\n //issue, see attachEvent/addEventListener comment elsewhere\n //in this file.\n if (node.detachEvent && !isOpera) {\n //Probably IE. If not it will throw an error, which will be\n //useful to know.\n if (ieName) {\n node.detachEvent(ieName, func);\n }\n } else {\n node.removeEventListener(name, func, false);\n }\n }\n\n /**\n * Given an event from a script node, get the requirejs info from it,\n * and then removes the event listeners on the node.\n * @param {Event} evt\n * @returns {Object}\n */\n function getScriptData(evt) {\n //Using currentTarget instead of target for Firefox 2.0's sake. Not\n //all old browsers will be supported, but this one was easy enough\n //to support and still makes sense.\n var node = evt.currentTarget || evt.srcElement;\n\n //Remove the listeners once here.\n removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');\n removeListener(node, context.onScriptError, 'error');\n\n return {\n node: node,\n id: node && node.getAttribute('data-requiremodule')\n };\n }\n\n function intakeDefines() {\n var args;\n\n //Any defined modules in the global queue, intake them now.\n takeGlobalQueue();\n\n //Make sure any remaining defQueue items get properly processed.\n while (defQueue.length) {\n args = defQueue.shift();\n if (args[0] === null) {\n return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' +\n args[args.length - 1]));\n } else {\n //args are id, deps, factory. Should be normalized by the\n //define() function.\n callGetModule(args);\n }\n }\n context.defQueueMap = {};\n }\n\n context = {\n config: config,\n contextName: contextName,\n registry: registry,\n defined: defined,\n urlFetched: urlFetched,\n defQueue: defQueue,\n defQueueMap: {},\n Module: Module,\n makeModuleMap: makeModuleMap,\n nextTick: req.nextTick,\n onError: onError,\n\n /**\n * Set a configuration for the context.\n * @param {Object} cfg config object to integrate.\n */\n configure: function (cfg) {\n //Make sure the baseUrl ends in a slash.\n if (cfg.baseUrl) {\n if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {\n cfg.baseUrl += '/';\n }\n }\n\n // Convert old style urlArgs string to a function.\n if (typeof cfg.urlArgs === 'string') {\n var urlArgs = cfg.urlArgs;\n cfg.urlArgs = function(id, url) {\n return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs;\n };\n }\n\n //Save off the paths since they require special processing,\n //they are additive.\n var shim = config.shim,\n objs = {\n paths: true,\n bundles: true,\n config: true,\n map: true\n };\n\n eachProp(cfg, function (value, prop) {\n if (objs[prop]) {\n if (!config[prop]) {\n config[prop] = {};\n }\n mixin(config[prop], value, true, true);\n } else {\n config[prop] = value;\n }\n });\n\n //Reverse map the bundles\n if (cfg.bundles) {\n eachProp(cfg.bundles, function (value, prop) {\n each(value, function (v) {\n if (v !== prop) {\n bundlesMap[v] = prop;\n }\n });\n });\n }\n\n //Merge shim\n if (cfg.shim) {\n eachProp(cfg.shim, function (value, id) {\n //Normalize the structure\n if (isArray(value)) {\n value = {\n deps: value\n };\n }\n if ((value.exports || value.init) && !value.exportsFn) {\n value.exportsFn = context.makeShimExports(value);\n }\n shim[id] = value;\n });\n config.shim = shim;\n }\n\n //Adjust packages if necessary.\n if (cfg.packages) {\n each(cfg.packages, function (pkgObj) {\n var location, name;\n\n pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj;\n\n name = pkgObj.name;\n location = pkgObj.location;\n if (location) {\n config.paths[name] = pkgObj.location;\n }\n\n //Save pointer to main module ID for pkg name.\n //Remove leading dot in main, so main paths are normalized,\n //and remove any trailing .js, since different package\n //envs have different conventions: some use a module name,\n //some use a file name.\n config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')\n .replace(currDirRegExp, '')\n .replace(jsSuffixRegExp, '');\n });\n }\n\n //If there are any \"waiting to execute\" modules in the registry,\n //update the maps for them, since their info, like URLs to load,\n //may have changed.\n eachProp(registry, function (mod, id) {\n //If module already has init called, since it is too\n //late to modify them, and ignore unnormalized ones\n //since they are transient.\n if (!mod.inited && !mod.map.unnormalized) {\n mod.map = makeModuleMap(id, null, true);\n }\n });\n\n //If a deps array or a config callback is specified, then call\n //require with those args. This is useful when require is defined as a\n //config object before require.js is loaded.\n if (cfg.deps || cfg.callback) {\n context.require(cfg.deps || [], cfg.callback);\n }\n },\n\n makeShimExports: function (value) {\n function fn() {\n var ret;\n if (value.init) {\n ret = value.init.apply(global, arguments);\n }\n return ret || (value.exports && getGlobal(value.exports));\n }\n return fn;\n },\n\n makeRequire: function (relMap, options) {\n options = options || {};\n\n function localRequire(deps, callback, errback) {\n var id, map, requireMod;\n\n if (options.enableBuildCallback && callback && isFunction(callback)) {\n callback.__requireJsBuild = true;\n }\n\n if (typeof deps === 'string') {\n if (isFunction(callback)) {\n //Invalid call\n return onError(makeError('requireargs', 'Invalid require call'), errback);\n }\n\n //If require|exports|module are requested, get the\n //value for them from the special handlers. Caveat:\n //this only works while module is being defined.\n if (relMap && hasProp(handlers, deps)) {\n return handlers[deps](registry[relMap.id]);\n }\n\n //Synchronous access to one module. If require.get is\n //available (as in the Node adapter), prefer that.\n if (req.get) {\n return req.get(context, deps, relMap, localRequire);\n }\n\n //Normalize module name, if it contains . or ..\n map = makeModuleMap(deps, relMap, false, true);\n id = map.id;\n\n if (!hasProp(defined, id)) {\n return onError(makeError('notloaded', 'Module name \"' +\n id +\n '\" has not been loaded yet for context: ' +\n contextName +\n (relMap ? '' : '. Use require([])')));\n }\n return defined[id];\n }\n\n //Grab defines waiting in the global queue.\n intakeDefines();\n\n //Mark all the dependencies as needing to be loaded.\n context.nextTick(function () {\n //Some defines could have been added since the\n //require call, collect them.\n intakeDefines();\n\n requireMod = getModule(makeModuleMap(null, relMap));\n\n //Store if map config should be applied to this require\n //call for dependencies.\n requireMod.skipMap = options.skipMap;\n\n requireMod.init(deps, callback, errback, {\n enabled: true\n });\n\n checkLoaded();\n });\n\n return localRequire;\n }\n\n mixin(localRequire, {\n isBrowser: isBrowser,\n\n /**\n * Converts a module name + .extension into an URL path.\n * *Requires* the use of a module name. It does not support using\n * plain URLs like nameToUrl.\n */\n toUrl: function (moduleNamePlusExt) {\n var ext,\n index = moduleNamePlusExt.lastIndexOf('.'),\n segment = moduleNamePlusExt.split('/')[0],\n isRelative = segment === '.' || segment === '..';\n\n //Have a file extension alias, and it is not the\n //dots from a relative path.\n if (index !== -1 && (!isRelative || index > 1)) {\n ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);\n moduleNamePlusExt = moduleNamePlusExt.substring(0, index);\n }\n\n return context.nameToUrl(normalize(moduleNamePlusExt,\n relMap && relMap.id, true), ext, true);\n },\n\n defined: function (id) {\n return hasProp(defined, makeModuleMap(id, relMap, false, true).id);\n },\n\n specified: function (id) {\n id = makeModuleMap(id, relMap, false, true).id;\n return hasProp(defined, id) || hasProp(registry, id);\n }\n });\n\n //Only allow undef on top level require calls\n if (!relMap) {\n localRequire.undef = function (id) {\n //Bind any waiting define() calls to this context,\n //fix for #408\n takeGlobalQueue();\n\n var map = makeModuleMap(id, relMap, true),\n mod = getOwn(registry, id);\n\n mod.undefed = true;\n removeScript(id);\n\n delete defined[id];\n delete urlFetched[map.url];\n delete undefEvents[id];\n\n //Clean queued defines too. Go backwards\n //in array so that the splices do not\n //mess up the iteration.\n eachReverse(defQueue, function(args, i) {\n if (args[0] === id) {\n defQueue.splice(i, 1);\n }\n });\n delete context.defQueueMap[id];\n\n if (mod) {\n //Hold on to listeners in case the\n //module will be attempted to be reloaded\n //using a different config.\n if (mod.events.defined) {\n undefEvents[id] = mod.events;\n }\n\n cleanRegistry(id);\n }\n };\n }\n\n return localRequire;\n },\n\n /**\n * Called to enable a module if it is still in the registry\n * awaiting enablement. A second arg, parent, the parent module,\n * is passed in for context, when this method is overridden by\n * the optimizer. Not shown here to keep code compact.\n */\n enable: function (depMap) {\n var mod = getOwn(registry, depMap.id);\n if (mod) {\n getModule(depMap).enable();\n }\n },\n\n /**\n * Internal method used by environment adapters to complete a load event.\n * A load event could be a script load or just a load pass from a synchronous\n * load call.\n * @param {String} moduleName the name of the module to potentially complete.\n */\n completeLoad: function (moduleName) {\n var found, args, mod,\n shim = getOwn(config.shim, moduleName) || {},\n shExports = shim.exports;\n\n takeGlobalQueue();\n\n while (defQueue.length) {\n args = defQueue.shift();\n if (args[0] === null) {\n args[0] = moduleName;\n //If already found an anonymous module and bound it\n //to this name, then this is some other anon module\n //waiting for its completeLoad to fire.\n if (found) {\n break;\n }\n found = true;\n } else if (args[0] === moduleName) {\n //Found matching define call for this script!\n found = true;\n }\n\n callGetModule(args);\n }\n context.defQueueMap = {};\n\n //Do this after the cycle of callGetModule in case the result\n //of those calls/init calls changes the registry.\n mod = getOwn(registry, moduleName);\n\n if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {\n if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {\n if (hasPathFallback(moduleName)) {\n return;\n } else {\n return onError(makeError('nodefine',\n 'No define call for ' + moduleName,\n null,\n [moduleName]));\n }\n } else {\n //A script that does not call define(), so just simulate\n //the call for it.\n callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);\n }\n }\n\n checkLoaded();\n },\n\n /**\n * Converts a module name to a file path. Supports cases where\n * moduleName may actually be just an URL.\n * Note that it **does not** call normalize on the moduleName,\n * it is assumed to have already been normalized. This is an\n * internal API, not a public one. Use toUrl for the public API.\n */\n nameToUrl: function (moduleName, ext, skipExt) {\n var paths, syms, i, parentModule, url,\n parentPath, bundleId,\n pkgMain = getOwn(config.pkgs, moduleName);\n\n if (pkgMain) {\n moduleName = pkgMain;\n }\n\n bundleId = getOwn(bundlesMap, moduleName);\n\n if (bundleId) {\n return context.nameToUrl(bundleId, ext, skipExt);\n }\n\n //If a colon is in the URL, it indicates a protocol is used and it is just\n //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)\n //or ends with .js, then assume the user meant to use an url and not a module id.\n //The slash is important for protocol-less URLs as well as full paths.\n if (req.jsExtRegExp.test(moduleName)) {\n //Just a plain path, not module name lookup, so just return it.\n //Add extension if it is included. This is a bit wonky, only non-.js things pass\n //an extension, this method probably needs to be reworked.\n url = moduleName + (ext || '');\n } else {\n //A module that needs to be converted to a path.\n paths = config.paths;\n\n syms = moduleName.split('/');\n //For each module name segment, see if there is a path\n //registered for it. Start with most specific name\n //and work up from it.\n for (i = syms.length; i > 0; i -= 1) {\n parentModule = syms.slice(0, i).join('/');\n\n parentPath = getOwn(paths, parentModule);\n if (parentPath) {\n //If an array, it means there are a few choices,\n //Choose the one that is desired\n if (isArray(parentPath)) {\n parentPath = parentPath[0];\n }\n syms.splice(0, i, parentPath);\n break;\n }\n }\n\n //Join the path parts together, then figure out if baseUrl is needed.\n url = syms.join('/');\n url += (ext || (/^data\\:|^blob\\:|\\?/.test(url) || skipExt ? '' : '.js'));\n url = (url.charAt(0) === '/' || url.match(/^[\\w\\+\\.\\-]+:/) ? '' : config.baseUrl) + url;\n }\n\n return config.urlArgs && !/^blob\\:/.test(url) ?\n url + config.urlArgs(moduleName, url) : url;\n },\n\n //Delegates to req.load. Broken out as a separate function to\n //allow overriding in the optimizer.\n load: function (id, url) {\n req.load(context, id, url);\n },\n\n /**\n * Executes a module callback function. Broken out as a separate function\n * solely to allow the build system to sequence the files in the built\n * layer in the right sequence.\n *\n * @private\n */\n execCb: function (name, callback, args, exports) {\n return callback.apply(exports, args);\n },\n\n /**\n * callback for script loads, used to check status of loading.\n *\n * @param {Event} evt the event from the browser for the script\n * that was loaded.\n */\n onScriptLoad: function (evt) {\n //Using currentTarget instead of target for Firefox 2.0's sake. Not\n //all old browsers will be supported, but this one was easy enough\n //to support and still makes sense.\n if (evt.type === 'load' ||\n (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {\n //Reset interactive script so a script node is not held onto for\n //to long.\n interactiveScript = null;\n\n //Pull out the name of the module and the context.\n var data = getScriptData(evt);\n context.completeLoad(data.id);\n }\n },\n\n /**\n * Callback for script errors.\n */\n onScriptError: function (evt) {\n var data = getScriptData(evt);\n if (!hasPathFallback(data.id)) {\n var parents = [];\n eachProp(registry, function(value, key) {\n if (key.indexOf('_@r') !== 0) {\n each(value.depMaps, function(depMap) {\n if (depMap.id === data.id) {\n parents.push(key);\n return true;\n }\n });\n }\n });\n return onError(makeError('scripterror', 'Script error for \"' + data.id +\n (parents.length ?\n '\", needed by: ' + parents.join(', ') :\n '\"'), evt, [data.id]));\n }\n }\n };\n\n context.require = context.makeRequire();\n return context;\n }\n\n /**\n * Main entry point.\n *\n * If the only argument to require is a string, then the module that\n * is represented by that string is fetched for the appropriate context.\n *\n * If the first argument is an array, then it will be treated as an array\n * of dependency string names to fetch. An optional function callback can\n * be specified to execute when all of those dependencies are available.\n *\n * Make a local req variable to help Caja compliance (it assumes things\n * on a require that are not standardized), and to give a short\n * name for minification/local scope use.\n */\n req = requirejs = function (deps, callback, errback, optional) {\n\n //Find the right context, use default\n var context, config,\n contextName = defContextName;\n\n // Determine if have config object in the call.\n if (!isArray(deps) && typeof deps !== 'string') {\n // deps is a config object\n config = deps;\n if (isArray(callback)) {\n // Adjust args if there are dependencies\n deps = callback;\n callback = errback;\n errback = optional;\n } else {\n deps = [];\n }\n }\n\n if (config && config.context) {\n contextName = config.context;\n }\n\n context = getOwn(contexts, contextName);\n if (!context) {\n context = contexts[contextName] = req.s.newContext(contextName);\n }\n\n if (config) {\n context.configure(config);\n }\n\n return context.require(deps, callback, errback);\n };\n\n /**\n * Support require.config() to make it easier to cooperate with other\n * AMD loaders on globally agreed names.\n */\n req.config = function (config) {\n return req(config);\n };\n\n /**\n * Execute something after the current tick\n * of the event loop. Override for other envs\n * that have a better solution than setTimeout.\n * @param {Function} fn function to execute later.\n */\n req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {\n setTimeout(fn, 4);\n } : function (fn) { fn(); };\n\n /**\n * Export require as a global, but only if it does not already exist.\n */\n if (!require) {\n require = req;\n }\n\n req.version = version;\n\n //Used to filter out dependencies that are already paths.\n req.jsExtRegExp = /^\\/|:|\\?|\\.js$/;\n req.isBrowser = isBrowser;\n s = req.s = {\n contexts: contexts,\n newContext: newContext\n };\n\n //Create default context.\n req({});\n\n //Exports some context-sensitive methods on global require.\n each([\n 'toUrl',\n 'undef',\n 'defined',\n 'specified'\n ], function (prop) {\n //Reference from contexts instead of early binding to default context,\n //so that during builds, the latest instance of the default context\n //with its config gets used.\n req[prop] = function () {\n var ctx = contexts[defContextName];\n return ctx.require[prop].apply(ctx, arguments);\n };\n });\n\n if (isBrowser) {\n head = s.head = document.getElementsByTagName('head')[0];\n //If BASE tag is in play, using appendChild is a problem for IE6.\n //When that browser dies, this can be removed. Details in this jQuery bug:\n //http://dev.jquery.com/ticket/2709\n baseElement = document.getElementsByTagName('base')[0];\n if (baseElement) {\n head = s.head = baseElement.parentNode;\n }\n }\n\n /**\n * Any errors that require explicitly generates will be passed to this\n * function. Intercept/override it if you want custom error handling.\n * @param {Error} err the error object.\n */\n req.onError = defaultOnError;\n\n /**\n * Creates the node for the load command. Only used in browser envs.\n */\n req.createNode = function (config, moduleName, url) {\n var node = config.xhtml ?\n document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :\n document.createElement('script');\n node.type = config.scriptType || 'text/javascript';\n node.charset = 'utf-8';\n node.async = true;\n return node;\n };\n\n /**\n * Does the request to load a module for the browser case.\n * Make this a separate function to allow other environments\n * to override it.\n *\n * @param {Object} context the require context to find state.\n * @param {String} moduleName the name of the module.\n * @param {Object} url the URL to the module.\n */\n req.load = function (context, moduleName, url) {\n var config = (context && context.config) || {},\n node;\n if (isBrowser) {\n //In the browser so use a script tag\n node = req.createNode(config, moduleName, url);\n\n node.setAttribute('data-requirecontext', context.contextName);\n node.setAttribute('data-requiremodule', moduleName);\n\n //Set up load listener. Test attachEvent first because IE9 has\n //a subtle issue in its addEventListener and script onload firings\n //that do not match the behavior of all other browsers with\n //addEventListener support, which fire the onload event for a\n //script right after the script execution. See:\n //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution\n //UNFORTUNATELY Opera implements attachEvent but does not follow the script\n //script execution mode.\n if (node.attachEvent &&\n //Check if node.attachEvent is artificially added by custom script or\n //natively supported by browser\n //read https://github.com/requirejs/requirejs/issues/187\n //if we can NOT find [native code] then it must NOT natively supported.\n //in IE8, node.attachEvent does not have toString()\n //Note the test for \"[native code\" with no closing brace, see:\n //https://github.com/requirejs/requirejs/issues/273\n !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&\n !isOpera) {\n //Probably IE. IE (at least 6-8) do not fire\n //script onload right after executing the script, so\n //we cannot tie the anonymous define call to a name.\n //However, IE reports the script as being in 'interactive'\n //readyState at the time of the define call.\n useInteractive = true;\n\n node.attachEvent('onreadystatechange', context.onScriptLoad);\n //It would be great to add an error handler here to catch\n //404s in IE9+. However, onreadystatechange will fire before\n //the error handler, so that does not help. If addEventListener\n //is used, then IE will fire error before load, but we cannot\n //use that pathway given the connect.microsoft.com issue\n //mentioned above about not doing the 'script execute,\n //then fire the script load event listener before execute\n //next script' that other browsers do.\n //Best hope: IE10 fixes the issues,\n //and then destroys all installs of IE 6-9.\n //node.attachEvent('onerror', context.onScriptError);\n } else {\n node.addEventListener('load', context.onScriptLoad, false);\n node.addEventListener('error', context.onScriptError, false);\n }\n node.src = url;\n\n //Calling onNodeCreated after all properties on the node have been\n //set, but before it is placed in the DOM.\n if (config.onNodeCreated) {\n config.onNodeCreated(node, config, moduleName, url);\n }\n\n //For some cache cases in IE 6-8, the script executes before the end\n //of the appendChild execution, so to tie an anonymous define\n //call to the module name (which is stored on the node), hold on\n //to a reference to this node, but clear after the DOM insertion.\n currentlyAddingScript = node;\n if (baseElement) {\n head.insertBefore(node, baseElement);\n } else {\n head.appendChild(node);\n }\n currentlyAddingScript = null;\n\n return node;\n } else if (isWebWorker) {\n try {\n //In a web worker, use importScripts. This is not a very\n //efficient use of importScripts, importScripts will block until\n //its script is downloaded and evaluated. However, if web workers\n //are in play, the expectation is that a build has been done so\n //that only one script needs to be loaded anyway. This may need\n //to be reevaluated if other use cases become common.\n\n // Post a task to the event loop to work around a bug in WebKit\n // where the worker gets garbage-collected after calling\n // importScripts(): https://webkit.org/b/153317\n setTimeout(function() {}, 0);\n importScripts(url);\n\n //Account for anonymous modules\n context.completeLoad(moduleName);\n } catch (e) {\n context.onError(makeError('importscripts',\n 'importScripts failed for ' +\n moduleName + ' at ' + url,\n e,\n [moduleName]));\n }\n }\n };\n\n function getInteractiveScript() {\n if (interactiveScript && interactiveScript.readyState === 'interactive') {\n return interactiveScript;\n }\n\n eachReverse(scripts(), function (script) {\n if (script.readyState === 'interactive') {\n return (interactiveScript = script);\n }\n });\n return interactiveScript;\n }\n\n //Look for a data-main script attribute, which could also adjust the baseUrl.\n if (isBrowser && !cfg.skipDataMain) {\n //Figure out baseUrl. Get it from the script tag with require.js in it.\n eachReverse(scripts(), function (script) {\n //Set the 'head' where we can append children by\n //using the script's parent.\n if (!head) {\n head = script.parentNode;\n }\n\n //Look for a data-main attribute to set main script for the page\n //to load. If it is there, the path to data main becomes the\n //baseUrl, if it is not already set.\n dataMain = script.getAttribute('data-main');\n if (dataMain) {\n //Preserve dataMain in case it is a path (i.e. contains '?')\n mainScript = dataMain;\n\n //Set final baseUrl if there is not already an explicit one,\n //but only do so if the data-main value is not a loader plugin\n //module ID.\n if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {\n //Pull off the directory of data-main for use as the\n //baseUrl.\n src = mainScript.split('/');\n mainScript = src.pop();\n subPath = src.length ? src.join('/') + '/' : './';\n\n cfg.baseUrl = subPath;\n }\n\n //Strip off any trailing .js since mainScript is now\n //like a module name.\n mainScript = mainScript.replace(jsSuffixRegExp, '');\n\n //If mainScript is still a path, fall back to dataMain\n if (req.jsExtRegExp.test(mainScript)) {\n mainScript = dataMain;\n }\n\n //Put the data-main script in the files to load.\n cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];\n\n return true;\n }\n });\n }\n\n /**\n * The function that handles definitions of modules. Differs from\n * require() in that a string for the module should be the first argument,\n * and the function to execute after dependencies are loaded should\n * return a value to define the module corresponding to the first argument's\n * name.\n */\n define = function (name, deps, callback) {\n var node, context;\n\n //Allow for anonymous modules\n if (typeof name !== 'string') {\n //Adjust args appropriately\n callback = deps;\n deps = name;\n name = null;\n }\n\n //This module may not have dependencies\n if (!isArray(deps)) {\n callback = deps;\n deps = null;\n }\n\n //If no name, and callback is a function, then figure out if it a\n //CommonJS thing with dependencies.\n if (!deps && isFunction(callback)) {\n deps = [];\n //Remove comments from the callback string,\n //look for require calls, and pull them into the dependencies,\n //but only if there are function args.\n if (callback.length) {\n callback\n .toString()\n .replace(commentRegExp, commentReplace)\n .replace(cjsRequireRegExp, function (match, dep) {\n deps.push(dep);\n });\n\n //May be a CommonJS thing even without require calls, but still\n //could use exports, and module. Avoid doing exports and module\n //work though if it just needs require.\n //REQUIRES the function to expect the CommonJS variables in the\n //order listed below.\n deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);\n }\n }\n\n //If in IE 6-8 and hit an anonymous define() call, do the interactive\n //work.\n if (useInteractive) {\n node = currentlyAddingScript || getInteractiveScript();\n if (node) {\n if (!name) {\n name = node.getAttribute('data-requiremodule');\n }\n context = contexts[node.getAttribute('data-requirecontext')];\n }\n }\n\n //Always save off evaluating the def call until the script onload handler.\n //This allows multiple modules to be in a file without prematurely\n //tracing dependencies, and allows for anonymous module support,\n //where the module name is not known until the script onload event\n //occurs. If no context, use the global queue, and get it processed\n //in the onscript load callback.\n if (context) {\n context.defQueue.push([name, deps, callback]);\n context.defQueueMap[name] = true;\n } else {\n globalDefQueue.push([name, deps, callback]);\n }\n };\n\n define.amd = {\n jQuery: true\n };\n\n /**\n * Executes the text. Normally just uses eval, but can be modified\n * to use a better, environment-specific call. Only used for transpiling\n * loader plugins, not for plain JS modules.\n * @param {String} text the text to execute/evaluate.\n */\n req.exec = function (text) {\n /*jslint evil: true */\n return eval(text);\n };\n\n //Set up with config info.\n req(cfg);\n}(this));\n\ndefine(\"requireLib\", function(){});\n\n", "!function(){function t(t){this.message=t}var r=\"undefined\"!=typeof exports?exports:self,e=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";t.prototype=new Error,t.prototype.name=\"InvalidCharacterError\",r.btoa||(r.btoa=function(r){for(var o,n,a=String(r),i=0,c=e,d=\"\";a.charAt(0|i)||(c=\"=\",i%1);d+=c.charAt(63&o>>8-i%1*8)){if(n=a.charCodeAt(i+=.75),n>255)throw new t(\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");o=o<<8|n}return d}),r.atob||(r.atob=function(r){var o=String(r).replace(/=+$/,\"\");if(o.length%4==1)throw new t(\"'atob' failed: The string to be decoded is not correctly encoded.\");for(var n,a,i=0,c=0,d=\"\";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?d+=String.fromCharCode(255&n>>(-2*i&6)):0)a=e.indexOf(a);return d})}();\ndefine(\"lib/base64.min.js\", function(){});\n\n", "window.browserDetect = {\n init: function () {\n this.browser = this.searchString(this.dataBrowser) || \"Other\";\n this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || \"Unknown\";\n // detect IE 11\n if (this.browser == 'Explorer' && this.version == '7' && navigator.userAgent.match(/Trident/i)) {\n this.version = this.searchVersionIE();\n }\n },\n\n searchString: function (data) {\n for (var i = 0 ; i < data.length ; i++) {\n var dataString = data[i].string;\n this.versionSearchString = data[i].subString;\n\n if (dataString.indexOf(data[i].subString) != -1) {\n return data[i].identity;\n }\n }\n },\n\n searchVersion: function (dataString) {\n var index = dataString.indexOf(this.versionSearchString);\n if (index == -1) return;\n return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));\n },\n\n searchVersionIE: function() {\n var ua = navigator.userAgent.toString().toLowerCase(),\n match = /(trident)(?:.*rv:([\\w.]+))?/.exec(ua) || /(msie) ([\\w.]+)/.exec(ua) || ['', null, -1],\n ver;\n try {\n ver = (match[2]).split('.')[0]; // version\n }\n catch (err) {\n ver = 'unknown'; //\n }\n return ver;\n },\n\n dataBrowser:\n [\n { string: navigator.userAgent, subString: \"Chrome\", identity: \"Chrome\" },\n { string: navigator.userAgent, subString: \"MSIE\", identity: \"Explorer\" },\n { string: navigator.userAgent, subString: \"Trident\", identity: \"Explorer\" },\n { string: navigator.userAgent, subString: \"Firefox\", identity: \"Firefox\" },\n { string: navigator.userAgent, subString: \"Safari\", identity: \"Safari\" },\n { string: navigator.userAgent, subString: \"Opera\", identity: \"Opera\" }\n ]\n\n};\n\nwindow.browserDetect.init();\ndefine(\"lib/browserdetect.js\", function(){});\n\n", "(function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|android|ipad|playbook|silk|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);\ndefine(\"lib/detectmobilebrowser.js\", function(){});\n\n", "/*!\n * jQuery-ajaxTransport-XDomainRequest - v1.0.4 - 2015-03-05\n * https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest\n * Copyright (c) 2015 Jason Moon (@JSONMOON)\n * Licensed MIT (/blob/master/LICENSE.txt)\n */\n(function(factory) {\n //if (typeof define === 'function' && define.amd) {\n // // AMD. Register as anonymous module.\n // define(['jquery'], factory);\n //} else if (typeof exports === 'object') {\n // // CommonJS\n // module.exports = factory(require('jquery'));\n //} else {\n // Browser globals.\n factory(jQuery);\n //}\n}(function($) {\n\n// Only continue if we're on IE8/IE9 with jQuery 1.5+ (contains the ajaxTransport function)\n if ($.support.cors || !$.ajaxTransport || !window.XDomainRequest) {\n return $;\n }\n\n var httpRegEx = /^(https?:)?\\/\\//i;\n var getOrPostRegEx = /^get|post$/i;\n var sameSchemeRegEx = new RegExp('^(\\/\\/|' + location.protocol + ')', 'i');\n\n// ajaxTransport exists in jQuery 1.5+\n $.ajaxTransport('* text html xml json', function(options, userOptions, jqXHR) {\n\n // Only continue if the request is: asynchronous, uses GET or POST method, has HTTP or HTTPS protocol, and has the same scheme as the calling page\n if (!options.crossDomain || !options.async || !getOrPostRegEx.test(options.type) || !httpRegEx.test(options.url) || !sameSchemeRegEx.test(options.url)) {\n return;\n }\n\n var xdr = null;\n\n return {\n send: function(headers, complete) {\n var postData = '';\n var userType = (userOptions.dataType || '').toLowerCase();\n\n xdr = new XDomainRequest();\n if (/^\\d+$/.test(userOptions.timeout)) {\n xdr.timeout = userOptions.timeout;\n }\n\n xdr.ontimeout = function() {\n complete(500, 'timeout');\n };\n\n xdr.onload = function() {\n var allResponseHeaders = 'Content-Length: ' + xdr.responseText.length + '\\r\\nContent-Type: ' + xdr.contentType;\n var status = {\n code: 200,\n message: 'success'\n };\n var responses = {\n text: xdr.responseText\n };\n try {\n if (userType === 'html' || /text\\/html/i.test(xdr.contentType)) {\n responses.html = xdr.responseText;\n } else if (userType === 'json' || (userType !== 'text' && /\\/json/i.test(xdr.contentType))) {\n try {\n responses.json = $.parseJSON(xdr.responseText);\n } catch(e) {\n status.code = 500;\n status.message = 'parseerror';\n //throw 'Invalid JSON: ' + xdr.responseText;\n }\n } else if (userType === 'xml' || (userType !== 'text' && /\\/xml/i.test(xdr.contentType))) {\n var doc = new ActiveXObject('Microsoft.XMLDOM');\n doc.async = false;\n try {\n doc.loadXML(xdr.responseText);\n } catch(e) {\n doc = undefined;\n }\n if (!doc || !doc.documentElement || doc.getElementsByTagName('parsererror').length) {\n status.code = 500;\n status.message = 'parseerror';\n throw 'Invalid XML: ' + xdr.responseText;\n }\n responses.xml = doc;\n }\n } catch(parseMessage) {\n throw parseMessage;\n } finally {\n complete(status.code, status.message, responses, allResponseHeaders);\n }\n };\n\n // set an empty handler for 'onprogress' so requests don't get aborted\n xdr.onprogress = function(){};\n xdr.onerror = function() {\n complete(401, 'error', {\n text: xdr.responseText\n });\n };\n\n if (userOptions.data) {\n postData = ($.type(userOptions.data) === 'string') ? userOptions.data : $.param(userOptions.data);\n }\n xdr.open(options.type, options.url);\n xdr.send(postData);\n },\n abort: function() {\n if (xdr) {\n xdr.abort();\n }\n }\n };\n });\n\n return $;\n\n}));\n\ndefine(\"lib/jquery.xdomainrequest.js\", function(){});\n\n", "/* Modernizr 2.8.3 (Custom Build) | MIT & BSD\n * Build: http://modernizr.com/download/#-input-inputtypes-cssclasses-load\n */\n/* Modernizr 2.8.3 (Custom Build) | MIT & BSD\n * Build: http://modernizr.com/download/#-input-inputtypes-cssclasses-cors-load\n * (add Non-core detects: cors)\n */\n;window.Modernizr=function(a,b,c){function v(a){j.cssText=a}function w(a,b){return v(prefixes.join(a+\";\")+(b||\"\"))}function x(a,b){return typeof a===b}function y(a,b){return!!~(\"\"+a).indexOf(b)}function z(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:x(f,\"function\")?f.bind(d||b):f}return!1}function A(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)p[c[d]]=c[d]in k;return p.list&&(p.list=!!b.createElement(\"datalist\")&&!!a.HTMLDataListElement),p}(\"autocomplete autofocus list placeholder max min multiple pattern required step\".split(\" \")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute(\"type\",f=a[d]),e=k.type!==\"text\",e&&(k.value=l,k.style.cssText=\"position:absolute;visibility:hidden;\",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!==\"textfield\"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),o[a[d]]=!!e;return o}(\"search tel url email datetime date month week time datetime-local number range color\".split(\" \"))}var d=\"2.8.3\",e={},f=!0,g=b.documentElement,h=\"modernizr\",i=b.createElement(h),j=i.style,k=b.createElement(\"input\"),l=\":)\",m={}.toString,n={},o={},p={},q=[],r=q.slice,s,t={}.hasOwnProperty,u;!x(t,\"undefined\")&&!x(t.call,\"undefined\")?u=function(a,b){return t.call(a,b)}:u=function(a,b){return b in a&&x(a.constructor.prototype[b],\"undefined\")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!=\"function\")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e});for(var B in n)u(n,B)&&(s=B.toLowerCase(),e[s]=n[B](),q.push((e[s]?\"\":\"no-\")+s));return e.input||A(),e.addTest=function(a,b){if(typeof a==\"object\")for(var d in a)u(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b==\"function\"?b():b,typeof f!=\"undefined\"&&f&&(g.className+=\" \"+(b?\"\":\"no-\")+a),e[a]=b}return e},v(\"\"),i=k=null,e._version=d,g.className=g.className.replace(/(^|\\s)no-js(\\s|$)/,\"$1$2\")+(f?\" js \"+q.join(\" \"):\"\"),e}(this,this.document),function(a,b,c){function d(a){return\"[object Function]\"==o.call(a)}function e(a){return\"string\"==typeof a}function f(){}function g(a){return!a||\"loaded\"==a||\"complete\"==a||\"uninitialized\"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){(\"c\"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){\"img\"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),\"object\"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height=\"0\",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),\"img\"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||\"j\",e(a)?i(\"c\"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName(\"script\")[0],o={}.toString,p=[],q=0,r=\"MozAppearance\"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&\"[object Opera]\"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?\"object\":l?\"script\":\"img\",v=l?\"script\":u,w=Array.isArray||function(a){return\"[object Array]\"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split(\"!\"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split(\"=\"),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(\".\").pop().split(\"?\").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split(\"/\").pop().split(\"?\")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&\"css\"==i.url.split(\".\").pop().split(\"?\").shift()?\"c\":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState=\"loading\",b.addEventListener(\"DOMContentLoaded\",A=function(){b.removeEventListener(\"DOMContentLoaded\",A,0),b.readyState=\"complete\"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement(\"script\"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement(\"link\"),j,c=i?h:c||f;e.href=a,e.rel=\"stylesheet\",e.type=\"text/css\";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},Modernizr.addTest(\"cors\",!!(window.XMLHttpRequest&&\"withCredentials\"in new XMLHttpRequest));\ndefine(\"lib/modernizr.js\", function(){});\n\n", "var __extends=this&&this.__extends||function(){var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t])};return function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),exjs;!function(r){r.version=\"0.5.1\"}(exjs||(exjs={}));var exjs;!function(r){Array.isArray||(Array.isArray=function(r){return\"[object Array]\"===Object.prototype.toString.call(r)})}(exjs||(exjs={}));var exjs;!function(r){var e=function(){function r(){}return r.prototype.getEnumerator=function(){return{moveNext:function(){return!1},current:void 0}},r.prototype.aggregate=function(r,e){for(var t=r,n=this.getEnumerator();n.moveNext();)t=e(t,n.current);return t},r.prototype.all=function(r){if(r)for(var e=this.getEnumerator(),t=0;e.moveNext();){if(!r(e.current,t))return!1;t++}return!0},r.prototype.any=function(r){for(var e=this.getEnumerator(),t=0;e.moveNext();){if(!r)return!0;if(r(e.current,t))return!0;t++}return!1},r.prototype.append=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];throw new Error(\"Not implemented\")},r.prototype.apply=function(r){throw new Error(\"Not implemented\")},r.prototype.at=function(r){for(var e=this.getEnumerator(),t=0;e.moveNext();){if(t===r)return e.current;t++}},r.prototype.average=function(r){var e=0,t=0;r=r||function(r){if(\"number\"!=typeof r)throw new Error(\"Object is not a number.\");return r};for(var n=this.getEnumerator();n.moveNext();)t+=r(n.current),e++;return 0===e?0:t/e},r.prototype.concat=function(r){throw new Error(\"Not implemented\")},r.prototype.count=function(r){for(var e=0,t=this.getEnumerator();t.moveNext();)r&&!r(t.current)||e++;return e},r.prototype.difference=function(r,e){return e=e||function(r,e){return r===e},r instanceof Array&&(r=r.en()),{intersection:this.intersect(r,e).toArray().en(),aNotB:this.except(r,e).toArray().en(),bNotA:r.except(this,e).toArray().en()}},r.prototype.distinct=function(r){throw new Error(\"Not implemented\")},r.prototype.except=function(r,e){throw new Error(\"Not implemented\")},r.prototype.first=function(r){for(var e=this.getEnumerator();e.moveNext();)if(!r||r(e.current))return e.current},r.prototype.firstIndex=function(r){for(var e=this.getEnumerator(),t=0;e.moveNext();t++)if(!r||r(e.current))return t;return-1},r.prototype.forEach=function(r){for(var e=this.getEnumerator();e.moveNext();)r(e.current)},r.prototype.groupBy=function(r,e){throw new Error(\"Not implemented\")},r.prototype.intersect=function(r,e){throw new Error(\"Not implemented\")},r.prototype.join=function(r,e,t,n,o){throw new Error(\"Not implemented\")},r.prototype.last=function(r){for(var e,t=this.getEnumerator();t.moveNext();)r&&!r(t.current)||(e=t.current);return e},r.prototype.lastIndex=function(r){for(var e=-1,t=this.getEnumerator(),n=0;t.moveNext();n++)r&&!r(t.current)||(e=n);return e},r.prototype.max=function(r){var e=this.getEnumerator();if(!e.moveNext())return 0;r=r||function(r){if(\"number\"!=typeof r)throw new Error(\"Object is not a number.\");return r};for(var t=r(e.current);e.moveNext();)t=Math.max(t,r(e.current));return t},r.prototype.min=function(r){var e=this.getEnumerator();if(!e.moveNext())return 0;r=r||function(r){if(\"number\"!=typeof r)throw new Error(\"Object is not a number.\");return r};for(var t=r(e.current);e.moveNext();)t=Math.min(t,r(e.current));return t},r.prototype.orderBy=function(r,e){throw new Error(\"Not implemented\")},r.prototype.orderByDescending=function(r,e){throw new Error(\"Not implemented\")},r.prototype.prepend=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];throw new Error(\"Not implemented\")},r.prototype.reverse=function(){throw new Error(\"Not implemented\")},r.prototype.select=function(r){throw new Error(\"Not implemented\")},r.prototype.selectMany=function(r){throw new Error(\"Not implemented\")},r.prototype.skip=function(r){throw new Error(\"Not implemented\")},r.prototype.skipWhile=function(r){throw new Error(\"Not implemented\")},r.prototype.standardDeviation=function(r){var e=this.average(r),t=0,n=0;r=r||function(r){if(\"number\"!=typeof r)throw new Error(\"Object is not a number.\");return r};for(var o=this.getEnumerator();o.moveNext();){var u=r(o.current)-e;t+=u*u,n++}return Math.sqrt(t/n)},r.prototype.sum=function(r){var e=0;r=r||function(r){if(\"number\"!=typeof r)throw new Error(\"Object is not a number.\");return r};for(var t=this.getEnumerator();t.moveNext();)e+=r(t.current);return e},r.prototype.take=function(r){throw new Error(\"Not implemented\")},r.prototype.takeWhile=function(r){throw new Error(\"Not implemented\")},r.prototype.traverse=function(r){throw new Error(\"Not implemented\")},r.prototype.traverseUnique=function(r,e){throw new Error(\"Not implemented\")},r.prototype.toArray=function(){for(var r=[],e=this.getEnumerator();e.moveNext();)r.push(e.current);return r},r.prototype.toMap=function(r,e){throw new Error(\"Not implemented\")},r.prototype.toList=function(){throw new Error(\"Not implemented\")},r.prototype.union=function(r,e){throw new Error(\"Not implemented\")},r.prototype.where=function(r){throw new Error(\"Not implemented\")},r.prototype.zip=function(r,e){throw new Error(\"Not implemented\")},r}();r.Enumerable=e}(exjs||(exjs={}));var exjs;!function(r){var e=function(){function e(r){this.size=0,this._keys=[],this._values=[];var e;if(r instanceof Array?e=r.en():r&&r.getEnumerator instanceof Function&&(e=r),e)for(var t=e.getEnumerator();t&&t.moveNext();)this.set(t.current[0],t.current[1])}return e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this.size=0},e.prototype.delete=function(r){var e=this._keys.indexOf(r);return e>-1&&(this._keys.splice(e,1),this._values.splice(e,1),this.size--,!0)},e.prototype.entries=function(){var e=this;return r.range(0,this.size).select(function(r){return[e._keys[r],e._values[r]]})},e.prototype.forEach=function(r,e){null==e&&(e=this);for(var t=0,n=this._keys,o=this._values,u=n.length;t<u;t++)r.call(e,o[t],n[t],this)},e.prototype.get=function(r){var e=this._keys.indexOf(r);return this._values[e]},e.prototype.has=function(r){return this._keys.indexOf(r)>-1},e.prototype.keys=function(){return this._keys.en()},e.prototype.set=function(r,e){var t=this._keys.indexOf(r);t>-1?this._values[t]=e:(this._keys.push(r),this._values.push(e),this.size++)},e.prototype.values=function(){return this._values.en()},e}();r.Map3=e,r.Enumerable.prototype.toMap=function(r,t){for(var n=new e,o=this.getEnumerator();o.moveNext();)n.set(r(o.current),t(o.current));return n},r.List&&(r.List.prototype.toMap=r.Enumerable.prototype.toMap)}(exjs||(exjs={})),function(r){r.Map||(r.Map=exjs.Map3)}(\"undefined\"==typeof window?global:window);var exjs;!function(r){function e(e){var t=new r.Enumerable;return t.getEnumerator=function(){var r={current:void 0,moveNext:function(){return e(r)}};return r},t}r.anonymous=e}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){var t,n,o=1,u={current:void 0,moveNext:function(){if(o<2){if(t=t||r.getEnumerator(),t.moveNext())return u.current=t.current,!0;o++}return n=n||e.en().getEnumerator(),n.moveNext()?(u.current=n.current,!0):(u.current=void 0,!1)}};return u}r.Enumerable.prototype.append=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var u=new r.Enumerable;return u.getEnumerator=function(){return e(t,n)},u},r.List&&(r.List.prototype.append=r.Enumerable.prototype.append)}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){var t,n=0,o={current:void 0,moveNext:function(){return t||(t=r.getEnumerator()),!!t.moveNext()&&(e(o.current=t.current,n),n++,!0)}};return o}r.Enumerable.prototype.apply=function(t){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return e(n,t)},o},r.List&&(r.List.prototype.apply=r.Enumerable.prototype.apply)}(exjs||(exjs={}));var exjs;!function(r){function e(r){var e=r.length,t={moveNext:void 0,current:void 0},n=-1;return t.moveNext=function(){return n++,n>=e?(t.current=void 0,!1):(t.current=r[n],!0)},t}function t(){return this&&Array.isArray(this)?new n(this):new r.Enumerable}var n=function(r){function t(t){var n=r.call(this)||this;return n.getEnumerator=function(){return e(t)},n.toArray=function(){return t.slice(0)},n}return __extends(t,r),t}(r.Enumerable);try{Object.defineProperty(Array.prototype,\"en\",{value:t,enumerable:!1,writable:!1,configurable:!1})}catch(r){Array.prototype.en=t}}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){var t,n=!1,o={current:void 0,moveNext:function(){return t||(t=r.getEnumerator()),o.current=void 0,t.moveNext()?(o.current=t.current,!0):!n&&(n=!0,t=e.getEnumerator(),!!t.moveNext()&&(o.current=t.current,!0))}};return o}r.Enumerable.prototype.concat=function(t){var n=this,o=t instanceof Array?t.en():t,u=new r.Enumerable;return u.getEnumerator=function(){return e(n,o)},u},r.List&&(r.List.prototype.concat=r.Enumerable.prototype.concat)}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){var t,n=[],o={current:void 0,moveNext:function(){if(t||(t=r.getEnumerator()),o.current=void 0,!e){for(;t.moveNext();)if(n.indexOf(t.current)<0)return n.push(o.current=t.current),!0;return!1}for(;t.moveNext();){for(var u=0,i=n.length,c=!1;u<i&&!c;u++)c=!!e(n[u],t.current);if(!c)return n.push(o.current=t.current),!0}return!1}};return o}r.Enumerable.prototype.distinct=function(t){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return e(n,t)},o},r.List&&(r.List.prototype.distinct=r.Enumerable.prototype.distinct)}(exjs||(exjs={}));var exjs;!function(r){function e(r,e,t){t=t||function(r,e){return r===e};var n,o={current:void 0,moveNext:function(){for(n||(n=r.getEnumerator()),o.current=void 0;n.moveNext();){for(var u=!1,i=e.getEnumerator();i.moveNext()&&!u;)u=t(n.current,i.current);if(!u)return o.current=n.current,!0}return!1}};return o}r.Enumerable.prototype.except=function(t,n){var o=this,u=t instanceof Array?t.en():t,i=new r.Enumerable;return i.getEnumerator=function(){return e(o,u,n)},i},r.List&&(r.List.prototype.except=r.Enumerable.prototype.except)}(exjs||(exjs={})),Function.prototype.fromJson=function(r,e){function t(r,e){if(null==r)return r;if(e instanceof Function)return e(r);if(e instanceof Array){if(e=e[0],!(e instanceof Function&&r instanceof Array))return;for(var t=[],n=0;n<r.length;n++)t.push(e(r[n]));return t}}var n=new this;if(null==r)return n;var o=[];for(var u in e){var i=t(r[u],e[u]);void 0!==i&&(n[u]=i,o.push(u))}for(var u in this.$jsonMappings)if(!(o.indexOf(u)>-1)){var i=t(r[u],this.$jsonMappings[u]);void 0!==i&&(n[u]=i,o.push(u))}for(var u in r)o.indexOf(u)>-1||(n[u]=r[u]);return n};var exjs;!function(r){function e(r,e,n){var o,u=0,i={current:void 0,moveNext:function(){return o||(o=t(r,e,n)),i.current=void 0,!(u>=o.length)&&(i.current=o[u],u++,!0)}};return i}function t(r,e,t){t=t||function(r,e){return r===e};for(var o,u=[],i=[],c=r.getEnumerator();c.moveNext();){o=e(c.current);for(var a=-1,p=0,f=i.length;p<f;p++)if(t(o,i[p])){a=p;break}var s;a<0?(i.push(o),u.push(s=new n(o))):s=u[a],s._add(c.current)}return u}var n=function(r){function e(e){var t=r.call(this)||this;return t.key=e,t._arr=[],t.getEnumerator=function(){return t._arr.en().getEnumerator()},t}return __extends(e,r),e.prototype._add=function(r){this._arr.push(r)},e}(r.Enumerable);r.Enumerable.prototype.groupBy=function(t,n){var o=this,u=new r.Enumerable;return u.getEnumerator=function(){return e(o,t,n)},u},r.List&&(r.List.prototype.groupBy=r.Enumerable.prototype.groupBy)}(exjs||(exjs={}));var exjs;!function(r){function e(e,t,n){n=n||function(r,e){return r===e};var o,u={current:void 0,moveNext:function(){for(o||(o=r.en(e).distinct().getEnumerator()),u.current=void 0;o.moveNext();){for(var i=!1,c=t.getEnumerator();c.moveNext()&&!i;)i=n(o.current,c.current);if(i)return u.current=o.current,!0}return!1}};return u}r.Enumerable.prototype.intersect=function(t,n){var o=this,u=t instanceof Array?t.en():t,i=new r.Enumerable;return i.getEnumerator=function(){return e(o,u,n)},i},r.List&&(r.List.prototype.intersect=r.Enumerable.prototype.intersect)}(exjs||(exjs={}));var exjs;!function(r){function e(e,t,n,o,u,i){i=i||function(r,e){return r===e};var c,a,p=0,f={current:void 0,moveNext:function(){if(f.current=void 0,!c){if(c=e.getEnumerator(),!c.moveNext())return!1;a=r.en(t).toArray()}var s;do{for(;p<a.length;p++)if(s=a[p],i(n(c.current),o(s)))return p++,f.current=u(c.current,s),!0;p=0}while(c.moveNext());return!1}};return f}r.Enumerable.prototype.join=function(t,n,o,u,i){var c=this,a=t instanceof Array?t.en():t,p=new r.Enumerable;return p.getEnumerator=function(){return e(c,a,n,o,u,i)},p},r.List&&(r.List.prototype.join=r.Enumerable.prototype.join)}(exjs||(exjs={}));var exjs;!function(r){function e(){this.constructor=t}r.Enumerable.prototype.toList=function(){for(var r=new t,e=this.getEnumerator();e.moveNext();)r.push(e.current);return r};var t=function(r){function e(){return null!==r&&r.apply(this,arguments)||this}return __extends(e,r),e.prototype.toString=function(){throw new Error(\"Not implemented\")},e.prototype.toLocaleString=function(){throw new Error(\"Not implemented\")},e.prototype.pop=function(){throw new Error(\"Not implemented\")},e.prototype.push=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];throw new Error(\"Not implemented\")},e.prototype.shift=function(){throw new Error(\"Not implemented\")},e.prototype.slice=function(r,e){throw new Error(\"Not implemented\")},e.prototype.sort=function(r){throw new Error(\"Not implemented\")},e.prototype.splice=function(){throw new Error(\"Not implemented\")},e.prototype.unshift=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];throw new Error(\"Not implemented\")},e.prototype.indexOf=function(r,e){throw new Error(\"Not implemented\")},e.prototype.lastIndexOf=function(r,e){throw new Error(\"Not implemented\")},e.prototype.every=function(r,e){throw new Error(\"Not implemented\")},e.prototype.some=function(r,e){throw new Error(\"Not implemented\")},e.prototype.forEach=function(r,e){throw new Error(\"Not implemented\")},e.prototype.map=function(r,e){throw new Error(\"Not implemented\")},e.prototype.filter=function(r,e){throw new Error(\"Not implemented\")},e.prototype.reduce=function(r,e){throw new Error(\"Not implemented\")},e.prototype.reduceRight=function(r,e){throw new Error(\"Not implemented\")},e.prototype.remove=function(r){throw new Error(\"Not implemented\")},e.prototype.removeWhere=function(r){throw new Error(\"Not implemented\")},e}(r.Enumerable);r.List=t;for(var n in Array)Array.hasOwnProperty(n)&&(t[n]=Array[n]);e.prototype=Array.prototype,t.prototype=new e;for(var o in r.Enumerable.prototype)\"getEnumerator\"!==o&&(t.prototype[o]=r.Enumerable.prototype[o]);t.prototype.getEnumerator=function(){var r=this,e=r.length,t={moveNext:void 0,current:void 0},n=-1;return t.moveNext=function(){return n++,n>=e?(t.current=void 0,!1):(t.current=r[n],!0)},t},t.prototype.remove=function(r){return this.removeWhere(function(e){return e===r}).any()},t.prototype.removeWhere=function(r){for(var e,t=[],n=this.length-1;n>=0;n--)e=this[n],r(e,n)===!0&&(this.splice(n,1),t.push(e));return t.en().reverse()}}(exjs||(exjs={}));var exjs;!function(r){function e(r,e,n,o){return new t(r,e,n,o)}var t=function(e){function t(r,t,n,o){var u=e.call(this)||this;u.Source=r,o=o||function(r,e){return r>e?1:r<e?-1:0};var i=n===!0?-1:1;return u.Sorter=function(r,e){return i*o(t(r),t(e))},u}return __extends(t,e),t.prototype.getEnumerator=function(){var e,t=this.Source,n=this.Sorter,o=0,u={current:void 0,moveNext:function(){return e||(e=r.en(t).toArray(),e.sort(n)),u.current=void 0,!(o>=e.length)&&(u.current=e[o],o++,!0)}};return u},t.prototype.thenBy=function(r,e){return new n(this,r,!1,e)},t.prototype.thenByDescending=function(r,e){return new n(this,r,!0,e)},t}(r.Enumerable),n=function(r){function e(e,t,n,o){var u=r.call(this,e,t,n,o)||this,i=e.Sorter,c=u.Sorter;return u.Sorter=function(r,e){return i(r,e)||c(r,e)},u}return __extends(e,r),e}(t),o=r.Enumerable.prototype;o.orderBy=function(r,t){return e(this,r,!1,t)},o.orderByDescending=function(r,t){return e(this,r,!0,t)},r.List&&(r.List.prototype.orderBy=r.Enumerable.prototype.orderBy,r.List.prototype.orderByDescending=r.Enumerable.prototype.orderByDescending)}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){var t,n,o=1,u={current:void 0,moveNext:function(){if(o<2){if(t=t||e.en().getEnumerator(),t.moveNext())return u.current=t.current,!0;o++}return n=n||r.getEnumerator(),n.moveNext()?(u.current=n.current,!0):(u.current=void 0,!1)}};return u}r.Enumerable.prototype.prepend=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var u=new r.Enumerable;return u.getEnumerator=function(){return e(t,n)},u},r.List&&(r.List.prototype.prepend=r.Enumerable.prototype.prepend)}(exjs||(exjs={}));var exjs;!function(r){function e(r,e,t){var n=r-t,o={current:void 0,moveNext:function(){return n+=t,!(n>=e)&&(o.current=n,!0)}};return o}function t(t,n,o){if(t=t||0,n=n||0,t>n)throw new Error(\"Start cannot be greater than end.\");null==o&&(o=1);var u=new r.Enumerable;return u.getEnumerator=function(){return e(t,n,o)},u}r.range=t}(exjs||(exjs={}));var exjs;!function(r){function e(e){var t,n=0,o={current:void 0,moveNext:function(){return t||(t=r.en(e).toArray(),n=t.length),n--,o.current=t[n],n>=0}};return o}r.Enumerable.prototype.reverse=function(){var t=this,n=new r.Enumerable;return n.getEnumerator=function(){return e(t)},n},r.List&&(r.List.prototype.reverse=r.Enumerable.prototype.reverse)}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){if(e=e||0,0===e)return Math.round(r);var t=Math.pow(10,e);return Math.round(r*t)/t}r.round=e}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){var t,n=0,o={current:void 0,moveNext:function(){return t||(t=r.getEnumerator()),!!t.moveNext()&&(o.current=e(t.current,n),n++,!0)}};return o}function t(e,t){var n,o,u={current:void 0,moveNext:function(){for(u.current=void 0,n||(n=e.getEnumerator());!o||!o.moveNext();){if(!n.moveNext())return!1;o=r.selectorEnumerator(t(n.current))}return u.current=o.current,!0}};return u}r.Enumerable.prototype.select=function(t){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return e(n,t)},o},r.Enumerable.prototype.selectMany=function(e){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return t(n,e)},o},r.List&&(r.List.prototype.select=r.Enumerable.prototype.select,r.List.prototype.selectMany=r.Enumerable.prototype.selectMany)}(exjs||(exjs={}));var exjs;!function(r){function e(r){return Array.isArray(r)?r.en().getEnumerator():null!=r&&\"function\"==typeof r.getEnumerator?r.getEnumerator():null}r.selectorEnumerator=e}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){var t,n={current:void 0,moveNext:function(){if(!t){t=r.getEnumerator();for(var o=0;o<e;o++)if(!t.moveNext())return!1}return t.moveNext()?(n.current=t.current,!0):(n.current=void 0,!1)}};return n}function t(r,e){var t,n={current:void 0,moveNext:function(){if(!t){t=r.getEnumerator();for(var o=0;t.moveNext();o++)if(!e(n.current=t.current,o))return!0;return n.current=void 0,!1}return t.moveNext()?(n.current=t.current,!0):(n.current=void 0,!1)}};return n}r.Enumerable.prototype.skip=function(t){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return e(n,t)},o},r.Enumerable.prototype.skipWhile=function(e){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return t(n,e)},o},r.List&&(r.List.prototype.skip=r.Enumerable.prototype.skip,r.List.prototype.skipWhile=r.Enumerable.prototype.skipWhile)}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){var t,n=0,o={current:void 0,moveNext:function(){return t||(t=r.getEnumerator()),n++,!(n>e)&&(o.current=void 0,!!t.moveNext()&&(o.current=t.current,!0))}};return o}function t(r,e){var t,n=0,o={current:void 0,moveNext:function(){return t||(t=r.getEnumerator()),t.moveNext()&&e(t.current,n)?(n++,o.current=t.current,!0):(o.current=void 0,!1)}};return o}r.Enumerable.prototype.take=function(t){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return e(n,t)},o},r.Enumerable.prototype.takeWhile=function(e){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return t(n,e)},o},r.List&&(r.List.prototype.take=r.Enumerable.prototype.take,r.List.prototype.takeWhile=r.Enumerable.prototype.takeWhile)}(exjs||(exjs={}));var exjs;!function(r){function e(e,t){var n,o=!1,u=[],i={current:void 0,moveNext:function(){if(o){if(null==n)return!1;u.push(n),n=r.selectorEnumerator(t(i.current))}else n=e.getEnumerator(),o=!0;for(;!(n&&n.moveNext()||u.length<1);)n=u.pop();return i.current=null==n?void 0:n.current,void 0!==i.current}};return i}function t(e,t,n){var o,u=!1,i=[],c={current:void 0,moveNext:function(){if(u){if(null==o)return!1;i.push(o),o=r.selectorEnumerator(t(c.current))}else o=e.getEnumerator(),u=!0;do{for(;!(o&&o.moveNext()||i.length<1);)o=i.pop();c.current=null==o?void 0:o.current}while(n(c.current));return void 0!==c.current}};return c}r.Enumerable.prototype.traverse=function(t){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return e(n,t)},o},r.Enumerable.prototype.traverseUnique=function(e,n){var o=this,u=[],i=new r.Enumerable;return n?i.getEnumerator=function(){return t(o,e,function(r){return!!u.some(function(e){return n(r,e)})||(u.push(r),!1)})}:i.getEnumerator=function(){return t(o,e,function(r){return u.indexOf(r)>-1||(u.push(r),!1)})},i},r.List&&(r.List.prototype.traverse=r.Enumerable.prototype.traverse,r.List.prototype.traverseUnique=r.Enumerable.prototype.traverseUnique)}(exjs||(exjs={}));var exjs;!function(r){function e(e,t,n){n=n||function(r,e){return r===e};var o,u,i=[],c={current:void 0,moveNext:function(){if(o||(o=r.en(e).distinct().getEnumerator()),c.current=void 0,!u&&o.moveNext())return i.push(c.current=o.current),!0;for(u=u||r.en(t).distinct().getEnumerator();u.moveNext();){for(var a=0,p=!1,f=i.length;a<f&&!p;a++)p=n(i[a],u.current);if(!p)return c.current=u.current,!0}return!1}};return c}r.Enumerable.prototype.union=function(t,n){var o=this,u=t instanceof Array?t.en():t,i=new r.Enumerable;return i.getEnumerator=function(){return e(o,u,n)},i},r.List&&(r.List.prototype.union=r.Enumerable.prototype.union)}(exjs||(exjs={}));var exjs;!function(r){function e(r,e){var t,n={current:void 0,moveNext:function(){t||(t=r.getEnumerator());for(var o;t.moveNext();)if(e(o=t.current))return n.current=o,!0;return!1}};return n}r.Enumerable.prototype.where=function(t){var n=this,o=new r.Enumerable;return o.getEnumerator=function(){return e(n,t)},o},r.List&&(r.List.prototype.where=r.Enumerable.prototype.where)}(exjs||(exjs={}));var exjs;!function(r){function e(e){var n=new r.Enumerable;return n.getEnumerator=function(){return t(e)},n}function t(r){var e=r.getEnumerator(),t={current:void 0,moveNext:void 0};return t.moveNext=function(){return e.moveNext()?(t.current=e.current,!0):(t.current=void 0,!1)},t}r.en=e}(exjs||(exjs={}));var ex=exjs.en,exjs;!function(r){function e(r,e,t){var n,o,u={current:void 0,moveNext:function(){return n||(n=r.getEnumerator()),o||(o=e.getEnumerator()),u.current=void 0,!(!n.moveNext()||!o.moveNext())&&(u.current=t(n.current,o.current),!0)}};return u}r.Enumerable.prototype.zip=function(t,n){var o=this,u=t instanceof Array?t.en():t,i=new r.Enumerable;return i.getEnumerator=function(){return e(o,u,n)},i},r.List&&(r.List.prototype.zip=r.Enumerable.prototype.zip)}(exjs||(exjs={}));\n//# sourceMappingURL=ex.es3.min.js.map\n\ndefine(\"lib/ex.es3.min.js\", function(){});\n\n", "var _Components;\r\n(function (_Components) {\r\n var BaseComponent = /** @class */ (function () {\r\n function BaseComponent(options) {\r\n this.options = options;\r\n this.options.data = $.extend(this.data(), options.data);\r\n }\r\n BaseComponent.prototype._init = function () {\r\n this._$element = $(this.options.target);\r\n if (!this._$element.length) {\r\n console.warn('element not found');\r\n return false;\r\n }\r\n this._$element.empty();\r\n return true;\r\n };\r\n BaseComponent.prototype.data = function () {\r\n return {};\r\n };\r\n BaseComponent.prototype.on = function (name, callback, ctx) {\r\n var e = this._e || (this._e = {});\r\n (e[name] || (e[name] = [])).push({\r\n fn: callback,\r\n ctx: ctx\r\n });\r\n };\r\n BaseComponent.prototype.fire = function (name) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n var data = [].slice.call(arguments, 1);\r\n var evtArr = ((this._e || (this._e = {}))[name] || []).slice();\r\n var i = 0;\r\n var len = evtArr.length;\r\n for (i; i < len; i++) {\r\n evtArr[i].fn.apply(evtArr[i].ctx, data);\r\n }\r\n };\r\n BaseComponent.prototype._resize = function () {\r\n };\r\n BaseComponent.prototype.set = function (data) {\r\n };\r\n return BaseComponent;\r\n }());\r\n _Components.BaseComponent = BaseComponent;\r\n})(_Components || (_Components = {}));\r\n(function (g) {\r\n if (!g._Components) {\r\n g._Components = _Components;\r\n }\r\n})(window);\r\n\ndefine(\"lib/BaseComponent.js\", function(){});\n\n", "var KeyCodes;\r\n(function (KeyCodes) {\r\n var KeyDown;\r\n (function (KeyDown) {\r\n KeyDown.Backspace = 8;\r\n KeyDown.Tab = 9;\r\n KeyDown.Enter = 13;\r\n KeyDown.Shift = 16;\r\n KeyDown.Ctrl = 17;\r\n KeyDown.Alt = 18;\r\n KeyDown.PauseBreak = 19;\r\n KeyDown.CapsLock = 20;\r\n KeyDown.Escape = 27;\r\n KeyDown.Spacebar = 32;\r\n KeyDown.PageUp = 33;\r\n KeyDown.PageDown = 34;\r\n KeyDown.End = 35;\r\n KeyDown.Home = 36;\r\n KeyDown.LeftArrow = 37;\r\n KeyDown.UpArrow = 38;\r\n KeyDown.RightArrow = 39;\r\n KeyDown.DownArrow = 40;\r\n KeyDown.PrintScrn = 44;\r\n KeyDown.Insert = 45;\r\n KeyDown.Delete = 46;\r\n KeyDown.Zero = 48;\r\n KeyDown.One = 49;\r\n KeyDown.Two = 50;\r\n KeyDown.Three = 51;\r\n KeyDown.Four = 52;\r\n KeyDown.Five = 53;\r\n KeyDown.Six = 54;\r\n KeyDown.Seven = 55;\r\n KeyDown.Eight = 56;\r\n KeyDown.Nine = 57;\r\n KeyDown.a = 65;\r\n KeyDown.b = 66;\r\n KeyDown.c = 67;\r\n KeyDown.d = 68;\r\n KeyDown.e = 69;\r\n KeyDown.f = 70;\r\n KeyDown.g = 71;\r\n KeyDown.h = 72;\r\n KeyDown.i = 73;\r\n KeyDown.j = 74;\r\n KeyDown.k = 75;\r\n KeyDown.l = 76;\r\n KeyDown.m = 77;\r\n KeyDown.n = 78;\r\n KeyDown.o = 79;\r\n KeyDown.p = 80;\r\n KeyDown.q = 81;\r\n KeyDown.r = 82;\r\n KeyDown.s = 83;\r\n KeyDown.t = 84;\r\n KeyDown.u = 85;\r\n KeyDown.v = 86;\r\n KeyDown.w = 87;\r\n KeyDown.x = 88;\r\n KeyDown.y = 89;\r\n KeyDown.z = 90;\r\n KeyDown.LeftWindowKey = 91;\r\n KeyDown.RightWindowKey = 92;\r\n KeyDown.SelectKey = 93;\r\n KeyDown.Numpad0 = 96;\r\n KeyDown.Numpad1 = 97;\r\n KeyDown.Numpad2 = 98;\r\n KeyDown.Numpad3 = 99;\r\n KeyDown.Numpad4 = 100;\r\n KeyDown.Numpad5 = 101;\r\n KeyDown.Numpad6 = 102;\r\n KeyDown.Numpad7 = 103;\r\n KeyDown.Numpad8 = 104;\r\n KeyDown.Numpad9 = 105;\r\n KeyDown.Multiply = 106;\r\n KeyDown.NumpadPlus = 107;\r\n KeyDown.NumpadMinus = 109;\r\n KeyDown.DecimalPoint = 110;\r\n KeyDown.Divide = 111;\r\n KeyDown.F1 = 112;\r\n KeyDown.F2 = 113;\r\n KeyDown.F3 = 114;\r\n KeyDown.F4 = 115;\r\n KeyDown.F5 = 116;\r\n KeyDown.F6 = 117;\r\n KeyDown.F7 = 118;\r\n KeyDown.F8 = 119;\r\n KeyDown.F9 = 120;\r\n KeyDown.F10 = 121;\r\n KeyDown.F11 = 122;\r\n KeyDown.F12 = 123;\r\n KeyDown.NumLock = 144;\r\n KeyDown.ScrollLock = 145;\r\n KeyDown.Semicolon = 186;\r\n KeyDown.Equals = 187;\r\n KeyDown.Comma = 188;\r\n KeyDown.LessThan = 188;\r\n KeyDown.Dash = 189;\r\n KeyDown.Period = 190;\r\n KeyDown.GreaterThan = 190;\r\n KeyDown.ForwardSlash = 191;\r\n KeyDown.QuestionMark = 191;\r\n KeyDown.GraveAccent = 192;\r\n KeyDown.Tilde = 192;\r\n KeyDown.OpenCurlyBracket = 219;\r\n KeyDown.OpenSquareBracket = 219;\r\n KeyDown.BackSlash = 220;\r\n KeyDown.VerticalPipe = 220;\r\n KeyDown.CloseCurlyBracket = 221;\r\n KeyDown.CloseSquareBracket = 221;\r\n KeyDown.Quote = 222;\r\n KeyDown.CommandFF = 224;\r\n })(KeyDown = KeyCodes.KeyDown || (KeyCodes.KeyDown = {}));\r\n})(KeyCodes || (KeyCodes = {}));\r\n(function (KeyCodes) {\r\n var KeyPress;\r\n (function (KeyPress) {\r\n KeyPress.Backspace = 8;\r\n KeyPress.Enter = 13;\r\n KeyPress.Spacebar = 32;\r\n KeyPress.Hash = 35;\r\n KeyPress.GraveAccent = 39;\r\n KeyPress.DoubleQuote = 34;\r\n KeyPress.Asterisk = 42;\r\n KeyPress.Plus = 43;\r\n KeyPress.Comma = 44;\r\n KeyPress.Minus = 45;\r\n KeyPress.Period = 46;\r\n KeyPress.ForwardSlash = 47;\r\n KeyPress.Zero = 48;\r\n KeyPress.One = 49;\r\n KeyPress.Two = 50;\r\n KeyPress.Three = 51;\r\n KeyPress.Four = 52;\r\n KeyPress.Five = 53;\r\n KeyPress.Six = 54;\r\n KeyPress.Seven = 55;\r\n KeyPress.Eight = 56;\r\n KeyPress.Nine = 57;\r\n KeyPress.Colon = 58;\r\n KeyPress.Semicolon = 59;\r\n KeyPress.LessThan = 60;\r\n KeyPress.Equals = 61;\r\n KeyPress.GreaterThan = 62;\r\n KeyPress.QuestionMark = 63;\r\n KeyPress.At = 64;\r\n KeyPress.OpenSquareBracket = 91;\r\n KeyPress.BackSlash = 92;\r\n KeyPress.CloseSquareBracket = 93;\r\n KeyPress.a = 97;\r\n KeyPress.b = 98;\r\n KeyPress.c = 99;\r\n KeyPress.d = 100;\r\n KeyPress.e = 101;\r\n KeyPress.f = 102;\r\n KeyPress.g = 103;\r\n KeyPress.h = 104;\r\n KeyPress.i = 105;\r\n KeyPress.j = 106;\r\n KeyPress.k = 107;\r\n KeyPress.l = 108;\r\n KeyPress.m = 109;\r\n KeyPress.n = 110;\r\n KeyPress.o = 111;\r\n KeyPress.p = 112;\r\n KeyPress.q = 113;\r\n KeyPress.r = 114;\r\n KeyPress.s = 115;\r\n KeyPress.t = 116;\r\n KeyPress.u = 117;\r\n KeyPress.v = 118;\r\n KeyPress.w = 119;\r\n KeyPress.x = 120;\r\n KeyPress.y = 121;\r\n KeyPress.z = 122;\r\n KeyPress.OpenCurlyBracket = 123;\r\n KeyPress.VerticalPipe = 124;\r\n KeyPress.CloseCurlyBracket = 125;\r\n KeyPress.Tilde = 126;\r\n })(KeyPress = KeyCodes.KeyPress || (KeyCodes.KeyPress = {}));\r\n})(KeyCodes || (KeyCodes = {}));\r\n(function (g) {\r\n if (!g.KeyCodes) {\r\n g.KeyCodes = KeyCodes;\r\n }\r\n})(window);\r\n\ndefine(\"lib/KeyCodes.js\", function(){});\n\n", "var HTTPStatusCode;\r\n(function (HTTPStatusCode) {\r\n HTTPStatusCode.CONTINUE = 100;\r\n HTTPStatusCode.SWITCHING_PROTOCOLS = 101;\r\n HTTPStatusCode.PROCESSING = 102;\r\n HTTPStatusCode.OK = 200;\r\n HTTPStatusCode.CREATED = 201;\r\n HTTPStatusCode.ACCEPTED = 202;\r\n HTTPStatusCode.NON_AUTHORITATIVE_INFORMATION = 203;\r\n HTTPStatusCode.NO_CONTENT = 204;\r\n HTTPStatusCode.RESET_CONTENT = 205;\r\n HTTPStatusCode.PARTIAL_CONTENT = 206;\r\n HTTPStatusCode.MULTI_STATUS = 207;\r\n HTTPStatusCode.MULTIPLE_CHOICES = 300;\r\n HTTPStatusCode.MOVED_PERMANENTLY = 301;\r\n HTTPStatusCode.MOVED_TEMPORARILY = 302;\r\n HTTPStatusCode.SEE_OTHER = 303;\r\n HTTPStatusCode.NOT_MODIFIED = 304;\r\n HTTPStatusCode.USE_PROXY = 305;\r\n HTTPStatusCode.TEMPORARY_REDIRECT = 307;\r\n HTTPStatusCode.BAD_REQUEST = 400;\r\n HTTPStatusCode.UNAUTHORIZED = 401;\r\n HTTPStatusCode.PAYMENT_REQUIRED = 402;\r\n HTTPStatusCode.FORBIDDEN = 403;\r\n HTTPStatusCode.NOT_FOUND = 404;\r\n HTTPStatusCode.METHOD_NOT_ALLOWED = 405;\r\n HTTPStatusCode.NOT_ACCEPTABLE = 406;\r\n HTTPStatusCode.PROXY_AUTHENTICATION_REQUIRED = 407;\r\n HTTPStatusCode.REQUEST_TIME_OUT = 408;\r\n HTTPStatusCode.CONFLICT = 409;\r\n HTTPStatusCode.GONE = 410;\r\n HTTPStatusCode.LENGTH_REQUIRED = 411;\r\n HTTPStatusCode.PRECONDITION_FAILED = 412;\r\n HTTPStatusCode.REQUEST_ENTITY_TOO_LARGE = 413;\r\n HTTPStatusCode.REQUEST_URI_TOO_LARGE = 414;\r\n HTTPStatusCode.UNSUPPORTED_MEDIA_TYPE = 415;\r\n HTTPStatusCode.REQUESTED_RANGE_NOT_SATISFIABLE = 416;\r\n HTTPStatusCode.EXPECTATION_FAILED = 417;\r\n HTTPStatusCode.IM_A_TEAPOT = 418;\r\n HTTPStatusCode.UNPROCESSABLE_ENTITY = 422;\r\n HTTPStatusCode.LOCKED = 423;\r\n HTTPStatusCode.FAILED_DEPENDENCY = 424;\r\n HTTPStatusCode.UNORDERED_COLLECTION = 425;\r\n HTTPStatusCode.UPGRADE_REQUIRED = 426;\r\n HTTPStatusCode.PRECONDITION_REQUIRED = 428;\r\n HTTPStatusCode.TOO_MANY_REQUESTS = 429;\r\n HTTPStatusCode.REQUEST_HEADER_FIELDS_TOO_LARGE = 431;\r\n HTTPStatusCode.INTERNAL_SERVER_ERROR = 500;\r\n HTTPStatusCode.NOT_IMPLEMENTED = 501;\r\n HTTPStatusCode.BAD_GATEWAY = 502;\r\n HTTPStatusCode.SERVICE_UNAVAILABLE = 503;\r\n HTTPStatusCode.GATEWAY_TIME_OUT = 504;\r\n HTTPStatusCode.HTTP_VERSION_NOT_SUPPORTED = 505;\r\n HTTPStatusCode.VARIANT_ALSO_NEGOTIATES = 506;\r\n HTTPStatusCode.INSUFFICIENT_STORAGE = 507;\r\n HTTPStatusCode.BANDWIDTH_LIMIT_EXCEEDED = 509;\r\n HTTPStatusCode.NOT_EXTENDED = 510;\r\n HTTPStatusCode.NETWORK_AUTHENTICATION_REQUIRED = 511;\r\n})(HTTPStatusCode || (HTTPStatusCode = {}));\r\n(function (g) {\r\n if (!g.HTTPStatusCode) {\r\n g.HTTPStatusCode = HTTPStatusCode;\r\n }\r\n})(window);\r\n\ndefine(\"lib/HTTPStatusCode.js\", function(){});\n\n", "(function ($) {\r\n $.fn.checkboxButton = function (onClick) {\r\n return this.each(function () {\r\n var $this = $(this);\r\n $this.on('click', function (e) {\r\n var tagName = e.target.tagName;\r\n var $checkbox = $(this).find(':checkbox');\r\n if (tagName !== \"INPUT\") {\r\n e.preventDefault();\r\n $checkbox.prop('checked', !$checkbox.prop('checked'));\r\n }\r\n var checked = $checkbox.is(':checked');\r\n onClick.call(this, checked);\r\n });\r\n });\r\n };\r\n $.fn.disable = function () {\r\n return this.each(function () {\r\n var $this = $(this);\r\n $this.addClass('disabled');\r\n $this.data('tabindex', $this.attr('tabindex'));\r\n $this.removeAttr('tabindex');\r\n });\r\n };\r\n $.fn.ellipsis = function (chars) {\r\n return this.each(function () {\r\n var $self = $(this);\r\n var text = $self.text();\r\n if (text.length > chars) {\r\n var trimmedText = text.substr(0, chars);\r\n trimmedText = trimmedText.substr(0, Math.min(trimmedText.length, trimmedText.lastIndexOf(\" \")));\r\n $self.empty().html(trimmedText + \"…\");\r\n }\r\n });\r\n };\r\n $.fn.ellipsisFill = function (text) {\r\n var textPassed = true;\r\n if (!text)\r\n textPassed = false;\r\n return this.each(function () {\r\n var $self = $(this);\r\n if (!textPassed)\r\n text = $self.text();\r\n $self.empty();\r\n var $spanElem = $('<span title=\"' + text + '\"></span>');\r\n $self.append($spanElem);\r\n $self.css('overflow', 'hidden');\r\n $spanElem.css('white-space', 'nowrap');\r\n $spanElem.html(text);\r\n // get the width of the span.\r\n // if it's wider than the container, remove a word until it's not.\r\n if ($spanElem.width() > $self.width()) {\r\n var lastText = null;\r\n while ($spanElem.width() > $self.width()) {\r\n var t = $spanElem.html();\r\n t = t.substring(0, t.lastIndexOf(' ')) + '…';\r\n if (t === lastText)\r\n break;\r\n $spanElem.html(t);\r\n lastText = t;\r\n }\r\n }\r\n });\r\n };\r\n // Truncates to a certain number of letters, while ignoring and preserving HTML\r\n $.fn.ellipsisHtmlFixed = function (chars, cb) {\r\n return this.each(function () {\r\n var $self = $(this);\r\n var expandedText = $self.html();\r\n var $trunc = $('<span></span>');\r\n $trunc.html($self.html().replace(/\\s[\\s]*/g, ' ').trim());\r\n if ($trunc.text().trim().length <= chars) {\r\n return; // do nothing if we're under the limit!\r\n }\r\n while ($trunc.text().trim().length > chars) {\r\n $trunc.removeLastWord(chars);\r\n }\r\n var collapsedText = $trunc.html();\r\n // Toggle function\r\n var expanded = false;\r\n $self.toggle = function () {\r\n $self.empty();\r\n var $toggleButton = $('<a href=\"#\" class=\"toggle\"></a>');\r\n if (expanded) {\r\n $self.html(expandedText + \" \");\r\n $toggleButton.text(\"less\");\r\n $toggleButton.switchClass(\"less\", \"more\");\r\n }\r\n else {\r\n $self.html(collapsedText + \"… \");\r\n $toggleButton.text(\"more\");\r\n $toggleButton.switchClass(\"more\", \"less\");\r\n }\r\n $toggleButton.one('click', function (e) {\r\n e.preventDefault();\r\n $self.toggle();\r\n });\r\n expanded = !expanded;\r\n $self.append($toggleButton);\r\n if (cb)\r\n cb();\r\n };\r\n $self.toggle();\r\n });\r\n };\r\n $.fn.enable = function () {\r\n return this.each(function () {\r\n var $self = $(this);\r\n $self.removeClass('disabled');\r\n $self.attr('tabindex', $self.data('tabindex'));\r\n });\r\n };\r\n $.fn.equaliseHeight = function (reset, average) {\r\n var maxHeight = -1;\r\n var minHeight = Number.MAX_VALUE;\r\n var heights = [];\r\n // reset all heights to auto first so they can be re-measured.\r\n if (reset) {\r\n this.each(function () {\r\n $(this).height('auto');\r\n });\r\n }\r\n this.each(function () {\r\n var currentHeight = $(this).height();\r\n heights.push(currentHeight);\r\n maxHeight = maxHeight > currentHeight ? maxHeight : currentHeight;\r\n minHeight = minHeight < currentHeight ? minHeight : currentHeight;\r\n });\r\n var finalHeight = maxHeight;\r\n if (average) {\r\n heights.sort(function (a, b) { return a - b; });\r\n var half = Math.floor(heights.length / 2);\r\n if (heights.length % 2) {\r\n finalHeight = heights[half];\r\n }\r\n else {\r\n finalHeight = (heights[half - 1] + heights[half]) / 2.0;\r\n }\r\n }\r\n this.each(function () {\r\n $(this).height(finalHeight);\r\n });\r\n return this;\r\n };\r\n $.fn.getVisibleElementWithGreatestTabIndex = function () {\r\n var $self = $(this);\r\n var maxTabIndex = 0;\r\n var $elementWithGreatestTabIndex = null;\r\n $self.find('*:visible[tabindex]').each(function (index, el) {\r\n var $el = $(el);\r\n var tabIndex = parseInt($el.attr('tabindex'));\r\n if (tabIndex > maxTabIndex) {\r\n maxTabIndex = tabIndex;\r\n $elementWithGreatestTabIndex = $el;\r\n }\r\n });\r\n return $elementWithGreatestTabIndex;\r\n };\r\n $.fn.horizontalMargins = function () {\r\n var $self = $(this);\r\n return parseInt($self.css('marginLeft')) + parseInt($self.css('marginRight'));\r\n };\r\n $.fn.leftMargin = function () {\r\n var $self = $(this);\r\n return parseInt($self.css('marginLeft'));\r\n };\r\n $.fn.rightMargin = function () {\r\n var $self = $(this);\r\n return parseInt($self.css('marginRight'));\r\n };\r\n $.fn.horizontalPadding = function () {\r\n var $self = $(this);\r\n return parseInt($self.css('paddingLeft')) + parseInt($self.css('paddingRight'));\r\n };\r\n $.fn.leftPadding = function () {\r\n var $self = $(this);\r\n return parseInt($self.css('paddingLeft'));\r\n };\r\n $.fn.rightPadding = function () {\r\n var $self = $(this);\r\n return parseInt($self.css('paddingRight'));\r\n };\r\n $.mlp = { x: 0, y: 0 }; // Mouse Last Position\r\n function documentHandler() {\r\n var $current = this === document ? $(this) : $(this).contents();\r\n $current.mousemove(function (e) { jQuery.mlp = { x: e.pageX, y: e.pageY }; });\r\n $current.find('iframe').on('load', documentHandler);\r\n }\r\n $(documentHandler);\r\n $.fn.ismouseover = function () {\r\n var result = false;\r\n this.eq(0).each(function () {\r\n var $current = $(this).is(\"iframe\") ? $(this).contents().find(\"body\") : $(this);\r\n var offset = $current.offset();\r\n result = offset.left <= $.mlp.x && offset.left + $current.outerWidth() > $.mlp.x &&\r\n offset.top <= $.mlp.y && offset.top + $current.outerHeight() > $.mlp.y;\r\n });\r\n return result;\r\n };\r\n var on = $.fn.on;\r\n var timer;\r\n $.fn.on = function () {\r\n var args = Array.apply(null, arguments);\r\n var last = args[args.length - 1];\r\n if (isNaN(last) || (last === 1 && args.pop()))\r\n return on.apply(this, args);\r\n var delay = args.pop();\r\n var fn = args.pop();\r\n args.push(function () {\r\n var self = this;\r\n var params = arguments;\r\n clearTimeout(timer);\r\n timer = setTimeout(function () {\r\n fn.apply(self, params);\r\n }, delay);\r\n });\r\n return on.apply(this, args);\r\n };\r\n $.fn.onEnter = function (cb) {\r\n return this.each(function () {\r\n var $this = $(this);\r\n $this.on('keyup', function (e) {\r\n if (e.keyCode === 13) {\r\n e.preventDefault();\r\n cb();\r\n }\r\n });\r\n });\r\n };\r\n $.fn.onPressed = function (cb) {\r\n return this.each(function () {\r\n var $this = $(this);\r\n $this.on('touchstart click', function (e) {\r\n e.preventDefault();\r\n cb(e);\r\n });\r\n $this.on('keyup', function (e) {\r\n if (e.keyCode === 13) {\r\n e.preventDefault();\r\n cb(e);\r\n }\r\n });\r\n });\r\n };\r\n // Recursively removes the last empty element (img, audio, etc) or word in an element\r\n $.fn.removeLastWord = function (chars, depth) {\r\n if (chars === void 0) { chars = 8; }\r\n if (depth === void 0) { depth = 0; }\r\n return this.each(function () {\r\n var $self = $(this);\r\n if ($self.contents().length > 0) {\r\n var $lastElement = $self.contents().last();\r\n if ($lastElement[0].nodeType === 3) {\r\n var words = $lastElement.text().trim().split(' ');\r\n if (words.length > 1) {\r\n words.splice(words.length - 1, 1);\r\n $lastElement[0].data = words.join(' '); // textnode.data\r\n return;\r\n }\r\n else if ('undefined' !== typeof chars && words.length === 1 && words[0].length > chars) {\r\n $lastElement[0].data = words.join(' ').substring(0, chars);\r\n return;\r\n }\r\n }\r\n $lastElement.removeLastWord(chars, depth + 1); // Element\r\n }\r\n else if (depth > 0) {\r\n // Empty element\r\n $self.remove();\r\n }\r\n });\r\n };\r\n $.fn.switchClass = function (class1, class2) {\r\n return this.each(function () {\r\n $(this).removeClass(class1).addClass(class2);\r\n });\r\n };\r\n $.fn.targetBlank = function () {\r\n return this.each(function () {\r\n $(this).find('a').prop('target', '_blank');\r\n });\r\n };\r\n $.fn.toggleExpandText = function (chars, lessText, moreText, cb) {\r\n return this.each(function () {\r\n var $self = $(this);\r\n var expandedText = $self.html();\r\n if (chars > expandedText.length)\r\n return;\r\n var expanded = false;\r\n var collapsedText = expandedText.substr(0, chars);\r\n collapsedText = collapsedText.substr(0, Math.min(collapsedText.length, collapsedText.lastIndexOf(\" \")));\r\n $self.toggle = function () {\r\n $self.empty();\r\n var $toggleButton = $('<a href=\"#\" class=\"toggle\"></a>');\r\n if (expanded) {\r\n $self.html(expandedText + \" \");\r\n $toggleButton.text(lessText);\r\n $toggleButton.switchClass(\"less\", \"more\");\r\n }\r\n else {\r\n $self.html(collapsedText + \" \");\r\n $toggleButton.text(moreText);\r\n $toggleButton.switchClass(\"more\", \"less\");\r\n }\r\n $toggleButton.one('click', function (e) {\r\n e.preventDefault();\r\n $self.toggle();\r\n });\r\n expanded = !expanded;\r\n $self.append($toggleButton);\r\n if (cb)\r\n cb();\r\n };\r\n $self.toggle();\r\n });\r\n };\r\n // Toggle expansion by number of lines\r\n $.fn.toggleExpandTextByLines = function (lines, lessText, moreText, cb) {\r\n return this.each(function () {\r\n var $self = $(this);\r\n var expandedText = $self.html();\r\n // add 'pad' to account for the right margin in the sidebar\r\n var $buttonPad = $('<span>… <a href=\"#\" class=\"toggle more\">morepad</a></span>');\r\n // when height changes, store string, then pick from line counts\r\n var stringsByLine = [expandedText];\r\n var lastHeight = $self.height();\r\n // Until empty\r\n while ($self.text().length > 0) {\r\n $self.removeLastWord();\r\n var html = $self.html();\r\n $self.append($buttonPad);\r\n if (lastHeight > $self.height()) {\r\n stringsByLine.unshift(html);\r\n lastHeight = $self.height();\r\n }\r\n $buttonPad.remove();\r\n }\r\n if (stringsByLine.length <= lines) {\r\n $self.html(expandedText);\r\n return;\r\n }\r\n var collapsedText = stringsByLine[lines - 1];\r\n // Toggle function\r\n var expanded = false;\r\n $self.toggle = function () {\r\n $self.empty();\r\n var $toggleButton = $('<a href=\"#\" class=\"toggle\"></a>');\r\n if (expanded) {\r\n $self.html(expandedText + \" \");\r\n $toggleButton.text(lessText);\r\n $toggleButton.switchClass(\"less\", \"more\");\r\n }\r\n else {\r\n $self.html(collapsedText + \"… \");\r\n $toggleButton.text(moreText);\r\n $toggleButton.switchClass(\"more\", \"less\");\r\n }\r\n $toggleButton.one('click', function (e) {\r\n e.preventDefault();\r\n $self.toggle();\r\n });\r\n expanded = !expanded;\r\n $self.append($toggleButton);\r\n if (cb)\r\n cb();\r\n };\r\n $self.toggle();\r\n });\r\n };\r\n $.fn.toggleText = function (text1, text2) {\r\n return this.each(function () {\r\n var $self = $(this);\r\n if ($self.text() === text1) {\r\n $(this).text(text2);\r\n }\r\n else {\r\n $(this).text(text1);\r\n }\r\n });\r\n };\r\n $.fn.updateAttr = function (attrName, oldVal, newVal) {\r\n return this.each(function () {\r\n var $self = $(this);\r\n var attr = $self.attr(attrName);\r\n if (attr && attr.indexOf(oldVal) === 0) {\r\n attr = attr.replace(oldVal, newVal);\r\n $self.attr(attrName, attr);\r\n }\r\n });\r\n };\r\n $.fn.verticalMargins = function () {\r\n var $self = $(this);\r\n return parseInt($self.css('marginTop')) + parseInt($self.css('marginBottom'));\r\n };\r\n $.fn.verticalPadding = function () {\r\n var $self = $(this);\r\n return parseInt($self.css('paddingTop')) + parseInt($self.css('paddingBottom'));\r\n };\r\n})(jQuery);\r\n\ndefine(\"lib/jquery-plugins.js\", function(){});\n\n", "/*! Tiny Pub/Sub - v0.7.0 - 2018-10-11\r\n* https://github.com/cowboy/jquery-tiny-pubsub\r\n* Copyright (c) 2018 \"Cowboy\" Ben Alman; Licensed MIT */\r\n(function($) {\n\n var o = null;\n\n $.initPubSub = function() {\n o = $({});\n };\n\n $.subscribe = function() {\n if (!o) {\n $.initPubSub();\n }\n\n o.on.apply(o, arguments);\n };\n\n $.unsubscribe = function() {\n if (!o) {\n $.initPubSub();\n }\n\n o.off.apply(o, arguments);\n };\n\n $.disposePubSub = function() {\n o = null;\n };\n\n $.publish = function() {\n if (!o) {\n $.initPubSub();\n }\n\n o.trigger.apply(o, arguments);\n };\n\n}(jQuery));\ndefine(\"lib/ba-tiny-pubsub.js\", function(){});\n\n", "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(\"manifesto\",[],t):\"object\"==typeof exports?exports.manifesto=t():e.manifesto=t()}(\"undefined\"!=typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=7)}([function(e,t,r){\"use strict\";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,\"__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(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.BOOKMARKING=\"oa:bookmarking\",e.CLASSIFYING=\"oa:classifying\",e.COMMENTING=\"oa:commenting\",e.DESCRIBING=\"oa:describing\",e.EDITING=\"oa:editing\",e.HIGHLIGHTING=\"oa:highlighting\",e.IDENTIFYING=\"oa:identifying\",e.LINKING=\"oa:linking\",e.MODERATING=\"oa:moderating\",e.PAINTING=\"sc:painting\",e.QUESTIONING=\"oa:questioning\",e.REPLYING=\"oa:replying\",e.TAGGING=\"oa:tagging\",e.TRANSCRIBING=\"oad:transcribing\"}(t.AnnotationMotivation||(t.AnnotationMotivation={})),function(e){e.AUTO_ADVANCE=\"auto-advance\",e.CONTINUOUS=\"continuous\",e.FACING_PAGES=\"facing-pages\",e.HIDDEN=\"hidden\",e.INDIVIDUALS=\"individuals\",e.MULTI_PART=\"multi-part\",e.NO_NAV=\"no-nav\",e.NON_PAGED=\"non-paged\",e.PAGED=\"paged\",e.REPEAT=\"repeat\",e.SEQUENCE=\"sequence\",e.THUMBNAIL_NAV=\"thumbnail-nav\",e.TOGETHER=\"together\",e.UNORDERED=\"unordered\"}(t.Behavior||(t.Behavior={})),function(e){e.CANVAS=\"canvas\",e.CHOICE=\"choice\",e.OA_CHOICE=\"oa:choice\",e.CONTENT_AS_TEXT=\"contentastext\",e.DATASET=\"dataset\",e.DOCUMENT=\"document\",e.IMAGE=\"image\",e.MODEL=\"model\",e.MOVING_IMAGE=\"movingimage\",e.PDF=\"pdf\",e.PHYSICAL_OBJECT=\"physicalobject\",e.SOUND=\"sound\",e.TEXT=\"text\",e.TEXTUALBODY=\"textualbody\",e.VIDEO=\"video\"}(t.ExternalResourceType||(t.ExternalResourceType={})),function(e){e.ANNOTATION=\"annotation\",e.CANVAS=\"canvas\",e.COLLECTION=\"collection\",e.MANIFEST=\"manifest\",e.RANGE=\"range\",e.SEQUENCE=\"sequence\"}(t.IIIFResourceType||(t.IIIFResourceType={})),function(e){e.AUDIO_MP4=\"audio/mp4\",e.CORTO=\"application/corto\",e.DICOM=\"application/dicom\",e.DRACO=\"application/draco\",e.EPUB=\"application/epub+zip\",e.GLB=\"model/gltf-binary\",e.GLTF=\"model/gltf+json\",e.IIIF_PRESENTATION_2='application/ld+json;profile=\"http://iiif.io/api/presentation/2/context.json\"',e.IIIF_PRESENTATION_3='application/ld+json;profile=\"http://iiif.io/api/presentation/3/context.json\"',e.JPG=\"image/jpeg\",e.M3U8=\"application/vnd.apple.mpegurl\",e.MP3=\"audio/mp3\",e.MPEG_DASH=\"application/dash+xml\",e.OBJ=\"text/plain\",e.OPF=\"application/oebps-package+xml\",e.PDF=\"application/pdf\",e.PLY=\"application/ply\",e.THREEJS=\"application/vnd.threejs+json\",e.USDZ=\"model/vnd.usd+zip\",e.VIDEO_MP4=\"video/mp4\",e.WEBM=\"video/webm\"}(t.MediaType||(t.MediaType={})),function(e){e.DOC=\"application/msword\",e.DOCX=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",e.PDF=\"application/pdf\"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/compliance.html#level0\",e.IMAGE_0_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/compliance.html#level1\",e.IMAGE_0_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/compliance.html#level2\",e.IMAGE_0_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/conformance.html#level0\",e.IMAGE_0_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/conformance.html#level1\",e.IMAGE_0_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/conformance.html#level2\",e.IMAGE_1_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\",e.IMAGE_1_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1\",e.IMAGE_1_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2\",e.IMAGE_1_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0\",e.IMAGE_1_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1\",e.IMAGE_1_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2\",e.IMAGE_1_LEVEL_0=\"http://iiif.io/api/image/1/level0.json\",e.IMAGE_1_PROFILE_LEVEL_0=\"http://iiif.io/api/image/1/profiles/level0.json\",e.IMAGE_1_LEVEL_1=\"http://iiif.io/api/image/1/level1.json\",e.IMAGE_1_PROFILE_LEVEL_1=\"http://iiif.io/api/image/1/profiles/level1.json\",e.IMAGE_1_LEVEL_2=\"http://iiif.io/api/image/1/level2.json\",e.IMAGE_1_PROFILE_LEVEL_2=\"http://iiif.io/api/image/1/profiles/level2.json\",e.IMAGE_2_LEVEL_0=\"http://iiif.io/api/image/2/level0.json\",e.IMAGE_2_PROFILE_LEVEL_0=\"http://iiif.io/api/image/2/profiles/level0.json\",e.IMAGE_2_LEVEL_1=\"http://iiif.io/api/image/2/level1.json\",e.IMAGE_2_PROFILE_LEVEL_1=\"http://iiif.io/api/image/2/profiles/level1.json\",e.IMAGE_2_LEVEL_2=\"http://iiif.io/api/image/2/level2.json\",e.IMAGE_2_PROFILE_LEVEL_2=\"http://iiif.io/api/image/2/profiles/level2.json\",e.AUTH_0_CLICK_THROUGH=\"http://iiif.io/api/auth/0/login/clickthrough\",e.AUTH_0_LOGIN=\"http://iiif.io/api/auth/0/login\",e.AUTH_0_LOGOUT=\"http://iiif.io/api/auth/0/logout\",e.AUTH_0_RESTRICTED=\"http://iiif.io/api/auth/0/login/restricted\",e.AUTH_0_TOKEN=\"http://iiif.io/api/auth/0/token\",e.AUTH_1_CLICK_THROUGH=\"http://iiif.io/api/auth/1/clickthrough\",e.AUTH_1_EXTERNAL=\"http://iiif.io/api/auth/1/external\",e.AUTH_1_KIOSK=\"http://iiif.io/api/auth/1/kiosk\",e.AUTH_1_LOGIN=\"http://iiif.io/api/auth/1/login\",e.AUTH_1_LOGOUT=\"http://iiif.io/api/auth/1/logout\",e.AUTH_1_PROBE=\"http://iiif.io/api/auth/1/probe\",e.AUTH_1_TOKEN=\"http://iiif.io/api/auth/1/token\",e.SEARCH_0=\"http://iiif.io/api/search/0/search\",e.SEARCH_0_AUTO_COMPLETE=\"http://iiif.io/api/search/0/autocomplete\",e.SEARCH_1=\"http://iiif.io/api/search/1/search\",e.SEARCH_1_AUTO_COMPLETE=\"http://iiif.io/api/search/1/autocomplete\",e.TRACKING_EXTENSIONS=\"http://universalviewer.io/tracking-extensions-profile\",e.UI_EXTENSIONS=\"http://universalviewer.io/ui-extensions-profile\",e.PRINT_EXTENSIONS=\"http://universalviewer.io/print-extensions-profile\",e.SHARE_EXTENSIONS=\"http://universalviewer.io/share-extensions-profile\",e.OTHER_MANIFESTATIONS=\"http://iiif.io/api/otherManifestations.json\",e.IXIF=\"http://wellcomelibrary.org/ld/ixif/0/alpha.json\"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.BOTTOM_TO_TOP=\"bottom-to-top\",e.LEFT_TO_RIGHT=\"left-to-right\",e.RIGHT_TO_LEFT=\"right-to-left\",e.TOP_TO_BOTTOM=\"top-to-bottom\"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS=\"continuous\",e.INDIVIDUALS=\"individuals\",e.NON_PAGED=\"non-paged\",e.PAGED=\"paged\",e.TOP=\"top\"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,r){var n=r(21).Symbol;e.exports=n},function(e,t,r){\"use strict\";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(0),a=r(1),s=r(36);r(37);var u=function(){function e(){}return e.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(\";\")[0]).trim()},e.getImageQuality=function(e){return e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_LEVEL_1||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_LEVEL_2||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?\"native\":\"default\"},e.getInexactLocale=function(e){return-1!==e.indexOf(\"-\")?e.substr(0,e.indexOf(\"-\")):e},e.getLocalisedValue=function(e,t){if(!Array.isArray(e))return e;for(var r=0;r<e.length;r++){var n=e[r];if(t===n[\"@language\"])return n[\"@value\"]}var i=t.substr(0,t.indexOf(\"-\"));for(r=0;r<e.length;r++){var o=e[r];if(o[\"@language\"]===i)return o[\"@value\"]}return null},e.generateTreeNodeIds=function(t,r){var n;void 0===r&&(r=0),n=t.parentNode?t.parentNode.id+\"-\"+r:\"0\",t.id=n;for(var i=0;i<t.nodes.length;i++){var o=t.nodes[i];e.generateTreeNodeIds(o,i)}},e.normaliseType=function(e){return-1!==(e=(e||\"\").toLowerCase()).indexOf(\":\")?e.split(\":\")[1]:e},e.normaliseUrl=function(e){return-1!==(e=e.substr(e.indexOf(\"://\"))).indexOf(\"#\")&&(e=e.split(\"#\")[0]),e},e.normalisedUrlsMatch=function(t,r){return e.normaliseUrl(t)===e.normaliseUrl(r)},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(e,t){return o.Deserialiser.parse(e,t)},e.checkStatus=function(e){if(e.ok)return e;var t=new Error(e.statusText);return t.response=e,Promise.reject(t)},e.loadManifest=function(t){return new Promise((function(r,n){fetch(t).then(e.checkStatus).then((function(e){return e.json()})).then((function(e){r(e)})).catch((function(e){n()}))}))},e.loadExternalResourcesAuth1=function(t,r,n,i,o,a,s,u){return new Promise((function(c,l){var p=t.map((function(t){return e.loadExternalResourceAuth1(t,r,n,i,o,a,s,u)}));Promise.all(p).then((function(){c(t)})).catch((function(e){l(e)}))}))},e.loadExternalResourceAuth1=function(t,r,o,a,u,c,l,p){return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return[4,a(t)];case 1:return(n=i.sent())?[4,t.getData(n)]:[3,6];case 2:return i.sent(),t.status!==s.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,r,o,u,c,l,p)];case 4:i.sent(),i.label=5;case 5:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return i.sent(),t.status!==s.MOVED_TEMPORARILY&&t.status!==s.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,r,o,u,c,l,p)];case 8:i.sent(),i.label=9;case 9:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}}))}))},e.doAuthChain=function(t,r,o,a,u,c,l){return n(this,void 0,void 0,(function(){var n,p,f,h,_,g,d,v;return i(this,(function(i){switch(i.label){case 0:return t.isAccessControlled()?((n=t.externalService)&&(n.options=t.options),(p=t.kioskService)&&(p.options=t.options),(f=t.clickThroughService)&&(f.options=t.options),(h=t.loginService)&&(h.options=t.options),t.isResponseHandled||t.status!==s.MOVED_TEMPORARILY?[3,2]:[4,c(t)]):[2,t];case 1:return i.sent(),[2,t];case 2:return _=null,g=null,(_=n)?(g=_,[4,e.attemptResourceWithToken(t,o,_)]):[3,4];case 3:return i.sent(),[2,t];case 4:return(_=p)?(g=_,(d=r(_))?[4,a(d)]:[3,7]):[3,7];case 5:return i.sent(),[4,e.attemptResourceWithToken(t,o,_)];case 6:return i.sent(),[2,t];case 7:return(_=f)?(g=_,[4,u(t,_)]):[3,11];case 8:return(v=i.sent())?[4,a(v)]:[3,11];case 9:return i.sent(),[4,e.attemptResourceWithToken(t,o,_)];case 10:return i.sent(),[2,t];case 11:return(_=h)?(g=_,[4,u(t,_)]):[3,15];case 12:return(v=i.sent())?[4,a(v)]:[3,15];case 13:return i.sent(),[4,e.attemptResourceWithToken(t,o,_)];case 14:return i.sent(),[2,t];case 15:return g&&l(t,g),[2]}}))}))},e.attemptResourceWithToken=function(e,t,r){return n(this,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return(n=r.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,t(e,n)]:[3,3];case 1:return(o=i.sent())&&o.accessToken?[4,e.getData(o)]:[3,3];case 2:return i.sent(),[2,e];case 3:return[2]}}))}))},e.loadExternalResourcesAuth09=function(t,r,n,i,o,a,s,u,c,l){return new Promise((function(p,f){var h=t.map((function(t){return e.loadExternalResourceAuth09(t,r,n,i,o,a,s,u,c,l)}));Promise.all(h).then((function(){p(t)})).catch((function(e){f(e)}))}))},e.loadExternalResourceAuth09=function(t,r,n,i,o,a,u,c,l,p){return new Promise((function(f,h){p&&p.pessimisticAccessControl?t.getData().then((function(){t.isAccessControlled()?t.clickThroughService?(f(n(t)),f(i(t))):o(t).then((function(){a(t,!0).then((function(r){t.getData(r).then((function(){f(l(t))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))})):f(t)})).catch((function(t){h(e.createInternalServerError(t))})):c(t,r).then((function(p){p?t.getData(p).then((function(){t.status===s.OK?f(l(t)):e.authorize(t,r,n,i,o,a,u,c).then((function(){f(l(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())})):e.authorize(t,r,n,i,o,a,u,c).then((function(){f(l(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())}))}))},e.createError=function(e,t){var r=new Error;return r.message=t,r.name=String(e),r},e.createAuthorizationFailedError=function(){return e.createError(o.StatusCode.AUTHORIZATION_FAILED,\"Authorization failed\")},e.createRestrictedError=function(){return e.createError(o.StatusCode.RESTRICTED,\"Restricted\")},e.createInternalServerError=function(t){return e.createError(o.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,r,n,i,o,a,u,c){return new Promise((function(l,p){t.getData().then((function(){t.isAccessControlled()?c(t,r).then((function(c){c?t.getData(c).then((function(){t.status===s.OK?l(t):e.showAuthInteraction(t,r,n,i,o,a,u,l,p)})).catch((function(t){p(e.createInternalServerError(t))})):a(t,!1).then((function(c){c?u(t,c,r).then((function(){t.getData(c).then((function(){t.status===s.OK?l(t):e.showAuthInteraction(t,r,n,i,o,a,u,l,p)})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))})):e.showAuthInteraction(t,r,n,i,o,a,u,l,p)}))})).catch((function(t){p(e.createInternalServerError(t))})):l(t)}))}))},e.showAuthInteraction=function(t,r,n,i,o,a,u,c,l){t.status!==s.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?n(t).then((function(){a(t,!0).then((function(n){u(t,n,r).then((function(){t.getData(n).then((function(){c(t)})).catch((function(t){l(e.createInternalServerError(t))}))})).catch((function(t){l(e.createInternalServerError(t))}))})).catch((function(t){l(e.createInternalServerError(t))}))})):o(t).then((function(){a(t,!0).then((function(n){u(t,n,r).then((function(){t.getData(n).then((function(){c(t)})).catch((function(t){l(e.createInternalServerError(t))}))})).catch((function(t){l(e.createInternalServerError(t))}))})).catch((function(t){l(e.createInternalServerError(t))}))})):c(t)},e.getService=function(e,t){for(var r=this.getServices(e),n=0;n<r.length;n++){var i=r[n];if(i.getProfile()===t)return i}return null},e.getResourceById=function(t,r){return e.traverseAndFind(t.__jsonld,\"@id\",r)},e.traverseAndFind=function(t,r,n){if(t.hasOwnProperty(r)&&t[r]===n)return t;for(var i=0;i<Object.keys(t).length;i++)if(\"object\"==typeof t[Object.keys(t)[i]]){var o=e.traverseAndFind(t[Object.keys(t)[i]],r,n);if(null!=o)return o}},e.getServices=function(e){var t,r=[];if(!(t=e.__jsonld?e.__jsonld.service:e.service))return r;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++){var i=t[n];if(\"string\"==typeof i){var a=this.getResourceById(e.options.resource,i);a&&r.push(new o.Service(a.__jsonld||a,e.options))}else r.push(new o.Service(i,e.options))}return r},e.getTemporalComponent=function(e){var t=/t=([^&]+)/g.exec(e),r=null;return t&&t[1]&&(r=t[1].split(\",\")),r},e}();t.Utils=u},function(e,t,r){var n=r(19),i=r(20);e.exports=function e(t,r,o,a,s){var u=-1,c=t.length;for(o||(o=i),s||(s=[]);++u<c;){var l=t[u];r>0&&o(l)?r>1?e(l,r-1,o,a,s):n(s,l):a||(s[s.length]=l)}return s}},function(e,t){e.exports=function(e){return null!=e&&\"object\"==typeof e}},function(e,t,r){\"use strict\";r.r(t),t.default=function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in i.open(t.method||\"get\",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+\",\"+r:r})),r(u())},i.onerror=n,i.withCredentials=\"include\"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)}))}},function(e,t,r){e.exports=r(8)},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(0));var n=r(3);t.loadManifest=function(e){return n.Utils.loadManifest(e)},t.parseManifest=function(e,t){return n.Utils.parseManifest(e,t)}},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(){function e(e){this.__jsonld=e,this.context=this.getProperty(\"context\"),this.id=this.getProperty(\"id\")}return e.prototype.getProperty=function(e){var t=null;return this.__jsonld&&((t=this.__jsonld[e])||(t=this.__jsonld[\"@\"+e])),t},e}();t.JSONLDResource=n},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(0),a=r(1),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.options=r,n}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty(\"type\"))},t.prototype.getLabel=function(){var e=this.getProperty(\"label\");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},t.prototype.getMetadata=function(){var e=this.getProperty(\"metadata\"),t=[];if(!e)return t;for(var r=0;r<e.length;r++){var n=e[r],i=new o.LabelValuePair(this.options.locale);i.parse(n),t.push(i)}return t},t.prototype.getRendering=function(e){for(var t=this.getRenderings(),r=0;r<t.length;r++){var n=t[r];if(n.getFormat()===e)return n}return null},t.prototype.getRenderings=function(){var e,t=[];if(!(e=this.__jsonld?this.__jsonld.rendering:this.rendering))return t;Array.isArray(e)||(e=[e]);for(var r=0;r<e.length;r++){var n=e[r];t.push(new o.Rendering(n,this.options))}return t},t.prototype.getService=function(e){return o.Utils.getService(this,e)},t.prototype.getServices=function(){return o.Utils.getServices(this)},t.prototype.getThumbnail=function(){var e=this.getProperty(\"thumbnail\");return Array.isArray(e)&&(e=e[0]),e?new o.Thumbnail(e,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},t}(o.JSONLDResource);t.ManifestResource=s},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty(\"format\");return e?e.toLowerCase():null},t.prototype.getResources=function(){var e=[];if(!this.__jsonld.resources)return e;for(var t=0;t<this.__jsonld.resources.length;t++){var r=this.__jsonld.resources[t],n=new o.Annotation(r,this.options);e.push(n)}return e},t.prototype.getType=function(){var e=this.getProperty(\"type\");return e?o.Utils.normaliseType(e):null},t.prototype.getWidth=function(){return this.getProperty(\"width\")},t.prototype.getHeight=function(){return this.getProperty(\"height\")},t.prototype.getMaxWidth=function(){return this.getProperty(\"maxWidth\")},t.prototype.getMaxHeight=function(){return this.getProperty(\"maxHeight\")?null:this.getMaxWidth()},t}(o.ManifestResource);t.Resource=a},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(0),a=r(1),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;n.index=-1,n.isLoaded=!1;var i={defaultLabel:\"-\",locale:\"en-GB\",resource:n,pessimisticAccessControl:!1};return n.options=Object.assign(i,r),n}return i(t,e),t.prototype.getAttribution=function(){var e=this.getProperty(\"attribution\");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getDescription=function(){var e=this.getProperty(\"description\");return e?o.PropertyValue.parse(e,this.options.locale):new o.PropertyValue([],this.options.locale)},t.prototype.getHomepage=function(){var e=this.getProperty(\"homepage\");return e?\"string\"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e[\"@id\"]||e.id):null},t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty(\"type\"))},t.prototype.getLogo=function(){var e=this.getProperty(\"logo\");return e?\"string\"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e[\"@id\"]||e.id):null},t.prototype.getLicense=function(){return o.Utils.getLocalisedValue(this.getProperty(\"license\"),this.options.locale)},t.prototype.getNavDate=function(){return new Date(this.getProperty(\"navDate\"))},t.prototype.getRelated=function(){return this.getProperty(\"related\")},t.prototype.getSeeAlso=function(){return this.getProperty(\"seeAlso\")},t.prototype.getTrackingLabel=function(){var e=this.getService(a.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty(\"trackingLabel\"):\"\"},t.prototype.getDefaultTree=function(){return this.defaultTree=new o.TreeNode(\"root\"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty(\"requiredStatement\");if(t)(e=new o.LabelValuePair(this.options.locale)).parse(t);else{var r=this.getAttribution();r&&((e=new o.LabelValuePair(this.options.locale)).value=r)}return e},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.load=function(){var e=this;return new Promise((function(t){if(e.isLoaded)t(e);else{var r=e.options;r.navDate=e.getNavDate();var n=e.__jsonld.id;n||(n=e.__jsonld[\"@id\"]),o.Utils.loadManifest(n).then((function(n){e.parentLabel=e.getLabel().getValue(r.locale);var i=o.Deserialiser.parse(n,r);(e=Object.assign(e,i)).index=r.index,t(e)}))}}))},t}(o.ManifestResource);t.IIIFResource=s},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getBody=function(){var e=[],t=this.getProperty(\"body\");if(t)if(Array.isArray(t))for(var r=0;r<t.length;r++){if((a=t[r]).items)for(var n=0;n<a.items.length;n++){var i=a.items[n];e.push(new o.AnnotationBody(i,this.options))}else e.push(new o.AnnotationBody(a,this.options))}else if(t.items)for(r=0;r<t.items.length;r++){var a=t.items[r];e.push(new o.AnnotationBody(a,this.options))}else e.push(new o.AnnotationBody(t,this.options));return e},t.prototype.getMotivation=function(){var e=this.getProperty(\"motivation\");return e||null},t.prototype.getOn=function(){return this.getProperty(\"on\")},t.prototype.getTarget=function(){return this.getProperty(\"target\")},t.prototype.getResource=function(){return new o.Resource(this.getProperty(\"resource\"),this.options)},t}(o.ManifestResource);t.Annotation=a},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty(\"format\");return e?o.Utils.getMediaType(e):null},t.prototype.getType=function(){return this.getProperty(\"type\")?o.Utils.normaliseType(this.getProperty(\"type\")):null},t.prototype.getWidth=function(){return this.getProperty(\"width\")},t.prototype.getHeight=function(){return this.getProperty(\"height\")},t}(o.ManifestResource);t.AnnotationBody=a},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(0),a=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.label=t,i.options=n,i}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty(\"type\"))},t.prototype.getLabel=function(){return this.label},t.prototype.getResources=function(){var e=this;return this.getProperty(\"resources\").map((function(t){return new o.Annotation(t,e.options)}))},t.prototype.load=function(){var e=this;return new Promise((function(t,r){if(e.isLoaded)t(e);else{var n=e.__jsonld.id;n||(n=e.__jsonld[\"@id\"]),o.Utils.loadManifest(n).then((function(r){e.__jsonld=r,e.context=e.getProperty(\"context\"),e.id=e.getProperty(\"id\"),e.isLoaded=!0,t(e)})).catch(r)}}))},t}(o.JSONLDResource);t.AnnotationList=a},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getItems=function(){return this.getProperty(\"items\")},t}(r(0).ManifestResource);t.AnnotationPage=o},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(1),a=r(0),s=r(18),u=r(30),c=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getCanonicalImageUri=function(e){var t,r=null,n=\"default\",i=e;if(this.externalResource&&this.externalResource.data&&this.externalResource.data[\"@id\"])r=this.externalResource.data[\"@id\"],i||(i=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)&&(n=\"native\");else{var o=this.getImages();if(o&&o.length){var s=o[0].getResource(),u=s.getServices();if(i||(i=s.getWidth()),u.length){var c=u[0];r=c.id,n=a.Utils.getImageQuality(c.getProfile())}else if(i===s.getWidth())return s.id}if(!r){var l=this.getProperty(\"thumbnail\");if(l){if(\"string\"==typeof l)return l;if(l[\"@id\"])return l[\"@id\"];if(l.length)return l[0].id}}}return t=i+\",\",r&&r.endsWith(\"/\")&&(r=r.substr(0,r.length-1)),[r,\"full\",t,0,n+\".jpg\"].join(\"/\")},t.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(e){return e.maxWidth}))[0])&&(t=new a.Size(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},t.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var r=null;if(t.length&&(r=new a.AnnotationPage(t[0],this.options)),!r)return e;for(var n=r.getItems(),i=0;i<n.length;i++){var o=n[i],s=new a.Annotation(o,this.options);e.push(s)}return e},t.prototype.getDuration=function(){return this.getProperty(\"duration\")},t.prototype.getImages=function(){var e=[];if(!this.__jsonld.images)return e;for(var t=0;t<this.__jsonld.images.length;t++){var r=this.__jsonld.images[t],n=new a.Annotation(r,this.options);e.push(n)}return e},t.prototype.getIndex=function(){return this.getProperty(\"index\")},t.prototype.getOtherContent=function(){var e=this,t=Array.isArray(this.getProperty(\"otherContent\"))?this.getProperty(\"otherContent\"):[this.getProperty(\"otherContent\")],r=t.filter((function(e){return e&&(t=e[\"@type\"],r=\"sc:AnnotationList\",\"string\"==typeof t&&\"string\"==typeof r&&t.toLowerCase()==t.toLowerCase());var t,r})).map((function(t,r){return new a.AnnotationList(t.label||\"Annotation list \"+r,t,e.options)})).map((function(e){return e.load()}));return Promise.all(r)},t.prototype.getWidth=function(){return this.getProperty(\"width\")},t.prototype.getHeight=function(){return this.getProperty(\"height\")},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},Object.defineProperty(t.prototype,\"imageResources\",{get:function(){var e=this,r=u.default([this.getImages().map((function(e){return e.getResource()})),this.getContent().map((function(e){return e.getBody()}))]);return s.default(r.map((function(r){switch(r.getProperty(\"type\").toLowerCase()){case o.ExternalResourceType.CHOICE:case o.ExternalResourceType.OA_CHOICE:return new t({images:s.default([r.getProperty(\"default\"),r.getProperty(\"item\")]).map((function(e){return{resource:e}}))},e.options).getImages().map((function(e){return e.getResource()}));default:return r}})))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"resourceAnnotations\",{get:function(){return u.default([this.getImages(),this.getContent()])},enumerable:!0,configurable:!0}),t.prototype.resourceAnnotation=function(e){return this.resourceAnnotations.find((function(t){return t.getResource().id===e||s.default(new Array(t.getBody())).some((function(t){return t.id===e}))}))},t.prototype.onFragment=function(e){var t=this.resourceAnnotation(e);if(t){var r=t.getProperty(\"on\"),n=t.getProperty(\"target\"),i=(r||n).match(/xywh=(.*)$/);if(i)return i[1].split(\",\").map((function(e){return parseInt(e,10)}))}},Object.defineProperty(t.prototype,\"iiifImageResources\",{get:function(){return this.imageResources.filter((function(e){return e&&e.getServices()[0]&&e.getServices()[0].id}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"imageServiceIds\",{get:function(){return this.iiifImageResources.map((function(e){return e.getServices()[0].id}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"aspectRatio\",{get:function(){return this.getWidth()/this.getHeight()},enumerable:!0,configurable:!0}),t}(a.Resource);t.Canvas=c},function(e,t,r){var n=r(4);e.exports=function(e){return(null==e?0:e.length)?n(e,1):[]}},function(e,t){e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},function(e,t,r){var n=r(2),i=r(24),o=r(29),a=n?n.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},function(e,t,r){var n=r(22),i=\"object\"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function(\"return this\")();e.exports=o},function(e,t,r){(function(t){var r=\"object\"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(23))},function(e,t){var r;r=function(){return this}();try{r=r||new Function(\"return this\")()}catch(e){\"object\"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(25),i=r(5),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,\"callee\")&&!s.call(e,\"callee\")};e.exports=u},function(e,t,r){var n=r(26),i=r(5),o=\"[object Arguments]\";e.exports=function(e){return i(e)&&n(e)==o}},function(e,t,r){var n=r(2),i=r(27),o=r(28),a=\"[object Null]\",s=\"[object Undefined]\",u=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?s:a:u&&u in Object(e)?i(e):o(e)}},function(e,t,r){var n=r(2),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){var n=r(4),i=1/0;e.exports=function(e){return(null==e?0:e.length)?n(e,i):[]}},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(1),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.items=[],n._collections=null,n._manifests=null,t.__collection=n,n}return i(t,e),t.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter((function(e){return e.isCollection()}))},t.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter((function(e){return e.isManifest()}))},t.prototype.getCollectionByIndex=function(e){for(var t,r=this.getCollections(),n=0;n<r.length;n++){var i=r[n];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error(\"Collection index not found\")},t.prototype.getManifestByIndex=function(e){for(var t,r=this.getManifests(),n=0;n<r.length;n++){var i=r[n];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error(\"Manifest index not found\")},t.prototype.getTotalCollections=function(){return this.getCollections().length},t.prototype.getTotalManifests=function(){return this.getManifests().length},t.prototype.getTotalItems=function(){return this.items.length},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")?this.getProperty(\"viewingDirection\"):o.ViewingDirection.LEFT_TO_RIGHT},t.prototype.getBehavior=function(){var e=this.getProperty(\"behavior\");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t.prototype.getDefaultTree=function(){return e.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},t.prototype._parseManifests=function(e){if(e.getManifests()&&e.getManifests().length)for(var t=0;t<e.getManifests().length;t++){var r=e.getManifests()[t],n=r.getDefaultTree();n.label=r.parentLabel||r.getLabel().getValue(this.options.locale)||\"manifest \"+(t+1),n.navDate=r.getNavDate(),n.data.id=r.id,n.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),e.defaultTree.addNode(n)}},t.prototype._parseCollections=function(e){if(e.getCollections()&&e.getCollections().length)for(var t=0;t<e.getCollections().length;t++){var r=e.getCollections()[t],n=r.getDefaultTree();n.label=r.parentLabel||r.getLabel().getValue(this.options.locale)||\"collection \"+(t+1),n.navDate=r.getNavDate(),n.data.id=r.id,n.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),e.defaultTree.addNode(n)}},t}(a.IIIFResource);t.Collection=s},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(){function e(e,t){this.start=e,this.end=t}return e.prototype.getLength=function(){return this.end-this.start},e}();t.Duration=n},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(0),i=function(){function e(e){this.defaultLocale=e}return e.prototype.parse=function(e){this.resource=e,this.label=n.PropertyValue.parse(this.resource.label,this.defaultLocale),this.value=n.PropertyValue.parse(this.resource.value,this.defaultLocale)},e.prototype.getLabel=function(e){return null===this.label?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.label.getValue(e||this.defaultLocale))},e.prototype.setLabel=function(e){null===this.label&&(this.label=new n.PropertyValue([])),this.label.setValue(e,this.defaultLocale)},e.prototype.getValue=function(e,t){return void 0===t&&(t=\"<br/>\"),null===this.value?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValue(e||this.defaultLocale,t))},e.prototype.getValues=function(e){return null===this.value?[]:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValues(e||this.defaultLocale))},e.prototype.setValue=function(e){null===this.value&&(this.value=new n.PropertyValue([])),this.value.setValue(e,this.defaultLocale)},e}();t.LabelValuePair=i},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.getValue=function(e,t){return e.getValue(t,\"<br/>\")},t.getValues=function(e,t){return e.getValues(t)},t}(Array);t.LanguageMap=o},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n};Object.defineProperty(t,\"__esModule\",{value:!0});var a=r(3),s=function(){function e(e,t,r){void 0===r&&(r=\"none\"),Array.isArray(e)&&1===e.length?this._value=e[0]:this._value=e,\"none\"!==t&&\"@none\"!==t||(t=void 0),this._locale=t,this._defaultLocale=r}return e.parseV2Value=function(t,r){return\"string\"==typeof t?new e(t,void 0,r):t[\"@value\"]?new e(t[\"@value\"],t[\"@language\"],r):null},Object.defineProperty(e.prototype,\"value\",{get:function(){return Array.isArray(this._value)?this._value.join(\"<br/>\"):this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"locale\",{get:function(){return void 0===this._locale?this._defaultLocale:this._locale},enumerable:!0,configurable:!0}),e.prototype.addValue=function(e){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(e)?this._value=this._value.concat(e):this._value.push(e)},e}();t.LocalizedValue=s;var u=function(e){function t(r,n){void 0===r&&(r=[]);var i=e.apply(this,r)||this;return i.__proto__=t.prototype,i._defaultLocale=n,i}return i(t,e),t.parse=function(e,r){if(!e)return new t([],r);if(Array.isArray(e)){var n=(i=e.map((function(e){return s.parseV2Value(e,r)})).filter((function(e){return null!==e}))).reduce((function(e,t){var r=t._locale;return r||(r=\"none\"),e[r]?e[r].addValue(t._value):e[r]=t,e}),{});return new t(Object.values(n),r)}return\"string\"==typeof e?new t([new s(e,void 0,r)],r):e[\"@language\"]?new t(null!==(i=s.parseV2Value(e))?[i]:[],r):new t(Object.keys(e).map((function(t){var n=e[t];if(!Array.isArray(n))throw new Error(\"A IIIF v3 localized property value must have an array as the value for a given language.\");return new s(n,t,r)})),r);var i},t.prototype.getSuitableLocale=function(e){for(var t=o(this).map((function(e){return e._locale})).filter((function(e){return void 0!==e})),r=function(e){var r=t.find((function(t){return t===e}));if(r)return{value:r}},n=0,i=e;n<i.length;n++){var s=r(i[n]);if(\"object\"==typeof s)return s.value}for(var u=function(e){var r=t.find((function(t){return a.Utils.getInexactLocale(t)===a.Utils.getInexactLocale(e)}));if(r)return{value:r}},c=0,l=e;c<l.length;c++){var p=u(l[c]);if(\"object\"==typeof p)return p.value}},t.prototype.setValue=function(e,t){var r=void 0;if(t){var n=this.getSuitableLocale([t]);n&&(r=this.find((function(e){return e._locale===n})))}else r=this.find((function(e){return void 0===e._locale}));r?r._value=e:this.push(new s(e,t,this._defaultLocale))},t.prototype.getValue=function(e,t){var r=this.getValues(e);return 0===r.length?null:t?r.join(t):r[0]},t.prototype.getValues=function(e){if(!this.length)return[];var t;if(t=e?Array.isArray(e)?e:[e]:[],1===this.length&&void 0===this[0]._locale){var r=this[0]._value;return Array.isArray(r)?r:[r]}var n=this.getSuitableLocale(t);if(n){r=this.find((function(e){return e._locale===n}))._value;return Array.isArray(r)?r:[r]}if(!this.find((function(e){return void 0===e._locale}))){r=this[0]._value;return Array.isArray(r)?r:[r]}var i=this.find((function(e){return void 0===e._locale}));return i?Array.isArray(i._value)?i._value:[i._value]:[]},t}(Array);t.PropertyValue=u},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511},function(e,t,r){e.exports=window.fetch||(window.fetch=r(6).default||r(6))},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(1),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;if(n.index=0,n._allRanges=null,n.items=[],n._topRanges=[],n.__jsonld.structures&&n.__jsonld.structures.length)for(var i=n._getTopRanges(),o=0;o<i.length;o++){var a=i[o];n._parseRanges(a,String(o))}return n}return i(t,e),t.prototype.getPosterCanvas=function(){var e=this.getProperty(\"posterCanvas\");return e&&(e=new a.Canvas(e,this.options)),e},t.prototype.getAccompanyingCanvas=function(){var e=this.getProperty(\"accompanyingCanvas\");return e&&(e=new a.Canvas(e,this.options)),e},t.prototype.getBehavior=function(){var e=this.getProperty(\"behavior\");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getDefaultTree=function(){if(e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),!this.isLoaded)return this.defaultTree;var t=this.getTopRanges();return t.length&&t[0].getTree(this.defaultTree),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._getTopRanges=function(){var e=[];if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var t=0;t<this.__jsonld.structures.length;t++){var r=this.__jsonld.structures[t];r.viewingHint===o.ViewingHint.TOP&&e.push(r)}if(!e.length){var n={};n.ranges=this.__jsonld.structures,e.push(n)}}return e},t.prototype.getTopRanges=function(){return this._topRanges},t.prototype._getRangeById=function(e){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var t=0;t<this.__jsonld.structures.length;t++){var r=this.__jsonld.structures[t];if(r[\"@id\"]===e||r.id===e)return r}return null},t.prototype._parseRanges=function(e,t,r){var n,i=null;if(\"string\"==typeof e&&(i=e,e=this._getRangeById(i)),e){(n=new a.Range(e,this.options)).parentRange=r,n.path=t,r?r.items.push(n):this._topRanges.push(n);var o=e.items||e.members;if(o)for(var s=0;s<o.length;s++){var u=o[s];if(u[\"@type\"]&&\"sc:range\"===u[\"@type\"].toLowerCase()||u.type&&\"range\"===u.type.toLowerCase())this._parseRanges(u,t+\"/\"+s,n);else if(u[\"@type\"]&&\"sc:canvas\"===u[\"@type\"].toLowerCase()||u.type&&\"canvas\"===u.type.toLowerCase()){n.canvases||(n.canvases=[]);var c=u.id||u[\"@id\"];n.canvases.push(c)}}else if(e.ranges)for(s=0;s<e.ranges.length;s++)this._parseRanges(e.ranges[s],t+\"/\"+s,n)}else console.warn(\"Range:\",i,\"does not exist\")},t.prototype.getAllRanges=function(){if(null!=this._allRanges)return this._allRanges;this._allRanges=[];for(var e=this.getTopRanges(),t=function(t){var n=e[t];n.id&&r._allRanges.push(n);var i=function(e,t){e.add(t);var r=t.getRanges();return r.length?r.reduce(i,e):e},o=Array.from(n.getRanges().reduce(i,new Set));r._allRanges=r._allRanges.concat(o)},r=this,n=0;n<e.length;n++)t(n);return this._allRanges},t.prototype.getRangeById=function(e){for(var t=this.getAllRanges(),r=0;r<t.length;r++){var n=t[r];if(n.id===e)return n}return null},t.prototype.getRangeByPath=function(e){for(var t=this.getAllRanges(),r=0;r<t.length;r++){var n=t[r];if(n.path===e)return n}return null},t.prototype.getSequences=function(){if(this.items.length)return this.items;var e=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(e)for(var t=0;t<e.length;t++){var r=e[t],n=new a.Sequence(r,this.options);this.items.push(n)}else if(this.__jsonld.items){n=new a.Sequence(this.__jsonld.items,this.options);this.items.push(n)}return this.items},t.prototype.getSequenceByIndex=function(e){return this.getSequences()[e]},t.prototype.getTotalSequences=function(){return this.getSequences().length},t.prototype.getManifestType=function(){var e=this.getService(o.ServiceProfile.UI_EXTENSIONS);return e?e.getProperty(\"manifestType\"):a.ManifestType.EMPTY},t.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();if(e)return e===o.ViewingHint.PAGED;var t=this.getBehavior();return!!t&&t===o.Behavior.PAGED},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t}(a.IIIFResource);t.Manifest=s},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.EMPTY=\"\",e.MANUSCRIPT=\"manuscript\",e.MONOGRAPH=\"monograph\"}(t.ManifestType||(t.ManifestType={}))},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(0),a=r(1),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._ranges=null,n.canvases=null,n.items=[],n}return i(t,e),t.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:this.canvases?this.canvases:[]},t.prototype.getDuration=function(){if(this.canvases&&this.canvases.length){for(var e=[],t=[],r=0,n=this.canvases;r<n.length;r++){if(_=n[r]){var i=_.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,_],a=i[1],s=i[2],u=i[3];a&&(e.push(parseFloat(s)),t.push(parseFloat(u)))}}if(e.length&&t.length)return new o.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}else{e=[],t=[];for(var c=0,l=d=this.getRanges();c<l.length;c++){(v=l[c].getDuration())&&(e.push(v.start),t.push(v.end))}if(e.length&&t.length)return new o.Duration(Math.min.apply(Math,e),Math.max.apply(Math,t))}var p,f;if(this.canvases&&this.canvases.length)for(var h=0;h<this.canvases.length;h++){var _=this.canvases[h],g=o.Utils.getTemporalComponent(_);g&&g.length>1&&(0===h&&(p=Number(g[0])),h===this.canvases.length-1&&(f=Number(g[1])))}else{var d=this.getRanges();for(h=0;h<d.length;h++){var v;(v=d[h].getDuration())&&(0===h&&(p=v.start),h===d.length-1&&(f=v.end))}}if(void 0!==p&&void 0!==f)return new o.Duration(p,f)},t.prototype.getRanges=function(){return this._ranges?this._ranges:this._ranges=this.items.filter((function(e){return e.isRange()}))},t.prototype.getBehavior=function(){var e=this.getProperty(\"behavior\");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t.prototype.getTree=function(e){e.data=this,this.treeNode=e;var t=this.getRanges();if(t&&t.length)for(var r=0;r<t.length;r++){var n=t[r],i=new o.TreeNode;e.addNode(i),this._parseTreeNode(i,n)}return o.Utils.generateTreeNodeIds(e),e},t.prototype.spansTime=function(e){var t=this.getDuration();return!!(t&&e>=t.start&&e<=t.end)},t.prototype._parseTreeNode=function(e,t){e.label=t.getLabel().getValue(this.options.locale),e.data=t,e.data.type=o.Utils.normaliseType(o.TreeNodeType.RANGE),t.treeNode=e;var r=t.getRanges();if(r&&r.length)for(var n=0;n<r.length;n++){var i=r[n];if(i.getBehavior()!==a.Behavior.NO_NAV){var s=new o.TreeNode;e.addNode(s),this._parseTreeNode(s,i)}}},t}(o.ManifestResource);t.Range=s},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getFormat=function(){return this.getProperty(\"format\")},t}(r(0).ManifestResource);t.Rendering=o},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(1),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.items=[],n._thumbnails=null,n}return i(t,e),t.prototype.getCanvases=function(){if(this.items.length)return this.items;var e=this.__jsonld.canvases||this.__jsonld.elements;if(e)for(var t=0;t<e.length;t++){var r=e[t];(n=new a.Canvas(r,this.options)).index=t,this.items.push(n)}else if(this.__jsonld)for(t=0;t<this.__jsonld.length;t++){var n;r=this.__jsonld[t];(n=new a.Canvas(r,this.options)).index=t,this.items.push(n)}return this.items},t.prototype.getCanvasById=function(e){for(var t=0;t<this.getTotalCanvases();t++){var r=this.getCanvasByIndex(t),n=a.Utils.normaliseUrl(r.id);if(a.Utils.normaliseUrl(e)===n)return r}return null},t.prototype.getCanvasByIndex=function(e){return this.getCanvases()[e]},t.prototype.getCanvasIndexById=function(e){for(var t=0;t<this.getTotalCanvases();t++){if(this.getCanvasByIndex(t).id===e)return t}return null},t.prototype.getCanvasIndexByLabel=function(e,t){e=e.trim(),isNaN(e)||(e=parseInt(e,10).toString(),t&&(e+=\"r\"));for(var r,n,i,o=/(\\d*)\\D+(\\d*)/,a=0;a<this.getTotalCanvases();a++){var s=this.getCanvasByIndex(a);if(s.getLabel().getValue(this.options.locale)===e)return a;if((r=o.exec(e))&&(n=r[1],(i=r[2])&&new RegExp(\"^\"+n+\"\\\\D+\"+i+\"$\").test(s.getLabel().toString())))return a}return-1},t.prototype.getLastCanvasLabel=function(e){for(var t=this.getTotalCanvases()-1;t>=0;t--){var r=this.getCanvasByIndex(t).getLabel().getValue(this.options.locale);if(e){if(/^[a-zA-Z0-9]*$/.test(r))return r}else if(r)return r}return this.options.defaultLabel},t.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},t.prototype.getNextPageIndex=function(e,t){var r;if(t){var n=this.getPagedIndices(e),i=this.getViewingDirection();r=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?n[0]+1:n[n.length-1]+1}else r=e+1;return r>this.getLastPageIndex()?-1:r},t.prototype.getPagedIndices=function(e,t){var r=[];if(t){r=this.isFirstCanvas(e)||this.isLastCanvas(e)?[e]:e%2?[e,e+1]:[e-1,e];var n=this.getViewingDirection();n&&n===o.ViewingDirection.RIGHT_TO_LEFT&&(r=r.reverse())}else r.push(e);return r},t.prototype.getPrevPageIndex=function(e,t){var r;if(t){var n=this.getPagedIndices(e),i=this.getViewingDirection();r=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?n[n.length-1]-1:n[0]-1}else r=e-1;return r},t.prototype.getStartCanvasIndex=function(){var e=this.getStartCanvas();if(e)for(var t=0;t<this.getTotalCanvases();t++){if(this.getCanvasByIndex(t).id===e)return t}return 0},t.prototype.getThumbs=function(e,t){for(var r=[],n=this.getTotalCanvases(),i=0;i<n;i++){var o=this.getCanvasByIndex(i),s=new a.Thumb(e,o);r.push(s)}return r},t.prototype.getThumbnails=function(){if(null!=this._thumbnails)return this._thumbnails;this._thumbnails=[];for(var e=this.getCanvases(),t=0;t<e.length;t++){var r=e[t].getThumbnail();r&&this._thumbnails.push(r)}return this._thumbnails},t.prototype.getStartCanvas=function(){return this.getProperty(\"startCanvas\")},t.prototype.getTotalCanvases=function(){return this.getCanvases().length},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")?this.getProperty(\"viewingDirection\"):this.options.resource.getViewingDirection?this.options.resource.getViewingDirection():null},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t.prototype.isCanvasIndexOutOfRange=function(e){return e>this.getTotalCanvases()-1},t.prototype.isFirstCanvas=function(e){return 0===e},t.prototype.isLastCanvas=function(e){return e===this.getTotalCanvases()-1},t.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();return!!e&&e===o.ViewingHint.PAGED},t.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2==0},t}(a.ManifestResource);t.Sequence=s},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(0),i=function(){function e(){}return e.parse=function(e,t){return\"string\"==typeof e&&(e=JSON.parse(e)),this.parseJson(e,t)},e.parseJson=function(e,t){var r;if(t&&t.navDate&&!isNaN(t.navDate.getTime())&&(e.navDate=t.navDate.toString()),e[\"@type\"])switch(e[\"@type\"]){case\"sc:Collection\":r=this.parseCollection(e,t);break;case\"sc:Manifest\":r=this.parseManifest(e,t);break;default:return null}else switch(e.type){case\"Collection\":r=this.parseCollection(e,t);break;case\"Manifest\":r=this.parseManifest(e,t);break;default:return null}return r.isLoaded=!0,r},e.parseCollection=function(e,t){var r=new n.Collection(e,t);return t?(r.index=t.index||0,t.resource&&(r.parentCollection=t.resource.parentCollection)):r.index=0,this.parseCollections(r,t),this.parseManifests(r,t),this.parseItems(r,t),r},e.parseCollections=function(e,t){var r;if(e.__jsonld.collections?r=e.__jsonld.collections:e.__jsonld.items&&(r=e.__jsonld.items.filter((function(e){return\"collection\"===e.type.toLowerCase()}))),r)for(var n=0;n<r.length;n++){t&&(t.index=n);var i=this.parseCollection(r[n],t);i.index=n,i.parentCollection=e,e.items.push(i)}},e.parseManifest=function(e,t){return new n.Manifest(e,t)},e.parseManifests=function(e,t){var r;if(e.__jsonld.manifests?r=e.__jsonld.manifests:e.__jsonld.items&&(r=e.__jsonld.items.filter((function(e){return\"manifest\"===e.type.toLowerCase()}))),r)for(var n=0;n<r.length;n++){var i=this.parseManifest(r[n],t);i.index=n,i.parentCollection=e,e.items.push(i)}},e.parseItem=function(e,t){if(e[\"@type\"]){if(\"sc:manifest\"===e[\"@type\"].toLowerCase())return this.parseManifest(e,t);if(\"sc:collection\"===e[\"@type\"].toLowerCase())return this.parseCollection(e,t)}else if(e.type){if(\"manifest\"===e.type.toLowerCase())return this.parseManifest(e,t);if(\"collection\"===e.type.toLowerCase())return this.parseCollection(e,t)}return null},e.parseItems=function(e,t){var r=e.__jsonld.members||e.__jsonld.items;if(r)for(var n=function(n){t&&(t.index=n);var o=i.parseItem(r[n],t);return o?e.items.filter((function(e){return e.id===o.id}))[0]?\"continue\":(o.index=n,o.parentCollection=e,void e.items.push(o)):{value:void 0}},i=this,o=0;o<r.length;o++){var a=n(o);if(\"object\"==typeof a)return a.value}},e}();t.Deserialiser=i},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=r(0),a=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t.prototype.getProfile=function(){var e=this.getProperty(\"profile\");return e||(e=this.getProperty(\"dcterms:conformsTo\")),Array.isArray(e)?e[0]:e},t.prototype.getConfirmLabel=function(){return o.Utils.getLocalisedValue(this.getProperty(\"confirmLabel\"),this.options.locale)},t.prototype.getDescription=function(){return o.Utils.getLocalisedValue(this.getProperty(\"description\"),this.options.locale)},t.prototype.getFailureDescription=function(){return o.Utils.getLocalisedValue(this.getProperty(\"failureDescription\"),this.options.locale)},t.prototype.getFailureHeader=function(){return o.Utils.getLocalisedValue(this.getProperty(\"failureHeader\"),this.options.locale)},t.prototype.getHeader=function(){return o.Utils.getLocalisedValue(this.getProperty(\"header\"),this.options.locale)},t.prototype.getServiceLabel=function(){return o.Utils.getLocalisedValue(this.getProperty(\"label\"),this.options.locale)},t.prototype.getInfoUri=function(){var e=this.id;return e.endsWith(\"/\")||(e+=\"/\"),e+=\"info.json\"},t}(o.ManifestResource);t.Service=a},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(e,t){this.width=e,this.height=t};t.Size=n},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e[e.AUTHORIZATION_FAILED=1]=\"AUTHORIZATION_FAILED\",e[e.FORBIDDEN=2]=\"FORBIDDEN\",e[e.INTERNAL_SERVER_ERROR=3]=\"INTERNAL_SERVER_ERROR\",e[e.RESTRICTED=4]=\"RESTRICTED\"}(t.StatusCode||(t.StatusCode={}))},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(e,t){this.data=t,this.index=t.index,this.width=e;var r=t.getHeight()/t.getWidth();this.height=r?Math.floor(this.width*r):e,this.uri=t.getCanonicalImageUri(e),this.label=t.getLabel().getValue()};t.Thumb=n},function(e,t,r){\"use strict\";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=function(e){function t(t,r){return e.call(this,t,r)||this}return i(t,e),t}(r(0).Resource);t.Thumbnail=o},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(0),i=function(){function e(e,t){this.label=e,this.data=t||{},this.nodes=[]}return e.prototype.addNode=function(e){this.nodes.push(e),e.parentNode=this},e.prototype.isCollection=function(){return this.data.type===n.Utils.normaliseType(n.TreeNodeType.COLLECTION)},e.prototype.isManifest=function(){return this.data.type===n.Utils.normaliseType(n.TreeNodeType.MANIFEST)},e.prototype.isRange=function(){return this.data.type===n.Utils.normaliseType(n.TreeNodeType.RANGE)},e}();t.TreeNode=i},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.COLLECTION=\"collection\",e.MANIFEST=\"manifest\",e.RANGE=\"range\"}(t.TreeNodeType||(t.TreeNodeType={}))}])}));\ndefine(\"lib/manifesto.js\", function(){});\n\n", "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(\"manifold\",[],t):\"object\"==typeof exports?exports.manifold=t():e.manifold=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=15)}([function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.BOOKMARKING=\"oa:bookmarking\",e.CLASSIFYING=\"oa:classifying\",e.COMMENTING=\"oa:commenting\",e.DESCRIBING=\"oa:describing\",e.EDITING=\"oa:editing\",e.HIGHLIGHTING=\"oa:highlighting\",e.IDENTIFYING=\"oa:identifying\",e.LINKING=\"oa:linking\",e.MODERATING=\"oa:moderating\",e.PAINTING=\"sc:painting\",e.QUESTIONING=\"oa:questioning\",e.REPLYING=\"oa:replying\",e.TAGGING=\"oa:tagging\",e.TRANSCRIBING=\"oad:transcribing\"}(t.AnnotationMotivation||(t.AnnotationMotivation={})),function(e){e.AUTO_ADVANCE=\"auto-advance\",e.CONTINUOUS=\"continuous\",e.FACING_PAGES=\"facing-pages\",e.HIDDEN=\"hidden\",e.INDIVIDUALS=\"individuals\",e.MULTI_PART=\"multi-part\",e.NO_NAV=\"no-nav\",e.NON_PAGED=\"non-paged\",e.PAGED=\"paged\",e.REPEAT=\"repeat\",e.SEQUENCE=\"sequence\",e.THUMBNAIL_NAV=\"thumbnail-nav\",e.TOGETHER=\"together\",e.UNORDERED=\"unordered\"}(t.Behavior||(t.Behavior={})),function(e){e.CANVAS=\"canvas\",e.CHOICE=\"choice\",e.OA_CHOICE=\"oa:choice\",e.CONTENT_AS_TEXT=\"contentastext\",e.DATASET=\"dataset\",e.DOCUMENT=\"document\",e.IMAGE=\"image\",e.MODEL=\"model\",e.MOVING_IMAGE=\"movingimage\",e.PDF=\"pdf\",e.PHYSICAL_OBJECT=\"physicalobject\",e.SOUND=\"sound\",e.TEXT=\"text\",e.TEXTUALBODY=\"textualbody\",e.VIDEO=\"video\"}(t.ExternalResourceType||(t.ExternalResourceType={})),function(e){e.ANNOTATION=\"annotation\",e.CANVAS=\"canvas\",e.COLLECTION=\"collection\",e.MANIFEST=\"manifest\",e.RANGE=\"range\",e.SEQUENCE=\"sequence\"}(t.IIIFResourceType||(t.IIIFResourceType={})),function(e){e.AUDIO_MP4=\"audio/mp4\",e.CORTO=\"application/corto\",e.DICOM=\"application/dicom\",e.DRACO=\"application/draco\",e.EPUB=\"application/epub+zip\",e.GLB=\"model/gltf-binary\",e.GLTF=\"model/gltf+json\",e.IIIF_PRESENTATION_2='application/ld+json;profile=\"http://iiif.io/api/presentation/2/context.json\"',e.IIIF_PRESENTATION_3='application/ld+json;profile=\"http://iiif.io/api/presentation/3/context.json\"',e.JPG=\"image/jpeg\",e.M3U8=\"application/vnd.apple.mpegurl\",e.MP3=\"audio/mp3\",e.MPEG_DASH=\"application/dash+xml\",e.OBJ=\"text/plain\",e.OPF=\"application/oebps-package+xml\",e.PDF=\"application/pdf\",e.PLY=\"application/ply\",e.THREEJS=\"application/vnd.threejs+json\",e.USDZ=\"model/vnd.usd+zip\",e.VIDEO_MP4=\"video/mp4\",e.WEBM=\"video/webm\"}(t.MediaType||(t.MediaType={})),function(e){e.DOC=\"application/msword\",e.DOCX=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",e.PDF=\"application/pdf\"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/compliance.html#level0\",e.IMAGE_0_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/compliance.html#level1\",e.IMAGE_0_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/compliance.html#level2\",e.IMAGE_0_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/conformance.html#level0\",e.IMAGE_0_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/conformance.html#level1\",e.IMAGE_0_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/conformance.html#level2\",e.IMAGE_1_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\",e.IMAGE_1_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1\",e.IMAGE_1_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2\",e.IMAGE_1_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0\",e.IMAGE_1_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1\",e.IMAGE_1_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2\",e.IMAGE_1_LEVEL_0=\"http://iiif.io/api/image/1/level0.json\",e.IMAGE_1_PROFILE_LEVEL_0=\"http://iiif.io/api/image/1/profiles/level0.json\",e.IMAGE_1_LEVEL_1=\"http://iiif.io/api/image/1/level1.json\",e.IMAGE_1_PROFILE_LEVEL_1=\"http://iiif.io/api/image/1/profiles/level1.json\",e.IMAGE_1_LEVEL_2=\"http://iiif.io/api/image/1/level2.json\",e.IMAGE_1_PROFILE_LEVEL_2=\"http://iiif.io/api/image/1/profiles/level2.json\",e.IMAGE_2_LEVEL_0=\"http://iiif.io/api/image/2/level0.json\",e.IMAGE_2_PROFILE_LEVEL_0=\"http://iiif.io/api/image/2/profiles/level0.json\",e.IMAGE_2_LEVEL_1=\"http://iiif.io/api/image/2/level1.json\",e.IMAGE_2_PROFILE_LEVEL_1=\"http://iiif.io/api/image/2/profiles/level1.json\",e.IMAGE_2_LEVEL_2=\"http://iiif.io/api/image/2/level2.json\",e.IMAGE_2_PROFILE_LEVEL_2=\"http://iiif.io/api/image/2/profiles/level2.json\",e.AUTH_0_CLICK_THROUGH=\"http://iiif.io/api/auth/0/login/clickthrough\",e.AUTH_0_LOGIN=\"http://iiif.io/api/auth/0/login\",e.AUTH_0_LOGOUT=\"http://iiif.io/api/auth/0/logout\",e.AUTH_0_RESTRICTED=\"http://iiif.io/api/auth/0/login/restricted\",e.AUTH_0_TOKEN=\"http://iiif.io/api/auth/0/token\",e.AUTH_1_CLICK_THROUGH=\"http://iiif.io/api/auth/1/clickthrough\",e.AUTH_1_EXTERNAL=\"http://iiif.io/api/auth/1/external\",e.AUTH_1_KIOSK=\"http://iiif.io/api/auth/1/kiosk\",e.AUTH_1_LOGIN=\"http://iiif.io/api/auth/1/login\",e.AUTH_1_LOGOUT=\"http://iiif.io/api/auth/1/logout\",e.AUTH_1_PROBE=\"http://iiif.io/api/auth/1/probe\",e.AUTH_1_TOKEN=\"http://iiif.io/api/auth/1/token\",e.SEARCH_0=\"http://iiif.io/api/search/0/search\",e.SEARCH_0_AUTO_COMPLETE=\"http://iiif.io/api/search/0/autocomplete\",e.SEARCH_1=\"http://iiif.io/api/search/1/search\",e.SEARCH_1_AUTO_COMPLETE=\"http://iiif.io/api/search/1/autocomplete\",e.TRACKING_EXTENSIONS=\"http://universalviewer.io/tracking-extensions-profile\",e.UI_EXTENSIONS=\"http://universalviewer.io/ui-extensions-profile\",e.PRINT_EXTENSIONS=\"http://universalviewer.io/print-extensions-profile\",e.SHARE_EXTENSIONS=\"http://universalviewer.io/share-extensions-profile\",e.OTHER_MANIFESTATIONS=\"http://iiif.io/api/otherManifestations.json\",e.IXIF=\"http://wellcomelibrary.org/ld/ixif/0/alpha.json\"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.BOTTOM_TO_TOP=\"bottom-to-top\",e.LEFT_TO_RIGHT=\"left-to-right\",e.RIGHT_TO_LEFT=\"right-to-left\",e.TOP_TO_BOTTOM=\"top-to-bottom\"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS=\"continuous\",e.INDIVIDUALS=\"individuals\",e.NON_PAGED=\"non-paged\",e.PAGED=\"paged\",e.TOP=\"top\"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511},function(e,t,r){\"use strict\";r.r(t);var n,i,o=function(){function e(e){this.__jsonld=e,this.context=this.getProperty(\"context\"),this.id=this.getProperty(\"id\")}return e.prototype.getProperty=function(e){var t=null;return this.__jsonld&&((t=this.__jsonld[e])||(t=this.__jsonld[\"@\"+e])),t},e}(),a=r(0),s=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.options=r,n}return s(t,e),t.prototype.getIIIFResourceType=function(){return x.normaliseType(this.getProperty(\"type\"))},t.prototype.getLabel=function(){var e=this.getProperty(\"label\");return e?H.parse(e,this.options.locale):new H([],this.options.locale)},t.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},t.prototype.getMetadata=function(){var e=this.getProperty(\"metadata\"),t=[];if(!e)return t;for(var r=0;r<e.length;r++){var n=e[r],i=new C(this.options.locale);i.parse(n),t.push(i)}return t},t.prototype.getRendering=function(e){for(var t=this.getRenderings(),r=0;r<t.length;r++){var n=t[r];if(n.getFormat()===e)return n}return null},t.prototype.getRenderings=function(){var e,t=[];if(!(e=this.__jsonld?this.__jsonld.rendering:this.rendering))return t;Array.isArray(e)||(e=[e]);for(var r=0;r<e.length;r++){var n=e[r];t.push(new W(n,this.options))}return t},t.prototype.getService=function(e){return x.getService(this,e)},t.prototype.getServices=function(){return x.getServices(this)},t.prototype.getThumbnail=function(){var e=this.getProperty(\"thumbnail\");return Array.isArray(e)&&(e=e[0]),e?new ne(e,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},t}(o),c=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),l=function(e){function t(t,r){return e.call(this,t,r)||this}return c(t,e),t.prototype.getFormat=function(){var e=this.getProperty(\"format\");return e?e.toLowerCase():null},t.prototype.getResources=function(){var e=[];if(!this.__jsonld.resources)return e;for(var t=0;t<this.__jsonld.resources.length;t++){var r=this.__jsonld.resources[t],n=new g(r,this.options);e.push(n)}return e},t.prototype.getType=function(){var e=this.getProperty(\"type\");return e?x.normaliseType(e):null},t.prototype.getWidth=function(){return this.getProperty(\"width\")},t.prototype.getHeight=function(){return this.getProperty(\"height\")},t.prototype.getMaxWidth=function(){return this.getProperty(\"maxWidth\")},t.prototype.getMaxHeight=function(){return this.getProperty(\"maxHeight\")?null:this.getMaxWidth()},t}(u),f=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),p=function(e){function t(t,r){var n=e.call(this,t,r)||this;n.index=-1,n.isLoaded=!1;var i={defaultLabel:\"-\",locale:\"en-GB\",resource:n,pessimisticAccessControl:!1};return n.options=Object.assign(i,r),n}return f(t,e),t.prototype.getAttribution=function(){var e=this.getProperty(\"attribution\");return e?H.parse(e,this.options.locale):new H([],this.options.locale)},t.prototype.getDescription=function(){var e=this.getProperty(\"description\");return e?H.parse(e,this.options.locale):new H([],this.options.locale)},t.prototype.getHomepage=function(){var e=this.getProperty(\"homepage\");return e?\"string\"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e[\"@id\"]||e.id):null},t.prototype.getIIIFResourceType=function(){return x.normaliseType(this.getProperty(\"type\"))},t.prototype.getLogo=function(){var e=this.getProperty(\"logo\");return e?\"string\"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e[\"@id\"]||e.id):null},t.prototype.getLicense=function(){return x.getLocalisedValue(this.getProperty(\"license\"),this.options.locale)},t.prototype.getNavDate=function(){return new Date(this.getProperty(\"navDate\"))},t.prototype.getRelated=function(){return this.getProperty(\"related\")},t.prototype.getSeeAlso=function(){return this.getProperty(\"seeAlso\")},t.prototype.getTrackingLabel=function(){var e=this.getService(a.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty(\"trackingLabel\"):\"\"},t.prototype.getDefaultTree=function(){return this.defaultTree=new ie(\"root\"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty(\"requiredStatement\");if(t)(e=new C(this.options.locale)).parse(t);else{var r=this.getAttribution();r&&((e=new C(this.options.locale)).value=r)}return e},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.load=function(){var e=this;return new Promise((function(t){if(e.isLoaded)t(e);else{var r=e.options;r.navDate=e.getNavDate();var n=e.__jsonld.id;n||(n=e.__jsonld[\"@id\"]),x.loadManifest(n).then((function(n){e.parentLabel=e.getLabel().getValue(r.locale);var i=z.parse(n,r);(e=Object.assign(e,i)).index=r.index,t(e)}))}}))},t}(u),h=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),g=function(e){function t(t,r){return e.call(this,t,r)||this}return h(t,e),t.prototype.getBody=function(){var e=[],t=this.getProperty(\"body\");if(t)if(Array.isArray(t))for(var r=0;r<t.length;r++){if((o=t[r]).items)for(var n=0;n<o.items.length;n++){var i=o.items[n];e.push(new v(i,this.options))}else e.push(new v(o,this.options))}else if(t.items)for(r=0;r<t.items.length;r++){var o=t.items[r];e.push(new v(o,this.options))}else e.push(new v(t,this.options));return e},t.prototype.getMotivation=function(){var e=this.getProperty(\"motivation\");return e||null},t.prototype.getOn=function(){return this.getProperty(\"on\")},t.prototype.getTarget=function(){return this.getProperty(\"target\")},t.prototype.getResource=function(){return new l(this.getProperty(\"resource\"),this.options)},t}(u),d=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),v=function(e){function t(t,r){return e.call(this,t,r)||this}return d(t,e),t.prototype.getFormat=function(){var e=this.getProperty(\"format\");return e?x.getMediaType(e):null},t.prototype.getType=function(){return this.getProperty(\"type\")?x.normaliseType(this.getProperty(\"type\")):null},t.prototype.getWidth=function(){return this.getProperty(\"width\")},t.prototype.getHeight=function(){return this.getProperty(\"height\")},t}(u),_=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),E=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.label=t,i.options=n,i}return _(t,e),t.prototype.getIIIFResourceType=function(){return x.normaliseType(this.getProperty(\"type\"))},t.prototype.getLabel=function(){return this.label},t.prototype.getResources=function(){var e=this;return this.getProperty(\"resources\").map((function(t){return new g(t,e.options)}))},t.prototype.load=function(){var e=this;return new Promise((function(t,r){if(e.isLoaded)t(e);else{var n=e.__jsonld.id;n||(n=e.__jsonld[\"@id\"]),x.loadManifest(n).then((function(r){e.__jsonld=r,e.context=e.getProperty(\"context\"),e.id=e.getProperty(\"id\"),e.isLoaded=!0,t(e)})).catch(r)}}))},t}(o),y=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),I=function(e){function t(t,r){return e.call(this,t,r)||this}return y(t,e),t.prototype.getItems=function(){return this.getProperty(\"items\")},t}(u),T=r(3),O=r.n(T),m=r(5),A=r.n(m),S=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),L=function(e){function t(t,r){return e.call(this,t,r)||this}return S(t,e),t.prototype.getCanonicalImageUri=function(e){var t,r=null,n=\"default\",i=e;if(this.externalResource&&this.externalResource.data&&this.externalResource.data[\"@id\"])r=this.externalResource.data[\"@id\"],i||(i=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)&&(n=\"native\");else{var o=this.getImages();if(o&&o.length){var a=o[0].getResource(),s=a.getServices();if(i||(i=a.getWidth()),s.length){var u=s[0];r=u.id,n=x.getImageQuality(u.getProfile())}else if(i===a.getWidth())return a.id}if(!r){var c=this.getProperty(\"thumbnail\");if(c){if(\"string\"==typeof c)return c;if(c[\"@id\"])return c[\"@id\"];if(c.length)return c[0].id}}}return t=i+\",\",r&&r.endsWith(\"/\")&&(r=r.substr(0,r.length-1)),[r,\"full\",t,0,n+\".jpg\"].join(\"/\")},t.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(e){return e.maxWidth}))[0])&&(t=new $(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},t.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var r=null;if(t.length&&(r=new I(t[0],this.options)),!r)return e;for(var n=r.getItems(),i=0;i<n.length;i++){var o=n[i],a=new g(o,this.options);e.push(a)}return e},t.prototype.getDuration=function(){return this.getProperty(\"duration\")},t.prototype.getImages=function(){var e=[];if(!this.__jsonld.images)return e;for(var t=0;t<this.__jsonld.images.length;t++){var r=this.__jsonld.images[t],n=new g(r,this.options);e.push(n)}return e},t.prototype.getIndex=function(){return this.getProperty(\"index\")},t.prototype.getOtherContent=function(){var e=this,t=Array.isArray(this.getProperty(\"otherContent\"))?this.getProperty(\"otherContent\"):[this.getProperty(\"otherContent\")],r=t.filter((function(e){return e&&(t=e[\"@type\"],r=\"sc:AnnotationList\",\"string\"==typeof t&&\"string\"==typeof r&&t.toLowerCase()==t.toLowerCase());var t,r})).map((function(t,r){return new E(t.label||\"Annotation list \"+r,t,e.options)})).map((function(e){return e.load()}));return Promise.all(r)},t.prototype.getWidth=function(){return this.getProperty(\"width\")},t.prototype.getHeight=function(){return this.getProperty(\"height\")},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},Object.defineProperty(t.prototype,\"imageResources\",{get:function(){var e=this,r=A()([this.getImages().map((function(e){return e.getResource()})),this.getContent().map((function(e){return e.getBody()}))]);return O()(r.map((function(r){switch(r.getProperty(\"type\").toLowerCase()){case a.ExternalResourceType.CHOICE:case a.ExternalResourceType.OA_CHOICE:return new t({images:O()([r.getProperty(\"default\"),r.getProperty(\"item\")]).map((function(e){return{resource:e}}))},e.options).getImages().map((function(e){return e.getResource()}));default:return r}})))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"resourceAnnotations\",{get:function(){return A()([this.getImages(),this.getContent()])},enumerable:!0,configurable:!0}),t.prototype.resourceAnnotation=function(e){return this.resourceAnnotations.find((function(t){return t.getResource().id===e||O()(new Array(t.getBody())).some((function(t){return t.id===e}))}))},t.prototype.onFragment=function(e){var t=this.resourceAnnotation(e);if(t){var r=t.getProperty(\"on\"),n=t.getProperty(\"target\"),i=(r||n).match(/xywh=(.*)$/);if(i)return i[1].split(\",\").map((function(e){return parseInt(e,10)}))}},Object.defineProperty(t.prototype,\"iiifImageResources\",{get:function(){return this.imageResources.filter((function(e){return e&&e.getServices()[0]&&e.getServices()[0].id}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"imageServiceIds\",{get:function(){return this.iiifImageResources.map((function(e){return e.getServices()[0].id}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"aspectRatio\",{get:function(){return this.getWidth()/this.getHeight()},enumerable:!0,configurable:!0}),t}(l),R=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),P=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.items=[],n._collections=null,n._manifests=null,t.__collection=n,n}return R(t,e),t.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter((function(e){return e.isCollection()}))},t.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter((function(e){return e.isManifest()}))},t.prototype.getCollectionByIndex=function(e){for(var t,r=this.getCollections(),n=0;n<r.length;n++){var i=r[n];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error(\"Collection index not found\")},t.prototype.getManifestByIndex=function(e){for(var t,r=this.getManifests(),n=0;n<r.length;n++){var i=r[n];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error(\"Manifest index not found\")},t.prototype.getTotalCollections=function(){return this.getCollections().length},t.prototype.getTotalManifests=function(){return this.getManifests().length},t.prototype.getTotalItems=function(){return this.items.length},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")?this.getProperty(\"viewingDirection\"):a.ViewingDirection.LEFT_TO_RIGHT},t.prototype.getBehavior=function(){var e=this.getProperty(\"behavior\");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t.prototype.getDefaultTree=function(){return e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=x.normaliseType(ee.COLLECTION),this._parseManifests(this),this._parseCollections(this),x.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._parseManifests=function(e){if(e.getManifests()&&e.getManifests().length)for(var t=0;t<e.getManifests().length;t++){var r=e.getManifests()[t],n=r.getDefaultTree();n.label=r.parentLabel||r.getLabel().getValue(this.options.locale)||\"manifest \"+(t+1),n.navDate=r.getNavDate(),n.data.id=r.id,n.data.type=x.normaliseType(ee.MANIFEST),e.defaultTree.addNode(n)}},t.prototype._parseCollections=function(e){if(e.getCollections()&&e.getCollections().length)for(var t=0;t<e.getCollections().length;t++){var r=e.getCollections()[t],n=r.getDefaultTree();n.label=r.parentLabel||r.getLabel().getValue(this.options.locale)||\"collection \"+(t+1),n.navDate=r.getNavDate(),n.data.id=r.id,n.data.type=x.normaliseType(ee.COLLECTION),e.defaultTree.addNode(n)}},t}(p),N=function(){function e(e,t){this.start=e,this.end=t}return e.prototype.getLength=function(){return this.end-this.start},e}(),C=function(){function e(e){this.defaultLocale=e}return e.prototype.parse=function(e){this.resource=e,this.label=H.parse(this.resource.label,this.defaultLocale),this.value=H.parse(this.resource.value,this.defaultLocale)},e.prototype.getLabel=function(e){return null===this.label?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.label.getValue(e||this.defaultLocale))},e.prototype.setLabel=function(e){null===this.label&&(this.label=new H([])),this.label.setValue(e,this.defaultLocale)},e.prototype.getValue=function(e,t){return void 0===t&&(t=\"<br/>\"),null===this.value?null:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValue(e||this.defaultLocale,t))},e.prototype.getValues=function(e){return null===this.value?[]:(Array.isArray(e)&&!e.length&&(e=void 0),this.value.getValues(e||this.defaultLocale))},e.prototype.setValue=function(e){null===this.value&&(this.value=new H([])),this.value.setValue(e,this.defaultLocale)},e}(),M=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.getValue=function(e,t){return e.getValue(t,\"<br/>\")},t.getValues=function(e,t){return e.getValues(t)},t}(Array),w=r(1),D=(r(29),function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}),U=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},x=function(){function e(){}return e.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(\";\")[0]).trim()},e.getImageQuality=function(e){return e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_LEVEL_1||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_LEVEL_2||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?\"native\":\"default\"},e.getInexactLocale=function(e){return-1!==e.indexOf(\"-\")?e.substr(0,e.indexOf(\"-\")):e},e.getLocalisedValue=function(e,t){if(!Array.isArray(e))return e;for(var r=0;r<e.length;r++){var n=e[r];if(t===n[\"@language\"])return n[\"@value\"]}var i=t.substr(0,t.indexOf(\"-\"));for(r=0;r<e.length;r++){var o=e[r];if(o[\"@language\"]===i)return o[\"@value\"]}return null},e.generateTreeNodeIds=function(t,r){var n;void 0===r&&(r=0),n=t.parentNode?t.parentNode.id+\"-\"+r:\"0\",t.id=n;for(var i=0;i<t.nodes.length;i++){var o=t.nodes[i];e.generateTreeNodeIds(o,i)}},e.normaliseType=function(e){return-1!==(e=(e||\"\").toLowerCase()).indexOf(\":\")?e.split(\":\")[1]:e},e.normaliseUrl=function(e){return-1!==(e=e.substr(e.indexOf(\"://\"))).indexOf(\"#\")&&(e=e.split(\"#\")[0]),e},e.normalisedUrlsMatch=function(t,r){return e.normaliseUrl(t)===e.normaliseUrl(r)},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(e,t){return z.parse(e,t)},e.checkStatus=function(e){if(e.ok)return e;var t=new Error(e.statusText);return t.response=e,Promise.reject(t)},e.loadManifest=function(t){return new Promise((function(r,n){fetch(t).then(e.checkStatus).then((function(e){return e.json()})).then((function(e){r(e)})).catch((function(e){n()}))}))},e.loadExternalResourcesAuth1=function(t,r,n,i,o,a,s,u){return new Promise((function(c,l){var f=t.map((function(t){return e.loadExternalResourceAuth1(t,r,n,i,o,a,s,u)}));Promise.all(f).then((function(){c(t)})).catch((function(e){l(e)}))}))},e.loadExternalResourceAuth1=function(t,r,n,i,o,a,s,u){return D(this,void 0,void 0,(function(){var c;return U(this,(function(l){switch(l.label){case 0:return[4,i(t)];case 1:return(c=l.sent())?[4,t.getData(c)]:[3,6];case 2:return l.sent(),t.status!==w.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,r,n,o,a,s,u)];case 4:l.sent(),l.label=5;case 5:if(t.status===w.OK||t.status===w.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return l.sent(),t.status!==w.MOVED_TEMPORARILY&&t.status!==w.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,r,n,o,a,s,u)];case 8:l.sent(),l.label=9;case 9:if(t.status===w.OK||t.status===w.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}}))}))},e.doAuthChain=function(t,r,n,i,o,a,s){return D(this,void 0,void 0,(function(){var u,c,l,f,p,h,g,d;return U(this,(function(v){switch(v.label){case 0:return t.isAccessControlled()?((u=t.externalService)&&(u.options=t.options),(c=t.kioskService)&&(c.options=t.options),(l=t.clickThroughService)&&(l.options=t.options),(f=t.loginService)&&(f.options=t.options),t.isResponseHandled||t.status!==w.MOVED_TEMPORARILY?[3,2]:[4,a(t)]):[2,t];case 1:return v.sent(),[2,t];case 2:return p=null,h=null,(p=u)?(h=p,[4,e.attemptResourceWithToken(t,n,p)]):[3,4];case 3:return v.sent(),[2,t];case 4:return(p=c)?(h=p,(g=r(p))?[4,i(g)]:[3,7]):[3,7];case 5:return v.sent(),[4,e.attemptResourceWithToken(t,n,p)];case 6:return v.sent(),[2,t];case 7:return(p=l)?(h=p,[4,o(t,p)]):[3,11];case 8:return(d=v.sent())?[4,i(d)]:[3,11];case 9:return v.sent(),[4,e.attemptResourceWithToken(t,n,p)];case 10:return v.sent(),[2,t];case 11:return(p=f)?(h=p,[4,o(t,p)]):[3,15];case 12:return(d=v.sent())?[4,i(d)]:[3,15];case 13:return v.sent(),[4,e.attemptResourceWithToken(t,n,p)];case 14:return v.sent(),[2,t];case 15:return h&&s(t,h),[2]}}))}))},e.attemptResourceWithToken=function(e,t,r){return D(this,void 0,void 0,(function(){var n,i;return U(this,(function(o){switch(o.label){case 0:return(n=r.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,t(e,n)]:[3,3];case 1:return(i=o.sent())&&i.accessToken?[4,e.getData(i)]:[3,3];case 2:return o.sent(),[2,e];case 3:return[2]}}))}))},e.loadExternalResourcesAuth09=function(t,r,n,i,o,a,s,u,c,l){return new Promise((function(f,p){var h=t.map((function(t){return e.loadExternalResourceAuth09(t,r,n,i,o,a,s,u,c,l)}));Promise.all(h).then((function(){f(t)})).catch((function(e){p(e)}))}))},e.loadExternalResourceAuth09=function(t,r,n,i,o,a,s,u,c,l){return new Promise((function(f,p){l&&l.pessimisticAccessControl?t.getData().then((function(){t.isAccessControlled()?t.clickThroughService?(f(n(t)),f(i(t))):o(t).then((function(){a(t,!0).then((function(r){t.getData(r).then((function(){f(c(t))})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))})):f(t)})).catch((function(t){p(e.createInternalServerError(t))})):u(t,r).then((function(l){l?t.getData(l).then((function(){t.status===w.OK?f(c(t)):e.authorize(t,r,n,i,o,a,s,u).then((function(){f(c(t))})).catch((function(t){p(e.createAuthorizationFailedError())}))})).catch((function(t){p(e.createAuthorizationFailedError())})):e.authorize(t,r,n,i,o,a,s,u).then((function(){f(c(t))})).catch((function(t){p(e.createAuthorizationFailedError())}))})).catch((function(t){p(e.createAuthorizationFailedError())}))}))},e.createError=function(e,t){var r=new Error;return r.message=t,r.name=String(e),r},e.createAuthorizationFailedError=function(){return e.createError(k.AUTHORIZATION_FAILED,\"Authorization failed\")},e.createRestrictedError=function(){return e.createError(k.RESTRICTED,\"Restricted\")},e.createInternalServerError=function(t){return e.createError(k.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,r,n,i,o,a,s,u){return new Promise((function(c,l){t.getData().then((function(){t.isAccessControlled()?u(t,r).then((function(u){u?t.getData(u).then((function(){t.status===w.OK?c(t):e.showAuthInteraction(t,r,n,i,o,a,s,c,l)})).catch((function(t){l(e.createInternalServerError(t))})):a(t,!1).then((function(u){u?s(t,u,r).then((function(){t.getData(u).then((function(){t.status===w.OK?c(t):e.showAuthInteraction(t,r,n,i,o,a,s,c,l)})).catch((function(t){l(e.createInternalServerError(t))}))})).catch((function(t){l(e.createInternalServerError(t))})):e.showAuthInteraction(t,r,n,i,o,a,s,c,l)}))})).catch((function(t){l(e.createInternalServerError(t))})):c(t)}))}))},e.showAuthInteraction=function(t,r,n,i,o,a,s,u,c){t.status!==w.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?n(t).then((function(){a(t,!0).then((function(n){s(t,n,r).then((function(){t.getData(n).then((function(){u(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):o(t).then((function(){a(t,!0).then((function(n){s(t,n,r).then((function(){t.getData(n).then((function(){u(t)})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})).catch((function(t){c(e.createInternalServerError(t))}))})):u(t)},e.getService=function(e,t){for(var r=this.getServices(e),n=0;n<r.length;n++){var i=r[n];if(i.getProfile()===t)return i}return null},e.getResourceById=function(t,r){return e.traverseAndFind(t.__jsonld,\"@id\",r)},e.traverseAndFind=function(t,r,n){if(t.hasOwnProperty(r)&&t[r]===n)return t;for(var i=0;i<Object.keys(t).length;i++)if(\"object\"==typeof t[Object.keys(t)[i]]){var o=e.traverseAndFind(t[Object.keys(t)[i]],r,n);if(null!=o)return o}},e.getServices=function(e){var t,r=[];if(!(t=e.__jsonld?e.__jsonld.service:e.service))return r;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++){var i=t[n];if(\"string\"==typeof i){var o=this.getResourceById(e.options.resource,i);o&&r.push(new Z(o.__jsonld||o,e.options))}else r.push(new Z(i,e.options))}return r},e.getTemporalComponent=function(e){var t=/t=([^&]+)/g.exec(e),r=null;return t&&t[1]&&(r=t[1].split(\",\")),r},e}(),V=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),j=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n},G=function(){function e(e,t,r){void 0===r&&(r=\"none\"),Array.isArray(e)&&1===e.length?this._value=e[0]:this._value=e,\"none\"!==t&&\"@none\"!==t||(t=void 0),this._locale=t,this._defaultLocale=r}return e.parseV2Value=function(t,r){return\"string\"==typeof t?new e(t,void 0,r):t[\"@value\"]?new e(t[\"@value\"],t[\"@language\"],r):null},Object.defineProperty(e.prototype,\"value\",{get:function(){return Array.isArray(this._value)?this._value.join(\"<br/>\"):this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"locale\",{get:function(){return void 0===this._locale?this._defaultLocale:this._locale},enumerable:!0,configurable:!0}),e.prototype.addValue=function(e){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(e)?this._value=this._value.concat(e):this._value.push(e)},e}(),H=function(e){function t(r,n){void 0===r&&(r=[]);var i=e.apply(this,r)||this;return i.__proto__=t.prototype,i._defaultLocale=n,i}return V(t,e),t.parse=function(e,r){if(!e)return new t([],r);if(Array.isArray(e)){var n=(i=e.map((function(e){return G.parseV2Value(e,r)})).filter((function(e){return null!==e}))).reduce((function(e,t){var r=t._locale;return r||(r=\"none\"),e[r]?e[r].addValue(t._value):e[r]=t,e}),{});return new t(Object.values(n),r)}return\"string\"==typeof e?new t([new G(e,void 0,r)],r):e[\"@language\"]?new t(null!==(i=G.parseV2Value(e))?[i]:[],r):new t(Object.keys(e).map((function(t){var n=e[t];if(!Array.isArray(n))throw new Error(\"A IIIF v3 localized property value must have an array as the value for a given language.\");return new G(n,t,r)})),r);var i},t.prototype.getSuitableLocale=function(e){for(var t=j(this).map((function(e){return e._locale})).filter((function(e){return void 0!==e})),r=function(e){var r=t.find((function(t){return t===e}));if(r)return{value:r}},n=0,i=e;n<i.length;n++){var o=r(i[n]);if(\"object\"==typeof o)return o.value}for(var a=function(e){var r=t.find((function(t){return x.getInexactLocale(t)===x.getInexactLocale(e)}));if(r)return{value:r}},s=0,u=e;s<u.length;s++){var c=a(u[s]);if(\"object\"==typeof c)return c.value}},t.prototype.setValue=function(e,t){var r=void 0;if(t){var n=this.getSuitableLocale([t]);n&&(r=this.find((function(e){return e._locale===n})))}else r=this.find((function(e){return void 0===e._locale}));r?r._value=e:this.push(new G(e,t,this._defaultLocale))},t.prototype.getValue=function(e,t){var r=this.getValues(e);return 0===r.length?null:t?r.join(t):r[0]},t.prototype.getValues=function(e){if(!this.length)return[];var t;if(t=e?Array.isArray(e)?e:[e]:[],1===this.length&&void 0===this[0]._locale){var r=this[0]._value;return Array.isArray(r)?r:[r]}var n=this.getSuitableLocale(t);if(n){r=this.find((function(e){return e._locale===n}))._value;return Array.isArray(r)?r:[r]}if(!this.find((function(e){return void 0===e._locale}))){r=this[0]._value;return Array.isArray(r)?r:[r]}var i=this.find((function(e){return void 0===e._locale}));return i?Array.isArray(i._value)?i._value:[i._value]:[]},t}(Array),F=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),B=function(e){function t(t,r){var n=e.call(this,t,r)||this;if(n.index=0,n._allRanges=null,n.items=[],n._topRanges=[],n.__jsonld.structures&&n.__jsonld.structures.length)for(var i=n._getTopRanges(),o=0;o<i.length;o++){var a=i[o];n._parseRanges(a,String(o))}return n}return F(t,e),t.prototype.getPosterCanvas=function(){var e=this.getProperty(\"posterCanvas\");return e&&(e=new L(e,this.options)),e},t.prototype.getAccompanyingCanvas=function(){var e=this.getProperty(\"accompanyingCanvas\");return e&&(e=new L(e,this.options)),e},t.prototype.getBehavior=function(){var e=this.getProperty(\"behavior\");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getDefaultTree=function(){if(e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=x.normaliseType(ee.MANIFEST),!this.isLoaded)return this.defaultTree;var t=this.getTopRanges();return t.length&&t[0].getTree(this.defaultTree),x.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._getTopRanges=function(){var e=[];if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var t=0;t<this.__jsonld.structures.length;t++){var r=this.__jsonld.structures[t];r.viewingHint===a.ViewingHint.TOP&&e.push(r)}if(!e.length){var n={};n.ranges=this.__jsonld.structures,e.push(n)}}return e},t.prototype.getTopRanges=function(){return this._topRanges},t.prototype._getRangeById=function(e){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var t=0;t<this.__jsonld.structures.length;t++){var r=this.__jsonld.structures[t];if(r[\"@id\"]===e||r.id===e)return r}return null},t.prototype._parseRanges=function(e,t,r){var n,i=null;if(\"string\"==typeof e&&(i=e,e=this._getRangeById(i)),e){(n=new q(e,this.options)).parentRange=r,n.path=t,r?r.items.push(n):this._topRanges.push(n);var o=e.items||e.members;if(o)for(var a=0;a<o.length;a++){var s=o[a];if(s[\"@type\"]&&\"sc:range\"===s[\"@type\"].toLowerCase()||s.type&&\"range\"===s.type.toLowerCase())this._parseRanges(s,t+\"/\"+a,n);else if(s[\"@type\"]&&\"sc:canvas\"===s[\"@type\"].toLowerCase()||s.type&&\"canvas\"===s.type.toLowerCase()){n.canvases||(n.canvases=[]);var u=s.id||s[\"@id\"];n.canvases.push(u)}}else if(e.ranges)for(a=0;a<e.ranges.length;a++)this._parseRanges(e.ranges[a],t+\"/\"+a,n)}else console.warn(\"Range:\",i,\"does not exist\")},t.prototype.getAllRanges=function(){if(null!=this._allRanges)return this._allRanges;this._allRanges=[];for(var e=this.getTopRanges(),t=function(t){var n=e[t];n.id&&r._allRanges.push(n);var i=function(e,t){e.add(t);var r=t.getRanges();return r.length?r.reduce(i,e):e},o=Array.from(n.getRanges().reduce(i,new Set));r._allRanges=r._allRanges.concat(o)},r=this,n=0;n<e.length;n++)t(n);return this._allRanges},t.prototype.getRangeById=function(e){for(var t=this.getAllRanges(),r=0;r<t.length;r++){var n=t[r];if(n.id===e)return n}return null},t.prototype.getRangeByPath=function(e){for(var t=this.getAllRanges(),r=0;r<t.length;r++){var n=t[r];if(n.path===e)return n}return null},t.prototype.getSequences=function(){if(this.items.length)return this.items;var e=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(e)for(var t=0;t<e.length;t++){var r=e[t],n=new X(r,this.options);this.items.push(n)}else if(this.__jsonld.items){n=new X(this.__jsonld.items,this.options);this.items.push(n)}return this.items},t.prototype.getSequenceByIndex=function(e){return this.getSequences()[e]},t.prototype.getTotalSequences=function(){return this.getSequences().length},t.prototype.getManifestType=function(){var e=this.getService(a.ServiceProfile.UI_EXTENSIONS);return e?e.getProperty(\"manifestType\"):i.EMPTY},t.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();if(e)return e===a.ViewingHint.PAGED;var t=this.getBehavior();return!!t&&t===a.Behavior.PAGED},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t}(p);!function(e){e.EMPTY=\"\",e.MANUSCRIPT=\"manuscript\",e.MONOGRAPH=\"monograph\"}(i||(i={}));var k,Y=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),q=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._ranges=null,n.canvases=null,n.items=[],n}return Y(t,e),t.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:this.canvases?this.canvases:[]},t.prototype.getDuration=function(){if(this.canvases&&this.canvases.length){for(var e=[],t=[],r=0,n=this.canvases;r<n.length;r++){if(h=n[r]){var i=h.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,h],o=i[1],a=i[2],s=i[3];o&&(e.push(parseFloat(a)),t.push(parseFloat(s)))}}if(e.length&&t.length)return new N(Math.min.apply(Math,e),Math.max.apply(Math,t))}else{e=[],t=[];for(var u=0,c=d=this.getRanges();u<c.length;u++){(v=c[u].getDuration())&&(e.push(v.start),t.push(v.end))}if(e.length&&t.length)return new N(Math.min.apply(Math,e),Math.max.apply(Math,t))}var l,f;if(this.canvases&&this.canvases.length)for(var p=0;p<this.canvases.length;p++){var h=this.canvases[p],g=x.getTemporalComponent(h);g&&g.length>1&&(0===p&&(l=Number(g[0])),p===this.canvases.length-1&&(f=Number(g[1])))}else{var d=this.getRanges();for(p=0;p<d.length;p++){var v;(v=d[p].getDuration())&&(0===p&&(l=v.start),p===d.length-1&&(f=v.end))}}if(void 0!==l&&void 0!==f)return new N(l,f)},t.prototype.getRanges=function(){return this._ranges?this._ranges:this._ranges=this.items.filter((function(e){return e.isRange()}))},t.prototype.getBehavior=function(){var e=this.getProperty(\"behavior\");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t.prototype.getTree=function(e){e.data=this,this.treeNode=e;var t=this.getRanges();if(t&&t.length)for(var r=0;r<t.length;r++){var n=t[r],i=new ie;e.addNode(i),this._parseTreeNode(i,n)}return x.generateTreeNodeIds(e),e},t.prototype.spansTime=function(e){var t=this.getDuration();return!!(t&&e>=t.start&&e<=t.end)},t.prototype._parseTreeNode=function(e,t){e.label=t.getLabel().getValue(this.options.locale),e.data=t,e.data.type=x.normaliseType(ee.RANGE),t.treeNode=e;var r=t.getRanges();if(r&&r.length)for(var n=0;n<r.length;n++){var i=r[n];if(i.getBehavior()!==a.Behavior.NO_NAV){var o=new ie;e.addNode(o),this._parseTreeNode(o,i)}}},t}(u),K=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),W=function(e){function t(t,r){return e.call(this,t,r)||this}return K(t,e),t.prototype.getFormat=function(){return this.getProperty(\"format\")},t}(u),Q=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),X=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.items=[],n._thumbnails=null,n}return Q(t,e),t.prototype.getCanvases=function(){if(this.items.length)return this.items;var e=this.__jsonld.canvases||this.__jsonld.elements;if(e)for(var t=0;t<e.length;t++){var r=e[t];(n=new L(r,this.options)).index=t,this.items.push(n)}else if(this.__jsonld)for(t=0;t<this.__jsonld.length;t++){var n;r=this.__jsonld[t];(n=new L(r,this.options)).index=t,this.items.push(n)}return this.items},t.prototype.getCanvasById=function(e){for(var t=0;t<this.getTotalCanvases();t++){var r=this.getCanvasByIndex(t),n=x.normaliseUrl(r.id);if(x.normaliseUrl(e)===n)return r}return null},t.prototype.getCanvasByIndex=function(e){return this.getCanvases()[e]},t.prototype.getCanvasIndexById=function(e){for(var t=0;t<this.getTotalCanvases();t++){if(this.getCanvasByIndex(t).id===e)return t}return null},t.prototype.getCanvasIndexByLabel=function(e,t){e=e.trim(),isNaN(e)||(e=parseInt(e,10).toString(),t&&(e+=\"r\"));for(var r,n,i,o=/(\\d*)\\D+(\\d*)/,a=0;a<this.getTotalCanvases();a++){var s=this.getCanvasByIndex(a);if(s.getLabel().getValue(this.options.locale)===e)return a;if((r=o.exec(e))&&(n=r[1],(i=r[2])&&new RegExp(\"^\"+n+\"\\\\D+\"+i+\"$\").test(s.getLabel().toString())))return a}return-1},t.prototype.getLastCanvasLabel=function(e){for(var t=this.getTotalCanvases()-1;t>=0;t--){var r=this.getCanvasByIndex(t).getLabel().getValue(this.options.locale);if(e){if(/^[a-zA-Z0-9]*$/.test(r))return r}else if(r)return r}return this.options.defaultLabel},t.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},t.prototype.getNextPageIndex=function(e,t){var r;if(t){var n=this.getPagedIndices(e),i=this.getViewingDirection();r=i&&i===a.ViewingDirection.RIGHT_TO_LEFT?n[0]+1:n[n.length-1]+1}else r=e+1;return r>this.getLastPageIndex()?-1:r},t.prototype.getPagedIndices=function(e,t){var r=[];if(t){r=this.isFirstCanvas(e)||this.isLastCanvas(e)?[e]:e%2?[e,e+1]:[e-1,e];var n=this.getViewingDirection();n&&n===a.ViewingDirection.RIGHT_TO_LEFT&&(r=r.reverse())}else r.push(e);return r},t.prototype.getPrevPageIndex=function(e,t){var r;if(t){var n=this.getPagedIndices(e),i=this.getViewingDirection();r=i&&i===a.ViewingDirection.RIGHT_TO_LEFT?n[n.length-1]-1:n[0]-1}else r=e-1;return r},t.prototype.getStartCanvasIndex=function(){var e=this.getStartCanvas();if(e)for(var t=0;t<this.getTotalCanvases();t++){if(this.getCanvasByIndex(t).id===e)return t}return 0},t.prototype.getThumbs=function(e,t){for(var r=[],n=this.getTotalCanvases(),i=0;i<n;i++){var o=this.getCanvasByIndex(i),a=new te(e,o);r.push(a)}return r},t.prototype.getThumbnails=function(){if(null!=this._thumbnails)return this._thumbnails;this._thumbnails=[];for(var e=this.getCanvases(),t=0;t<e.length;t++){var r=e[t].getThumbnail();r&&this._thumbnails.push(r)}return this._thumbnails},t.prototype.getStartCanvas=function(){return this.getProperty(\"startCanvas\")},t.prototype.getTotalCanvases=function(){return this.getCanvases().length},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")?this.getProperty(\"viewingDirection\"):this.options.resource.getViewingDirection?this.options.resource.getViewingDirection():null},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t.prototype.isCanvasIndexOutOfRange=function(e){return e>this.getTotalCanvases()-1},t.prototype.isFirstCanvas=function(e){return 0===e},t.prototype.isLastCanvas=function(e){return e===this.getTotalCanvases()-1},t.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();return!!e&&e===a.ViewingHint.PAGED},t.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2==0},t}(u),z=function(){function e(){}return e.parse=function(e,t){return\"string\"==typeof e&&(e=JSON.parse(e)),this.parseJson(e,t)},e.parseJson=function(e,t){var r;if(t&&t.navDate&&!isNaN(t.navDate.getTime())&&(e.navDate=t.navDate.toString()),e[\"@type\"])switch(e[\"@type\"]){case\"sc:Collection\":r=this.parseCollection(e,t);break;case\"sc:Manifest\":r=this.parseManifest(e,t);break;default:return null}else switch(e.type){case\"Collection\":r=this.parseCollection(e,t);break;case\"Manifest\":r=this.parseManifest(e,t);break;default:return null}return r.isLoaded=!0,r},e.parseCollection=function(e,t){var r=new P(e,t);return t?(r.index=t.index||0,t.resource&&(r.parentCollection=t.resource.parentCollection)):r.index=0,this.parseCollections(r,t),this.parseManifests(r,t),this.parseItems(r,t),r},e.parseCollections=function(e,t){var r;if(e.__jsonld.collections?r=e.__jsonld.collections:e.__jsonld.items&&(r=e.__jsonld.items.filter((function(e){return\"collection\"===e.type.toLowerCase()}))),r)for(var n=0;n<r.length;n++){t&&(t.index=n);var i=this.parseCollection(r[n],t);i.index=n,i.parentCollection=e,e.items.push(i)}},e.parseManifest=function(e,t){return new B(e,t)},e.parseManifests=function(e,t){var r;if(e.__jsonld.manifests?r=e.__jsonld.manifests:e.__jsonld.items&&(r=e.__jsonld.items.filter((function(e){return\"manifest\"===e.type.toLowerCase()}))),r)for(var n=0;n<r.length;n++){var i=this.parseManifest(r[n],t);i.index=n,i.parentCollection=e,e.items.push(i)}},e.parseItem=function(e,t){if(e[\"@type\"]){if(\"sc:manifest\"===e[\"@type\"].toLowerCase())return this.parseManifest(e,t);if(\"sc:collection\"===e[\"@type\"].toLowerCase())return this.parseCollection(e,t)}else if(e.type){if(\"manifest\"===e.type.toLowerCase())return this.parseManifest(e,t);if(\"collection\"===e.type.toLowerCase())return this.parseCollection(e,t)}return null},e.parseItems=function(e,t){var r=e.__jsonld.members||e.__jsonld.items;if(r)for(var n=function(n){t&&(t.index=n);var o=i.parseItem(r[n],t);return o?e.items.filter((function(e){return e.id===o.id}))[0]?\"continue\":(o.index=n,o.parentCollection=e,void e.items.push(o)):{value:void 0}},i=this,o=0;o<r.length;o++){var a=n(o);if(\"object\"==typeof a)return a.value}},e}(),J=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Z=function(e){function t(t,r){return e.call(this,t,r)||this}return J(t,e),t.prototype.getProfile=function(){var e=this.getProperty(\"profile\");return e||(e=this.getProperty(\"dcterms:conformsTo\")),Array.isArray(e)?e[0]:e},t.prototype.getConfirmLabel=function(){return x.getLocalisedValue(this.getProperty(\"confirmLabel\"),this.options.locale)},t.prototype.getDescription=function(){return x.getLocalisedValue(this.getProperty(\"description\"),this.options.locale)},t.prototype.getFailureDescription=function(){return x.getLocalisedValue(this.getProperty(\"failureDescription\"),this.options.locale)},t.prototype.getFailureHeader=function(){return x.getLocalisedValue(this.getProperty(\"failureHeader\"),this.options.locale)},t.prototype.getHeader=function(){return x.getLocalisedValue(this.getProperty(\"header\"),this.options.locale)},t.prototype.getServiceLabel=function(){return x.getLocalisedValue(this.getProperty(\"label\"),this.options.locale)},t.prototype.getInfoUri=function(){var e=this.id;return e.endsWith(\"/\")||(e+=\"/\"),e+=\"info.json\"},t}(u),$=function(e,t){this.width=e,this.height=t};!function(e){e[e.AUTHORIZATION_FAILED=1]=\"AUTHORIZATION_FAILED\",e[e.FORBIDDEN=2]=\"FORBIDDEN\",e[e.INTERNAL_SERVER_ERROR=3]=\"INTERNAL_SERVER_ERROR\",e[e.RESTRICTED=4]=\"RESTRICTED\"}(k||(k={}));var ee,te=function(e,t){this.data=t,this.index=t.index,this.width=e;var r=t.getHeight()/t.getWidth();this.height=r?Math.floor(this.width*r):e,this.uri=t.getCanonicalImageUri(e),this.label=t.getLabel().getValue()},re=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ne=function(e){function t(t,r){return e.call(this,t,r)||this}return re(t,e),t}(l),ie=function(){function e(e,t){this.label=e,this.data=t||{},this.nodes=[]}return e.prototype.addNode=function(e){this.nodes.push(e),e.parentNode=this},e.prototype.isCollection=function(){return this.data.type===x.normaliseType(ee.COLLECTION)},e.prototype.isManifest=function(){return this.data.type===x.normaliseType(ee.MANIFEST)},e.prototype.isRange=function(){return this.data.type===x.normaliseType(ee.RANGE)},e}();!function(e){e.COLLECTION=\"collection\",e.MANIFEST=\"manifest\",e.RANGE=\"range\"}(ee||(ee={})),r.d(t,\"loadManifest\",(function(){return oe})),r.d(t,\"parseManifest\",(function(){return ae})),r.d(t,\"Utils\",(function(){return x})),r.d(t,\"JSONLDResource\",(function(){return o})),r.d(t,\"ManifestResource\",(function(){return u})),r.d(t,\"Resource\",(function(){return l})),r.d(t,\"IIIFResource\",(function(){return p})),r.d(t,\"Annotation\",(function(){return g})),r.d(t,\"AnnotationBody\",(function(){return v})),r.d(t,\"AnnotationList\",(function(){return E})),r.d(t,\"AnnotationPage\",(function(){return I})),r.d(t,\"Canvas\",(function(){return L})),r.d(t,\"Collection\",(function(){return P})),r.d(t,\"Duration\",(function(){return N})),r.d(t,\"LabelValuePair\",(function(){return C})),r.d(t,\"LanguageMap\",(function(){return b})),r.d(t,\"LocalizedValue\",(function(){return G})),r.d(t,\"PropertyValue\",(function(){return H})),r.d(t,\"Manifest\",(function(){return B})),r.d(t,\"ManifestType\",(function(){return i})),r.d(t,\"Range\",(function(){return q})),r.d(t,\"Rendering\",(function(){return W})),r.d(t,\"Sequence\",(function(){return X})),r.d(t,\"Deserialiser\",(function(){return z})),r.d(t,\"Service\",(function(){return Z})),r.d(t,\"Size\",(function(){return $})),r.d(t,\"StatusCode\",(function(){return k})),r.d(t,\"Thumb\",(function(){return te})),r.d(t,\"Thumbnail\",(function(){return ne})),r.d(t,\"TreeNode\",(function(){return ie})),r.d(t,\"TreeNodeType\",(function(){return ee}));var oe=function(e){return x.loadManifest(e)},ae=function(e,t){return x.parseManifest(e,t)}},function(e,t,r){var n=r(10);e.exports=function(e){return(null==e?0:e.length)?n(e,1):[]}},function(e,t,r){var n=r(20).Symbol;e.exports=n},function(e,t,r){var n=r(10),i=1/0;e.exports=function(e){return(null==e?0:e.length)?n(e,i):[]}},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(e){this.isVisible=!0;var t=e.on.match(/.*xywh=(\\d*),(\\d*),(\\d*),(\\d*)/);this.x=Number(t[1]),this.y=Number(t[2]),this.width=Number(t[3]),this.height=Number(t[4]),this.chars=e.resource.chars};t.AnnotationRect=n},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(8),i=r(0),o=r(2),a=function(){function e(e){this._options=e,this._options.locale=this._options.locale||\"en-GB\"}return e.prototype.bootstrap=function(e,t){var r=this;return new Promise((function(n,i){e&&t&&(n=e,i=t),o.Utils.loadManifest(r._options.manifestUri).then((function(e){r._loaded(r,e,n,i)}))}))},e.prototype._loaded=function(e,t,r,a){var s=o.Utils.parseManifest(t,{locale:e._options.locale});if(s){e._options.iiifResource||(e._options.iiifResource=s);var u=e._options.collectionIndex,c=e._options.manifestIndex;if(s.getIIIFResourceType()===i.IIIFResourceType.COLLECTION){var l=s.getManifests(),f=s.getCollections();l.length||void 0!==u||(u=0),void 0!==u&&f&&f.length?s.getCollectionByIndex(u).then((function(t){t||a(\"Collection index not found\"),0===t.getTotalManifests()&&0===c&&t.getTotalCollections()>0?(e._options.collectionIndex=0,e._options.manifestUri=t.id,e.bootstrap(r,a)):void 0!==c&&t.getManifestByIndex(c).then((function(t){e._options.manifest=t;var i=new n.Helper(e._options);r(i)}))})):s.getManifestByIndex(e._options.manifestIndex).then((function(t){e._options.manifest=t;var i=new n.Helper(e._options);r(i)}))}else{e._options.manifest=s;var p=new n.Helper(e._options);r(p)}}else console.error(\"Unable to load IIIF resource\")},e}();t.Bootstrapper=a},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(9),i=r(13),o=r(14),a=r(0),s=r(30),u=r(2),c=function(){function e(e){this.options=e,this.iiifResource=this.options.iiifResource,this.manifestUri=this.options.manifestUri,this.manifest=this.options.manifest,this.collectionIndex=this.options.collectionIndex||0,this.manifestIndex=this.options.manifestIndex||0,this.sequenceIndex=this.options.sequenceIndex||0,this.canvasIndex=this.options.canvasIndex||0}return e.prototype.getAutoCompleteService=function(){var e=this.getSearchService(),t=null;return e&&((t=e.getService(a.ServiceProfile.SEARCH_0_AUTO_COMPLETE))||(t=e.getService(a.ServiceProfile.SEARCH_1_AUTO_COMPLETE))),t},e.prototype.getAttribution=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=this.manifest.getAttribution();return e?e.getValue(this.options.locale):null},e.prototype.getCanvases=function(){return this.getCurrentSequence().getCanvases()},e.prototype.getCanvasById=function(e){return this.getCurrentSequence().getCanvasById(e)},e.prototype.getCanvasesById=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],i=this.getCanvasById(n);i&&t.push(i)}return t},e.prototype.getCanvasByIndex=function(e){return this.getCurrentSequence().getCanvasByIndex(e)},e.prototype.getCanvasIndexById=function(e){return this.getCurrentSequence().getCanvasIndexById(e)},e.prototype.getCanvasIndexByLabel=function(e){var t=this.getManifestType()===u.ManifestType.MANUSCRIPT;return this.getCurrentSequence().getCanvasIndexByLabel(e,t)},e.prototype.getCanvasRange=function(e,t){var r=this.getCanvasRanges(e);if(t){for(var n=0;n<r.length;n++){var i=r[n];if(i.path===t)return i}return null}return r[0]},e.prototype.getCanvasRanges=function(e){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return e.ranges?e.ranges:(e.ranges=this.manifest.getAllRanges().filter((function(t){return t.getCanvasIds().some((function(t){return u.Utils.normaliseUrl(t)===u.Utils.normaliseUrl(e.id)}))})),e.ranges)},e.prototype.getCollectionIndex=function(e){if(!e.parentCollection||e.parentCollection.parentCollection)return e.parentCollection?e.parentCollection.index:void 0},e.prototype.getCurrentCanvas=function(){return this.getCurrentSequence().getCanvasByIndex(this.canvasIndex)},e.prototype.getCurrentSequence=function(){return this.getSequenceByIndex(this.sequenceIndex)},e.prototype.getDescription=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=this.manifest.getDescription();return e?e.getValue(this.options.locale):null},e.prototype.getLabel=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=this.manifest.getLabel();return e?e.getValue(this.options.locale):null},e.prototype.getLastCanvasLabel=function(e){return this.getCurrentSequence().getLastCanvasLabel(e)},e.prototype.getFirstPageIndex=function(){return 0},e.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},e.prototype.getLicense=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getLicense()},e.prototype.getLogo=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getLogo()},e.prototype.getManifestType=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=this.manifest.getManifestType();return e===u.ManifestType.EMPTY&&(e=u.ManifestType.MONOGRAPH),e},e.prototype.getMetadata=function(e){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var t=[],r=this.manifest.getMetadata(),n=new i.MetadataGroup(this.manifest),o=this.options.locale;(r&&r.length&&n.addMetadata(r,!0),this.manifest.getDescription().length)&&((l=new u.LabelValuePair(o)).label=new u.PropertyValue([new u.LocalizedValue(\"description\",o)]),l.value=this.manifest.getDescription(),l.isRootLevel=!0,n.addItem(l));this.manifest.getAttribution().length&&((l=new u.LabelValuePair(o)).label=new u.PropertyValue([new u.LocalizedValue(\"attribution\",o)]),l.value=this.manifest.getAttribution(),l.isRootLevel=!0,n.addItem(l));var a=this.manifest.getLicense();if(a){var c={label:\"license\",value:e&&e.licenseFormatter?e.licenseFormatter.format(a):a};(l=new u.LabelValuePair(o)).parse(c),l.isRootLevel=!0,n.addItem(l)}if(this.manifest.getLogo()){var l;c={label:\"logo\",value:'<img alt=\"logo\" src=\"'+this.manifest.getLogo()+'\"/>'};(l=new u.LabelValuePair(o)).parse(c),l.isRootLevel=!0,n.addItem(l)}return t.push(n),e?this._parseMetadataOptions(e,t):t},e.prototype.getRequiredStatement=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=this.manifest.getRequiredStatement();return e?{label:e.label?e.getLabel():\"\",value:e.value&&e.value.length?e.getValue():\"\"}:null},e.prototype._parseMetadataOptions=function(e,t){var r=this.getCurrentSequence(),n=r.getMetadata();if(n&&n.length){var o=new i.MetadataGroup(r);o.addMetadata(n),t.push(o)}if(e.range){var a=this._getRangeMetadata([],e.range);a=a.reverse(),t=t.concat(a)}if(e.canvases&&e.canvases.length)for(var s=0;s<e.canvases.length;s++){var u=e.canvases[s],c=u.getMetadata();if(c&&c.length){var l=new i.MetadataGroup(u);l.addMetadata(u.getMetadata()),t.push(l)}for(var f=u.getImages(),p=0;p<f.length;p++){var h=f[p],g=h.getMetadata();if(g&&g.length){var d=new i.MetadataGroup(h);d.addMetadata(g),t.push(d)}}}return t},e.prototype._getRangeMetadata=function(e,t){var r=t.getMetadata();if(r&&r.length){var n=new i.MetadataGroup(t);n.addMetadata(r),e.push(n)}else if(t.parentRange)return this._getRangeMetadata(e,t.parentRange);return e},e.prototype.getMultiSelectState=function(){return this._multiSelectState||(this._multiSelectState=new n.MultiSelectState,this._multiSelectState.ranges=this.getRanges().slice(0),this._multiSelectState.canvases=this.getCurrentSequence().getCanvases().slice(0)),this._multiSelectState},e.prototype.getCurrentRange=function(){return this.rangeId?this.getRangeById(this.rangeId):null},e.prototype.getPosterCanvas=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getPosterCanvas()},e.prototype.getAccompanyingCanvas=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getAccompanyingCanvas()},e.prototype.getPosterImage=function(){var e=this.getPosterCanvas();if(e){var t=e.getContent();if(t&&t.length)return t[0].getBody()[0].id}return null},e.prototype.getAccompanyingCanvasImage=function(){var e=this.getAccompanyingCanvas();if(e){var t=e.getContent();if(t&&t.length)return t[0].getBody()[0].id}return null},e.prototype.getPreviousRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var r=this.getFlattenedTree();if(r)for(var n=0;n<r.length;n++){var i=r[n];if(i&&i.data.id===t.id){for(;n>0;){return r[--n].data}break}}}return null},e.prototype.getNextRange=function(e){var t=null;if(t=e||this.getCurrentRange()){var r=this.getFlattenedTree();if(r)for(var n=0;n<r.length;n++){var i=r[n];if(i&&i.data.id===t.id){for(;n<r.length-1;){var o=r[++n];if(o.data.canvases&&o.data.canvases.length)return o.data}break}}}return null},e.prototype.getFlattenedTree=function(e){var t=null;return(t=e||this.getTree())?this._flattenTree(t,\"nodes\"):null},e.prototype._flattenTree=function(e,t){var r=this,n=[e];return e[t]&&e[t].length>0?n.concat(e[t].map((function(e){return r._flattenTree(e,t)})).reduce((function(e,t){return e.concat(t)}),[])):n},e.prototype.getRanges=function(){return this.manifest.getAllRanges()},e.prototype.getRangeByPath=function(e){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getRangeByPath(e)},e.prototype.getRangeById=function(e){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getRangeById(e)},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesById(t)},e.prototype.getRelated=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getRelated()},e.prototype.getSearchService=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=this.manifest.getService(a.ServiceProfile.SEARCH_0);return e||(e=this.manifest.getService(a.ServiceProfile.SEARCH_1)),e},e.prototype.getSeeAlso=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getSeeAlso()},e.prototype.getSequenceByIndex=function(e){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getSequenceByIndex(e)},e.prototype.getShareServiceUrl=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=null,t=this.manifest.getService(a.ServiceProfile.SHARE_EXTENSIONS);return t&&(t.length&&(t=t[0]),e=t.__jsonld.shareUrl),e},e.prototype._getSortedTreeNodesByDate=function(e,t){var r=this.getFlattenedTree(t);if(r){var n=r.filter((function(e){return e.data.type===u.TreeNodeType.MANIFEST}));this.createDecadeNodes(e,r),this.sortDecadeNodes(e),this.createYearNodes(e,r),this.sortYearNodes(e),this.createMonthNodes(e,n),this.sortMonthNodes(e),this.createDateNodes(e,n),this.pruneDecadeNodes(e)}},e.prototype.getStartCanvasIndex=function(){return this.getCurrentSequence().getStartCanvasIndex()},e.prototype.getThumbs=function(e,t){return this.getCurrentSequence().getThumbs(e,t)},e.prototype.getTopRanges=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getTopRanges()},e.prototype.getTotalCanvases=function(){return this.getCurrentSequence().getTotalCanvases()},e.prototype.getTrackingLabel=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.getTrackingLabel()},e.prototype._getTopRanges=function(){return this.iiifResource.getTopRanges()},e.prototype.getTree=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=o.TreeSortType.NONE),!this.iiifResource)return null;var r;if(this.iiifResource.isCollection())r=this.iiifResource.getDefaultTree();else{var n=this._getTopRanges(),i=new u.TreeNode;if(i.label=\"root\",i.data=this.iiifResource,!n.length)return i;r=n[e].getTree(i)}var a=new u.TreeNode;switch(t.toString()){case o.TreeSortType.DATE.toString():if(this.treeHasNavDates(r))return this._getSortedTreeNodesByDate(a,r),a}return r},e.prototype.treeHasNavDates=function(e){var t=this.getFlattenedTree(e);return!!t&&t.some((function(e){return!isNaN(e.navDate)}))},e.prototype.getViewingDirection=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=this.getCurrentSequence().getViewingDirection();return e||(e=this.manifest.getViewingDirection()),e},e.prototype.getViewingHint=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=this.getCurrentSequence().getViewingHint();return e||(e=this.manifest.getViewingHint()),e},e.prototype.hasParentCollection=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return!!this.manifest.parentCollection},e.prototype.hasRelatedPage=function(){var e=this.getRelated();return!!e&&(e.length&&(e=e[0]),\"text/html\"===e.format)},e.prototype.hasResources=function(){return this.getCurrentCanvas().getResources().length>0},e.prototype.isBottomToTop=function(){var e=this.getViewingDirection();return!!e&&e===a.ViewingDirection.BOTTOM_TO_TOP},e.prototype.isCanvasIndexOutOfRange=function(e){return this.getCurrentSequence().isCanvasIndexOutOfRange(e)},e.prototype.isContinuous=function(){var e=this.getViewingHint();return!!e&&e===a.ViewingHint.CONTINUOUS},e.prototype.isFirstCanvas=function(e){return void 0!==e?this.getCurrentSequence().isFirstCanvas(e):this.getCurrentSequence().isFirstCanvas(this.canvasIndex)},e.prototype.isHorizontallyAligned=function(){return this.isLeftToRight()||this.isRightToLeft()},e.prototype.isLastCanvas=function(e){return void 0!==e?this.getCurrentSequence().isLastCanvas(e):this.getCurrentSequence().isLastCanvas(this.canvasIndex)},e.prototype.isLeftToRight=function(){var e=this.getViewingDirection();return!!e&&e===a.ViewingDirection.LEFT_TO_RIGHT},e.prototype.isMultiCanvas=function(){return this.getCurrentSequence().isMultiCanvas()},e.prototype.isMultiSequence=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.isMultiSequence()},e.prototype.isPaged=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var e=this.getViewingHint();return e?e===a.ViewingHint.PAGED:this.manifest.isPagingEnabled()},e.prototype.isPagingAvailable=function(){return this.isPagingEnabled()&&this.getTotalCanvases()>2},e.prototype.isPagingEnabled=function(){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);return this.manifest.isPagingEnabled()||this.getCurrentSequence().isPagingEnabled()},e.prototype.isRightToLeft=function(){var e=this.getViewingDirection();return!!e&&e===a.ViewingDirection.RIGHT_TO_LEFT},e.prototype.isTopToBottom=function(){var e=this.getViewingDirection();return!!e&&e===a.ViewingDirection.TOP_TO_BOTTOM},e.prototype.isTotalCanvasesEven=function(){return this.getCurrentSequence().isTotalCanvasesEven()},e.prototype.isUIEnabled=function(e){if(!this.manifest)throw new Error(s.Errors.manifestNotLoaded);var t=this.manifest.getService(a.ServiceProfile.UI_EXTENSIONS);if(t){var r=t.getProperty(\"disableUI\");if(r&&(-1!==r.indexOf(e)||-1!==r.indexOf(e.toLowerCase())))return!1}return!0},e.prototype.isVerticallyAligned=function(){return this.isTopToBottom()||this.isBottomToTop()},e.prototype.createDateNodes=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=this.getNodeYear(n),o=this.getNodeMonth(n),a=new u.TreeNode;a.id=n.id,a.label=this.getNodeDisplayDate(n),a.data=n.data,a.data.type=u.TreeNodeType.MANIFEST,a.data.year=i,a.data.month=o;var s=this.getDecadeNode(e,i);if(s){var c=this.getYearNode(s,i);if(c){var l=this.getMonthNode(c,o);l&&l.addNode(a)}}}},e.prototype.createDecadeNodes=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(n.navDate){var i=this.getNodeYear(n),o=Number(i.toString().substr(0,3)+\"9\");if(!this.getDecadeNode(e,i)){var a=new u.TreeNode;a.label=i+\" - \"+o,a.navDate=n.navDate,a.data.startYear=i,a.data.endYear=o,e.addNode(a)}}}},e.prototype.createMonthNodes=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(n.navDate){var i=this.getNodeYear(n),o=this.getNodeMonth(n),a=this.getDecadeNode(e,i),s=null;if(a&&(s=this.getYearNode(a,i)),a&&s&&!this.getMonthNode(s,o)){var c=new u.TreeNode;c.label=this.getNodeDisplayMonth(n),c.navDate=n.navDate,c.data.year=i,c.data.month=o,s.addNode(c)}}}},e.prototype.createYearNodes=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(n.navDate){var i=this.getNodeYear(n),o=this.getDecadeNode(e,i);if(o&&!this.getYearNode(o,i)){var a=new u.TreeNode;a.label=i.toString(),a.navDate=n.navDate,a.data.year=i,o.addNode(a)}}}},e.prototype.getDecadeNode=function(e,t){for(var r=0;r<e.nodes.length;r++){var n=e.nodes[r];if(t>=n.data.startYear&&t<=n.data.endYear)return n}return null},e.prototype.getMonthNode=function(e,t){for(var r=0;r<e.nodes.length;r++){var n=e.nodes[r];if(t===this.getNodeMonth(n))return n}return null},e.prototype.getNodeDisplayDate=function(e){return e.navDate.toDateString()},e.prototype.getNodeDisplayMonth=function(e){return[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"][e.navDate.getMonth()]},e.prototype.getNodeMonth=function(e){return e.navDate.getMonth()},e.prototype.getNodeYear=function(e){return e.navDate.getFullYear()},e.prototype.getYearNode=function(e,t){for(var r=0;r<e.nodes.length;r++){var n=e.nodes[r];if(t===this.getNodeYear(n))return n}return null},e.prototype.pruneDecadeNodes=function(e){for(var t=[],r=0;r<e.nodes.length;r++){var n=e.nodes[r];n.nodes.length||t.push(n)}for(var i=0;i<t.length;i++){var o=t[i],a=e.nodes.indexOf(o);a>-1&&e.nodes.splice(a,1)}},e.prototype.sortDecadeNodes=function(e){e.nodes=e.nodes.sort((function(e,t){return e.data.startYear-t.data.startYear}))},e.prototype.sortMonthNodes=function(e){for(var t=this,r=0;r<e.nodes.length;r++)for(var n=e.nodes[r],i=0;i<n.nodes.length;i++){var o=n.nodes[i];o.nodes=o.nodes.sort((function(e,r){return t.getNodeMonth(e)-t.getNodeMonth(r)}))}},e.prototype.sortYearNodes=function(e){for(var t=this,r=0;r<e.nodes.length;r++){var n=e.nodes[r];n.nodes=n.nodes.sort((function(e,r){return t.getNodeYear(e)-t.getNodeYear(r)}))}},e}();t.Helper=c},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(2),i=function(){function e(){this.isEnabled=!1,this.ranges=[],this.canvases=[]}return e.prototype.allCanvasesSelected=function(){return this.canvases.length>0&&this.getAllSelectedCanvases().length===this.canvases.length},e.prototype.allRangesSelected=function(){return this.ranges.length>0&&this.getAllSelectedRanges().length===this.ranges.length},e.prototype.allSelected=function(){return this.allRangesSelected()&&this.allCanvasesSelected()},e.prototype.getAll=function(){return this.canvases.concat(this.ranges)},e.prototype.getAllSelectedCanvases=function(){return this.canvases.filter((function(e){return e.multiSelected}))},e.prototype.getAllSelectedRanges=function(){return this.ranges.filter((function(e){return e.multiSelected}))},e.prototype.getCanvasById=function(e){return this.canvases.filter((function(t){return n.Utils.normaliseUrl(t.id)===n.Utils.normaliseUrl(e)}))[0]},e.prototype.getCanvasesByIds=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(this.getCanvasById(n))}return t},e.prototype.getRangeCanvases=function(e){var t=e.getCanvasIds();return this.getCanvasesByIds(t)},e.prototype.selectAll=function(e){this.selectRanges(this.ranges,e),this.selectCanvases(this.canvases,e)},e.prototype.selectCanvas=function(e,t){this.canvases.filter((function(t){return t.id===e.id}))[0].multiSelected=t},e.prototype.selectAllCanvases=function(e){this.selectCanvases(this.canvases,e)},e.prototype.selectCanvases=function(e,t){for(var r=0;r<e.length;r++){e[r].multiSelected=t}},e.prototype.selectRange=function(e,t){var r=this.ranges.filter((function(t){return t.id===e.id}))[0];r.multiSelected=t;var n=this.getRangeCanvases(r);this.selectCanvases(n,t)},e.prototype.selectAllRanges=function(e){this.selectRanges(this.ranges,e)},e.prototype.selectRanges=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];n.multiSelected=t;var i=this.getCanvasesByIds(n.getCanvasIds());this.selectCanvases(i,t)}},e.prototype.setEnabled=function(e){this.isEnabled=e;for(var t=this.getAll(),r=0;r<t.length;r++){var n=t[r];n.multiSelectEnabled=this.isEnabled,e||(n.multiSelected=!1)}},e}();t.MultiSelectState=i},function(e,t,r){var n=r(18),i=r(19);e.exports=function e(t,r,o,a,s){var u=-1,c=t.length;for(o||(o=i),s||(s=[]);++u<c;){var l=t[u];r>0&&o(l)?r>1?e(l,r-1,o,a,s):n(s,l):a||(s[s.length]=l)}return s}},function(e,t){e.exports=function(e){return null!=e&&\"object\"==typeof e}},function(e,t,r){\"use strict\";r.r(t),t.default=function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in i.open(t.method||\"get\",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+\",\"+r:r})),r(u())},i.onerror=n,i.withCredentials=\"include\"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)}))}},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(){function e(e,t){this.items=[],this.resource=e,this.label=t}return e.prototype.addItem=function(e){this.items.push(e)},e.prototype.addMetadata=function(e,t){void 0===t&&(t=!1);for(var r=0;r<e.length;r++){var n=e[r];n.isRootLevel=t,this.addItem(n)}},e}();t.MetadataGroup=n},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.DATE=\"date\",e.NONE=\"none\"}(t.TreeSortType||(t.TreeSortType={}))},function(e,t,r){e.exports=r(16)},function(e,t,r){\"use strict\";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,\"__esModule\",{value:!0}),n(r(17)),n(r(6)),n(r(7)),n(r(31)),n(r(8)),n(r(33)),n(r(13)),n(r(34)),n(r(9)),n(r(35)),n(r(14)),n(r(36));var i=r(7);t.loadManifest=function(e){return new i.Bootstrapper(e).bootstrap()}},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(6),i=function(){function e(e,t){this.rects=[],this.canvasIndex=t,this.addRect(e)}return e.prototype.addRect=function(e){var t=new n.AnnotationRect(e);t.canvasIndex=this.canvasIndex,t.index=this.rects.length,this.rects.push(t),this.rects.sort((function(e,t){return e.index-t.index}))},e}();t.AnnotationGroup=i},function(e,t){e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},function(e,t,r){var n=r(4),i=r(23),o=r(28),a=n?n.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},function(e,t,r){var n=r(21),i=\"object\"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function(\"return this\")();e.exports=o},function(e,t,r){(function(t){var r=\"object\"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(22))},function(e,t){var r;r=function(){return this}();try{r=r||new Function(\"return this\")()}catch(e){\"object\"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(24),i=r(11),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,\"callee\")&&!s.call(e,\"callee\")};e.exports=u},function(e,t,r){var n=r(25),i=r(11),o=\"[object Arguments]\";e.exports=function(e){return i(e)&&n(e)==o}},function(e,t,r){var n=r(4),i=r(26),o=r(27),a=\"[object Null]\",s=\"[object Undefined]\",u=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?s:a:u&&u in Object(e)?i(e):o(e)}},function(e,t,r){var n=r(4),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){e.exports=self.fetch||(self.fetch=r(12).default||r(12))},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(){function e(){}return e.manifestNotLoaded=\"Manifest has not loaded yet\",e}();t.Errors=n},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(0),i=r(32),o=r(2),a=function(){function e(e,t){this.authHoldingPage=null,this.clickThroughService=null,this.externalService=null,this.isProbed=!1,this.isResponseHandled=!1,this.kioskService=null,this.loginService=null,this.logoutService=null,this.probeService=null,this.restrictedService=null,this.tokenService=null,e.externalResource=this,this.dataUri=this._getDataUri(e),this.index=e.index,this.authAPIVersion=t.authApiVersion,this._parseAuthServices(e),this._parseCanvasDimensions(e)}return e.prototype._getImageServiceDescriptor=function(e){for(var t=null,r=0;r<e.length;r++){var n=e[r],i=n.id;i.endsWith(\"/\")||(i+=\"/\"),o.Utils.isImageProfile(n.getProfile())&&(t=i+\"info.json\")}return t},e.prototype._getDataUri=function(e){var t=e.getContent(),r=e.getImages(),i=null;if(t&&t.length){var o=t[0].getBody();return o.length?(a=o[0].getServices()).length&&(i=this._getImageServiceDescriptor(a))?i:o[0].id:null}if(r&&r.length){var a,s=r[0].getResource();return(a=s.getServices()).length&&(i=this._getImageServiceDescriptor(a))?i:s.id}var u=e.getService(n.ServiceProfile.IXIF);return u?u.getInfoUri():e.id},e.prototype._parseAuthServices=function(e){if(.9===this.authAPIVersion)this.clickThroughService=o.Utils.getService(e,n.ServiceProfile.AUTH_0_CLICK_THROUGH),this.loginService=o.Utils.getService(e,n.ServiceProfile.AUTH_0_LOGIN),this.restrictedService=o.Utils.getService(e,n.ServiceProfile.AUTH_0_RESTRICTED),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(n.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.clickThroughService.getService(n.ServiceProfile.AUTH_0_TOKEN)):this.loginService?(this.logoutService=this.loginService.getService(n.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.loginService.getService(n.ServiceProfile.AUTH_0_TOKEN)):this.restrictedService&&(this.logoutService=this.restrictedService.getService(n.ServiceProfile.AUTH_0_LOGOUT),this.tokenService=this.restrictedService.getService(n.ServiceProfile.AUTH_0_TOKEN));else{if(void 0!==e.isCanvas&&e.isCanvas()){var t=e.getContent();if(t&&t.length){var r=t[0].getBody();if(r&&r.length)e=r[0]}}this.clickThroughService=o.Utils.getService(e,n.ServiceProfile.AUTH_1_CLICK_THROUGH),this.loginService=o.Utils.getService(e,n.ServiceProfile.AUTH_1_LOGIN),this.externalService=o.Utils.getService(e,n.ServiceProfile.AUTH_1_EXTERNAL),this.kioskService=o.Utils.getService(e,n.ServiceProfile.AUTH_1_KIOSK),this.clickThroughService?(this.logoutService=this.clickThroughService.getService(n.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.clickThroughService.getService(n.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.clickThroughService.getService(n.ServiceProfile.AUTH_1_PROBE)):this.loginService?(this.logoutService=this.loginService.getService(n.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.loginService.getService(n.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.loginService.getService(n.ServiceProfile.AUTH_1_PROBE)):this.externalService?(this.logoutService=this.externalService.getService(n.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.externalService.getService(n.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.externalService.getService(n.ServiceProfile.AUTH_1_PROBE)):this.kioskService&&(this.logoutService=this.kioskService.getService(n.ServiceProfile.AUTH_1_LOGOUT),this.tokenService=this.kioskService.getService(n.ServiceProfile.AUTH_1_TOKEN),this.probeService=this.kioskService.getService(n.ServiceProfile.AUTH_1_PROBE))}},e.prototype._parseCanvasDimensions=function(e){var t=e.getImages();if(t&&t.length){var r=t[0].getResource();this.width=r.getWidth(),this.height=r.getHeight()}else if((t=e.getContent()).length){var n=t[0].getBody();n.length&&(this.width=n[0].getWidth(),this.height=n[0].getHeight())}},e.prototype._parseDescriptorDimensions=function(e){void 0!==e.width&&(this.width=e.width),void 0!==e.height&&(this.height=e.height)},e.prototype.isAccessControlled=function(){return!!(this.clickThroughService||this.loginService||this.externalService||this.kioskService||this.probeService)},e.prototype.hasServiceDescriptor=function(){return!!this.dataUri&&this.dataUri.endsWith(\"info.json\")},e.prototype.getData=function(e){var t=this;return t.data={},new Promise((function(r,n){if(t.dataUri)if(t.probeService){t.isProbed=!0;var o=new XMLHttpRequest;o.open(\"GET\",t.probeService.id,!0),o.withCredentials=!0,o.onload=function(){var e=JSON.parse(o.responseText);unescape(e.contentLocation)!==t.dataUri?t.status=i.MOVED_TEMPORARILY:t.status=i.OK,r(t)},o.onerror=function(){t.status=o.status,r(t)},o.send()}else{var a=\"GET\";if(!t.hasServiceDescriptor()){if(!t.isAccessControlled())return t.status=i.OK,void r(t);a=\"HEAD\"}var s=new XMLHttpRequest;s.open(a,t.dataUri,!0),e&&s.setRequestHeader(\"Authorization\",\"Bearer \"+e.accessToken),s.onload=function(){if(s.responseText){var e=JSON.parse(s.responseText),n=unescape(e[\"@id\"]);t.data=e,t._parseAuthServices(t.data),t._parseDescriptorDimensions(t.data),n.endsWith(\"/info.json\")&&(n=n.substr(0,n.lastIndexOf(\"/\")));var o=t.dataUri;o&&o.endsWith(\"/info.json\")&&(o=o.substr(0,o.lastIndexOf(\"/\"))),n!==o&&t.loginService?t.status=i.MOVED_TEMPORARILY:t.status=i.OK,r(t)}else t.status=i.OK,r(t)},s.onerror=function(){t.status=s.status,s.responseText&&t._parseAuthServices(JSON.parse(s.responseText)),r(t)},s.send()}else n(\"There is no dataUri to fetch\")}))},e}();t.ExternalResource=a},function(e,t,r){window,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511}])},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(){};t.ILabelValuePair=n},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(){};t.MetadataOptions=n},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(e,t){this.value=e,this.locale=t};t.Translation=n},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(){function e(e){this.labels=e}return e.prototype.format=function(e){return-1!=e.indexOf(\"<a\")?e:'<a href=\"'+e+'\">'+(this.labels[e]?this.labels[e]:e)+\"</a>\"},e}();t.UriLabeller=n}])}));\ndefine(\"lib/manifold.js\", function(){});\n\n", "var Utils;\r\n(function (Utils) {\r\n var Async = /** @class */ (function () {\r\n function Async() {\r\n }\r\n Async.waitFor = function (test, successCallback, failureCallback, interval, maxTries, numTries) {\r\n if (!interval)\r\n interval = 200;\r\n if (!maxTries)\r\n maxTries = 100; // try 100 times over 20 seconds\r\n if (!numTries)\r\n numTries = 0;\r\n numTries += 1;\r\n if (numTries > maxTries) {\r\n if (failureCallback)\r\n failureCallback();\r\n }\r\n else if (test()) {\r\n successCallback();\r\n }\r\n else {\r\n setTimeout(function () {\r\n Async.waitFor(test, successCallback, failureCallback, interval, maxTries, numTries);\r\n }, interval);\r\n }\r\n };\r\n return Async;\r\n }());\r\n Utils.Async = Async;\r\n var Bools = /** @class */ (function () {\r\n function Bools() {\r\n }\r\n Bools.getBool = function (val, defaultVal) {\r\n if (val === null || typeof (val) === 'undefined') {\r\n return defaultVal;\r\n }\r\n return val;\r\n };\r\n return Bools;\r\n }());\r\n Utils.Bools = Bools;\r\n var Clipboard = /** @class */ (function () {\r\n function Clipboard() {\r\n }\r\n Clipboard.supportsCopy = function () {\r\n return document.queryCommandSupported && document.queryCommandSupported('copy');\r\n };\r\n Clipboard.copy = function (text) {\r\n text = Clipboard.convertBrToNewLine(text);\r\n var textArea = document.createElement(\"textarea\");\r\n textArea.value = text;\r\n Clipboard.hideButKeepEnabled(textArea);\r\n document.body.appendChild(textArea);\r\n textArea.focus();\r\n textArea.select();\r\n document.execCommand('copy');\r\n document.body.removeChild(textArea);\r\n };\r\n Clipboard.hideButKeepEnabled = function (textArea) {\r\n // Place in top-left corner of screen regardless of scroll position.\r\n textArea.style.position = 'fixed';\r\n textArea.style.top = '0';\r\n textArea.style.left = '0';\r\n // Ensure it has a small width and height. Setting to 1px / 1em\r\n // doesn't work as this gives a negative w/h on some browsers.\r\n textArea.style.width = '2em';\r\n textArea.style.height = '2em';\r\n // We don't need padding, reducing the size if it does flash render.\r\n textArea.style.padding = '0';\r\n // Clean up any borders.\r\n textArea.style.border = 'none';\r\n textArea.style.outline = 'none';\r\n textArea.style.boxShadow = 'none';\r\n // Avoid flash of white box if rendered for any reason.\r\n textArea.style.background = 'transparent';\r\n };\r\n Clipboard.convertBrToNewLine = function (text) {\r\n var brRegex = /<br\\s*[\\/]?>/gi;\r\n text = text.replace(brRegex, \"\\n\");\r\n return text;\r\n };\r\n return Clipboard;\r\n }());\r\n Utils.Clipboard = Clipboard;\r\n var Colors = /** @class */ (function () {\r\n function Colors() {\r\n }\r\n Colors.float32ColorToARGB = function (float32Color) {\r\n var a = (float32Color & 0xff000000) >>> 24;\r\n var r = (float32Color & 0xff0000) >>> 16;\r\n var g = (float32Color & 0xff00) >>> 8;\r\n var b = float32Color & 0xff;\r\n var result = [a, r, g, b];\r\n return result;\r\n };\r\n Colors._componentToHex = function (c) {\r\n var hex = c.toString(16);\r\n return hex.length == 1 ? \"0\" + hex : hex;\r\n };\r\n Colors.rgbToHexString = function (rgb) {\r\n Colors.coalesce(rgb);\r\n return \"#\" + Colors._componentToHex(rgb[0]) + Colors._componentToHex(rgb[1]) + Colors._componentToHex(rgb[2]);\r\n };\r\n Colors.argbToHexString = function (argb) {\r\n return \"#\" + Colors._componentToHex(argb[0]) + Colors._componentToHex(argb[1]) + Colors._componentToHex(argb[2]) + Colors._componentToHex(argb[3]);\r\n };\r\n Colors.coalesce = function (arr) {\r\n for (var i = 1; i < arr.length; i++) {\r\n if (typeof (arr[i]) === 'undefined')\r\n arr[i] = arr[i - 1];\r\n }\r\n };\r\n return Colors;\r\n }());\r\n Utils.Colors = Colors;\r\n var Dates = /** @class */ (function () {\r\n function Dates() {\r\n }\r\n Dates.getTimeStamp = function () {\r\n return new Date().getTime();\r\n };\r\n return Dates;\r\n }());\r\n Utils.Dates = Dates;\r\n var Device = /** @class */ (function () {\r\n function Device() {\r\n }\r\n Device.getPixelRatio = function (ctx) {\r\n var dpr = window.devicePixelRatio || 1;\r\n var bsr = ctx.webkitBackingStorePixelRatio ||\r\n ctx.mozBackingStorePixelRatio ||\r\n ctx.msBackingStorePixelRatio ||\r\n ctx.oBackingStorePixelRatio ||\r\n ctx.backingStorePixelRatio || 1;\r\n return dpr / bsr;\r\n };\r\n Device.isTouch = function () {\r\n return !!(\"ontouchstart\" in window) || window.navigator.msMaxTouchPoints > 0;\r\n };\r\n return Device;\r\n }());\r\n Utils.Device = Device;\r\n var Documents = /** @class */ (function () {\r\n function Documents() {\r\n }\r\n Documents.isInIFrame = function () {\r\n // see http://stackoverflow.com/questions/326069/how-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-t\r\n try {\r\n return window.self !== window.top;\r\n }\r\n catch (e) {\r\n return true;\r\n }\r\n };\r\n Documents.supportsFullscreen = function () {\r\n var doc = document.documentElement;\r\n var support = doc.requestFullscreen || doc.mozRequestFullScreen ||\r\n doc.webkitRequestFullScreen || doc.msRequestFullscreen;\r\n return support !== undefined;\r\n };\r\n Documents.isHidden = function () {\r\n var prop = Documents.getHiddenProp();\r\n if (!prop)\r\n return false;\r\n return true;\r\n //return document[prop];\r\n };\r\n Documents.getHiddenProp = function () {\r\n var prefixes = ['webkit', 'moz', 'ms', 'o'];\r\n // if 'hidden' is natively supported just return it\r\n if ('hidden' in document)\r\n return 'hidden';\r\n // otherwise loop over all the known prefixes until we find one\r\n for (var i = 0; i < prefixes.length; i++) {\r\n if ((prefixes[i] + 'Hidden') in document) {\r\n return prefixes[i] + 'Hidden';\r\n }\r\n }\r\n // otherwise it's not supported\r\n return null;\r\n };\r\n return Documents;\r\n }());\r\n Utils.Documents = Documents;\r\n var Events = /** @class */ (function () {\r\n function Events() {\r\n }\r\n Events.debounce = function (fn, debounceDuration) {\r\n // summary:\r\n // Returns a debounced function that will make sure the given\r\n // function is not triggered too much.\r\n // fn: Function\r\n // Function to debounce.\r\n // debounceDuration: Number\r\n // OPTIONAL. The amount of time in milliseconds for which we\r\n // will debounce the function. (defaults to 100ms)\r\n debounceDuration = debounceDuration || 100;\r\n return function () {\r\n if (!fn.debouncing) {\r\n var args = Array.prototype.slice.apply(arguments);\r\n fn.lastReturnVal = fn.apply(window, args);\r\n fn.debouncing = true;\r\n }\r\n clearTimeout(fn.debounceTimeout);\r\n fn.debounceTimeout = setTimeout(function () {\r\n fn.debouncing = false;\r\n }, debounceDuration);\r\n return fn.lastReturnVal;\r\n };\r\n };\r\n return Events;\r\n }());\r\n Utils.Events = Events;\r\n var Files = /** @class */ (function () {\r\n function Files() {\r\n }\r\n Files.simplifyMimeType = function (mime) {\r\n switch (mime) {\r\n case 'text/plain':\r\n return 'txt';\r\n case 'image/jpeg':\r\n return 'jpg';\r\n case 'application/msword':\r\n return 'doc';\r\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\r\n return 'docx';\r\n default:\r\n var parts = mime.split('/');\r\n return parts[parts.length - 1];\r\n }\r\n };\r\n return Files;\r\n }());\r\n Utils.Files = Files;\r\n var Keyboard = /** @class */ (function () {\r\n function Keyboard() {\r\n }\r\n Keyboard.getCharCode = function (e) {\r\n var charCode = (typeof e.which == \"number\") ? e.which : e.keyCode;\r\n return charCode;\r\n };\r\n return Keyboard;\r\n }());\r\n Utils.Keyboard = Keyboard;\r\n var Maths = /** @class */ (function () {\r\n function Maths() {\r\n }\r\n Maths.normalise = function (num, min, max) {\r\n return (num - min) / (max - min);\r\n };\r\n Maths.median = function (values) {\r\n values.sort(function (a, b) {\r\n return a - b;\r\n });\r\n var half = Math.floor(values.length / 2);\r\n if (values.length % 2) {\r\n return values[half];\r\n }\r\n else {\r\n return (values[half - 1] + values[half]) / 2.0;\r\n }\r\n };\r\n Maths.clamp = function (value, min, max) {\r\n return Math.min(Math.max(value, min), max);\r\n };\r\n return Maths;\r\n }());\r\n Utils.Maths = Maths;\r\n var Size = /** @class */ (function () {\r\n function Size(width, height) {\r\n this.width = width;\r\n this.height = height;\r\n }\r\n return Size;\r\n }());\r\n Utils.Size = Size;\r\n var Dimensions = /** @class */ (function () {\r\n function Dimensions() {\r\n }\r\n Dimensions.fitRect = function (width1, height1, width2, height2) {\r\n var ratio1 = height1 / width1;\r\n var ratio2 = height2 / width2;\r\n var width = 0;\r\n var height = 0;\r\n var scale;\r\n if (ratio1 < ratio2) {\r\n scale = width2 / width1;\r\n width = width1 * scale;\r\n height = height1 * scale;\r\n }\r\n else {\r\n scale = height2 / height1;\r\n width = width1 * scale;\r\n height = height1 * scale;\r\n }\r\n return new Size(Math.floor(width), Math.floor(height));\r\n };\r\n Dimensions.hitRect = function (x, y, w, h, mx, my) {\r\n if (mx > x && mx < (x + w) && my > y && my < (y + h)) {\r\n return true;\r\n }\r\n return false;\r\n };\r\n return Dimensions;\r\n }());\r\n Utils.Dimensions = Dimensions;\r\n var Numbers = /** @class */ (function () {\r\n function Numbers() {\r\n }\r\n Numbers.numericalInput = function (event) {\r\n // Allow: backspace, delete, tab and escape\r\n if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 ||\r\n // Allow: Ctrl+A\r\n (event.keyCode == 65 && event.ctrlKey === true) ||\r\n // Allow: home, end, left, right\r\n (event.keyCode >= 35 && event.keyCode <= 39)) {\r\n // let it happen, don't do anything\r\n return true;\r\n }\r\n else {\r\n // Ensure that it is a number and stop the keypress\r\n if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {\r\n event.preventDefault();\r\n return false;\r\n }\r\n return true;\r\n }\r\n };\r\n return Numbers;\r\n }());\r\n Utils.Numbers = Numbers;\r\n var Objects = /** @class */ (function () {\r\n function Objects() {\r\n }\r\n Objects.toPlainObject = function (value) {\r\n value = Object(value);\r\n var result = {};\r\n for (var key in value) {\r\n result[key] = value[key];\r\n }\r\n return result;\r\n };\r\n return Objects;\r\n }());\r\n Utils.Objects = Objects;\r\n var Storage = /** @class */ (function () {\r\n function Storage() {\r\n }\r\n Storage.clear = function (storageType) {\r\n if (storageType === void 0) { storageType = StorageType.memory; }\r\n switch (storageType.value) {\r\n case StorageType.memory.value:\r\n this._memoryStorage = {};\r\n break;\r\n case StorageType.session.value:\r\n sessionStorage.clear();\r\n break;\r\n case StorageType.local.value:\r\n localStorage.clear();\r\n break;\r\n }\r\n };\r\n Storage.clearExpired = function (storageType) {\r\n if (storageType === void 0) { storageType = StorageType.memory; }\r\n var items = this.getItems(storageType);\r\n for (var i = 0; i < items.length; i++) {\r\n var item = items[i];\r\n if (this._isExpired(item)) {\r\n this.remove(item.key);\r\n }\r\n }\r\n };\r\n Storage.get = function (key, storageType) {\r\n if (storageType === void 0) { storageType = StorageType.memory; }\r\n var data = null;\r\n switch (storageType.value) {\r\n case StorageType.memory.value:\r\n data = this._memoryStorage[key];\r\n break;\r\n case StorageType.session.value:\r\n data = sessionStorage.getItem(key);\r\n break;\r\n case StorageType.local.value:\r\n data = localStorage.getItem(key);\r\n break;\r\n }\r\n if (!data)\r\n return null;\r\n var item = null;\r\n try {\r\n item = JSON.parse(data);\r\n }\r\n catch (error) {\r\n return null;\r\n }\r\n if (!item)\r\n return null;\r\n if (this._isExpired(item))\r\n return null;\r\n // useful reference\r\n item.key = key;\r\n return item;\r\n };\r\n Storage._isExpired = function (item) {\r\n if (new Date().getTime() < item.expiresAt) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n Storage.getItems = function (storageType) {\r\n if (storageType === void 0) { storageType = StorageType.memory; }\r\n var items = [];\r\n switch (storageType.value) {\r\n case StorageType.memory.value:\r\n var keys = Object.keys(this._memoryStorage);\r\n for (var i = 0; i < keys.length; i++) {\r\n var item = this.get(keys[i], StorageType.memory);\r\n if (item) {\r\n items.push(item);\r\n }\r\n }\r\n break;\r\n case StorageType.session.value:\r\n for (var i = 0; i < sessionStorage.length; i++) {\r\n var key = sessionStorage.key(i);\r\n if (key) {\r\n var item = this.get(key, StorageType.session);\r\n if (item) {\r\n items.push(item);\r\n }\r\n }\r\n }\r\n break;\r\n case StorageType.local.value:\r\n for (var i = 0; i < localStorage.length; i++) {\r\n var key = localStorage.key(i);\r\n if (key) {\r\n var item = this.get(key, StorageType.local);\r\n if (item) {\r\n items.push(item);\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n return items;\r\n };\r\n Storage.remove = function (key, storageType) {\r\n if (storageType === void 0) { storageType = StorageType.memory; }\r\n switch (storageType.value) {\r\n case StorageType.memory.value:\r\n delete this._memoryStorage[key];\r\n break;\r\n case StorageType.session.value:\r\n sessionStorage.removeItem(key);\r\n break;\r\n case StorageType.local.value:\r\n localStorage.removeItem(key);\r\n break;\r\n }\r\n };\r\n Storage.set = function (key, value, expirationSecs, storageType) {\r\n if (storageType === void 0) { storageType = StorageType.memory; }\r\n var expirationMS = expirationSecs * 1000;\r\n var record = new StorageItem();\r\n record.value = value;\r\n record.expiresAt = new Date().getTime() + expirationMS;\r\n switch (storageType.value) {\r\n case StorageType.memory.value:\r\n this._memoryStorage[key] = JSON.stringify(record);\r\n break;\r\n case StorageType.session.value:\r\n sessionStorage.setItem(key, JSON.stringify(record));\r\n break;\r\n case StorageType.local.value:\r\n localStorage.setItem(key, JSON.stringify(record));\r\n break;\r\n }\r\n return record;\r\n };\r\n Storage._memoryStorage = {};\r\n return Storage;\r\n }());\r\n Utils.Storage = Storage;\r\n var StorageItem = /** @class */ (function () {\r\n function StorageItem() {\r\n }\r\n return StorageItem;\r\n }());\r\n Utils.StorageItem = StorageItem;\r\n var StorageType = /** @class */ (function () {\r\n function StorageType(value) {\r\n this.value = value;\r\n }\r\n StorageType.prototype.toString = function () {\r\n return this.value;\r\n };\r\n StorageType.memory = new StorageType(\"memory\");\r\n StorageType.session = new StorageType(\"session\");\r\n StorageType.local = new StorageType(\"local\");\r\n return StorageType;\r\n }());\r\n Utils.StorageType = StorageType;\r\n var Strings = /** @class */ (function () {\r\n function Strings() {\r\n }\r\n Strings.ellipsis = function (text, chars) {\r\n if (text.length <= chars)\r\n return text;\r\n var trimmedText = text.substr(0, chars);\r\n var lastSpaceIndex = trimmedText.lastIndexOf(\" \");\r\n if (lastSpaceIndex != -1) {\r\n trimmedText = trimmedText.substr(0, Math.min(trimmedText.length, lastSpaceIndex));\r\n }\r\n return trimmedText + \"…\";\r\n };\r\n Strings.htmlDecode = function (encoded) {\r\n var div = document.createElement('div');\r\n div.innerHTML = encoded;\r\n return div.firstChild.nodeValue;\r\n };\r\n Strings.format = function (str) {\r\n var values = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n values[_i - 1] = arguments[_i];\r\n }\r\n for (var i = 0; i < values.length; i++) {\r\n var reg = new RegExp(\"\\\\{\" + i + \"\\\\}\", \"gm\");\r\n str = str.replace(reg, values[i]);\r\n }\r\n return str;\r\n };\r\n Strings.isAlphanumeric = function (str) {\r\n return /^[a-zA-Z0-9]*$/.test(str);\r\n };\r\n Strings.toCssClass = function (str) {\r\n return str.replace(/[^a-z0-9]/g, function (s) {\r\n var c = s.charCodeAt(0);\r\n if (c == 32)\r\n return '-';\r\n if (c >= 65 && c <= 90)\r\n return '_' + s.toLowerCase();\r\n return '__' + ('000' + c.toString(16)).slice(-4);\r\n });\r\n };\r\n Strings.toFileName = function (str) {\r\n return str.replace(/[^a-z0-9]/gi, '_').toLowerCase();\r\n };\r\n Strings.utf8_to_b64 = function (str) {\r\n return window.btoa(unescape(encodeURIComponent(str)));\r\n };\r\n return Strings;\r\n }());\r\n Utils.Strings = Strings;\r\n var Urls = /** @class */ (function () {\r\n function Urls() {\r\n }\r\n Urls.getHashParameter = function (key, doc) {\r\n if (!doc)\r\n doc = window.document;\r\n if (doc && doc.location) {\r\n return this.getHashParameterFromString(key, doc.location.hash);\r\n }\r\n return null;\r\n };\r\n Urls.getHashParameterFromString = function (key, url) {\r\n var regex = new RegExp(\"#.*[?&]\" + key + \"=([^&]+)(&|$)\");\r\n var match = regex.exec(url);\r\n return (match ? decodeURIComponent(match[1].replace(/\\+/g, \" \")) : null);\r\n };\r\n Urls.setHashParameter = function (key, value, doc) {\r\n if (!doc)\r\n doc = window.document;\r\n if (doc && doc.location) {\r\n var kvp = this.updateURIKeyValuePair(doc.location.hash.replace('#?', ''), key, value);\r\n var newHash = \"#?\" + kvp;\r\n var url = doc.URL;\r\n // remove hash value (if present).\r\n var index = url.indexOf('#');\r\n if (index != -1) {\r\n url = url.substr(0, url.indexOf('#'));\r\n }\r\n doc.location.replace(url + newHash);\r\n }\r\n };\r\n Urls.getQuerystringParameter = function (key, w) {\r\n if (!w)\r\n w = window;\r\n return this.getQuerystringParameterFromString(key, w.location.search);\r\n };\r\n Urls.getQuerystringParameterFromString = function (key, querystring) {\r\n key = key.replace(/[\\[]/, \"\\\\\\[\").replace(/[\\]]/, \"\\\\\\]\");\r\n var regex = new RegExp(\"[\\\\?&]\" + key + \"=([^&#]*)\");\r\n var match = regex.exec(querystring);\r\n return (match ? decodeURIComponent(match[1].replace(/\\+/g, \" \")) : null);\r\n };\r\n Urls.setQuerystringParameter = function (key, value, doc) {\r\n if (!doc)\r\n doc = window.document;\r\n if (doc && doc.location) {\r\n var kvp = this.updateURIKeyValuePair(doc.location.hash.replace('#?', ''), key, value);\r\n // redirects.\r\n window.location.search = kvp;\r\n }\r\n };\r\n Urls.updateURIKeyValuePair = function (uriSegment, key, value) {\r\n key = encodeURIComponent(key);\r\n value = encodeURIComponent(value);\r\n var kvp = uriSegment.split('&');\r\n // Array.split() returns an array with a single \"\" item\r\n // if the target string is empty. remove if present.\r\n if (kvp[0] == \"\")\r\n kvp.shift();\r\n var i = kvp.length;\r\n var x;\r\n // replace if already present.\r\n while (i--) {\r\n x = kvp[i].split('=');\r\n if (x[0] == key) {\r\n x[1] = value;\r\n kvp[i] = x.join('=');\r\n break;\r\n }\r\n }\r\n // not found, so append.\r\n if (i < 0) {\r\n kvp[kvp.length] = [key, value].join('=');\r\n }\r\n return kvp.join('&');\r\n };\r\n Urls.getUrlParts = function (url) {\r\n var a = document.createElement('a');\r\n a.href = url;\r\n return a;\r\n };\r\n Urls.convertToRelativeUrl = function (url) {\r\n var parts = this.getUrlParts(url);\r\n var relUri = parts.pathname + parts.searchWithin;\r\n if (!relUri.startsWith(\"/\")) {\r\n relUri = \"/\" + relUri;\r\n }\r\n return relUri;\r\n };\r\n return Urls;\r\n }());\r\n Utils.Urls = Urls;\r\n})(Utils || (Utils = {}));\r\nwindow.Utils = Utils;\r\n\ndefine(\"lib/Utils.js\", function(){});\n\n", "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var FilterCSS=require(\"cssfilter\").FilterCSS;var getDefaultCSSWhiteList=require(\"cssfilter\").getDefaultWhiteList;var _=require(\"./util\");function getDefaultWhiteList(){return{a:[\"target\",\"href\",\"title\"],abbr:[\"title\"],address:[],area:[\"shape\",\"coords\",\"href\",\"alt\"],article:[],aside:[],audio:[\"autoplay\",\"controls\",\"loop\",\"preload\",\"src\"],b:[],bdi:[\"dir\"],bdo:[\"dir\"],big:[],blockquote:[\"cite\"],br:[],caption:[],center:[],cite:[],code:[],col:[\"align\",\"valign\",\"span\",\"width\"],colgroup:[\"align\",\"valign\",\"span\",\"width\"],dd:[],del:[\"datetime\"],details:[\"open\"],div:[],dl:[],dt:[],em:[],font:[\"color\",\"size\",\"face\"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:[\"src\",\"alt\",\"title\",\"width\",\"height\"],ins:[\"datetime\"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],strong:[],table:[\"width\",\"border\",\"align\",\"valign\"],tbody:[\"align\",\"valign\"],td:[\"width\",\"rowspan\",\"colspan\",\"align\",\"valign\"],tfoot:[\"align\",\"valign\"],th:[\"width\",\"rowspan\",\"colspan\",\"align\",\"valign\"],thead:[\"align\",\"valign\"],tr:[\"rowspan\",\"align\",\"valign\"],tt:[],u:[],ul:[],video:[\"autoplay\",\"controls\",\"loop\",\"preload\",\"src\",\"height\",\"width\"]}}var defaultCSSFilter=new FilterCSS;function onTag(tag,html,options){}function onIgnoreTag(tag,html,options){}function onTagAttr(tag,name,value){}function onIgnoreTagAttr(tag,name,value){}function escapeHtml(html){return html.replace(REGEXP_LT,\"<\").replace(REGEXP_GT,\">\")}function safeAttrValue(tag,name,value,cssFilter){value=friendlyAttrValue(value);if(name===\"href\"||name===\"src\"){value=_.trim(value);if(value===\"#\")return\"#\";if(!(value.substr(0,7)===\"http://\"||value.substr(0,8)===\"https://\"||value.substr(0,7)===\"mailto:\"||value.substr(0,4)===\"tel:\"||value[0]===\"#\"||value[0]===\"/\")){return\"\"}}else if(name===\"background\"){REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex=0;if(REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)){return\"\"}}else if(name===\"style\"){REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex=0;if(REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)){return\"\"}REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex=0;if(REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)){REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex=0;if(REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)){return\"\"}}if(cssFilter!==false){cssFilter=cssFilter||defaultCSSFilter;value=cssFilter.process(value)}}value=escapeAttrValue(value);return value}var REGEXP_LT=/</g;var REGEXP_GT=/>/g;var REGEXP_QUOTE=/\"/g;var REGEXP_QUOTE_2=/"/g;var REGEXP_ATTR_VALUE_1=/&#([a-zA-Z0-9]*);?/gim;var REGEXP_ATTR_VALUE_COLON=/:?/gim;var REGEXP_ATTR_VALUE_NEWLINE=/&newline;?/gim;var REGEXP_DEFAULT_ON_TAG_ATTR_3=/\\/\\*|\\*\\//gm;var REGEXP_DEFAULT_ON_TAG_ATTR_4=/((j\\s*a\\s*v\\s*a|v\\s*b|l\\s*i\\s*v\\s*e)\\s*s\\s*c\\s*r\\s*i\\s*p\\s*t\\s*|m\\s*o\\s*c\\s*h\\s*a)\\:/gi;var REGEXP_DEFAULT_ON_TAG_ATTR_5=/^[\\s\"'`]*(d\\s*a\\s*t\\s*a\\s*)\\:/gi;var REGEXP_DEFAULT_ON_TAG_ATTR_6=/^[\\s\"'`]*(d\\s*a\\s*t\\s*a\\s*)\\:\\s*image\\//gi;var REGEXP_DEFAULT_ON_TAG_ATTR_7=/e\\s*x\\s*p\\s*r\\s*e\\s*s\\s*s\\s*i\\s*o\\s*n\\s*\\(.*/gi;var REGEXP_DEFAULT_ON_TAG_ATTR_8=/u\\s*r\\s*l\\s*\\(.*/gi;function escapeQuote(str){return str.replace(REGEXP_QUOTE,\""\")}function unescapeQuote(str){return str.replace(REGEXP_QUOTE_2,'\"')}function escapeHtmlEntities(str){return str.replace(REGEXP_ATTR_VALUE_1,function replaceUnicode(str,code){return code[0]===\"x\"||code[0]===\"X\"?String.fromCharCode(parseInt(code.substr(1),16)):String.fromCharCode(parseInt(code,10))})}function escapeDangerHtml5Entities(str){return str.replace(REGEXP_ATTR_VALUE_COLON,\":\").replace(REGEXP_ATTR_VALUE_NEWLINE,\" \")}function clearNonPrintableCharacter(str){var str2=\"\";for(var i=0,len=str.length;i<len;i++){str2+=str.charCodeAt(i)<32?\" \":str.charAt(i)}return _.trim(str2)}function friendlyAttrValue(str){str=unescapeQuote(str);str=escapeHtmlEntities(str);str=escapeDangerHtml5Entities(str);str=clearNonPrintableCharacter(str);return str}function escapeAttrValue(str){str=escapeQuote(str);str=escapeHtml(str);return str}function onIgnoreTagStripAll(){return\"\"}function StripTagBody(tags,next){if(typeof next!==\"function\"){next=function(){}}var isRemoveAllTag=!Array.isArray(tags);function isRemoveTag(tag){if(isRemoveAllTag)return true;return _.indexOf(tags,tag)!==-1}var removeList=[];var posStart=false;return{onIgnoreTag:function(tag,html,options){if(isRemoveTag(tag)){if(options.isClosing){var ret=\"[/removed]\";var end=options.position+ret.length;removeList.push([posStart!==false?posStart:options.position,end]);posStart=false;return ret}else{if(!posStart){posStart=options.position}return\"[removed]\"}}else{return next(tag,html,options)}},remove:function(html){var rethtml=\"\";var lastPos=0;_.forEach(removeList,function(pos){rethtml+=html.slice(lastPos,pos[0]);lastPos=pos[1]});rethtml+=html.slice(lastPos);return rethtml}}}function stripCommentTag(html){return html.replace(STRIP_COMMENT_TAG_REGEXP,\"\")}var STRIP_COMMENT_TAG_REGEXP=/<!--[\\s\\S]*?-->/g;function stripBlankChar(html){var chars=html.split(\"\");chars=chars.filter(function(char){var c=char.charCodeAt(0);if(c===127)return false;if(c<=31){if(c===10||c===13)return true;return false}return true});return chars.join(\"\")}exports.whiteList=getDefaultWhiteList();exports.getDefaultWhiteList=getDefaultWhiteList;exports.onTag=onTag;exports.onIgnoreTag=onIgnoreTag;exports.onTagAttr=onTagAttr;exports.onIgnoreTagAttr=onIgnoreTagAttr;exports.safeAttrValue=safeAttrValue;exports.escapeHtml=escapeHtml;exports.escapeQuote=escapeQuote;exports.unescapeQuote=unescapeQuote;exports.escapeHtmlEntities=escapeHtmlEntities;exports.escapeDangerHtml5Entities=escapeDangerHtml5Entities;exports.clearNonPrintableCharacter=clearNonPrintableCharacter;exports.friendlyAttrValue=friendlyAttrValue;exports.escapeAttrValue=escapeAttrValue;exports.onIgnoreTagStripAll=onIgnoreTagStripAll;exports.StripTagBody=StripTagBody;exports.stripCommentTag=stripCommentTag;exports.stripBlankChar=stripBlankChar;exports.cssFilter=defaultCSSFilter;exports.getDefaultCSSWhiteList=getDefaultCSSWhiteList},{\"./util\":4,cssfilter:8}],2:[function(require,module,exports){var DEFAULT=require(\"./default\");var parser=require(\"./parser\");var FilterXSS=require(\"./xss\");function filterXSS(html,options){var xss=new FilterXSS(options);return xss.process(html)}exports=module.exports=filterXSS;exports.FilterXSS=FilterXSS;for(var i in DEFAULT)exports[i]=DEFAULT[i];for(var i in parser)exports[i]=parser[i];if(typeof window!==\"undefined\"){window.filterXSS=module.exports}function isWorkerEnv(){return typeof self!==\"undefined\"&&typeof DedicatedWorkerGlobalScope!==\"undefined\"&&self instanceof DedicatedWorkerGlobalScope}if(isWorkerEnv()){self.filterXSS=module.exports}},{\"./default\":1,\"./parser\":3,\"./xss\":5}],3:[function(require,module,exports){var _=require(\"./util\");function getTagName(html){var i=_.spaceIndex(html);if(i===-1){var tagName=html.slice(1,-1)}else{var tagName=html.slice(1,i+1)}tagName=_.trim(tagName).toLowerCase();if(tagName.slice(0,1)===\"/\")tagName=tagName.slice(1);if(tagName.slice(-1)===\"/\")tagName=tagName.slice(0,-1);return tagName}function isClosing(html){return html.slice(0,2)===\"</\"}function parseTag(html,onTag,escapeHtml){\"user strict\";var rethtml=\"\";var lastPos=0;var tagStart=false;var quoteStart=false;var currentPos=0;var len=html.length;var currentTagName=\"\";var currentHtml=\"\";for(currentPos=0;currentPos<len;currentPos++){var c=html.charAt(currentPos);if(tagStart===false){if(c===\"<\"){tagStart=currentPos;continue}}else{if(quoteStart===false){if(c===\"<\"){rethtml+=escapeHtml(html.slice(lastPos,currentPos));tagStart=currentPos;lastPos=currentPos;continue}if(c===\">\"){rethtml+=escapeHtml(html.slice(lastPos,tagStart));currentHtml=html.slice(tagStart,currentPos+1);currentTagName=getTagName(currentHtml);rethtml+=onTag(tagStart,rethtml.length,currentTagName,currentHtml,isClosing(currentHtml));lastPos=currentPos+1;tagStart=false;continue}if((c==='\"'||c===\"'\")&&html.charAt(currentPos-1)===\"=\"){quoteStart=c;continue}}else{if(c===quoteStart){quoteStart=false;continue}}}}if(lastPos<html.length){rethtml+=escapeHtml(html.substr(lastPos))}return rethtml}var REGEXP_ILLEGAL_ATTR_NAME=/[^a-zA-Z0-9_:\\.\\-]/gim;function parseAttr(html,onAttr){\"user strict\";var lastPos=0;var retAttrs=[];var tmpName=false;var len=html.length;function addAttr(name,value){name=_.trim(name);name=name.replace(REGEXP_ILLEGAL_ATTR_NAME,\"\").toLowerCase();if(name.length<1)return;var ret=onAttr(name,value||\"\");if(ret)retAttrs.push(ret)}for(var i=0;i<len;i++){var c=html.charAt(i);var v,j;if(tmpName===false&&c===\"=\"){tmpName=html.slice(lastPos,i);lastPos=i+1;continue}if(tmpName!==false){if(i===lastPos&&(c==='\"'||c===\"'\")&&html.charAt(i-1)===\"=\"){j=html.indexOf(c,i+1);if(j===-1){break}else{v=_.trim(html.slice(lastPos+1,j));addAttr(tmpName,v);tmpName=false;i=j;lastPos=i+1;continue}}}if(/\\s|\\n|\\t/.test(c)){html=html.replace(/\\s|\\n|\\t/g,\" \");if(tmpName===false){j=findNextEqual(html,i);if(j===-1){v=_.trim(html.slice(lastPos,i));addAttr(v);tmpName=false;lastPos=i+1;continue}else{i=j-1;continue}}else{j=findBeforeEqual(html,i-1);if(j===-1){v=_.trim(html.slice(lastPos,i));v=stripQuoteWrap(v);addAttr(tmpName,v);tmpName=false;lastPos=i+1;continue}else{continue}}}}if(lastPos<html.length){if(tmpName===false){addAttr(html.slice(lastPos))}else{addAttr(tmpName,stripQuoteWrap(_.trim(html.slice(lastPos))))}}return _.trim(retAttrs.join(\" \"))}function findNextEqual(str,i){for(;i<str.length;i++){var c=str[i];if(c===\" \")continue;if(c===\"=\")return i;return-1}}function findBeforeEqual(str,i){for(;i>0;i--){var c=str[i];if(c===\" \")continue;if(c===\"=\")return i;return-1}}function isQuoteWrapString(text){if(text[0]==='\"'&&text[text.length-1]==='\"'||text[0]===\"'\"&&text[text.length-1]===\"'\"){return true}else{return false}}function stripQuoteWrap(text){if(isQuoteWrapString(text)){return text.substr(1,text.length-2)}else{return text}}exports.parseTag=parseTag;exports.parseAttr=parseAttr},{\"./util\":4}],4:[function(require,module,exports){module.exports={indexOf:function(arr,item){var i,j;if(Array.prototype.indexOf){return arr.indexOf(item)}for(i=0,j=arr.length;i<j;i++){if(arr[i]===item){return i}}return-1},forEach:function(arr,fn,scope){var i,j;if(Array.prototype.forEach){return arr.forEach(fn,scope)}for(i=0,j=arr.length;i<j;i++){fn.call(scope,arr[i],i,arr)}},trim:function(str){if(String.prototype.trim){return str.trim()}return str.replace(/(^\\s*)|(\\s*$)/g,\"\")},spaceIndex:function(str){var reg=/\\s|\\n|\\t/;var match=reg.exec(str);return match?match.index:-1}}},{}],5:[function(require,module,exports){var FilterCSS=require(\"cssfilter\").FilterCSS;var DEFAULT=require(\"./default\");var parser=require(\"./parser\");var parseTag=parser.parseTag;var parseAttr=parser.parseAttr;var _=require(\"./util\");function isNull(obj){return obj===undefined||obj===null}function getAttrs(html){var i=_.spaceIndex(html);if(i===-1){return{html:\"\",closing:html[html.length-2]===\"/\"}}html=_.trim(html.slice(i+1,-1));var isClosing=html[html.length-1]===\"/\";if(isClosing)html=_.trim(html.slice(0,-1));return{html:html,closing:isClosing}}function shallowCopyObject(obj){var ret={};for(var i in obj){ret[i]=obj[i]}return ret}function FilterXSS(options){options=shallowCopyObject(options||{});if(options.stripIgnoreTag){if(options.onIgnoreTag){console.error('Notes: cannot use these two options \"stripIgnoreTag\" and \"onIgnoreTag\" at the same time')}options.onIgnoreTag=DEFAULT.onIgnoreTagStripAll}options.whiteList=options.whiteList||DEFAULT.whiteList;options.onTag=options.onTag||DEFAULT.onTag;options.onTagAttr=options.onTagAttr||DEFAULT.onTagAttr;options.onIgnoreTag=options.onIgnoreTag||DEFAULT.onIgnoreTag;options.onIgnoreTagAttr=options.onIgnoreTagAttr||DEFAULT.onIgnoreTagAttr;options.safeAttrValue=options.safeAttrValue||DEFAULT.safeAttrValue;options.escapeHtml=options.escapeHtml||DEFAULT.escapeHtml;this.options=options;if(options.css===false){this.cssFilter=false}else{options.css=options.css||{};this.cssFilter=new FilterCSS(options.css)}}FilterXSS.prototype.process=function(html){html=html||\"\";html=html.toString();if(!html)return\"\";var me=this;var options=me.options;var whiteList=options.whiteList;var onTag=options.onTag;var onIgnoreTag=options.onIgnoreTag;var onTagAttr=options.onTagAttr;var onIgnoreTagAttr=options.onIgnoreTagAttr;var safeAttrValue=options.safeAttrValue;var escapeHtml=options.escapeHtml;var cssFilter=me.cssFilter;if(options.stripBlankChar){html=DEFAULT.stripBlankChar(html)}if(!options.allowCommentTag){html=DEFAULT.stripCommentTag(html)}var stripIgnoreTagBody=false;if(options.stripIgnoreTagBody){var stripIgnoreTagBody=DEFAULT.StripTagBody(options.stripIgnoreTagBody,onIgnoreTag);onIgnoreTag=stripIgnoreTagBody.onIgnoreTag}var retHtml=parseTag(html,function(sourcePosition,position,tag,html,isClosing){var info={sourcePosition:sourcePosition,position:position,isClosing:isClosing,isWhite:whiteList.hasOwnProperty(tag)};var ret=onTag(tag,html,info);if(!isNull(ret))return ret;if(info.isWhite){if(info.isClosing){return\"</\"+tag+\">\"}var attrs=getAttrs(html);var whiteAttrList=whiteList[tag];var attrsHtml=parseAttr(attrs.html,function(name,value){var isWhiteAttr=_.indexOf(whiteAttrList,name)!==-1;var ret=onTagAttr(tag,name,value,isWhiteAttr);if(!isNull(ret))return ret;if(isWhiteAttr){value=safeAttrValue(tag,name,value,cssFilter);if(value){return name+'=\"'+value+'\"'}else{return name}}else{var ret=onIgnoreTagAttr(tag,name,value,isWhiteAttr);if(!isNull(ret))return ret;return}});var html=\"<\"+tag;if(attrsHtml)html+=\" \"+attrsHtml;if(attrs.closing)html+=\" /\";html+=\">\";return html}else{var ret=onIgnoreTag(tag,html,info);if(!isNull(ret))return ret;return escapeHtml(html)}},escapeHtml);if(stripIgnoreTagBody){retHtml=stripIgnoreTagBody.remove(retHtml)}return retHtml};module.exports=FilterXSS},{\"./default\":1,\"./parser\":3,\"./util\":4,cssfilter:8}],6:[function(require,module,exports){var DEFAULT=require(\"./default\");var parseStyle=require(\"./parser\");var _=require(\"./util\");function isNull(obj){return obj===undefined||obj===null}function shallowCopyObject(obj){var ret={};for(var i in obj){ret[i]=obj[i]}return ret}function FilterCSS(options){options=shallowCopyObject(options||{});options.whiteList=options.whiteList||DEFAULT.whiteList;options.onAttr=options.onAttr||DEFAULT.onAttr;options.onIgnoreAttr=options.onIgnoreAttr||DEFAULT.onIgnoreAttr;options.safeAttrValue=options.safeAttrValue||DEFAULT.safeAttrValue;this.options=options}FilterCSS.prototype.process=function(css){css=css||\"\";css=css.toString();if(!css)return\"\";var me=this;var options=me.options;var whiteList=options.whiteList;var onAttr=options.onAttr;var onIgnoreAttr=options.onIgnoreAttr;var safeAttrValue=options.safeAttrValue;var retCSS=parseStyle(css,function(sourcePosition,position,name,value,source){var check=whiteList[name];var isWhite=false;if(check===true)isWhite=check;else if(typeof check===\"function\")isWhite=check(value);else if(check instanceof RegExp)isWhite=check.test(value);if(isWhite!==true)isWhite=false;value=safeAttrValue(name,value);if(!value)return;var opts={position:position,sourcePosition:sourcePosition,source:source,isWhite:isWhite};if(isWhite){var ret=onAttr(name,value,opts);if(isNull(ret)){return name+\":\"+value}else{return ret}}else{var ret=onIgnoreAttr(name,value,opts);if(!isNull(ret)){return ret}}});return retCSS};module.exports=FilterCSS},{\"./default\":7,\"./parser\":9,\"./util\":10}],7:[function(require,module,exports){function getDefaultWhiteList(){var whiteList={};whiteList[\"align-content\"]=false;whiteList[\"align-items\"]=false;whiteList[\"align-self\"]=false;whiteList[\"alignment-adjust\"]=false;whiteList[\"alignment-baseline\"]=false;whiteList[\"all\"]=false;whiteList[\"anchor-point\"]=false;whiteList[\"animation\"]=false;whiteList[\"animation-delay\"]=false;whiteList[\"animation-direction\"]=false;whiteList[\"animation-duration\"]=false;whiteList[\"animation-fill-mode\"]=false;whiteList[\"animation-iteration-count\"]=false;whiteList[\"animation-name\"]=false;whiteList[\"animation-play-state\"]=false;whiteList[\"animation-timing-function\"]=false;whiteList[\"azimuth\"]=false;whiteList[\"backface-visibility\"]=false;whiteList[\"background\"]=true;whiteList[\"background-attachment\"]=true;whiteList[\"background-clip\"]=true;whiteList[\"background-color\"]=true;whiteList[\"background-image\"]=true;whiteList[\"background-origin\"]=true;whiteList[\"background-position\"]=true;whiteList[\"background-repeat\"]=true;whiteList[\"background-size\"]=true;whiteList[\"baseline-shift\"]=false;whiteList[\"binding\"]=false;whiteList[\"bleed\"]=false;whiteList[\"bookmark-label\"]=false;whiteList[\"bookmark-level\"]=false;whiteList[\"bookmark-state\"]=false;whiteList[\"border\"]=true;whiteList[\"border-bottom\"]=true;whiteList[\"border-bottom-color\"]=true;whiteList[\"border-bottom-left-radius\"]=true;whiteList[\"border-bottom-right-radius\"]=true;whiteList[\"border-bottom-style\"]=true;whiteList[\"border-bottom-width\"]=true;whiteList[\"border-collapse\"]=true;whiteList[\"border-color\"]=true;whiteList[\"border-image\"]=true;whiteList[\"border-image-outset\"]=true;whiteList[\"border-image-repeat\"]=true;whiteList[\"border-image-slice\"]=true;whiteList[\"border-image-source\"]=true;whiteList[\"border-image-width\"]=true;whiteList[\"border-left\"]=true;whiteList[\"border-left-color\"]=true;whiteList[\"border-left-style\"]=true;whiteList[\"border-left-width\"]=true;whiteList[\"border-radius\"]=true;whiteList[\"border-right\"]=true;whiteList[\"border-right-color\"]=true;whiteList[\"border-right-style\"]=true;whiteList[\"border-right-width\"]=true;whiteList[\"border-spacing\"]=true;whiteList[\"border-style\"]=true;whiteList[\"border-top\"]=true;whiteList[\"border-top-color\"]=true;whiteList[\"border-top-left-radius\"]=true;whiteList[\"border-top-right-radius\"]=true;whiteList[\"border-top-style\"]=true;whiteList[\"border-top-width\"]=true;whiteList[\"border-width\"]=true;whiteList[\"bottom\"]=false;whiteList[\"box-decoration-break\"]=true;whiteList[\"box-shadow\"]=true;whiteList[\"box-sizing\"]=true;whiteList[\"box-snap\"]=true;whiteList[\"box-suppress\"]=true;whiteList[\"break-after\"]=true;whiteList[\"break-before\"]=true;whiteList[\"break-inside\"]=true;whiteList[\"caption-side\"]=false;whiteList[\"chains\"]=false;whiteList[\"clear\"]=true;whiteList[\"clip\"]=false;whiteList[\"clip-path\"]=false;whiteList[\"clip-rule\"]=false;whiteList[\"color\"]=true;whiteList[\"color-interpolation-filters\"]=true;whiteList[\"column-count\"]=false;whiteList[\"column-fill\"]=false;whiteList[\"column-gap\"]=false;whiteList[\"column-rule\"]=false;whiteList[\"column-rule-color\"]=false;whiteList[\"column-rule-style\"]=false;whiteList[\"column-rule-width\"]=false;whiteList[\"column-span\"]=false;whiteList[\"column-width\"]=false;whiteList[\"columns\"]=false;whiteList[\"contain\"]=false;whiteList[\"content\"]=false;whiteList[\"counter-increment\"]=false;whiteList[\"counter-reset\"]=false;whiteList[\"counter-set\"]=false;whiteList[\"crop\"]=false;whiteList[\"cue\"]=false;whiteList[\"cue-after\"]=false;whiteList[\"cue-before\"]=false;whiteList[\"cursor\"]=false;whiteList[\"direction\"]=false;whiteList[\"display\"]=true;whiteList[\"display-inside\"]=true;whiteList[\"display-list\"]=true;whiteList[\"display-outside\"]=true;whiteList[\"dominant-baseline\"]=false;whiteList[\"elevation\"]=false;whiteList[\"empty-cells\"]=false;whiteList[\"filter\"]=false;whiteList[\"flex\"]=false;whiteList[\"flex-basis\"]=false;whiteList[\"flex-direction\"]=false;whiteList[\"flex-flow\"]=false;whiteList[\"flex-grow\"]=false;whiteList[\"flex-shrink\"]=false;whiteList[\"flex-wrap\"]=false;whiteList[\"float\"]=false;whiteList[\"float-offset\"]=false;whiteList[\"flood-color\"]=false;whiteList[\"flood-opacity\"]=false;whiteList[\"flow-from\"]=false;whiteList[\"flow-into\"]=false;whiteList[\"font\"]=true;whiteList[\"font-family\"]=true;whiteList[\"font-feature-settings\"]=true;whiteList[\"font-kerning\"]=true;whiteList[\"font-language-override\"]=true;whiteList[\"font-size\"]=true;whiteList[\"font-size-adjust\"]=true;whiteList[\"font-stretch\"]=true;whiteList[\"font-style\"]=true;whiteList[\"font-synthesis\"]=true;whiteList[\"font-variant\"]=true;whiteList[\"font-variant-alternates\"]=true;whiteList[\"font-variant-caps\"]=true;whiteList[\"font-variant-east-asian\"]=true;whiteList[\"font-variant-ligatures\"]=true;whiteList[\"font-variant-numeric\"]=true;whiteList[\"font-variant-position\"]=true;whiteList[\"font-weight\"]=true;whiteList[\"grid\"]=false;whiteList[\"grid-area\"]=false;whiteList[\"grid-auto-columns\"]=false;whiteList[\"grid-auto-flow\"]=false;whiteList[\"grid-auto-rows\"]=false;whiteList[\"grid-column\"]=false;whiteList[\"grid-column-end\"]=false;whiteList[\"grid-column-start\"]=false;whiteList[\"grid-row\"]=false;whiteList[\"grid-row-end\"]=false;whiteList[\"grid-row-start\"]=false;whiteList[\"grid-template\"]=false;whiteList[\"grid-template-areas\"]=false;whiteList[\"grid-template-columns\"]=false;whiteList[\"grid-template-rows\"]=false;whiteList[\"hanging-punctuation\"]=false;whiteList[\"height\"]=true;whiteList[\"hyphens\"]=false;whiteList[\"icon\"]=false;whiteList[\"image-orientation\"]=false;whiteList[\"image-resolution\"]=false;whiteList[\"ime-mode\"]=false;whiteList[\"initial-letters\"]=false;whiteList[\"inline-box-align\"]=false;whiteList[\"justify-content\"]=false;whiteList[\"justify-items\"]=false;whiteList[\"justify-self\"]=false;whiteList[\"left\"]=false;whiteList[\"letter-spacing\"]=true;whiteList[\"lighting-color\"]=true;whiteList[\"line-box-contain\"]=false;whiteList[\"line-break\"]=false;whiteList[\"line-grid\"]=false;whiteList[\"line-height\"]=false;whiteList[\"line-snap\"]=false;whiteList[\"line-stacking\"]=false;whiteList[\"line-stacking-ruby\"]=false;whiteList[\"line-stacking-shift\"]=false;whiteList[\"line-stacking-strategy\"]=false;whiteList[\"list-style\"]=true;whiteList[\"list-style-image\"]=true;whiteList[\"list-style-position\"]=true;whiteList[\"list-style-type\"]=true;whiteList[\"margin\"]=true;whiteList[\"margin-bottom\"]=true;whiteList[\"margin-left\"]=true;whiteList[\"margin-right\"]=true;whiteList[\"margin-top\"]=true;whiteList[\"marker-offset\"]=false;whiteList[\"marker-side\"]=false;whiteList[\"marks\"]=false;whiteList[\"mask\"]=false;whiteList[\"mask-box\"]=false;whiteList[\"mask-box-outset\"]=false;whiteList[\"mask-box-repeat\"]=false;whiteList[\"mask-box-slice\"]=false;whiteList[\"mask-box-source\"]=false;whiteList[\"mask-box-width\"]=false;whiteList[\"mask-clip\"]=false;whiteList[\"mask-image\"]=false;whiteList[\"mask-origin\"]=false;whiteList[\"mask-position\"]=false;whiteList[\"mask-repeat\"]=false;whiteList[\"mask-size\"]=false;whiteList[\"mask-source-type\"]=false;whiteList[\"mask-type\"]=false;whiteList[\"max-height\"]=true;whiteList[\"max-lines\"]=false;whiteList[\"max-width\"]=true;whiteList[\"min-height\"]=true;whiteList[\"min-width\"]=true;whiteList[\"move-to\"]=false;whiteList[\"nav-down\"]=false;whiteList[\"nav-index\"]=false;whiteList[\"nav-left\"]=false;whiteList[\"nav-right\"]=false;whiteList[\"nav-up\"]=false;whiteList[\"object-fit\"]=false;whiteList[\"object-position\"]=false;whiteList[\"opacity\"]=false;whiteList[\"order\"]=false;whiteList[\"orphans\"]=false;whiteList[\"outline\"]=false;whiteList[\"outline-color\"]=false;whiteList[\"outline-offset\"]=false;whiteList[\"outline-style\"]=false;whiteList[\"outline-width\"]=false;whiteList[\"overflow\"]=false;whiteList[\"overflow-wrap\"]=false;whiteList[\"overflow-x\"]=false;whiteList[\"overflow-y\"]=false;whiteList[\"padding\"]=true;whiteList[\"padding-bottom\"]=true;whiteList[\"padding-left\"]=true;whiteList[\"padding-right\"]=true;whiteList[\"padding-top\"]=true;whiteList[\"page\"]=false;whiteList[\"page-break-after\"]=false;whiteList[\"page-break-before\"]=false;whiteList[\"page-break-inside\"]=false;whiteList[\"page-policy\"]=false;whiteList[\"pause\"]=false;whiteList[\"pause-after\"]=false;whiteList[\"pause-before\"]=false;whiteList[\"perspective\"]=false;whiteList[\"perspective-origin\"]=false;whiteList[\"pitch\"]=false;whiteList[\"pitch-range\"]=false;whiteList[\"play-during\"]=false;whiteList[\"position\"]=false;whiteList[\"presentation-level\"]=false;whiteList[\"quotes\"]=false;whiteList[\"region-fragment\"]=false;whiteList[\"resize\"]=false;whiteList[\"rest\"]=false;whiteList[\"rest-after\"]=false;whiteList[\"rest-before\"]=false;whiteList[\"richness\"]=false;whiteList[\"right\"]=false;whiteList[\"rotation\"]=false;whiteList[\"rotation-point\"]=false;whiteList[\"ruby-align\"]=false;whiteList[\"ruby-merge\"]=false;whiteList[\"ruby-position\"]=false;whiteList[\"shape-image-threshold\"]=false;whiteList[\"shape-outside\"]=false;whiteList[\"shape-margin\"]=false;whiteList[\"size\"]=false;whiteList[\"speak\"]=false;whiteList[\"speak-as\"]=false;whiteList[\"speak-header\"]=false;whiteList[\"speak-numeral\"]=false;whiteList[\"speak-punctuation\"]=false;whiteList[\"speech-rate\"]=false;whiteList[\"stress\"]=false;whiteList[\"string-set\"]=false;whiteList[\"tab-size\"]=false;whiteList[\"table-layout\"]=false;whiteList[\"text-align\"]=true;whiteList[\"text-align-last\"]=true;whiteList[\"text-combine-upright\"]=true;whiteList[\"text-decoration\"]=true;whiteList[\"text-decoration-color\"]=true;whiteList[\"text-decoration-line\"]=true;whiteList[\"text-decoration-skip\"]=true;whiteList[\"text-decoration-style\"]=true;whiteList[\"text-emphasis\"]=true;whiteList[\"text-emphasis-color\"]=true;whiteList[\"text-emphasis-position\"]=true;whiteList[\"text-emphasis-style\"]=true;whiteList[\"text-height\"]=true;whiteList[\"text-indent\"]=true;whiteList[\"text-justify\"]=true;whiteList[\"text-orientation\"]=true;whiteList[\"text-overflow\"]=true;whiteList[\"text-shadow\"]=true;whiteList[\"text-space-collapse\"]=true;whiteList[\"text-transform\"]=true;whiteList[\"text-underline-position\"]=true;whiteList[\"text-wrap\"]=true;whiteList[\"top\"]=false;whiteList[\"transform\"]=false;whiteList[\"transform-origin\"]=false;whiteList[\"transform-style\"]=false;whiteList[\"transition\"]=false;whiteList[\"transition-delay\"]=false;whiteList[\"transition-duration\"]=false;whiteList[\"transition-property\"]=false;whiteList[\"transition-timing-function\"]=false;whiteList[\"unicode-bidi\"]=false;whiteList[\"vertical-align\"]=false;whiteList[\"visibility\"]=false;whiteList[\"voice-balance\"]=false;whiteList[\"voice-duration\"]=false;whiteList[\"voice-family\"]=false;whiteList[\"voice-pitch\"]=false;whiteList[\"voice-range\"]=false;whiteList[\"voice-rate\"]=false;whiteList[\"voice-stress\"]=false;whiteList[\"voice-volume\"]=false;whiteList[\"volume\"]=false;whiteList[\"white-space\"]=false;whiteList[\"widows\"]=false;whiteList[\"width\"]=true;whiteList[\"will-change\"]=false;whiteList[\"word-break\"]=true;whiteList[\"word-spacing\"]=true;whiteList[\"word-wrap\"]=true;whiteList[\"wrap-flow\"]=false;whiteList[\"wrap-through\"]=false;whiteList[\"writing-mode\"]=false;whiteList[\"z-index\"]=false;return whiteList}function onAttr(name,value,options){}function onIgnoreAttr(name,value,options){}var REGEXP_URL_JAVASCRIPT=/javascript\\s*\\:/gim;function safeAttrValue(name,value){if(REGEXP_URL_JAVASCRIPT.test(value))return\"\";return value}exports.whiteList=getDefaultWhiteList();exports.getDefaultWhiteList=getDefaultWhiteList;exports.onAttr=onAttr;exports.onIgnoreAttr=onIgnoreAttr;exports.safeAttrValue=safeAttrValue},{}],8:[function(require,module,exports){var DEFAULT=require(\"./default\");var FilterCSS=require(\"./css\");function filterCSS(html,options){var xss=new FilterCSS(options);return xss.process(html)}exports=module.exports=filterCSS;exports.FilterCSS=FilterCSS;for(var i in DEFAULT)exports[i]=DEFAULT[i];if(typeof window!==\"undefined\"){window.filterCSS=module.exports}},{\"./css\":6,\"./default\":7}],9:[function(require,module,exports){var _=require(\"./util\");function parseStyle(css,onAttr){css=_.trimRight(css);if(css[css.length-1]!==\";\")css+=\";\";var cssLength=css.length;var isParenthesisOpen=false;var lastPos=0;var i=0;var retCSS=\"\";function addNewAttr(){if(!isParenthesisOpen){var source=_.trim(css.slice(lastPos,i));var j=source.indexOf(\":\");if(j!==-1){var name=_.trim(source.slice(0,j));var value=_.trim(source.slice(j+1));if(name){var ret=onAttr(lastPos,retCSS.length,name,value,source);if(ret)retCSS+=ret+\"; \"}}}lastPos=i+1}for(;i<cssLength;i++){var c=css[i];if(c===\"/\"&&css[i+1]===\"*\"){var j=css.indexOf(\"*/\",i+2);if(j===-1)break;i=j+1;lastPos=i+1;isParenthesisOpen=false}else if(c===\"(\"){isParenthesisOpen=true}else if(c===\")\"){isParenthesisOpen=false}else if(c===\";\"){if(isParenthesisOpen){}else{addNewAttr()}}else if(c===\"\\n\"){addNewAttr()}}return _.trim(retCSS)}module.exports=parseStyle},{\"./util\":10}],10:[function(require,module,exports){module.exports={indexOf:function(arr,item){var i,j;if(Array.prototype.indexOf){return arr.indexOf(item)}for(i=0,j=arr.length;i<j;i++){if(arr[i]===item){return i}}return-1},forEach:function(arr,fn,scope){var i,j;if(Array.prototype.forEach){return arr.forEach(fn,scope)}for(i=0,j=arr.length;i<j;i++){fn.call(scope,arr[i],i,arr)}},trim:function(str){if(String.prototype.trim){return str.trim()}return str.replace(/(^\\s*)|(\\s*$)/g,\"\")},trimRight:function(str){if(String.prototype.trimRight){return str.trimRight()}return str.replace(/(\\s*$)/g,\"\")}}},{}]},{},[2]);\ndefine(\"lib/xss.min.js\", function(){});\n\n", "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define('lib/fetch.umd.js',['exports'], factory) :\n (factory((global.WHATWGFetch = {})));\n}(this, (function (exports) { 'use strict';\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n", "define('UVDataProvider',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var UVDataProvider = /** @class */ (function () {\r\n function UVDataProvider(readonly) {\r\n this.readonly = false;\r\n this.readonly = readonly;\r\n }\r\n UVDataProvider.prototype.get = function (key, defaultValue) {\r\n return null;\r\n };\r\n UVDataProvider.prototype.set = function (key, value) {\r\n };\r\n return UVDataProvider;\r\n }());\r\n exports.UVDataProvider = UVDataProvider;\r\n});\r\n//# sourceMappingURL=UVDataProvider.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('URLDataProvider',[\"require\", \"exports\", \"./UVDataProvider\"], function (require, exports, UVDataProvider_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var URLDataProvider = /** @class */ (function (_super) {\r\n __extends(URLDataProvider, _super);\r\n function URLDataProvider(readonly) {\r\n return _super.call(this, readonly) || this;\r\n }\r\n URLDataProvider.prototype.get = function (key, defaultValue) {\r\n return Utils.Urls.getHashParameter(key, document) || defaultValue;\r\n };\r\n URLDataProvider.prototype.set = function (key, value) {\r\n if (!this.readonly) {\r\n if (value) {\r\n Utils.Urls.setHashParameter(key, value.toString(), document);\r\n }\r\n else {\r\n Utils.Urls.setHashParameter(key, '', document);\r\n }\r\n }\r\n };\r\n return URLDataProvider;\r\n }(UVDataProvider_1.UVDataProvider));\r\n exports.default = URLDataProvider;\r\n});\r\n//# sourceMappingURL=URLDataProvider.js.map\n", "!function(i,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(\"vocabulary\",[],e):\"object\"==typeof exports?exports.vocabulary=e():i.vocabulary=e()}(\"undefined\"!=typeof self?self:this,function(){return function(i){var e={};function t(o){if(e[o])return e[o].exports;var a=e[o]={i:o,l:!1,exports:{}};return i[o].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=i,t.c=e,t.d=function(i,e,o){t.o(i,e)||Object.defineProperty(i,e,{enumerable:!0,get:o})},t.r=function(i){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(i,\"__esModule\",{value:!0})},t.t=function(i,e){if(1&e&&(i=t(i)),8&e)return i;if(4&e&&\"object\"==typeof i&&i&&i.__esModule)return i;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,\"default\",{enumerable:!0,value:i}),2&e&&\"string\"!=typeof i)for(var a in i)t.d(o,a,function(e){return i[e]}.bind(null,a));return o},t.n=function(i){var e=i&&i.__esModule?function(){return i.default}:function(){return i};return t.d(e,\"a\",e),e},t.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},t.p=\"\",t(t.s=0)}([function(i,e,t){i.exports=t(1)},function(i,e,t){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),function(i){i.BOOKMARKING=\"oa:bookmarking\",i.CLASSIFYING=\"oa:classifying\",i.COMMENTING=\"oa:commenting\",i.DESCRIBING=\"oa:describing\",i.EDITING=\"oa:editing\",i.HIGHLIGHTING=\"oa:highlighting\",i.IDENTIFYING=\"oa:identifying\",i.LINKING=\"oa:linking\",i.MODERATING=\"oa:moderating\",i.PAINTING=\"sc:painting\",i.QUESTIONING=\"oa:questioning\",i.REPLYING=\"oa:replying\",i.TAGGING=\"oa:tagging\",i.TRANSCRIBING=\"oad:transcribing\"}(e.AnnotationMotivation||(e.AnnotationMotivation={})),function(i){i.AUTO_ADVANCE=\"auto-advance\",i.CONTINUOUS=\"continuous\",i.FACING_PAGES=\"facing-pages\",i.HIDDEN=\"hidden\",i.INDIVIDUALS=\"individuals\",i.MULTI_PART=\"multi-part\",i.NO_NAV=\"no-nav\",i.NON_PAGED=\"non-paged\",i.PAGED=\"paged\",i.REPEAT=\"repeat\",i.SEQUENCE=\"sequence\",i.THUMBNAIL_NAV=\"thumbnail-nav\",i.TOGETHER=\"together\",i.UNORDERED=\"unordered\"}(e.Behavior||(e.Behavior={})),function(i){i.CANVAS=\"canvas\",i.CHOICE=\"choice\",i.OA_CHOICE=\"oa:choice\",i.CONTENT_AS_TEXT=\"contentastext\",i.DATASET=\"dataset\",i.DOCUMENT=\"document\",i.IMAGE=\"image\",i.MODEL=\"model\",i.MOVING_IMAGE=\"movingimage\",i.PDF=\"pdf\",i.PHYSICAL_OBJECT=\"physicalobject\",i.SOUND=\"sound\",i.TEXT=\"text\",i.TEXTUALBODY=\"textualbody\",i.VIDEO=\"video\"}(e.ExternalResourceType||(e.ExternalResourceType={})),function(i){i.ANNOTATION=\"annotation\",i.CANVAS=\"canvas\",i.COLLECTION=\"collection\",i.MANIFEST=\"manifest\",i.RANGE=\"range\",i.SEQUENCE=\"sequence\"}(e.IIIFResourceType||(e.IIIFResourceType={})),function(i){i.AUDIO_MP4=\"audio/mp4\",i.CORTO=\"application/corto\",i.DICOM=\"application/dicom\",i.DRACO=\"application/draco\",i.EPUB=\"application/epub+zip\",i.GLB=\"model/gltf-binary\",i.GLTF=\"model/gltf+json\",i.IIIF_PRESENTATION_2='application/ld+json;profile=\"http://iiif.io/api/presentation/2/context.json\"',i.IIIF_PRESENTATION_3='application/ld+json;profile=\"http://iiif.io/api/presentation/3/context.json\"',i.JPG=\"image/jpeg\",i.M3U8=\"application/vnd.apple.mpegurl\",i.MP3=\"audio/mp3\",i.MPEG_DASH=\"application/dash+xml\",i.OBJ=\"text/plain\",i.OPF=\"application/oebps-package+xml\",i.PDF=\"application/pdf\",i.PLY=\"application/ply\",i.THREEJS=\"application/vnd.threejs+json\",i.USDZ=\"model/vnd.usd+zip\",i.VIDEO_MP4=\"video/mp4\",i.WEBM=\"video/webm\"}(e.MediaType||(e.MediaType={})),function(i){i.DOC=\"application/msword\",i.DOCX=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",i.PDF=\"application/pdf\"}(e.RenderingFormat||(e.RenderingFormat={})),function(i){i.IMAGE_0_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/compliance.html#level0\",i.IMAGE_0_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/compliance.html#level1\",i.IMAGE_0_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/compliance.html#level2\",i.IMAGE_0_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/conformance.html#level0\",i.IMAGE_0_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/conformance.html#level1\",i.IMAGE_0_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/conformance.html#level2\",i.IMAGE_1_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\",i.IMAGE_1_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1\",i.IMAGE_1_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2\",i.IMAGE_1_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0\",i.IMAGE_1_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1\",i.IMAGE_1_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2\",i.IMAGE_1_LEVEL_0=\"http://iiif.io/api/image/1/level0.json\",i.IMAGE_1_PROFILE_LEVEL_0=\"http://iiif.io/api/image/1/profiles/level0.json\",i.IMAGE_1_LEVEL_1=\"http://iiif.io/api/image/1/level1.json\",i.IMAGE_1_PROFILE_LEVEL_1=\"http://iiif.io/api/image/1/profiles/level1.json\",i.IMAGE_1_LEVEL_2=\"http://iiif.io/api/image/1/level2.json\",i.IMAGE_1_PROFILE_LEVEL_2=\"http://iiif.io/api/image/1/profiles/level2.json\",i.IMAGE_2_LEVEL_0=\"http://iiif.io/api/image/2/level0.json\",i.IMAGE_2_PROFILE_LEVEL_0=\"http://iiif.io/api/image/2/profiles/level0.json\",i.IMAGE_2_LEVEL_1=\"http://iiif.io/api/image/2/level1.json\",i.IMAGE_2_PROFILE_LEVEL_1=\"http://iiif.io/api/image/2/profiles/level1.json\",i.IMAGE_2_LEVEL_2=\"http://iiif.io/api/image/2/level2.json\",i.IMAGE_2_PROFILE_LEVEL_2=\"http://iiif.io/api/image/2/profiles/level2.json\",i.AUTH_0_CLICK_THROUGH=\"http://iiif.io/api/auth/0/login/clickthrough\",i.AUTH_0_LOGIN=\"http://iiif.io/api/auth/0/login\",i.AUTH_0_LOGOUT=\"http://iiif.io/api/auth/0/logout\",i.AUTH_0_RESTRICTED=\"http://iiif.io/api/auth/0/login/restricted\",i.AUTH_0_TOKEN=\"http://iiif.io/api/auth/0/token\",i.AUTH_1_CLICK_THROUGH=\"http://iiif.io/api/auth/1/clickthrough\",i.AUTH_1_EXTERNAL=\"http://iiif.io/api/auth/1/external\",i.AUTH_1_KIOSK=\"http://iiif.io/api/auth/1/kiosk\",i.AUTH_1_LOGIN=\"http://iiif.io/api/auth/1/login\",i.AUTH_1_LOGOUT=\"http://iiif.io/api/auth/1/logout\",i.AUTH_1_PROBE=\"http://iiif.io/api/auth/1/probe\",i.AUTH_1_TOKEN=\"http://iiif.io/api/auth/1/token\",i.SEARCH_0=\"http://iiif.io/api/search/0/search\",i.SEARCH_0_AUTO_COMPLETE=\"http://iiif.io/api/search/0/autocomplete\",i.SEARCH_1=\"http://iiif.io/api/search/1/search\",i.SEARCH_1_AUTO_COMPLETE=\"http://iiif.io/api/search/1/autocomplete\",i.TRACKING_EXTENSIONS=\"http://universalviewer.io/tracking-extensions-profile\",i.UI_EXTENSIONS=\"http://universalviewer.io/ui-extensions-profile\",i.PRINT_EXTENSIONS=\"http://universalviewer.io/print-extensions-profile\",i.SHARE_EXTENSIONS=\"http://universalviewer.io/share-extensions-profile\",i.OTHER_MANIFESTATIONS=\"http://iiif.io/api/otherManifestations.json\",i.IXIF=\"http://wellcomelibrary.org/ld/ixif/0/alpha.json\"}(e.ServiceProfile||(e.ServiceProfile={})),function(i){i.BOTTOM_TO_TOP=\"bottom-to-top\",i.LEFT_TO_RIGHT=\"left-to-right\",i.RIGHT_TO_LEFT=\"right-to-left\",i.TOP_TO_BOTTOM=\"top-to-bottom\"}(e.ViewingDirection||(e.ViewingDirection={})),function(i){i.CONTINUOUS=\"continuous\",i.INDIVIDUALS=\"individuals\",i.NON_PAGED=\"non-paged\",i.PAGED=\"paged\",i.TOP=\"top\"}(e.ViewingHint||(e.ViewingHint={}))}])});\n//# sourceMappingURL=vocabulary.js.map\ndefine(\"lib/vocabulary.js\", function(){});\n\n", "define('modules/uv-shared-module/BaseEvents',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var BaseEvents = /** @class */ (function () {\r\n function BaseEvents() {\r\n }\r\n BaseEvents.ACCEPT_TERMS = 'acceptTerms';\r\n BaseEvents.ANNOTATION_CANVAS_CHANGED = 'annotationCanvasChanged';\r\n BaseEvents.ANNOTATION_CHANGED = 'annotationChanged';\r\n BaseEvents.ANNOTATIONS_CLEARED = 'annotationsCleared';\r\n BaseEvents.ANNOTATIONS_EMPTY = 'annotationsEmpty';\r\n BaseEvents.ANNOTATIONS = 'annotations';\r\n BaseEvents.BOOKMARK = 'bookmark';\r\n BaseEvents.CANVAS_INDEX_CHANGE_FAILED = 'canvasIndexChangeFailed';\r\n BaseEvents.CANVAS_INDEX_CHANGED = 'canvasIndexChanged';\r\n BaseEvents.CLEAR_ANNOTATIONS = 'clearAnnotations';\r\n BaseEvents.CLICKTHROUGH = 'clickthrough';\r\n BaseEvents.CLOSE_ACTIVE_DIALOGUE = 'closeActiveDialogue';\r\n BaseEvents.CLOSE_LEFT_PANEL = 'closeLeftPanel';\r\n BaseEvents.CLOSE_RIGHT_PANEL = 'closeRightPanel';\r\n BaseEvents.COLLECTION_INDEX_CHANGED = 'collectionIndexChanged';\r\n BaseEvents.CREATE = 'create';\r\n BaseEvents.CREATED = 'created';\r\n BaseEvents.DOWN_ARROW = 'downArrow';\r\n BaseEvents.DOWNLOAD = 'download';\r\n BaseEvents.DROP = 'drop';\r\n BaseEvents.END = 'end';\r\n BaseEvents.ERROR = 'error';\r\n BaseEvents.ESCAPE = 'escape';\r\n BaseEvents.EXIT_FULLSCREEN = 'exitFullScreen';\r\n BaseEvents.EXTERNAL_LINK_CLICKED = 'externalLinkClicked';\r\n BaseEvents.FEEDBACK = 'feedback';\r\n BaseEvents.FIRST = 'first';\r\n BaseEvents.FORBIDDEN = 'forbidden';\r\n BaseEvents.GALLERY_DECREASE_SIZE = 'galleryDecreaseSize';\r\n BaseEvents.GALLERY_INCREASE_SIZE = 'galleryIncreaseSize';\r\n BaseEvents.GALLERY_THUMB_SELECTED = 'galleryThumbSelected';\r\n BaseEvents.HIDE_AUTH_DIALOGUE = 'hideAuthDialogue';\r\n BaseEvents.HIDE_CLICKTHROUGH_DIALOGUE = 'hideClickthroughDialogue';\r\n BaseEvents.HIDE_DOWNLOAD_DIALOGUE = 'hideDownloadDialogue';\r\n BaseEvents.HIDE_EMBED_DIALOGUE = 'hideEmbedDialogue';\r\n BaseEvents.HIDE_EXTERNALCONTENT_DIALOGUE = 'hideExternalContentDialogue';\r\n BaseEvents.HIDE_GENERIC_DIALOGUE = 'hideGenericDialogue';\r\n BaseEvents.HIDE_HELP_DIALOGUE = 'hideHelpDialogue';\r\n BaseEvents.HIDE_INFORMATION = 'hideInformation';\r\n BaseEvents.HIDE_LOGIN_DIALOGUE = 'hideLoginDialogue';\r\n BaseEvents.HIDE_MOREINFO_DIALOGUE = 'hideMoreInfoDialogue';\r\n BaseEvents.HIDE_MULTISELECT_DIALOGUE = 'hideMultiSelectDialogue';\r\n BaseEvents.HIDE_OVERLAY = 'hideOverlay';\r\n BaseEvents.HIDE_RESTRICTED_DIALOGUE = 'hideRestrictedDialogue';\r\n BaseEvents.HIDE_SETTINGS_DIALOGUE = 'hideSettingsDialogue';\r\n BaseEvents.HIDE_SHARE_DIALOGUE = 'hideShareDialogue';\r\n BaseEvents.HOME = 'home';\r\n BaseEvents.LAST = 'last';\r\n BaseEvents.LEFT_ARROW = 'leftArrow';\r\n BaseEvents.LEFTPANEL_COLLAPSE_FULL_FINISH = 'leftPanelCollapseFullFinish';\r\n BaseEvents.LEFTPANEL_COLLAPSE_FULL_START = 'leftPanelCollapseFullStart';\r\n BaseEvents.LEFTPANEL_EXPAND_FULL_FINISH = 'leftPanelExpandFullFinish';\r\n BaseEvents.LEFTPANEL_EXPAND_FULL_START = 'leftPanelExpandFullStart';\r\n BaseEvents.LOAD_FAILED = 'loadFailed';\r\n BaseEvents.LOGIN_FAILED = 'loginFailed';\r\n BaseEvents.LOGIN = 'login';\r\n BaseEvents.LOGOUT = 'logout';\r\n BaseEvents.MANIFEST_INDEX_CHANGED = 'manifestIndexChanged';\r\n BaseEvents.METRIC_CHANGED = 'metricChanged';\r\n BaseEvents.MINUS = 'minus';\r\n BaseEvents.MULTISELECT_CHANGE = 'multiSelectChange';\r\n BaseEvents.MULTISELECTION_MADE = 'multiSelectionMade';\r\n BaseEvents.NEXT = 'next';\r\n BaseEvents.NOT_FOUND = 'notFound';\r\n BaseEvents.OPEN_EXTERNAL_RESOURCE = 'openExternalResource';\r\n BaseEvents.OPEN_LEFT_PANEL = 'openLeftPanel';\r\n BaseEvents.OPEN_RIGHT_PANEL = 'openRightPanel';\r\n BaseEvents.OPEN_THUMBS_VIEW = 'openThumbsView';\r\n BaseEvents.OPEN_TREE_VIEW = 'openTreeView';\r\n BaseEvents.OPEN = 'open';\r\n BaseEvents.PAGE_DOWN = 'pageDown';\r\n BaseEvents.PAGE_UP = 'pageUp';\r\n BaseEvents.PLUS = 'plus';\r\n BaseEvents.PREV = 'prev';\r\n BaseEvents.RANGE_CHANGED = 'rangeChanged';\r\n BaseEvents.REDIRECT = 'redirect';\r\n BaseEvents.REFRESH = 'refresh';\r\n BaseEvents.RELOAD = 'reload';\r\n BaseEvents.RESIZE = 'resize';\r\n BaseEvents.RESOURCE_DEGRADED = 'resourceDegraded';\r\n BaseEvents.RETRY = 'retry';\r\n BaseEvents.RETURN = 'return';\r\n BaseEvents.RIGHT_ARROW = 'rightArrow';\r\n BaseEvents.RIGHTPANEL_COLLAPSE_FULL_FINISH = 'rightPanelCollapseFullFinish';\r\n BaseEvents.RIGHTPANEL_COLLAPSE_FULL_START = 'rightPanelCollapseFullStart';\r\n BaseEvents.RIGHTPANEL_EXPAND_FULL_FINISH = 'rightPanelExpandFullFinish';\r\n BaseEvents.RIGHTPANEL_EXPAND_FULL_START = 'rightPanelExpandFullStart';\r\n BaseEvents.SEQUENCE_INDEX_CHANGED = 'sequenceIndexChanged';\r\n BaseEvents.SETTINGS_CHANGED = 'settingsChanged';\r\n BaseEvents.SHOW_AUTH_DIALOGUE = 'showAuthDialogue';\r\n BaseEvents.SHOW_CLICKTHROUGH_DIALOGUE = 'showClickThroughDialogue';\r\n BaseEvents.SHOW_DOWNLOAD_DIALOGUE = 'showDownloadDialogue';\r\n BaseEvents.SHOW_EMBED_DIALOGUE = 'showEmbedDialogue';\r\n BaseEvents.SHOW_EXTERNALCONTENT_DIALOGUE = 'showExternalContentDialogue';\r\n BaseEvents.SHOW_GENERIC_DIALOGUE = 'showGenericDialogue';\r\n BaseEvents.SHOW_HELP_DIALOGUE = 'showHelpDialogue';\r\n BaseEvents.SHOW_INFORMATION = 'showInformation';\r\n BaseEvents.SHOW_LOGIN_DIALOGUE = 'showLoginDialogue';\r\n BaseEvents.SHOW_MESSAGE = 'showMessage';\r\n BaseEvents.SHOW_MOREINFO_DIALOGUE = 'showMoreInfoDialogue';\r\n BaseEvents.SHOW_MULTISELECT_DIALOGUE = 'showMultiSelectDialogue';\r\n BaseEvents.SHOW_OVERLAY = 'showOverlay';\r\n BaseEvents.SHOW_RESTRICTED_DIALOGUE = 'showRestrictedDialogue';\r\n BaseEvents.SHOW_SETTINGS_DIALOGUE = 'showSettingsDialogue';\r\n BaseEvents.SHOW_SHARE_DIALOGUE = 'showShareDialogue';\r\n BaseEvents.SHOW_TERMS_OF_USE = 'showTermsOfUse';\r\n BaseEvents.THUMB_MULTISELECTED = 'thumbMultiSelected';\r\n BaseEvents.THUMB_SELECTED = 'thumbSelected';\r\n BaseEvents.TOGGLE_EXPAND_LEFT_PANEL = 'toggleExpandLeftPanel';\r\n BaseEvents.TOGGLE_EXPAND_RIGHT_PANEL = 'toggleExpandRightPanel';\r\n BaseEvents.TOGGLE_FULLSCREEN = 'toggleFullScreen';\r\n BaseEvents.TREE_NODE_MULTISELECTED = 'treeNodeMultiSelected';\r\n BaseEvents.TREE_NODE_SELECTED = 'treeNodeSelected';\r\n BaseEvents.UP_ARROW = 'upArrow';\r\n BaseEvents.UPDATE_SETTINGS = 'updateSettings';\r\n BaseEvents.VIEW_FULL_TERMS = 'viewFullTerms';\r\n BaseEvents.WINDOW_UNLOAD = 'windowUnload';\r\n return BaseEvents;\r\n }());\r\n exports.BaseEvents = BaseEvents;\r\n});\r\n//# sourceMappingURL=BaseEvents.js.map\n", "define('modules/uv-shared-module/Panel',[\"require\", \"exports\", \"./BaseEvents\"], function (require, exports, BaseEvents_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Panel = /** @class */ (function () {\r\n function Panel($element, fitToParentWidth, fitToParentHeight) {\r\n this.isResized = false;\r\n this.$element = $element;\r\n this.fitToParentWidth = fitToParentWidth || false;\r\n this.fitToParentHeight = fitToParentHeight || false;\r\n this.create();\r\n }\r\n Panel.prototype.create = function () {\r\n var _this = this;\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RESIZE, function () {\r\n _this.resize();\r\n });\r\n };\r\n Panel.prototype.whenResized = function (cb) {\r\n var _this = this;\r\n Utils.Async.waitFor(function () {\r\n return _this.isResized;\r\n }, cb);\r\n };\r\n Panel.prototype.resize = function () {\r\n var $parent = this.$element.parent();\r\n if (this.fitToParentWidth) {\r\n this.$element.width($parent.width());\r\n }\r\n if (this.fitToParentHeight) {\r\n this.$element.height($parent.height());\r\n }\r\n this.isResized = true;\r\n };\r\n return Panel;\r\n }());\r\n exports.Panel = Panel;\r\n});\r\n//# sourceMappingURL=Panel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/BaseView',[\"require\", \"exports\", \"./Panel\"], function (require, exports, Panel_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var BaseView = /** @class */ (function (_super) {\r\n __extends(BaseView, _super);\r\n function BaseView($element, fitToParentWidth, fitToParentHeight) {\r\n return _super.call(this, $element, fitToParentWidth, fitToParentHeight) || this;\r\n }\r\n BaseView.prototype.create = function () {\r\n this.component = this.$element.closest(\".uv\").data(\"component\");\r\n _super.prototype.create.call(this);\r\n this.extension = this.component.extension;\r\n this.config = {};\r\n this.config.content = {};\r\n this.config.options = {};\r\n var that = this;\r\n // build config inheritance chain\r\n if (that.modules && that.modules.length) {\r\n that.modules = that.modules.reverse();\r\n that.modules.forEach(function (moduleName) {\r\n that.config = $.extend(true, that.config, that.extension.data.config.modules[moduleName]);\r\n });\r\n }\r\n this.content = this.config.content;\r\n this.options = this.config.options;\r\n };\r\n BaseView.prototype.init = function () {\r\n };\r\n BaseView.prototype.setConfig = function (moduleName) {\r\n if (!this.modules) {\r\n this.modules = [];\r\n }\r\n this.modules.push(moduleName);\r\n };\r\n BaseView.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return BaseView;\r\n }(Panel_1.Panel));\r\n exports.BaseView = BaseView;\r\n});\r\n//# sourceMappingURL=BaseView.js.map\n", "define('modules/uv-shared-module/Position',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Position;\r\n (function (Position) {\r\n Position[Position[\"TOP_LEFT\"] = 0] = \"TOP_LEFT\";\r\n Position[Position[\"TOP_CENTER\"] = 1] = \"TOP_CENTER\";\r\n Position[Position[\"TOP_RIGHT\"] = 2] = \"TOP_RIGHT\";\r\n Position[Position[\"CENTER_LEFT\"] = 3] = \"CENTER_LEFT\";\r\n Position[Position[\"CENTER\"] = 4] = \"CENTER\";\r\n Position[Position[\"CENTER_RIGHT\"] = 5] = \"CENTER_RIGHT\";\r\n Position[Position[\"BOTTOM_LEFT\"] = 6] = \"BOTTOM_LEFT\";\r\n Position[Position[\"BOTTOM_CENTER\"] = 7] = \"BOTTOM_CENTER\";\r\n Position[Position[\"BOTTOM_RIGHT\"] = 8] = \"BOTTOM_RIGHT\";\r\n })(Position = exports.Position || (exports.Position = {}));\r\n});\r\n//# sourceMappingURL=Position.js.map\n", "define('Utils',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var UVUtils = /** @class */ (function () {\r\n function UVUtils() {\r\n }\r\n UVUtils.sanitize = function (html) {\r\n return filterXSS(html, {\r\n whiteList: {\r\n a: [\"href\", \"title\", \"target\", \"class\"],\r\n b: [],\r\n br: [],\r\n i: [],\r\n img: [\"src\", \"alt\"],\r\n p: [],\r\n small: [],\r\n span: [],\r\n strong: [],\r\n sub: [],\r\n sup: []\r\n }\r\n });\r\n };\r\n UVUtils.isValidUrl = function (value) {\r\n var a = document.createElement('a');\r\n a.href = value;\r\n return (!!a.host && a.host !== window.location.host);\r\n };\r\n UVUtils.propertiesChanged = function (newData, currentData, properties) {\r\n var propChanged = false;\r\n for (var i = 0; i < properties.length; i++) {\r\n propChanged = UVUtils.propertyChanged(newData, currentData, properties[i]);\r\n if (propChanged) {\r\n break;\r\n }\r\n }\r\n return propChanged;\r\n };\r\n UVUtils.propertyChanged = function (newData, currentData, propertyName) {\r\n return currentData[propertyName] !== newData[propertyName];\r\n };\r\n return UVUtils;\r\n }());\r\n exports.UVUtils = UVUtils;\r\n});\r\n//# sourceMappingURL=Utils.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/CenterPanel',[\"require\", \"exports\", \"./BaseView\", \"./Position\", \"../../Utils\"], function (require, exports, BaseView_1, Position_1, Utils_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var CenterPanel = /** @class */ (function (_super) {\r\n __extends(CenterPanel, _super);\r\n function CenterPanel($element) {\r\n var _this = _super.call(this, $element, false, true) || this;\r\n _this.subtitleExpanded = false;\r\n _this.isAttributionOpen = false;\r\n _this.attributionPosition = Position_1.Position.BOTTOM_LEFT;\r\n return _this;\r\n }\r\n CenterPanel.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n this.$title = $('<div class=\"title\"></div>');\r\n this.$element.append(this.$title);\r\n this.$subtitle = $(\"<div class=\\\"subtitle\\\">\\n <div class=\\\"wrapper\\\">\\n <button type=\\\"button\\\" class=\\\"expand-btn\\\" aria-label=\\\"Expand\\\">\\n <span aria-hidden=\\\"true\\\">+</span>\\n </button>\\n <span class=\\\"text\\\"></span>\\n </div>\\n </div>\");\r\n this.$element.append(this.$subtitle);\r\n this.$subtitleWrapper = this.$subtitle.find('.wrapper');\r\n this.$subtitleExpand = this.$subtitle.find('.expand-btn');\r\n this.$subtitleText = this.$subtitle.find('.text');\r\n this.$content = $('<div class=\"content\"></div>');\r\n this.$element.append(this.$content);\r\n this.$attribution = $(\"\\n <div class=\\\"attribution\\\">\\n <div class=\\\"header\\\">\\n <div class=\\\"title\\\"></div>\\n <button type=\\\"button\\\" class=\\\"close\\\" aria-label=\\\"Close\\\">\\n <span aria-hidden=\\\"true\\\">×</span>\\n </button>\\n </div>\\n <div class=\\\"main\\\">\\n <div class=\\\"attribution-text\\\"></div>\\n <div class=\\\"license\\\"></div>\\n <div class=\\\"logo\\\"></div>\\n </div>\\n </div>\\n \");\r\n this.$attribution.find('.header .title').text(this.content.attribution);\r\n this.$content.append(this.$attribution);\r\n this.closeAttribution();\r\n this.$closeAttributionButton = this.$attribution.find('.header .close');\r\n this.$closeAttributionButton.on('click', function (e) {\r\n e.preventDefault();\r\n _this.closeAttribution();\r\n });\r\n this.$subtitleExpand.on('click', function (e) {\r\n e.preventDefault();\r\n _this.subtitleExpanded = !_this.subtitleExpanded;\r\n if (_this.subtitleExpanded) {\r\n _this.$subtitleWrapper.addClass('expanded');\r\n _this.$subtitleExpand.text('-');\r\n }\r\n else {\r\n _this.$subtitleWrapper.removeClass('expanded');\r\n _this.$subtitleExpand.text('+');\r\n }\r\n _this.resize();\r\n });\r\n if (Utils.Bools.getBool(this.options.titleEnabled, true)) {\r\n this.$title.removeClass('hidden');\r\n }\r\n else {\r\n this.$title.addClass('hidden');\r\n }\r\n if (Utils.Bools.getBool(this.options.subtitleEnabled, false)) {\r\n this.$subtitle.removeClass('hidden');\r\n }\r\n else {\r\n this.$subtitle.addClass('hidden');\r\n }\r\n this.whenResized(function () {\r\n _this.updateRequiredStatement();\r\n });\r\n };\r\n CenterPanel.prototype.openAttribution = function () {\r\n this.$attribution.show();\r\n this.isAttributionOpen = true;\r\n };\r\n CenterPanel.prototype.closeAttribution = function () {\r\n this.$attribution.hide();\r\n this.isAttributionOpen = false;\r\n };\r\n CenterPanel.prototype.updateRequiredStatement = function () {\r\n var _this = this;\r\n var requiredStatement = this.extension.helper.getRequiredStatement();\r\n //var license = this.provider.getLicense();\r\n //var logo = this.provider.getLogo();\r\n var enabled = Utils.Bools.getBool(this.options.requiredStatementEnabled, true);\r\n if (!requiredStatement || !requiredStatement.value || !enabled) {\r\n return;\r\n }\r\n this.openAttribution();\r\n var $attributionTitle = this.$attribution.find('.title');\r\n var $attributionText = this.$attribution.find('.attribution-text');\r\n var $license = this.$attribution.find('.license');\r\n var $logo = this.$attribution.find('.logo');\r\n if (requiredStatement.label) {\r\n var sanitizedTitle = Utils_1.UVUtils.sanitize(requiredStatement.label);\r\n $attributionTitle.html(sanitizedTitle);\r\n }\r\n else {\r\n $attributionTitle.text(this.content.attribution);\r\n }\r\n if (requiredStatement.value) {\r\n var sanitizedText = Utils_1.UVUtils.sanitize(requiredStatement.value);\r\n $attributionText.html(sanitizedText);\r\n $attributionText.find('img').one('load', function () {\r\n _this.resize();\r\n }).each(function () {\r\n if (this.complete)\r\n $(this).load();\r\n });\r\n $attributionText.targetBlank();\r\n }\r\n // $attribution.toggleExpandText(this.options.trimAttributionCount, () => {\r\n // this.resize();\r\n // });\r\n //if (license){\r\n // $license.append('<a href=\"' + license + '\">' + license + '</a>');\r\n //} else {\r\n $license.hide();\r\n //}\r\n //\r\n //if (logo){\r\n // $logo.append('<img src=\"' + logo + '\"/>');\r\n //} else {\r\n $logo.hide();\r\n //}\r\n this.resize();\r\n };\r\n CenterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n var leftPanelWidth = this.extension.shell.$leftPanel.is(':visible') ? Math.floor(this.extension.shell.$leftPanel.width()) : 0;\r\n var rightPanelWidth = this.extension.shell.$rightPanel.is(':visible') ? Math.floor(this.extension.shell.$rightPanel.width()) : 0;\r\n var width = Math.floor(this.$element.parent().width() - leftPanelWidth - rightPanelWidth);\r\n this.$element.css({\r\n 'left': leftPanelWidth,\r\n 'width': width\r\n });\r\n var titleHeight;\r\n var subtitleHeight;\r\n if (this.options && this.options.titleEnabled === false || !this.$title.is(':visible')) {\r\n titleHeight = 0;\r\n }\r\n else {\r\n titleHeight = this.$title.height();\r\n }\r\n if (this.options && this.options.subtitleEnabled === false || !this.$subtitle.is(':visible')) {\r\n subtitleHeight = 0;\r\n }\r\n else {\r\n subtitleHeight = this.$subtitle.height();\r\n }\r\n this.$content.height(this.$element.height() - titleHeight - subtitleHeight);\r\n this.$content.width(this.$element.width());\r\n if (this.$attribution && this.isAttributionOpen) {\r\n switch (this.attributionPosition) {\r\n case Position_1.Position.BOTTOM_LEFT:\r\n this.$attribution.css('top', this.$content.height() - this.$attribution.outerHeight() - this.$attribution.verticalMargins());\r\n this.$attribution.css('left', 0);\r\n break;\r\n case Position_1.Position.BOTTOM_RIGHT:\r\n this.$attribution.css('top', this.$content.height() - this.$attribution.outerHeight() - this.$attribution.verticalMargins());\r\n this.$attribution.css('left', this.$content.width() - this.$attribution.outerWidth() - this.$attribution.horizontalMargins());\r\n break;\r\n }\r\n // hide the attribution if there's no room for it\r\n if (this.$content.width() <= this.$attribution.width()) {\r\n this.$attribution.hide();\r\n }\r\n else {\r\n this.$attribution.show();\r\n }\r\n }\r\n if (this.subtitle && this.options.subtitleEnabled) {\r\n this.$subtitleText.html(Utils_1.UVUtils.sanitize(this.subtitle.replace(/<br\\s*[\\/]?>/gi, '; ')));\r\n this.$subtitleText.removeClass('elided');\r\n this.$subtitle.removeClass('hidden');\r\n this.$subtitleWrapper.css('max-height', this.$content.height() + this.$subtitle.outerHeight());\r\n this.$subtitleWrapper.width(this.$content.width());\r\n if (!this.subtitleExpanded) {\r\n this.$subtitleText.width('auto');\r\n this.$subtitleWrapper.width('auto');\r\n this.$subtitleExpand.hide();\r\n // if the subtitle span is wider than the container, set it to display:block \r\n // and set its width to that of the container\r\n // this will make it appear elided.\r\n // show the expand button\r\n if (this.$subtitleText.width() > this.$content.width()) {\r\n this.$subtitleExpand.show();\r\n this.$subtitleText.addClass('elided');\r\n this.$subtitleText.width(this.$content.width() - (this.$subtitleExpand.outerWidth() + this.$subtitleText.horizontalMargins()));\r\n }\r\n }\r\n else {\r\n // subtitle expanded\r\n this.$subtitleText.width(this.$content.width() - this.$subtitleText.horizontalMargins() - 2);\r\n }\r\n }\r\n else {\r\n this.$subtitle.addClass('hidden');\r\n }\r\n };\r\n return CenterPanel;\r\n }(BaseView_1.BaseView));\r\n exports.CenterPanel = CenterPanel;\r\n});\r\n//# sourceMappingURL=CenterPanel.js.map\n", "!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(\"IIIFAVComponent\",[],e):\"object\"==typeof exports?exports.IIIFAVComponent=e():t.IIIFAVComponent=e()}(\"undefined\"!=typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,\"a\",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=\"\",n(n.s=36)}([function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),function(t){t.BOOKMARKING=\"oa:bookmarking\",t.CLASSIFYING=\"oa:classifying\",t.COMMENTING=\"oa:commenting\",t.DESCRIBING=\"oa:describing\",t.EDITING=\"oa:editing\",t.HIGHLIGHTING=\"oa:highlighting\",t.IDENTIFYING=\"oa:identifying\",t.LINKING=\"oa:linking\",t.MODERATING=\"oa:moderating\",t.PAINTING=\"sc:painting\",t.QUESTIONING=\"oa:questioning\",t.REPLYING=\"oa:replying\",t.TAGGING=\"oa:tagging\",t.TRANSCRIBING=\"oad:transcribing\"}(e.AnnotationMotivation||(e.AnnotationMotivation={})),function(t){t.AUTO_ADVANCE=\"auto-advance\",t.CONTINUOUS=\"continuous\",t.FACING_PAGES=\"facing-pages\",t.HIDDEN=\"hidden\",t.INDIVIDUALS=\"individuals\",t.MULTI_PART=\"multi-part\",t.NO_NAV=\"no-nav\",t.NON_PAGED=\"non-paged\",t.PAGED=\"paged\",t.REPEAT=\"repeat\",t.SEQUENCE=\"sequence\",t.THUMBNAIL_NAV=\"thumbnail-nav\",t.TOGETHER=\"together\",t.UNORDERED=\"unordered\"}(e.Behavior||(e.Behavior={})),function(t){t.CANVAS=\"canvas\",t.CHOICE=\"choice\",t.OA_CHOICE=\"oa:choice\",t.CONTENT_AS_TEXT=\"contentastext\",t.DATASET=\"dataset\",t.DOCUMENT=\"document\",t.IMAGE=\"image\",t.MODEL=\"model\",t.MOVING_IMAGE=\"movingimage\",t.PDF=\"pdf\",t.PHYSICAL_OBJECT=\"physicalobject\",t.SOUND=\"sound\",t.TEXT=\"text\",t.TEXTUALBODY=\"textualbody\",t.VIDEO=\"video\"}(e.ExternalResourceType||(e.ExternalResourceType={})),function(t){t.ANNOTATION=\"annotation\",t.CANVAS=\"canvas\",t.COLLECTION=\"collection\",t.MANIFEST=\"manifest\",t.RANGE=\"range\",t.SEQUENCE=\"sequence\"}(e.IIIFResourceType||(e.IIIFResourceType={})),function(t){t.AUDIO_MP4=\"audio/mp4\",t.CORTO=\"application/corto\",t.DICOM=\"application/dicom\",t.DRACO=\"application/draco\",t.EPUB=\"application/epub+zip\",t.GLB=\"model/gltf-binary\",t.GLTF=\"model/gltf+json\",t.IIIF_PRESENTATION_2='application/ld+json;profile=\"http://iiif.io/api/presentation/2/context.json\"',t.IIIF_PRESENTATION_3='application/ld+json;profile=\"http://iiif.io/api/presentation/3/context.json\"',t.JPG=\"image/jpeg\",t.M3U8=\"application/vnd.apple.mpegurl\",t.MP3=\"audio/mp3\",t.MPEG_DASH=\"application/dash+xml\",t.OBJ=\"text/plain\",t.OPF=\"application/oebps-package+xml\",t.PDF=\"application/pdf\",t.PLY=\"application/ply\",t.THREEJS=\"application/vnd.threejs+json\",t.USDZ=\"model/vnd.usd+zip\",t.VIDEO_MP4=\"video/mp4\",t.WEBM=\"video/webm\"}(e.MediaType||(e.MediaType={})),function(t){t.DOC=\"application/msword\",t.DOCX=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",t.PDF=\"application/pdf\"}(e.RenderingFormat||(e.RenderingFormat={})),function(t){t.IMAGE_0_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/compliance.html#level0\",t.IMAGE_0_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/compliance.html#level1\",t.IMAGE_0_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/compliance.html#level2\",t.IMAGE_0_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/conformance.html#level0\",t.IMAGE_0_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/conformance.html#level1\",t.IMAGE_0_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/conformance.html#level2\",t.IMAGE_1_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\",t.IMAGE_1_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1\",t.IMAGE_1_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2\",t.IMAGE_1_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0\",t.IMAGE_1_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1\",t.IMAGE_1_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2\",t.IMAGE_1_LEVEL_0=\"http://iiif.io/api/image/1/level0.json\",t.IMAGE_1_PROFILE_LEVEL_0=\"http://iiif.io/api/image/1/profiles/level0.json\",t.IMAGE_1_LEVEL_1=\"http://iiif.io/api/image/1/level1.json\",t.IMAGE_1_PROFILE_LEVEL_1=\"http://iiif.io/api/image/1/profiles/level1.json\",t.IMAGE_1_LEVEL_2=\"http://iiif.io/api/image/1/level2.json\",t.IMAGE_1_PROFILE_LEVEL_2=\"http://iiif.io/api/image/1/profiles/level2.json\",t.IMAGE_2_LEVEL_0=\"http://iiif.io/api/image/2/level0.json\",t.IMAGE_2_PROFILE_LEVEL_0=\"http://iiif.io/api/image/2/profiles/level0.json\",t.IMAGE_2_LEVEL_1=\"http://iiif.io/api/image/2/level1.json\",t.IMAGE_2_PROFILE_LEVEL_1=\"http://iiif.io/api/image/2/profiles/level1.json\",t.IMAGE_2_LEVEL_2=\"http://iiif.io/api/image/2/level2.json\",t.IMAGE_2_PROFILE_LEVEL_2=\"http://iiif.io/api/image/2/profiles/level2.json\",t.AUTH_0_CLICK_THROUGH=\"http://iiif.io/api/auth/0/login/clickthrough\",t.AUTH_0_LOGIN=\"http://iiif.io/api/auth/0/login\",t.AUTH_0_LOGOUT=\"http://iiif.io/api/auth/0/logout\",t.AUTH_0_RESTRICTED=\"http://iiif.io/api/auth/0/login/restricted\",t.AUTH_0_TOKEN=\"http://iiif.io/api/auth/0/token\",t.AUTH_1_CLICK_THROUGH=\"http://iiif.io/api/auth/1/clickthrough\",t.AUTH_1_EXTERNAL=\"http://iiif.io/api/auth/1/external\",t.AUTH_1_KIOSK=\"http://iiif.io/api/auth/1/kiosk\",t.AUTH_1_LOGIN=\"http://iiif.io/api/auth/1/login\",t.AUTH_1_LOGOUT=\"http://iiif.io/api/auth/1/logout\",t.AUTH_1_PROBE=\"http://iiif.io/api/auth/1/probe\",t.AUTH_1_TOKEN=\"http://iiif.io/api/auth/1/token\",t.SEARCH_0=\"http://iiif.io/api/search/0/search\",t.SEARCH_0_AUTO_COMPLETE=\"http://iiif.io/api/search/0/autocomplete\",t.SEARCH_1=\"http://iiif.io/api/search/1/search\",t.SEARCH_1_AUTO_COMPLETE=\"http://iiif.io/api/search/1/autocomplete\",t.TRACKING_EXTENSIONS=\"http://universalviewer.io/tracking-extensions-profile\",t.UI_EXTENSIONS=\"http://universalviewer.io/ui-extensions-profile\",t.PRINT_EXTENSIONS=\"http://universalviewer.io/print-extensions-profile\",t.SHARE_EXTENSIONS=\"http://universalviewer.io/share-extensions-profile\",t.OTHER_MANIFESTATIONS=\"http://iiif.io/api/otherManifestations.json\",t.IXIF=\"http://wellcomelibrary.org/ld/ixif/0/alpha.json\"}(e.ServiceProfile||(e.ServiceProfile={})),function(t){t.BOTTOM_TO_TOP=\"bottom-to-top\",t.LEFT_TO_RIGHT=\"left-to-right\",t.RIGHT_TO_LEFT=\"right-to-left\",t.TOP_TO_BOTTOM=\"top-to-bottom\"}(e.ViewingDirection||(e.ViewingDirection={})),function(t){t.CONTINUOUS=\"continuous\",t.INDIVIDUALS=\"individuals\",t.NON_PAGED=\"non-paged\",t.PAGED=\"paged\",t.TOP=\"top\"}(e.ViewingHint||(e.ViewingHint={}))},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.CONTINUE=100,e.SWITCHING_PROTOCOLS=101,e.PROCESSING=102,e.OK=200,e.CREATED=201,e.ACCEPTED=202,e.NON_AUTHORITATIVE_INFORMATION=203,e.NO_CONTENT=204,e.RESET_CONTENT=205,e.PARTIAL_CONTENT=206,e.MULTI_STATUS=207,e.MULTIPLE_CHOICES=300,e.MOVED_PERMANENTLY=301,e.MOVED_TEMPORARILY=302,e.SEE_OTHER=303,e.NOT_MODIFIED=304,e.USE_PROXY=305,e.TEMPORARY_REDIRECT=307,e.BAD_REQUEST=400,e.UNAUTHORIZED=401,e.PAYMENT_REQUIRED=402,e.FORBIDDEN=403,e.NOT_FOUND=404,e.METHOD_NOT_ALLOWED=405,e.NOT_ACCEPTABLE=406,e.PROXY_AUTHENTICATION_REQUIRED=407,e.REQUEST_TIME_OUT=408,e.CONFLICT=409,e.GONE=410,e.LENGTH_REQUIRED=411,e.PRECONDITION_FAILED=412,e.REQUEST_ENTITY_TOO_LARGE=413,e.REQUEST_URI_TOO_LARGE=414,e.UNSUPPORTED_MEDIA_TYPE=415,e.REQUESTED_RANGE_NOT_SATISFIABLE=416,e.EXPECTATION_FAILED=417,e.IM_A_TEAPOT=418,e.UNPROCESSABLE_ENTITY=422,e.LOCKED=423,e.FAILED_DEPENDENCY=424,e.UNORDERED_COLLECTION=425,e.UPGRADE_REQUIRED=426,e.PRECONDITION_REQUIRED=428,e.TOO_MANY_REQUESTS=429,e.REQUEST_HEADER_FIELDS_TOO_LARGE=431,e.INTERNAL_SERVER_ERROR=500,e.NOT_IMPLEMENTED=501,e.BAD_GATEWAY=502,e.SERVICE_UNAVAILABLE=503,e.GATEWAY_TIME_OUT=504,e.HTTP_VERSION_NOT_SUPPORTED=505,e.VARIANT_ALSO_NEGOTIATES=506,e.INSUFFICIENT_STORAGE=507,e.BANDWIDTH_LIMIT_EXCEEDED=509,e.NOT_EXTENDED=510,e.NETWORK_AUTHENTICATION_REQUIRED=511},function(t,e,n){\"use strict\";(function(t){Object.defineProperty(e,\"__esModule\",{value:!0});var n=\"production\"!==t.env.NODE,i=function(){return n||window&&window.__DEBUG_AV_COMPONENT__};e.Logger={log:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i()&&console.log.apply(console,t)},warn:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i()&&console.warn.apply(console,t)},error:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i()&&console.error.apply(console,t)},groupCollapsed:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i()&&console.groupCollapsed.apply(console,t)},group:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i()&&console.group.apply(console,t)},groupEnd:function(){i()&&console.groupEnd()}}}).call(this,n(55))},function(t,e,n){\"use strict\";n.r(e),n.d(e,\"JSONLDResource\",(function(){return a})),n.d(e,\"ManifestResource\",(function(){return u})),n.d(e,\"Resource\",(function(){return c})),n.d(e,\"IIIFResource\",(function(){return p})),n.d(e,\"Annotation\",(function(){return d})),n.d(e,\"AnnotationBody\",(function(){return v})),n.d(e,\"AnnotationList\",(function(){return m})),n.d(e,\"AnnotationPage\",(function(){return E})),n.d(e,\"Canvas\",(function(){return A})),n.d(e,\"Collection\",(function(){return O})),n.d(e,\"Duration\",(function(){return R})),n.d(e,\"LabelValuePair\",(function(){return M})),n.d(e,\"LanguageMap\",(function(){return S})),n.d(e,\"LocalizedValue\",(function(){return $})),n.d(e,\"PropertyValue\",(function(){return k})),n.d(e,\"Manifest\",(function(){return H})),n.d(e,\"ManifestType\",(function(){return r})),n.d(e,\"Range\",(function(){return W})),n.d(e,\"Rendering\",(function(){return Y})),n.d(e,\"Sequence\",(function(){return q})),n.d(e,\"Deserialiser\",(function(){return Q})),n.d(e,\"Service\",(function(){return J})),n.d(e,\"Size\",(function(){return Z})),n.d(e,\"StatusCode\",(function(){return G})),n.d(e,\"Thumb\",(function(){return et})),n.d(e,\"Thumbnail\",(function(){return it})),n.d(e,\"TreeNode\",(function(){return rt})),n.d(e,\"TreeNodeType\",(function(){return tt})),n.d(e,\"Utils\",(function(){return V})),n.d(e,\"loadManifest\",(function(){return at})),n.d(e,\"parseManifest\",(function(){return ot}));var i,r,a=function(){function t(t){this.__jsonld=t,this.context=this.getProperty(\"context\"),this.id=this.getProperty(\"id\")}return t.prototype.getProperty=function(t){var e=null;return this.__jsonld&&((e=this.__jsonld[t])||(e=this.__jsonld[\"@\"+t])),e},t}(),o=n(0),s=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e,n){var i=t.call(this,e)||this;return i.options=n,i}return s(e,t),e.prototype.getIIIFResourceType=function(){return V.normaliseType(this.getProperty(\"type\"))},e.prototype.getLabel=function(){var t=this.getProperty(\"label\");return t?k.parse(t,this.options.locale):new k([],this.options.locale)},e.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},e.prototype.getMetadata=function(){var t=this.getProperty(\"metadata\"),e=[];if(!t)return e;for(var n=0;n<t.length;n++){var i=t[n],r=new M(this.options.locale);r.parse(i),e.push(r)}return e},e.prototype.getRendering=function(t){for(var e=this.getRenderings(),n=0;n<e.length;n++){var i=e[n];if(i.getFormat()===t)return i}return null},e.prototype.getRenderings=function(){var t,e=[];if(!(t=this.__jsonld?this.__jsonld.rendering:this.rendering))return e;Array.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++){var i=t[n];e.push(new Y(i,this.options))}return e},e.prototype.getService=function(t){return V.getService(this,t)},e.prototype.getServices=function(){return V.getServices(this)},e.prototype.getThumbnail=function(){var t=this.getProperty(\"thumbnail\");return Array.isArray(t)&&(t=t[0]),t?new it(t,this.options):null},e.prototype.isAnnotation=function(){return this.getIIIFResourceType()===o.IIIFResourceType.ANNOTATION},e.prototype.isCanvas=function(){return this.getIIIFResourceType()===o.IIIFResourceType.CANVAS},e.prototype.isCollection=function(){return this.getIIIFResourceType()===o.IIIFResourceType.COLLECTION},e.prototype.isManifest=function(){return this.getIIIFResourceType()===o.IIIFResourceType.MANIFEST},e.prototype.isRange=function(){return this.getIIIFResourceType()===o.IIIFResourceType.RANGE},e.prototype.isSequence=function(){return this.getIIIFResourceType()===o.IIIFResourceType.SEQUENCE},e}(a),l=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),c=function(t){function e(e,n){return t.call(this,e,n)||this}return l(e,t),e.prototype.getFormat=function(){var t=this.getProperty(\"format\");return t?t.toLowerCase():null},e.prototype.getResources=function(){var t=[];if(!this.__jsonld.resources)return t;for(var e=0;e<this.__jsonld.resources.length;e++){var n=this.__jsonld.resources[e],i=new d(n,this.options);t.push(i)}return t},e.prototype.getType=function(){var t=this.getProperty(\"type\");return t?V.normaliseType(t):null},e.prototype.getWidth=function(){return this.getProperty(\"width\")},e.prototype.getHeight=function(){return this.getProperty(\"height\")},e.prototype.getMaxWidth=function(){return this.getProperty(\"maxWidth\")},e.prototype.getMaxHeight=function(){return this.getProperty(\"maxHeight\")?null:this.getMaxWidth()},e}(u),h=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=function(t){function e(e,n){var i=t.call(this,e,n)||this;i.index=-1,i.isLoaded=!1;var r={defaultLabel:\"-\",locale:\"en-GB\",resource:i,pessimisticAccessControl:!1};return i.options=Object.assign(r,n),i}return h(e,t),e.prototype.getAttribution=function(){var t=this.getProperty(\"attribution\");return t?k.parse(t,this.options.locale):new k([],this.options.locale)},e.prototype.getDescription=function(){var t=this.getProperty(\"description\");return t?k.parse(t,this.options.locale):new k([],this.options.locale)},e.prototype.getHomepage=function(){var t=this.getProperty(\"homepage\");return t?\"string\"==typeof t?t:(Array.isArray(t)&&t.length&&(t=t[0]),t[\"@id\"]||t.id):null},e.prototype.getIIIFResourceType=function(){return V.normaliseType(this.getProperty(\"type\"))},e.prototype.getLogo=function(){var t=this.getProperty(\"logo\");return t?\"string\"==typeof t?t:(Array.isArray(t)&&t.length&&(t=t[0]),t[\"@id\"]||t.id):null},e.prototype.getLicense=function(){return V.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(o.ServiceProfile.TRACKING_EXTENSIONS);return t?t.getProperty(\"trackingLabel\"):\"\"},e.prototype.getDefaultTree=function(){return this.defaultTree=new rt(\"root\"),this.defaultTree.data=this,this.defaultTree},e.prototype.getRequiredStatement=function(){var t=null,e=this.getProperty(\"requiredStatement\");if(e)(t=new M(this.options.locale)).parse(e);else{var n=this.getAttribution();n&&((t=new M(this.options.locale)).value=n)}return t},e.prototype.isCollection=function(){return this.getIIIFResourceType()===o.IIIFResourceType.COLLECTION},e.prototype.isManifest=function(){return this.getIIIFResourceType()===o.IIIFResourceType.MANIFEST},e.prototype.load=function(){var t=this;return new Promise((function(e){if(t.isLoaded)e(t);else{var n=t.options;n.navDate=t.getNavDate();var i=t.__jsonld.id;i||(i=t.__jsonld[\"@id\"]),V.loadManifest(i).then((function(i){t.parentLabel=t.getLabel().getValue(n.locale);var r=Q.parse(i,n);(t=Object.assign(t,r)).index=n.index,e(t)}))}}))},e}(u),f=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),d=function(t){function e(e,n){return t.call(this,e,n)||this}return f(e,t),e.prototype.getBody=function(){var t=[],e=this.getProperty(\"body\");if(e)if(Array.isArray(e))for(var n=0;n<e.length;n++){if((a=e[n]).items)for(var i=0;i<a.items.length;i++){var r=a.items[i];t.push(new v(r,this.options))}else t.push(new v(a,this.options))}else if(e.items)for(n=0;n<e.items.length;n++){var a=e.items[n];t.push(new v(a,this.options))}else t.push(new v(e,this.options));return t},e.prototype.getMotivation=function(){var t=this.getProperty(\"motivation\");return t||null},e.prototype.getOn=function(){return this.getProperty(\"on\")},e.prototype.getTarget=function(){return this.getProperty(\"target\")},e.prototype.getResource=function(){return new c(this.getProperty(\"resource\"),this.options)},e}(u),g=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),v=function(t){function e(e,n){return t.call(this,e,n)||this}return g(e,t),e.prototype.getFormat=function(){var t=this.getProperty(\"format\");return t?V.getMediaType(t):null},e.prototype.getType=function(){return this.getProperty(\"type\")?V.normaliseType(this.getProperty(\"type\")):null},e.prototype.getWidth=function(){return this.getProperty(\"width\")},e.prototype.getHeight=function(){return this.getProperty(\"height\")},e}(u),_=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),m=function(t){function e(e,n,i){var r=t.call(this,n)||this;return r.label=e,r.options=i,r}return _(e,t),e.prototype.getIIIFResourceType=function(){return V.normaliseType(this.getProperty(\"type\"))},e.prototype.getLabel=function(){return this.label},e.prototype.getResources=function(){var t=this;return this.getProperty(\"resources\").map((function(e){return new d(e,t.options)}))},e.prototype.load=function(){var t=this;return new Promise((function(e,n){if(t.isLoaded)e(t);else{var i=t.__jsonld.id;i||(i=t.__jsonld[\"@id\"]),V.loadManifest(i).then((function(n){t.__jsonld=n,t.context=t.getProperty(\"context\"),t.id=t.getProperty(\"id\"),t.isLoaded=!0,e(t)})).catch(n)}}))},e}(a),y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),E=function(t){function e(e,n){return t.call(this,e,n)||this}return y(e,t),e.prototype.getItems=function(){return this.getProperty(\"items\")},e}(u),T=n(7),C=n.n(T),I=n(21),P=n.n(I),w=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),A=function(t){function e(e,n){return t.call(this,e,n)||this}return w(e,t),e.prototype.getCanonicalImageUri=function(t){var e,n=null,i=\"default\",r=t;if(this.externalResource&&this.externalResource.data&&this.externalResource.data[\"@id\"])n=this.externalResource.data[\"@id\"],r||(r=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)&&(i=\"native\");else{var a=this.getImages();if(a&&a.length){var o=a[0].getResource(),s=o.getServices();if(r||(r=o.getWidth()),s.length){var u=s[0];n=u.id,i=V.getImageQuality(u.getProfile())}else if(r===o.getWidth())return o.id}if(!n){var l=this.getProperty(\"thumbnail\");if(l){if(\"string\"==typeof l)return l;if(l[\"@id\"])return l[\"@id\"];if(l.length)return l[0].id}}}return e=r+\",\",n&&n.endsWith(\"/\")&&(n=n.substr(0,n.length-1)),[n,\"full\",e,0,i+\".jpg\"].join(\"/\")},e.prototype.getMaxDimensions=function(){var t,e=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(t=this.externalResource.data.profile,Array.isArray(t)&&(t=t.filter((function(t){return t.maxWidth}))[0])&&(e=new Z(t.maxWidth,t.maxHeight?t.maxHeight:t.maxWidth))),e},e.prototype.getContent=function(){var t=[],e=this.__jsonld.items||this.__jsonld.content;if(!e)return t;var n=null;if(e.length&&(n=new E(e[0],this.options)),!n)return t;for(var i=n.getItems(),r=0;r<i.length;r++){var a=i[r],o=new d(a,this.options);t.push(o)}return t},e.prototype.getDuration=function(){return this.getProperty(\"duration\")},e.prototype.getImages=function(){var t=[];if(!this.__jsonld.images)return t;for(var e=0;e<this.__jsonld.images.length;e++){var n=this.__jsonld.images[e],i=new d(n,this.options);t.push(i)}return t},e.prototype.getIndex=function(){return this.getProperty(\"index\")},e.prototype.getOtherContent=function(){var t=this,e=Array.isArray(this.getProperty(\"otherContent\"))?this.getProperty(\"otherContent\"):[this.getProperty(\"otherContent\")],n=e.filter((function(t){return t&&(e=t[\"@type\"],n=\"sc:AnnotationList\",\"string\"==typeof e&&\"string\"==typeof n&&e.toLowerCase()==e.toLowerCase());var e,n})).map((function(e,n){return new m(e.label||\"Annotation list \"+n,e,t.options)})).map((function(t){return t.load()}));return Promise.all(n)},e.prototype.getWidth=function(){return this.getProperty(\"width\")},e.prototype.getHeight=function(){return this.getProperty(\"height\")},e.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},Object.defineProperty(e.prototype,\"imageResources\",{get:function(){var t=this,n=P()([this.getImages().map((function(t){return t.getResource()})),this.getContent().map((function(t){return t.getBody()}))]);return C()(n.map((function(n){switch(n.getProperty(\"type\").toLowerCase()){case o.ExternalResourceType.CHOICE:case o.ExternalResourceType.OA_CHOICE:return new e({images:C()([n.getProperty(\"default\"),n.getProperty(\"item\")]).map((function(t){return{resource:t}}))},t.options).getImages().map((function(t){return t.getResource()}));default:return n}})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"resourceAnnotations\",{get:function(){return P()([this.getImages(),this.getContent()])},enumerable:!0,configurable:!0}),e.prototype.resourceAnnotation=function(t){return this.resourceAnnotations.find((function(e){return e.getResource().id===t||C()(new Array(e.getBody())).some((function(e){return e.id===t}))}))},e.prototype.onFragment=function(t){var e=this.resourceAnnotation(t);if(e){var n=e.getProperty(\"on\"),i=e.getProperty(\"target\"),r=(n||i).match(/xywh=(.*)$/);if(r)return r[1].split(\",\").map((function(t){return parseInt(t,10)}))}},Object.defineProperty(e.prototype,\"iiifImageResources\",{get:function(){return this.imageResources.filter((function(t){return t&&t.getServices()[0]&&t.getServices()[0].id}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"imageServiceIds\",{get:function(){return this.iiifImageResources.map((function(t){return t.getServices()[0].id}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,\"aspectRatio\",{get:function(){return this.getWidth()/this.getHeight()},enumerable:!0,configurable:!0}),e}(c),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),O=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i.items=[],i._collections=null,i._manifests=null,e.__collection=i,i}return b(e,t),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 e,n=this.getCollections(),i=0;i<n.length;i++){var r=n[i];r.index===t&&(e=r)}if(e)return e.options.index=t,e.load();throw new Error(\"Collection index not found\")},e.prototype.getManifestByIndex=function(t){for(var e,n=this.getManifests(),i=0;i<n.length;i++){var r=n[i];r.index===t&&(e=r)}if(e)return e.options.index=t,e.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\"):o.ViewingDirection.LEFT_TO_RIGHT},e.prototype.getBehavior=function(){var t=this.getProperty(\"behavior\");return Array.isArray(t)&&(t=t[0]),t||null},e.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},e.prototype.getDefaultTree=function(){return t.prototype.getDefaultTree.call(this),this.defaultTree.data.type=V.normaliseType(tt.COLLECTION),this._parseManifests(this),this._parseCollections(this),V.generateTreeNodeIds(this.defaultTree),this.defaultTree},e.prototype._parseManifests=function(t){if(t.getManifests()&&t.getManifests().length)for(var e=0;e<t.getManifests().length;e++){var n=t.getManifests()[e],i=n.getDefaultTree();i.label=n.parentLabel||n.getLabel().getValue(this.options.locale)||\"manifest \"+(e+1),i.navDate=n.getNavDate(),i.data.id=n.id,i.data.type=V.normaliseType(tt.MANIFEST),t.defaultTree.addNode(i)}},e.prototype._parseCollections=function(t){if(t.getCollections()&&t.getCollections().length)for(var e=0;e<t.getCollections().length;e++){var n=t.getCollections()[e],i=n.getDefaultTree();i.label=n.parentLabel||n.getLabel().getValue(this.options.locale)||\"collection \"+(e+1),i.navDate=n.getNavDate(),i.data.id=n.id,i.data.type=V.normaliseType(tt.COLLECTION),t.defaultTree.addNode(i)}},e}(p),R=function(){function t(t,e){this.start=t,this.end=e}return t.prototype.getLength=function(){return this.end-this.start},t}(),M=function(){function t(t){this.defaultLocale=t}return t.prototype.parse=function(t){this.resource=t,this.label=k.parse(this.resource.label,this.defaultLocale),this.value=k.parse(this.resource.value,this.defaultLocale)},t.prototype.getLabel=function(t){return null===this.label?null:(Array.isArray(t)&&!t.length&&(t=void 0),this.label.getValue(t||this.defaultLocale))},t.prototype.setLabel=function(t){null===this.label&&(this.label=new k([])),this.label.setValue(t,this.defaultLocale)},t.prototype.getValue=function(t,e){return void 0===e&&(e=\"<br/>\"),null===this.value?null:(Array.isArray(t)&&!t.length&&(t=void 0),this.value.getValue(t||this.defaultLocale,e))},t.prototype.getValues=function(t){return null===this.value?[]:(Array.isArray(t)&&!t.length&&(t=void 0),this.value.getValues(t||this.defaultLocale))},t.prototype.setValue=function(t){null===this.value&&(this.value=new k([])),this.value.setValue(t,this.defaultLocale)},t}(),L=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return L(e,t),e.getValue=function(t,e){return t.getValue(e,\"<br/>\")},e.getValues=function(t,e){return t.getValues(e)},e}(Array),x=n(1),N=(n(49),function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))}),D=function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError(\"Generator is already executing.\");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},V=function(){function t(){}return t.getMediaType=function(t){return(t=(t=t.toLowerCase()).split(\";\")[0]).trim()},t.getImageQuality=function(t){return t===o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||t===o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||t===o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||t===o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||t===o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||t===o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||t===o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||t===o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||t===o.ServiceProfile.IMAGE_1_LEVEL_1||t===o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||t===o.ServiceProfile.IMAGE_1_LEVEL_2||t===o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?\"native\":\"default\"},t.getInexactLocale=function(t){return-1!==t.indexOf(\"-\")?t.substr(0,t.indexOf(\"-\")):t},t.getLocalisedValue=function(t,e){if(!Array.isArray(t))return t;for(var n=0;n<t.length;n++){var i=t[n];if(e===i[\"@language\"])return i[\"@value\"]}var r=e.substr(0,e.indexOf(\"-\"));for(n=0;n<t.length;n++){var a=t[n];if(a[\"@language\"]===r)return a[\"@value\"]}return null},t.generateTreeNodeIds=function(e,n){var i;void 0===n&&(n=0),i=e.parentNode?e.parentNode.id+\"-\"+n:\"0\",e.id=i;for(var r=0;r<e.nodes.length;r++){var a=e.nodes[r];t.generateTreeNodeIds(a,r)}},t.normaliseType=function(t){return-1!==(t=(t||\"\").toLowerCase()).indexOf(\":\")?t.split(\":\")[1]:t},t.normaliseUrl=function(t){return-1!==(t=t.substr(t.indexOf(\"://\"))).indexOf(\"#\")&&(t=t.split(\"#\")[0]),t},t.normalisedUrlsMatch=function(e,n){return t.normaliseUrl(e)===t.normaliseUrl(n)},t.isImageProfile=function(e){return!!(t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},t.isLevel0ImageProfile=function(e){return!!(t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_LEVEL_0)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},t.isLevel1ImageProfile=function(e){return!!(t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_LEVEL_1)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},t.isLevel2ImageProfile=function(e){return!!(t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_LEVEL_2)||t.normalisedUrlsMatch(e,o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},t.parseManifest=function(t,e){return Q.parse(t,e)},t.checkStatus=function(t){if(t.ok)return t;var e=new Error(t.statusText);return e.response=t,Promise.reject(e)},t.loadManifest=function(e){return new Promise((function(n,i){fetch(e).then(t.checkStatus).then((function(t){return t.json()})).then((function(t){n(t)})).catch((function(t){i()}))}))},t.loadExternalResourcesAuth1=function(e,n,i,r,a,o,s,u){return new Promise((function(l,c){var h=e.map((function(e){return t.loadExternalResourceAuth1(e,n,i,r,a,o,s,u)}));Promise.all(h).then((function(){l(e)})).catch((function(t){c(t)}))}))},t.loadExternalResourceAuth1=function(e,n,i,r,a,o,s,u){return N(this,void 0,void 0,(function(){var l;return D(this,(function(c){switch(c.label){case 0:return[4,r(e)];case 1:return(l=c.sent())?[4,e.getData(l)]:[3,6];case 2:return c.sent(),e.status!==x.OK?[3,3]:[2,e];case 3:return[4,t.doAuthChain(e,n,i,a,o,s,u)];case 4:c.sent(),c.label=5;case 5:if(e.status===x.OK||e.status===x.MOVED_TEMPORARILY)return[2,e];throw t.createAuthorizationFailedError();case 6:return[4,e.getData()];case 7:return c.sent(),e.status!==x.MOVED_TEMPORARILY&&e.status!==x.UNAUTHORIZED?[3,9]:[4,t.doAuthChain(e,n,i,a,o,s,u)];case 8:c.sent(),c.label=9;case 9:if(e.status===x.OK||e.status===x.MOVED_TEMPORARILY)return[2,e];throw t.createAuthorizationFailedError()}}))}))},t.doAuthChain=function(e,n,i,r,a,o,s){return N(this,void 0,void 0,(function(){var u,l,c,h,p,f,d,g;return D(this,(function(v){switch(v.label){case 0:return e.isAccessControlled()?((u=e.externalService)&&(u.options=e.options),(l=e.kioskService)&&(l.options=e.options),(c=e.clickThroughService)&&(c.options=e.options),(h=e.loginService)&&(h.options=e.options),e.isResponseHandled||e.status!==x.MOVED_TEMPORARILY?[3,2]:[4,o(e)]):[2,e];case 1:return v.sent(),[2,e];case 2:return p=null,f=null,(p=u)?(f=p,[4,t.attemptResourceWithToken(e,i,p)]):[3,4];case 3:return v.sent(),[2,e];case 4:return(p=l)?(f=p,(d=n(p))?[4,r(d)]:[3,7]):[3,7];case 5:return v.sent(),[4,t.attemptResourceWithToken(e,i,p)];case 6:return v.sent(),[2,e];case 7:return(p=c)?(f=p,[4,a(e,p)]):[3,11];case 8:return(g=v.sent())?[4,r(g)]:[3,11];case 9:return v.sent(),[4,t.attemptResourceWithToken(e,i,p)];case 10:return v.sent(),[2,e];case 11:return(p=h)?(f=p,[4,a(e,p)]):[3,15];case 12:return(g=v.sent())?[4,r(g)]:[3,15];case 13:return v.sent(),[4,t.attemptResourceWithToken(e,i,p)];case 14:return v.sent(),[2,e];case 15:return f&&s(e,f),[2]}}))}))},t.attemptResourceWithToken=function(t,e,n){return N(this,void 0,void 0,(function(){var i,r;return D(this,(function(a){switch(a.label){case 0:return(i=n.getService(o.ServiceProfile.AUTH_1_TOKEN))?[4,e(t,i)]:[3,3];case 1:return(r=a.sent())&&r.accessToken?[4,t.getData(r)]:[3,3];case 2:return a.sent(),[2,t];case 3:return[2]}}))}))},t.loadExternalResourcesAuth09=function(e,n,i,r,a,o,s,u,l,c){return new Promise((function(h,p){var f=e.map((function(e){return t.loadExternalResourceAuth09(e,n,i,r,a,o,s,u,l,c)}));Promise.all(f).then((function(){h(e)})).catch((function(t){p(t)}))}))},t.loadExternalResourceAuth09=function(e,n,i,r,a,o,s,u,l,c){return new Promise((function(h,p){c&&c.pessimisticAccessControl?e.getData().then((function(){e.isAccessControlled()?e.clickThroughService?(h(i(e)),h(r(e))):a(e).then((function(){o(e,!0).then((function(n){e.getData(n).then((function(){h(l(e))})).catch((function(e){p(t.createInternalServerError(e))}))})).catch((function(e){p(t.createInternalServerError(e))}))})).catch((function(e){p(t.createInternalServerError(e))})):h(e)})).catch((function(e){p(t.createInternalServerError(e))})):u(e,n).then((function(c){c?e.getData(c).then((function(){e.status===x.OK?h(l(e)):t.authorize(e,n,i,r,a,o,s,u).then((function(){h(l(e))})).catch((function(e){p(t.createAuthorizationFailedError())}))})).catch((function(e){p(t.createAuthorizationFailedError())})):t.authorize(e,n,i,r,a,o,s,u).then((function(){h(l(e))})).catch((function(e){p(t.createAuthorizationFailedError())}))})).catch((function(e){p(t.createAuthorizationFailedError())}))}))},t.createError=function(t,e){var n=new Error;return n.message=e,n.name=String(t),n},t.createAuthorizationFailedError=function(){return t.createError(G.AUTHORIZATION_FAILED,\"Authorization failed\")},t.createRestrictedError=function(){return t.createError(G.RESTRICTED,\"Restricted\")},t.createInternalServerError=function(e){return t.createError(G.INTERNAL_SERVER_ERROR,e)},t.authorize=function(e,n,i,r,a,o,s,u){return new Promise((function(l,c){e.getData().then((function(){e.isAccessControlled()?u(e,n).then((function(u){u?e.getData(u).then((function(){e.status===x.OK?l(e):t.showAuthInteraction(e,n,i,r,a,o,s,l,c)})).catch((function(e){c(t.createInternalServerError(e))})):o(e,!1).then((function(u){u?s(e,u,n).then((function(){e.getData(u).then((function(){e.status===x.OK?l(e):t.showAuthInteraction(e,n,i,r,a,o,s,l,c)})).catch((function(e){c(t.createInternalServerError(e))}))})).catch((function(e){c(t.createInternalServerError(e))})):t.showAuthInteraction(e,n,i,r,a,o,s,l,c)}))})).catch((function(e){c(t.createInternalServerError(e))})):l(e)}))}))},t.showAuthInteraction=function(e,n,i,r,a,o,s,u,l){e.status!==x.MOVED_TEMPORARILY||e.isResponseHandled?e.clickThroughService&&!e.isResponseHandled?i(e).then((function(){o(e,!0).then((function(i){s(e,i,n).then((function(){e.getData(i).then((function(){u(e)})).catch((function(e){l(t.createInternalServerError(e))}))})).catch((function(e){l(t.createInternalServerError(e))}))})).catch((function(e){l(t.createInternalServerError(e))}))})):a(e).then((function(){o(e,!0).then((function(i){s(e,i,n).then((function(){e.getData(i).then((function(){u(e)})).catch((function(e){l(t.createInternalServerError(e))}))})).catch((function(e){l(t.createInternalServerError(e))}))})).catch((function(e){l(t.createInternalServerError(e))}))})):u(e)},t.getService=function(t,e){for(var n=this.getServices(t),i=0;i<n.length;i++){var r=n[i];if(r.getProfile()===e)return r}return null},t.getResourceById=function(e,n){return t.traverseAndFind(e.__jsonld,\"@id\",n)},t.traverseAndFind=function(e,n,i){if(e.hasOwnProperty(n)&&e[n]===i)return e;for(var r=0;r<Object.keys(e).length;r++)if(\"object\"==typeof e[Object.keys(e)[r]]){var a=t.traverseAndFind(e[Object.keys(e)[r]],n,i);if(null!=a)return a}},t.getServices=function(t){var e,n=[];if(!(e=t.__jsonld?t.__jsonld.service:t.service))return n;Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var r=e[i];if(\"string\"==typeof r){var a=this.getResourceById(t.options.resource,r);a&&n.push(new J(a.__jsonld||a,t.options))}else n.push(new J(r,t.options))}return n},t.getTemporalComponent=function(t){var e=/t=([^&]+)/g.exec(t),n=null;return e&&e[1]&&(n=e[1].split(\",\")),n},t}(),j=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),F=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i},$=function(){function t(t,e,n){void 0===n&&(n=\"none\"),Array.isArray(t)&&1===t.length?this._value=t[0]:this._value=t,\"none\"!==e&&\"@none\"!==e||(e=void 0),this._locale=e,this._defaultLocale=n}return t.parseV2Value=function(e,n){return\"string\"==typeof e?new t(e,void 0,n):e[\"@value\"]?new t(e[\"@value\"],e[\"@language\"],n):null},Object.defineProperty(t.prototype,\"value\",{get:function(){return Array.isArray(this._value)?this._value.join(\"<br/>\"):this._value},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,\"locale\",{get:function(){return void 0===this._locale?this._defaultLocale:this._locale},enumerable:!0,configurable:!0}),t.prototype.addValue=function(t){Array.isArray(this._value)||(this._value=[this._value]),Array.isArray(t)?this._value=this._value.concat(t):this._value.push(t)},t}(),k=function(t){function e(n,i){void 0===n&&(n=[]);var r=t.apply(this,n)||this;return r.__proto__=e.prototype,r._defaultLocale=i,r}return j(e,t),e.parse=function(t,n){if(!t)return new e([],n);if(Array.isArray(t)){var i=(r=t.map((function(t){return $.parseV2Value(t,n)})).filter((function(t){return null!==t}))).reduce((function(t,e){var n=e._locale;return n||(n=\"none\"),t[n]?t[n].addValue(e._value):t[n]=e,t}),{});return new e(Object.values(i),n)}return\"string\"==typeof t?new e([new $(t,void 0,n)],n):t[\"@language\"]?new e(null!==(r=$.parseV2Value(t))?[r]:[],n):new e(Object.keys(t).map((function(e){var i=t[e];if(!Array.isArray(i))throw new Error(\"A IIIF v3 localized property value must have an array as the value for a given language.\");return new $(i,e,n)})),n);var r},e.prototype.getSuitableLocale=function(t){for(var e=F(this).map((function(t){return t._locale})).filter((function(t){return void 0!==t})),n=function(t){var n=e.find((function(e){return e===t}));if(n)return{value:n}},i=0,r=t;i<r.length;i++){var a=n(r[i]);if(\"object\"==typeof a)return a.value}for(var o=function(t){var n=e.find((function(e){return V.getInexactLocale(e)===V.getInexactLocale(t)}));if(n)return{value:n}},s=0,u=t;s<u.length;s++){var l=o(u[s]);if(\"object\"==typeof l)return l.value}},e.prototype.setValue=function(t,e){var n=void 0;if(e){var i=this.getSuitableLocale([e]);i&&(n=this.find((function(t){return t._locale===i})))}else n=this.find((function(t){return void 0===t._locale}));n?n._value=t:this.push(new $(t,e,this._defaultLocale))},e.prototype.getValue=function(t,e){var n=this.getValues(t);return 0===n.length?null:e?n.join(e):n[0]},e.prototype.getValues=function(t){if(!this.length)return[];var e;if(e=t?Array.isArray(t)?t:[t]:[],1===this.length&&void 0===this[0]._locale){var n=this[0]._value;return Array.isArray(n)?n:[n]}var i=this.getSuitableLocale(e);if(i){n=this.find((function(t){return t._locale===i}))._value;return Array.isArray(n)?n:[n]}if(!this.find((function(t){return void 0===t._locale}))){n=this[0]._value;return Array.isArray(n)?n:[n]}var r=this.find((function(t){return void 0===t._locale}));return r?Array.isArray(r._value)?r._value:[r._value]:[]},e}(Array),U=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),H=function(t){function e(e,n){var i=t.call(this,e,n)||this;if(i.index=0,i._allRanges=null,i.items=[],i._topRanges=[],i.__jsonld.structures&&i.__jsonld.structures.length)for(var r=i._getTopRanges(),a=0;a<r.length;a++){var o=r[a];i._parseRanges(o,String(a))}return i}return U(e,t),e.prototype.getPosterCanvas=function(){var t=this.getProperty(\"posterCanvas\");return t&&(t=new A(t,this.options)),t},e.prototype.getAccompanyingCanvas=function(){var t=this.getProperty(\"accompanyingCanvas\");return t&&(t=new A(t,this.options)),t},e.prototype.getBehavior=function(){var t=this.getProperty(\"behavior\");return Array.isArray(t)&&(t=t[0]),t||null},e.prototype.getDefaultTree=function(){if(t.prototype.getDefaultTree.call(this),this.defaultTree.data.type=V.normaliseType(tt.MANIFEST),!this.isLoaded)return this.defaultTree;var e=this.getTopRanges();return e.length&&e[0].getTree(this.defaultTree),V.generateTreeNodeIds(this.defaultTree),this.defaultTree},e.prototype._getTopRanges=function(){var t=[];if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var e=0;e<this.__jsonld.structures.length;e++){var n=this.__jsonld.structures[e];n.viewingHint===o.ViewingHint.TOP&&t.push(n)}if(!t.length){var i={};i.ranges=this.__jsonld.structures,t.push(i)}}return t},e.prototype.getTopRanges=function(){return this._topRanges},e.prototype._getRangeById=function(t){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var e=0;e<this.__jsonld.structures.length;e++){var n=this.__jsonld.structures[e];if(n[\"@id\"]===t||n.id===t)return n}return null},e.prototype._parseRanges=function(t,e,n){var i,r=null;if(\"string\"==typeof t&&(r=t,t=this._getRangeById(r)),t){(i=new W(t,this.options)).parentRange=n,i.path=e,n?n.items.push(i):this._topRanges.push(i);var a=t.items||t.members;if(a)for(var o=0;o<a.length;o++){var s=a[o];if(s[\"@type\"]&&\"sc:range\"===s[\"@type\"].toLowerCase()||s.type&&\"range\"===s.type.toLowerCase())this._parseRanges(s,e+\"/\"+o,i);else if(s[\"@type\"]&&\"sc:canvas\"===s[\"@type\"].toLowerCase()||s.type&&\"canvas\"===s.type.toLowerCase()){i.canvases||(i.canvases=[]);var u=s.id||s[\"@id\"];i.canvases.push(u)}}else if(t.ranges)for(o=0;o<t.ranges.length;o++)this._parseRanges(t.ranges[o],e+\"/\"+o,i)}else console.warn(\"Range:\",r,\"does not exist\")},e.prototype.getAllRanges=function(){if(null!=this._allRanges)return this._allRanges;this._allRanges=[];for(var t=this.getTopRanges(),e=function(e){var i=t[e];i.id&&n._allRanges.push(i);var r=function(t,e){t.add(e);var n=e.getRanges();return n.length?n.reduce(r,t):t},a=Array.from(i.getRanges().reduce(r,new Set));n._allRanges=n._allRanges.concat(a)},n=this,i=0;i<t.length;i++)e(i);return this._allRanges},e.prototype.getRangeById=function(t){for(var e=this.getAllRanges(),n=0;n<e.length;n++){var i=e[n];if(i.id===t)return i}return null},e.prototype.getRangeByPath=function(t){for(var e=this.getAllRanges(),n=0;n<e.length;n++){var i=e[n];if(i.path===t)return i}return null},e.prototype.getSequences=function(){if(this.items.length)return this.items;var t=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(t)for(var e=0;e<t.length;e++){var n=t[e],i=new q(n,this.options);this.items.push(i)}else if(this.__jsonld.items){i=new q(this.__jsonld.items,this.options);this.items.push(i)}return this.items},e.prototype.getSequenceByIndex=function(t){return this.getSequences()[t]},e.prototype.getTotalSequences=function(){return this.getSequences().length},e.prototype.getManifestType=function(){var t=this.getService(o.ServiceProfile.UI_EXTENSIONS);return t?t.getProperty(\"manifestType\"):r.EMPTY},e.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},e.prototype.isPagingEnabled=function(){var t=this.getViewingHint();if(t)return t===o.ViewingHint.PAGED;var e=this.getBehavior();return!!e&&e===o.Behavior.PAGED},e.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")},e.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},e}(p);!function(t){t.EMPTY=\"\",t.MANUSCRIPT=\"manuscript\",t.MONOGRAPH=\"monograph\"}(r||(r={}));var G,B=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),W=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._ranges=null,i.canvases=null,i.items=[],i}return B(e,t),e.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:this.canvases?this.canvases:[]},e.prototype.getDuration=function(){if(this.canvases&&this.canvases.length){for(var t=[],e=[],n=0,i=this.canvases;n<i.length;n++){if(f=i[n]){var r=f.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,f],a=r[1],o=r[2],s=r[3];a&&(t.push(parseFloat(o)),e.push(parseFloat(s)))}}if(t.length&&e.length)return new R(Math.min.apply(Math,t),Math.max.apply(Math,e))}else{t=[],e=[];for(var u=0,l=g=this.getRanges();u<l.length;u++){(v=l[u].getDuration())&&(t.push(v.start),e.push(v.end))}if(t.length&&e.length)return new R(Math.min.apply(Math,t),Math.max.apply(Math,e))}var c,h;if(this.canvases&&this.canvases.length)for(var p=0;p<this.canvases.length;p++){var f=this.canvases[p],d=V.getTemporalComponent(f);d&&d.length>1&&(0===p&&(c=Number(d[0])),p===this.canvases.length-1&&(h=Number(d[1])))}else{var g=this.getRanges();for(p=0;p<g.length;p++){var v;(v=g[p].getDuration())&&(0===p&&(c=v.start),p===g.length-1&&(h=v.end))}}if(void 0!==c&&void 0!==h)return new R(c,h)},e.prototype.getRanges=function(){return this._ranges?this._ranges:this._ranges=this.items.filter((function(t){return t.isRange()}))},e.prototype.getBehavior=function(){var t=this.getProperty(\"behavior\");return Array.isArray(t)&&(t=t[0]),t||null},e.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")},e.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},e.prototype.getTree=function(t){t.data=this,this.treeNode=t;var e=this.getRanges();if(e&&e.length)for(var n=0;n<e.length;n++){var i=e[n],r=new rt;t.addNode(r),this._parseTreeNode(r,i)}return V.generateTreeNodeIds(t),t},e.prototype.spansTime=function(t){var e=this.getDuration();return!!(e&&t>=e.start&&t<=e.end)},e.prototype._parseTreeNode=function(t,e){t.label=e.getLabel().getValue(this.options.locale),t.data=e,t.data.type=V.normaliseType(tt.RANGE),e.treeNode=t;var n=e.getRanges();if(n&&n.length)for(var i=0;i<n.length;i++){var r=n[i];if(r.getBehavior()!==o.Behavior.NO_NAV){var a=new rt;t.addNode(a),this._parseTreeNode(a,r)}}},e}(u),z=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Y=function(t){function e(e,n){return t.call(this,e,n)||this}return z(e,t),e.prototype.getFormat=function(){return this.getProperty(\"format\")},e}(u),X=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),q=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i.items=[],i._thumbnails=null,i}return X(e,t),e.prototype.getCanvases=function(){if(this.items.length)return this.items;var t=this.__jsonld.canvases||this.__jsonld.elements;if(t)for(var e=0;e<t.length;e++){var n=t[e];(i=new A(n,this.options)).index=e,this.items.push(i)}else if(this.__jsonld)for(e=0;e<this.__jsonld.length;e++){var i;n=this.__jsonld[e];(i=new A(n,this.options)).index=e,this.items.push(i)}return this.items},e.prototype.getCanvasById=function(t){for(var e=0;e<this.getTotalCanvases();e++){var n=this.getCanvasByIndex(e),i=V.normaliseUrl(n.id);if(V.normaliseUrl(t)===i)return n}return null},e.prototype.getCanvasByIndex=function(t){return this.getCanvases()[t]},e.prototype.getCanvasIndexById=function(t){for(var e=0;e<this.getTotalCanvases();e++){if(this.getCanvasByIndex(e).id===t)return e}return null},e.prototype.getCanvasIndexByLabel=function(t,e){t=t.trim(),isNaN(t)||(t=parseInt(t,10).toString(),e&&(t+=\"r\"));for(var n,i,r,a=/(\\d*)\\D+(\\d*)/,o=0;o<this.getTotalCanvases();o++){var s=this.getCanvasByIndex(o);if(s.getLabel().getValue(this.options.locale)===t)return o;if((n=a.exec(t))&&(i=n[1],(r=n[2])&&new RegExp(\"^\"+i+\"\\\\D+\"+r+\"$\").test(s.getLabel().toString())))return o}return-1},e.prototype.getLastCanvasLabel=function(t){for(var e=this.getTotalCanvases()-1;e>=0;e--){var n=this.getCanvasByIndex(e).getLabel().getValue(this.options.locale);if(t){if(/^[a-zA-Z0-9]*$/.test(n))return n}else if(n)return n}return this.options.defaultLabel},e.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},e.prototype.getNextPageIndex=function(t,e){var n;if(e){var i=this.getPagedIndices(t),r=this.getViewingDirection();n=r&&r===o.ViewingDirection.RIGHT_TO_LEFT?i[0]+1:i[i.length-1]+1}else n=t+1;return n>this.getLastPageIndex()?-1:n},e.prototype.getPagedIndices=function(t,e){var n=[];if(e){n=this.isFirstCanvas(t)||this.isLastCanvas(t)?[t]:t%2?[t,t+1]:[t-1,t];var i=this.getViewingDirection();i&&i===o.ViewingDirection.RIGHT_TO_LEFT&&(n=n.reverse())}else n.push(t);return n},e.prototype.getPrevPageIndex=function(t,e){var n;if(e){var i=this.getPagedIndices(t),r=this.getViewingDirection();n=r&&r===o.ViewingDirection.RIGHT_TO_LEFT?i[i.length-1]-1:i[0]-1}else n=t-1;return n},e.prototype.getStartCanvasIndex=function(){var t=this.getStartCanvas();if(t)for(var e=0;e<this.getTotalCanvases();e++){if(this.getCanvasByIndex(e).id===t)return e}return 0},e.prototype.getThumbs=function(t,e){for(var n=[],i=this.getTotalCanvases(),r=0;r<i;r++){var a=this.getCanvasByIndex(r),o=new et(t,a);n.push(o)}return n},e.prototype.getThumbnails=function(){if(null!=this._thumbnails)return this._thumbnails;this._thumbnails=[];for(var t=this.getCanvases(),e=0;e<t.length;e++){var n=t[e].getThumbnail();n&&this._thumbnails.push(n)}return this._thumbnails},e.prototype.getStartCanvas=function(){return this.getProperty(\"startCanvas\")},e.prototype.getTotalCanvases=function(){return this.getCanvases().length},e.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")?this.getProperty(\"viewingDirection\"):this.options.resource.getViewingDirection?this.options.resource.getViewingDirection():null},e.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},e.prototype.isCanvasIndexOutOfRange=function(t){return t>this.getTotalCanvases()-1},e.prototype.isFirstCanvas=function(t){return 0===t},e.prototype.isLastCanvas=function(t){return t===this.getTotalCanvases()-1},e.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},e.prototype.isPagingEnabled=function(){var t=this.getViewingHint();return!!t&&t===o.ViewingHint.PAGED},e.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2==0},e}(u),Q=function(){function t(){}return t.parse=function(t,e){return\"string\"==typeof t&&(t=JSON.parse(t)),this.parseJson(t,e)},t.parseJson=function(t,e){var n;if(e&&e.navDate&&!isNaN(e.navDate.getTime())&&(t.navDate=e.navDate.toString()),t[\"@type\"])switch(t[\"@type\"]){case\"sc:Collection\":n=this.parseCollection(t,e);break;case\"sc:Manifest\":n=this.parseManifest(t,e);break;default:return null}else switch(t.type){case\"Collection\":n=this.parseCollection(t,e);break;case\"Manifest\":n=this.parseManifest(t,e);break;default:return null}return n.isLoaded=!0,n},t.parseCollection=function(t,e){var n=new O(t,e);return e?(n.index=e.index||0,e.resource&&(n.parentCollection=e.resource.parentCollection)):n.index=0,this.parseCollections(n,e),this.parseManifests(n,e),this.parseItems(n,e),n},t.parseCollections=function(t,e){var n;if(t.__jsonld.collections?n=t.__jsonld.collections:t.__jsonld.items&&(n=t.__jsonld.items.filter((function(t){return\"collection\"===t.type.toLowerCase()}))),n)for(var i=0;i<n.length;i++){e&&(e.index=i);var r=this.parseCollection(n[i],e);r.index=i,r.parentCollection=t,t.items.push(r)}},t.parseManifest=function(t,e){return new H(t,e)},t.parseManifests=function(t,e){var n;if(t.__jsonld.manifests?n=t.__jsonld.manifests:t.__jsonld.items&&(n=t.__jsonld.items.filter((function(t){return\"manifest\"===t.type.toLowerCase()}))),n)for(var i=0;i<n.length;i++){var r=this.parseManifest(n[i],e);r.index=i,r.parentCollection=t,t.items.push(r)}},t.parseItem=function(t,e){if(t[\"@type\"]){if(\"sc:manifest\"===t[\"@type\"].toLowerCase())return this.parseManifest(t,e);if(\"sc:collection\"===t[\"@type\"].toLowerCase())return this.parseCollection(t,e)}else if(t.type){if(\"manifest\"===t.type.toLowerCase())return this.parseManifest(t,e);if(\"collection\"===t.type.toLowerCase())return this.parseCollection(t,e)}return null},t.parseItems=function(t,e){var n=t.__jsonld.members||t.__jsonld.items;if(n)for(var i=function(i){e&&(e.index=i);var a=r.parseItem(n[i],e);return a?t.items.filter((function(t){return t.id===a.id}))[0]?\"continue\":(a.index=i,a.parentCollection=t,void t.items.push(a)):{value:void 0}},r=this,a=0;a<n.length;a++){var o=i(a);if(\"object\"==typeof o)return o.value}},t}(),K=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),J=function(t){function e(e,n){return t.call(this,e,n)||this}return K(e,t),e.prototype.getProfile=function(){var t=this.getProperty(\"profile\");return t||(t=this.getProperty(\"dcterms:conformsTo\")),Array.isArray(t)?t[0]:t},e.prototype.getConfirmLabel=function(){return V.getLocalisedValue(this.getProperty(\"confirmLabel\"),this.options.locale)},e.prototype.getDescription=function(){return V.getLocalisedValue(this.getProperty(\"description\"),this.options.locale)},e.prototype.getFailureDescription=function(){return V.getLocalisedValue(this.getProperty(\"failureDescription\"),this.options.locale)},e.prototype.getFailureHeader=function(){return V.getLocalisedValue(this.getProperty(\"failureHeader\"),this.options.locale)},e.prototype.getHeader=function(){return V.getLocalisedValue(this.getProperty(\"header\"),this.options.locale)},e.prototype.getServiceLabel=function(){return V.getLocalisedValue(this.getProperty(\"label\"),this.options.locale)},e.prototype.getInfoUri=function(){var t=this.id;return t.endsWith(\"/\")||(t+=\"/\"),t+=\"info.json\"},e}(u),Z=function(t,e){this.width=t,this.height=e};!function(t){t[t.AUTHORIZATION_FAILED=1]=\"AUTHORIZATION_FAILED\",t[t.FORBIDDEN=2]=\"FORBIDDEN\",t[t.INTERNAL_SERVER_ERROR=3]=\"INTERNAL_SERVER_ERROR\",t[t.RESTRICTED=4]=\"RESTRICTED\"}(G||(G={}));var tt,et=function(t,e){this.data=e,this.index=e.index,this.width=t;var n=e.getHeight()/e.getWidth();this.height=n?Math.floor(this.width*n):t,this.uri=e.getCanonicalImageUri(t),this.label=e.getLabel().getValue()},nt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),it=function(t){function e(e,n){return t.call(this,e,n)||this}return nt(e,t),e}(c),rt=function(){function t(t,e){this.label=t,this.data=e||{},this.nodes=[]}return t.prototype.addNode=function(t){this.nodes.push(t),t.parentNode=this},t.prototype.isCollection=function(){return this.data.type===V.normaliseType(tt.COLLECTION)},t.prototype.isManifest=function(){return this.data.type===V.normaliseType(tt.MANIFEST)},t.prototype.isRange=function(){return this.data.type===V.normaliseType(tt.RANGE)},t}();!function(t){t.COLLECTION=\"collection\",t.MANIFEST=\"manifest\",t.RANGE=\"range\"}(tt||(tt={}));var at=function(t){return V.loadManifest(t)},ot=function(t,e){return V.parseManifest(t,e)}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=function(){function t(){}return t.VOLUME_CHANGED=\"volumechanged\",t}();e.VolumeEvents=i},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=function(){function t(t,e){void 0===e&&(e={}),this.source=t,this.options=e}return t.prototype.attachTo=function(t){t.setAttribute(\"src\",this.source)},t}();e.MediaFormat=i},function(t,e,n){\"use strict\";function i(t,e){return t*e}Object.defineProperty(e,\"__esModule\",{value:!0}),e.timelineTime=function(t){return t},e.canvasTime=function(t){return t},e.annotationTime=function(t){return t},e.addTime=function(t,e){return t+e},e.minusTime=function(t,e){return t-e},e.multiplyTime=i,e.toMs=function(t){return i(t,1e3)},e.fromMs=function(t){return t/1e3}},function(t,e,n){var i=n(23);t.exports=function(t){return(null==t?0:t.length)?i(t,1):[]}},function(t,e,n){var i=n(40).Symbol;t.exports=i},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=function(){function t(){}return t.NEXT_RANGE=\"nextrange\",t.PAUSECANVAS=\"pause\",t.PLAYCANVAS=\"play\",t.PREVIOUS_RANGE=\"previousrange\",t}();e.CanvasInstanceEvents=i},function(t,e,n){\"use strict\";n.r(e),n.d(e,\"BaseComponent\",(function(){return i}));var i=function(){function t(t){this.options=t,this.options.data=Object.assign({},this.data(),t.data)}return t.prototype._init=function(){return this.el=this.options.target,this.el?(this.el.innerHTML=\"\",!0):(console.warn(\"element not found\"),!1)},t.prototype.data=function(){return{}},t.prototype.on=function(t,e,n){var i=this._e||(this._e={});(i[t]||(i[t]=[])).push({fn:e,ctx:n})},t.prototype.fire=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=[].slice.call(arguments,1),r=((this._e||(this._e={}))[t]||[]).slice(),a=0,o=r.length;a<o;a++)r[a].fn.apply(r[a].ctx,i)},t.prototype._resize=function(){},t.prototype.set=function(t){},t}()},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(3),r=n(26),a=n(12),o=function(){function t(){this.canvases=[],this.durationMap={},this.totalDuration=0,this.id=r.getTimestamp()}return t.prototype.addCanvas=function(t){this.canvases.push(jQuery.extend(!0,{},t));var e=t.getDuration()||0;this.totalDuration+=e,this.durationMap[t.id]={duration:e,runningDuration:this.totalDuration}},t.prototype.getContent=function(){var t=this,e=[];return this.canvases.forEach((function(n){var r=n.getContent();r.forEach((function(t){var e=t.getTarget();e&&(i.Utils.getTemporalComponent(e)||(t.__jsonld.target+=\"#t=0,\"+n.getDuration()))})),r.forEach((function(e){var n=e.getTarget();n&&(e.__jsonld.target=a.retargetTemporalComponent(t.canvases,n))})),e.push.apply(e,r)})),e},t.prototype.getDuration=function(){var t=0;return this.canvases.forEach((function(e){var n=e.getDuration();n&&(t+=n)})),Math.floor(t)},t.prototype.getWidth=function(){return this.canvases.length?this.canvases[0].getWidth():0},t.prototype.getHeight=function(){return this.canvases.length?this.canvases[0].getHeight():0},t}();e.VirtualCanvas=o},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(3);e.retargetTemporalComponent=function(t,e){var n=i.Utils.getTemporalComponent(e);if(n){for(var r=0,a=e.substr(0,e.indexOf(\"#\")),o=0;o<t.length;o++){var s=t[o];if(s.id.includes(a))break;var u=s.getDuration();u&&(r+=u)}return n[0]=Number(n[0])+r,n[1]=Number(n[1])+r,a+\"#t=\"+n[0]+\",\"+n[1]}}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(14);e.isHLSFormat=function(t){return i.hlsMimeTypes.includes(t.toString())}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.hlsMimeTypes=[\"application/vnd.apple.mpegurl\",\"vnd.apple.mpegurl\",\"audio/mpegurl\",\"audio/x-mpegurl\",\"application/x-mpegurl\",\"video/x-mpegurl\",\"video/mpegurl\",\"application/mpegurl\"]},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.isMpegDashFormat=function(t){return\"application/dash+xml\"===t.toString()}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(14);e.canPlayHls=function(){var t=\"object\"==typeof document&&document,e=t&&t.createElement(\"video\");return Boolean(e&&e.canPlayType)&&i.hlsMimeTypes.some((function(t){return!!e&&/maybe|probably/i.test(e.canPlayType(t))}))}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getSpatialComponent=function(t){var e=/xywh=([^&]+)/g.exec(t),n=null;return e&&e[1]&&(n=e[1].split(\",\")),n}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=function(){function t(){}return t.PLAY=\"play\",t.PAUSE=\"pause\",t.MEDIA_READY=\"mediaready\",t.LOG=\"log\",t.RANGE_CHANGED=\"rangechanged\",t.WAVEFORM_READY=\"waveformready\",t.WAVEFORMS_READY=\"waveformsready\",t}();e.Events=i},function(t,e,n){\"use strict\";function i(t,e){var n=[];return Object.keys(t).forEach((function(i){Object.is(e[i],t[i])||n.push(i)})),n}Object.defineProperty(e,\"__esModule\",{value:!0}),e.diffData=function(t,e){return Array.from(new Set(i(t,e).concat(i(e,t))))}},function(t,e,n){var i=n(23);t.exports=function(t){return(null==t?0:t.length)?i(t,1/0):[]}},function(t,e,n){\"use strict\";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError(\"Generator is already executing.\");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,\"__esModule\",{value:!0});var s=n(3),u=n(9),l=n(10),c=n(4),h=n(11),p=n(27),f=n(20),d=n(35),g=n(19),v=n(2),_=function(t){function e(e){var n=t.call(this,e)||this;return n._data=n.data(),n.canvasInstances=[],n._readyMedia=0,n._readyWaveforms=0,n._posterCanvasWidth=0,n._posterCanvasHeight=0,n._posterImageExpanded=!1,n._init(),n._resize(),n}return r(e,t),e.prototype._init=function(){var e=t.prototype._init.call(this);return this._$element=$(this.el),e||v.Logger.error(\"Component failed to initialise\"),e},e.prototype.getCurrentCanvasInstance=function(){var t=this._data.helper.getRangeById(this._data.range.id);if(!t)return null;var e=d.getFirstTargetedCanvasId(t);return e?this._data.helper.getCanvasById(e):null},e.prototype.data=function(){return{autoPlay:!1,constrainNavigationToRange:!1,defaultAspectRatio:.56,doubleClickMS:350,halveAtWidth:200,limitToRange:!1,posterImageRatio:.3,virtualCanvasEnabled:!0,content:{currentTime:\"Current Time\",collapse:\"Collapse\",duration:\"Duration\",expand:\"Expand\",mute:\"Mute\",next:\"Next\",pause:\"Pause\",play:\"Play\",previous:\"Previous\",unmute:\"Unmute\"},enableFastForward:!0,enableFastRewind:!0}},e.prototype.set=function(t){var e=this;v.Logger.groupCollapsed(\"AVComponent.set()\"),v.Logger.log(\"Data\",t);var n=Object.assign({},this._data);this._data=Object.assign(this._data,t);var i=f.diffData(n,this._data);if(i.includes(\"helper\")&&this._reset(),this._data.helper){if(this.canvasInstances.forEach((function(t,n){var r={};i.includes(\"limitToRange\")&&e._data.canvasId&&(r.limitToRange=e._data.limitToRange),i.includes(\"constrainNavigationToRange\")&&e._data.canvasId&&(r.constrainNavigationToRange=e._data.constrainNavigationToRange),i.includes(\"autoSelectRange\")&&e._data.canvasId&&(r.autoSelectRange=e._data.autoSelectRange),t.set(r)})),(i.includes(\"virtualCanvasEnabled\")||i.includes(\"canvasId\"))&&this._data.canvasId){var r=this._getCanvasInstanceById(this._data.canvasId);r&&this.canvasInstances.forEach((function(t){t.getCanvasId()!==r.getCanvasId()?t.set({visible:!1}):i.includes(\"range\")?t.set({visible:!0,range:e._data.range?jQuery.extend(!0,{},e._data.range):void 0}):t.set({visible:!0})}))}if(i.includes(\"virtualCanvasEnabled\")&&(this.set({range:void 0}),this._data.virtualCanvasEnabled&&this.canvasInstances.forEach((function(t){t.isVirtual()&&e.set({canvasId:t.getCanvasId(),range:void 0})}))),i.includes(\"range\")&&this._data.range){var a=this._data.helper.getRangeById(this._data.range.id);if(a){var o=d.getFirstTargetedCanvasId(a);if(o){var u=this._getCanvasInstanceById(o);if(u){if(u.isVirtual()&&this._data.virtualCanvasEnabled&&u.includesVirtualSubCanvas(o)){o=u.getCanvasId();for(var l=0;l<u.ranges.length;l++){var c=u.ranges[l];if(c.id===a.id){a=c;break}}}this._data.canvasId&&(this._data.canvasId.includes(\"://\")?s.Utils.normaliseUrl(this._data.canvasId):this._data.canvasId)!==o?this.set({canvasId:o,range:jQuery.extend(!0,{},a)}):u.set({range:jQuery.extend(!0,{},a)})}}}else v.Logger.warn(\"range not found\",{id:this._data.range.id})}this._render(),this._resize(),v.Logger.groupEnd()}else v.Logger.warn(\"must pass a helper object\")},e.prototype._render=function(){},e.prototype.reset=function(){this._reset()},e.prototype._reset=function(){var t=this;if(this._readyMedia=0,this._readyWaveforms=0,this._posterCanvasWidth=0,this._posterCanvasHeight=0,clearInterval(this._checkAllMediaReadyInterval),clearInterval(this._checkAllWaveformsReadyInterval),this.canvasInstances.forEach((function(t){t.destroy()})),this.canvasInstances=[],this._$element.empty(),this._data&&this._data.helper&&this._data.helper.manifest){var e=this._data.helper.manifest.getBehavior(),n=this._getCanvases();if(e&&\"auto-advance\"===e.toString()){var i=new h.VirtualCanvas;n.forEach((function(t){i.addCanvas(t)})),this._initCanvas(i)}n.forEach((function(e){t._initCanvas(e)})),this.canvasInstances.length>0&&(this._data.canvasId=this.canvasInstances[0].getCanvasId()),this._checkAllMediaReadyInterval=setInterval(this._checkAllMediaReady.bind(this),100),this._checkAllWaveformsReadyInterval=setInterval(this._checkAllWaveformsReady.bind(this),100),this._$posterContainer=$('<div class=\"poster-container\"></div>'),this._$element.append(this._$posterContainer),this._$posterImage=$('<div class=\"poster-image\"></div>'),this._$posterExpandButton=$('\\n <button class=\"btn\" title=\"'+(this._data&&this._data.content?this._data.content.expand:\"\")+'\">\\n <i class=\"av-icon av-icon-expand expand\" aria-hidden=\"true\"></i><span>'+(this._data&&this._data.content?this._data.content.expand:\"\")+\"</span>\\n </button>\\n \"),this._$posterImage.append(this._$posterExpandButton),this._$posterImage.on(\"touchstart click\",(function(e){e.preventDefault();var n=t._getPosterImageCss(!t._posterImageExpanded);if(t._$posterImage.animate(n),t._posterImageExpanded=!t._posterImageExpanded,t._data.content)if(t._posterImageExpanded){var i=t._data.content.collapse;t._$posterExpandButton.prop(\"title\",i),t._$posterExpandButton.find(\"i\").switchClass(\"expand\",\"collapse\")}else{i=t._data.content.expand;t._$posterExpandButton.prop(\"title\",i),t._$posterExpandButton.find(\"i\").switchClass(\"collapse\",\"expand\")}}));var r=this._data.helper.getAccompanyingCanvas();if(r||(r=this._data.helper.getPosterCanvas()),r){this._posterCanvasWidth=r.getWidth(),this._posterCanvasHeight=r.getHeight();var a=this._data.helper.getPosterImage();if(a||(a=this._data.helper.getAccompanyingCanvasImage()),a){this._$posterContainer.append(this._$posterImage);var o=this._getPosterImageCss(this._posterImageExpanded);o=Object.assign({},o,{\"background-image\":\"url(\"+a+\")\"}),this._$posterImage.css(o)}}}},e.prototype.setCurrentTime=function(t){return a(this,void 0,void 0,(function(){var e;return o(this,(function(n){return(e=this._getCurrentCanvas())?[2,e.setCurrentTime(t)]:[2]}))}))},e.prototype.getCurrentTime=function(){var t=this._getCurrentCanvas();return t?t.getClockTime():0},e.prototype.isPlaying=function(){return this.canvasInstances.reduce((function(t,e){return t||e.isPlaying()}),!1)},e.prototype._checkAllMediaReady=function(){this._readyMedia===this.canvasInstances.length&&(clearInterval(this._checkAllMediaReadyInterval),this.fire(g.Events.MEDIA_READY),this.resize())},e.prototype._checkAllWaveformsReady=function(){this._readyWaveforms===this._getCanvasInstancesWithWaveforms().length&&(clearInterval(this._checkAllWaveformsReadyInterval),this.fire(g.Events.WAVEFORMS_READY),this.resize())},e.prototype._getCanvasInstancesWithWaveforms=function(){return this.canvasInstances.filter((function(t){return t.waveforms.length>0}))},e.prototype._getCanvases=function(){return this._data.helper?this._data.helper.getCanvases():[]},e.prototype._initCanvas=function(t){var e=this,n=new p.CanvasInstance({target:document.createElement(\"div\"),data:Object.assign({},{canvas:t},this._data)});n.logMessage=this._logMessage.bind(this),n.isOnlyCanvasInstance=1===this._getCanvases().length,this._$element.append(n.$playerElement),n.init(),this.canvasInstances.push(n),n.on(\"play\",(function(){e.fire(g.Events.PLAY,n)}),!1),n.on(\"pause\",(function(){e.fire(g.Events.PAUSE,n)}),!1),n.on(g.Events.MEDIA_READY,(function(){e._readyMedia++,n.loaded()}),!1),n.on(g.Events.WAVEFORM_READY,(function(){e._readyWaveforms++}),!1),n.on(u.CanvasInstanceEvents.PREVIOUS_RANGE,(function(){e._prevRange(),e.play()}),!1),n.on(u.CanvasInstanceEvents.NEXT_RANGE,(function(){e._nextRange(),e.play()}),!1),n.on(g.Events.RANGE_CHANGED,(function(t){e.fire(g.Events.RANGE_CHANGED,t)}),!1),n.on(c.VolumeEvents.VOLUME_CHANGED,(function(t){e._setCanvasInstanceVolumes(t),e.fire(c.VolumeEvents.VOLUME_CHANGED,t)}),!1)},e.prototype.getCurrentRange=function(){var t=this._data.helper.getCurrentRange().id;return this._getCurrentCanvas().ranges.find((function(e){return e.id===t}))||null},e.prototype._prevRange=function(){if(this._data&&this._data.helper){var t=this.getCurrentRange();if(t){var e=this.getCurrentTime(),n=t.getDuration().start||0;if(e-n>5)return void this.setCurrentTime(n)}var i=this._data.helper.getPreviousRange();i?this.playRange(i.id):this._rewind()}},e.prototype._nextRange=function(){if(this._data&&this._data.helper){var t=this._data.helper.getNextRange();t&&this.playRange(t.id)}},e.prototype._setCanvasInstanceVolumes=function(t){this.canvasInstances.forEach((function(e){e.set({volume:t})}))},e.prototype._getNormaliseCanvasId=function(t){return t.includes(\"://\")?s.Utils.normaliseUrl(t):t},e.prototype._getCanvasInstanceById=function(t){if(t=this._getNormaliseCanvasId(t),this._data.virtualCanvasEnabled)for(var e=0;e<this.canvasInstances.length;e++){var n=(i=this.canvasInstances[e]).getCanvasId();if(n&&(n=this._getNormaliseCanvasId(n),(i.isVirtual()||1===this.canvasInstances.length)&&n===t||i.includesVirtualSubCanvas(t)))return i}else for(e=0;e<this.canvasInstances.length;e++){var i,r=(i=this.canvasInstances[e]).getCanvasId();if(r)if(s.Utils.normaliseUrl(r)===t)return i}},e.prototype._getCurrentCanvas=function(){if(this._data.canvasId)return this._getCanvasInstanceById(this._data.canvasId)},e.prototype._rewind=function(){if(!this._data.limitToRange){var t=this._getCurrentCanvas();t&&t.set({range:void 0})}},e.prototype.play=function(){var t=this._getCurrentCanvas();t&&t.play()},e.prototype.viewRange=function(t){var e=this._getCurrentCanvas();e&&e.viewRange(t)},e.prototype.pause=function(){var t=this._getCurrentCanvas();t&&t.pause()},e.prototype.playRange=function(t,e){if(void 0===e&&(e=!1),this._data.helper){var n=this._data.helper.getRangeById(t);n&&this.set({range:jQuery.extend(!0,{autoChanged:e},n)})}},e.prototype.showCanvas=function(t){var e=this._getCurrentCanvas();this._data.virtualCanvasEnabled&&e&&e.getCanvasId()===t&&!e.isVisible()?e.set({visible:!0}):this.set({canvasId:t})},e.prototype._logMessage=function(t){this.fire(g.Events.LOG,t)},e.prototype._getPosterImageCss=function(t){var e=this._getCurrentCanvas();if(e){var n=e.$playerElement.find(\".options-container\"),i=e.$playerElement.parent().width(),r=e.$playerElement.parent().height()-n.height();if(t)return{top:0,left:0,width:i,height:r};var a=void 0,o=void 0,s=void 0;return this._posterCanvasWidth>this._posterCanvasHeight?(a=this._posterCanvasHeight/this._posterCanvasWidth,s=(o=i*(this._data.posterImageRatio||1))*a):(a=this._posterCanvasWidth/this._posterCanvasHeight,o=(s=r*(this._data.posterImageRatio||1))*a),{top:0,left:i-o,width:o,height:s}}return null},e.prototype.resize=function(){this.canvasInstances.forEach((function(t){t.resize()})),this._getCurrentCanvas()&&this._$posterImage&&this._$posterImage.is(\":visible\")&&(this._posterImageExpanded?this._$posterImage.css(this._getPosterImageCss(!0)):this._$posterImage.css(this._getPosterImageCss(!1)))},e.newRanges=!0,e}(l.BaseComponent);e.AVComponent=_},function(t,e,n){var i=n(38),r=n(39);t.exports=function t(e,n,a,o,s){var u=-1,l=e.length;for(a||(a=r),s||(s=[]);++u<l;){var c=e[u];n>0&&a(c)?n>1?t(c,n-1,a,o,s):i(s,c):o||(s[s.length]=c)}return s}},function(t,e){t.exports=function(t){return null!=t&&\"object\"==typeof t}},function(t,e,n){\"use strict\";n.r(e),e.default=function(t,e){return e=e||{},new Promise((function(n,i){var r=new XMLHttpRequest,a=[],o=[],s={},u=function(){return{ok:2==(r.status/100|0),statusText:r.statusText,status:r.status,url:r.responseURL,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},clone:u,headers:{keys:function(){return a},entries:function(){return o},get:function(t){return s[t.toLowerCase()]},has:function(t){return t.toLowerCase()in s}}}};for(var l in r.open(e.method||\"get\",t,!0),r.onload=function(){r.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,(function(t,e,n){a.push(e=e.toLowerCase()),o.push([e,n]),s[e]=s[e]?s[e]+\",\"+n:n})),n(u())},r.onerror=i,r.withCredentials=\"include\"==e.credentials,e.headers)r.setRequestHeader(l,e.headers[l]);r.send(e.body||null)}))}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.getTimestamp=function(){return String((new Date).valueOf())}},function(t,e,n){\"use strict\";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError(\"Generator is already executing.\");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,\"__esModule\",{value:!0});var s=n(3),u=n(10),l=n(50),c=n(56),h=n(4),p=n(28),f=n(29),d=n(57),g=n(30),v=n(31),_=n(9),m=n(22),y=n(11),E=n(58),T=n(19),C=n(13),I=n(15),P=n(12),w=n(18),A=n(16),b=n(32),O=n(17),R=n(33),M=n(20),L=n(34),S=n(6),x=n(2),N=function(t){function e(e){var n=t.call(this,e)||this;return n._canvasClockFrequency=25,n._canvasClockStartDate=0,n._canvasClockTime=0,n._canvasHeight=0,n._canvasWidth=0,n._data=n.data(),n._highPriorityFrequency=25,n._isPlaying=!1,n._isStalled=!1,n._lowPriorityFrequency=250,n._mediaSyncMarginSecs=1,n._rangeSpanPadding=.25,n._readyMediaCount=0,n._stallRequestedBy=[],n._wasPlaying=!1,n.ranges=[],n.waveforms=[],n._buffering=!1,n._bufferShown=!1,n.isOnlyCanvasInstance=!1,n.waveformDeltaX=0,n.waveformPageX=0,n.waveFormInit=!1,n._scaleY=function(t,e){return Math.max(n._data.waveformBarWidth,t*e/256)},n._$element=$(n.options.target),n._data=n.options.data,n.$playerElement=$('<div class=\"player player--loading\"></div>'),n}return r(e,t),e.prototype.loaded=function(){var t=this;setTimeout((function(){t.$playerElement.removeClass(\"player--loading\")}),500)},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.getClockTime=function(){return this._canvasClockTime},e.prototype.createTimeStops=function(){var t=this,e=this._data.helper,n=this._data.canvas;if(e&&n){this.ranges=[],this._contentAnnotations=[];for(var i=[],r=0,a=n.canvases;r<a.length;r++)for(var o=a[r],s=0,u=o.getContent();s<u.length;s++){var h=u[s],f=p.extractMediaFromAnnotationBodies(h);if(f){var _=v.getMediaSourceFromAnnotationBody(h,f,{id:o.id,duration:o.getDuration()||0,height:o.getHeight(),width:o.getWidth()}),m=new l.MediaElement(_,{adaptiveAuthEnabled:this._data.adaptiveAuthEnabled});m.setSize(this._convertToPercentage(_.x||0,o.getHeight()),this._convertToPercentage(_.y||0,o.getWidth()),this._convertToPercentage(_.width||o.getWidth(),o.getWidth()),this._convertToPercentage(_.height||o.getHeight(),o.getHeight())),i.push(m);var y=h.getProperty(\"seeAlso\");if(y&&y.length){var E=y[0].id;this.waveforms.push(E)}}}var C=new d.CompositeMediaElement(i);C.appendTo(this.$playerElement),C.load().then((function(){t.fire(T.Events.MEDIA_READY)}));var I=g.createTimePlansFromManifest(e.manifest,i);window.timePlanPlayer=this.timePlanPlayer=new c.TimePlanPlayer(C,I,(function(e){t.setCurrentRangeId(e,{autoChanged:!0})}),(function(e){t._canvasClockTime=e}),(function(e){e?t.play(!0):t.pause(!0)}))}},e.prototype.init=function(){var t=this;if(this._data&&this._data.content&&this._data.canvas){this._$hoverPreviewTemplate=$('<div class=\"hover-preview\"><div class=\"label\"></div><div class=\"pointer\"><span class=\"arrow\"></span></div></div>'),this._$canvasContainer=$('<div class=\"canvas-container\"></div>'),this._$optionsContainer=$('<div class=\"options-container\"></div>'),this._$rangeTimelineContainer=$('<div class=\"range-timeline-container\"></div>'),this._$canvasTimelineContainer=$('<div class=\"canvas-timeline-container\"></div>'),this._$canvasHoverPreview=this._$hoverPreviewTemplate.clone(),this._$canvasHoverHighlight=$('<div class=\"hover-highlight\"></div>'),this._$rangeHoverPreview=this._$hoverPreviewTemplate.clone(),this._$rangeHoverHighlight=$('<div class=\"hover-highlight\"></div>'),this._$durationHighlight=$('<div class=\"duration-highlight\"></div>'),this._$timelineItemContainer=$('<div class=\"timeline-item-container\"></div>'),this._$controlsContainer=$('<div class=\"controls-container\"></div>'),this._$prevButton=$('\\n <button class=\"btn\" title=\"'+this._data.content.previous+'\">\\n <i class=\"av-icon av-icon-previous\" aria-hidden=\"true\"></i>'+this._data.content.previous+\"\\n </button>\"),this._$playButton=$('\\n <button class=\"btn\" title=\"'+this._data.content.play+'\">\\n <i class=\"av-icon av-icon-play play\" aria-hidden=\"true\"></i>'+this._data.content.play+\"\\n </button>\"),this._$nextButton=$('\\n <button class=\"btn\" title=\"'+this._data.content.next+'\">\\n <i class=\"av-icon av-icon-next\" aria-hidden=\"true\"></i>'+this._data.content.next+\"\\n </button>\"),this._$fastForward=$('\\n <button class=\"btn\" title=\"'+this._data.content.next+'\">\\n <i class=\"av-icon av-icon-fast-forward\" aria-hidden=\"true\"></i>'+(this._data.content.fastForward||\"\")+\"\\n </button>\"),this._$fastRewind=$('\\n <button class=\"btn\" title=\"'+this._data.content.next+'\">\\n <i class=\"av-icon av-icon-fast-rewind\" aria-hidden=\"true\"></i>'+(this._data.content.fastRewind||\"\")+\"\\n </button>\"),this._$timeDisplay=$('<div class=\"time-display\"><span class=\"canvas-time\"></span> / <span class=\"canvas-duration\"></span></div>'),this._$canvasTime=this._$timeDisplay.find(\".canvas-time\"),this._$canvasDuration=this._$timeDisplay.find(\".canvas-duration\"),this.isVirtual()&&this.$playerElement.addClass(\"virtual\");var e=$('<div class=\"volume\"></div>');this._volume=new f.AVVolumeControl({target:e[0],data:Object.assign({},this._data)}),this._volume.on(h.VolumeEvents.VOLUME_CHANGED,(function(e){t.fire(h.VolumeEvents.VOLUME_CHANGED,e)}),!1),this._$controlsContainer.append(this._$prevButton,this._data.enableFastRewind?this._$fastRewind:null,this._$playButton,this._data.enableFastForward?this._$fastForward:null,this._$nextButton,this._$timeDisplay,e),this._$canvasTimelineContainer.append(this._$canvasHoverPreview,this._$canvasHoverHighlight,this._$durationHighlight),this._$rangeTimelineContainer.append(this._$rangeHoverPreview,this._$rangeHoverHighlight),this._$optionsContainer.append(this._$canvasTimelineContainer,this._$rangeTimelineContainer,this._$controlsContainer),this.$playerElement.append(this._$canvasContainer,this._$optionsContainer),this._$canvasHoverPreview.hide(),this._$rangeHoverPreview.hide();var n=this.isVirtual()&&m.AVComponent.newRanges;if(n&&this.createTimeStops(),!n&&this._data&&this._data.helper&&this._data.canvas){var i=[];L.isVirtual(this._data.canvas)?this._data.canvas.canvases.forEach((function(e){if(t._data&&t._data.helper){var n=t._data.helper.getCanvasRanges(e),r=[];n.forEach((function(e){var n=jQuery.extend(!0,{},e);if(r.push(n),n.canvases&&n.canvases.length)for(var i=0;i<n.canvases.length;i++)L.isVirtual(t._data.canvas)&&(n.canvases[i]=P.retargetTemporalComponent(t._data.canvas.canvases,n.__jsonld.items[i].id))})),i.push.apply(i,r)}})):i=i.concat(this._data.helper.getCanvasRanges(this._data.canvas)),i.forEach((function(e){t.ranges.push(e)}))}var r=this._data.canvas.getWidth(),a=this._data.canvas.getHeight();this._canvasWidth=r||this.$playerElement.parent().width(),this._canvasHeight=a||this._canvasWidth*(this._data.defaultAspectRatio||1);var o=this,u=0,l=0;if(this._$prevButton.on(\"touchstart click\",(function(e){e.preventDefault(),1===++u?(t._previous(!1),l=setTimeout((function(){u=0,l=0}),t._data.doubleClickMS)):(t._previous(!0),clearTimeout(l),u=0,l=0)})),this._$playButton.on(\"touchstart click\",(function(e){e.preventDefault(),t._isPlaying?t.pause():t.play()})),this._$nextButton.on(\"touchstart click\",(function(e){e.preventDefault(),t._next()})),this._$fastForward.on(\"touchstart click\",(function(e){var n=t.getRangeTiming().end,i=S.addTime(t.getClockTime(),20);return i<n?t._setCurrentTime(i):t._setCurrentTime(n)})),this._$fastRewind.on(\"touchstart click\",(function(e){var n=t.getRangeTiming().start,i=S.minusTime(t.getClockTime(),20);return i>=n?t._setCurrentTime(i):t._setCurrentTime(n)})),n?this._$canvasTimelineContainer.slider({value:0,step:.01,orientation:\"horizontal\",range:\"min\",min:0,max:this.timePlanPlayer.getDuration(),animate:!1,slide:function(e,n){t._setCurrentTime(t.timePlanPlayer.plan.start+n.value)}}):this._$canvasTimelineContainer.slider({value:0,step:.01,orientation:\"horizontal\",range:\"min\",max:o._getDuration(),animate:!1,create:function(t,e){},slide:function(t,e){o._setCurrentTime(e.value)},stop:function(t,e){}}),this._$canvasTimelineContainer.mouseout((function(){o._$canvasHoverHighlight.width(0),o._$canvasHoverPreview.hide()})),this._$rangeTimelineContainer.mouseout((function(){o._$rangeHoverHighlight.width(0),o._$rangeHoverPreview.hide()})),this._$canvasTimelineContainer.on(\"mousemove\",(function(e){n?t._updateHoverPreview(e,t._$canvasTimelineContainer,t.timePlanPlayer.getDuration()):t._updateHoverPreview(e,t._$canvasTimelineContainer,t._getDuration())})),this._$rangeTimelineContainer.on(\"mousemove\",(function(e){if(n)t._updateHoverPreview(e,t._$canvasTimelineContainer,t.timePlanPlayer.getDuration());else if(t._data.range){var i=t._data.range.getDuration();t._updateHoverPreview(e,t._$rangeTimelineContainer,i?i.getLength():0)}})),!n){this._contentAnnotations=[];var c=this._data.canvas.getContent();this._$timelineItemContainer.hide();for(var p=0;p<c.length;p++){var d=c[p],g=void 0,v=d.getBody();if(!v.length)return void x.Logger.warn(\"item has no body\");var _=this._getBody(v);if(_){var y=_.getType(),E=_.getFormat();y&&\"textualbody\"===y.toString()||(g=_.id.split(\"#\")[0]);var T=d.getTarget();if(!T)return void x.Logger.warn(\"item has no target\");var C=w.getSpatialComponent(T),I=s.Utils.getTemporalComponent(T);C||(C=[0,0,this._canvasWidth,this._canvasHeight]),I||(I=[0,this._getDuration()]);var A=parseInt(String(C[0])),b=parseInt(String(C[1])),O=parseInt(String(C[2])),R=parseInt(String(C[3])),M=parseInt(String(I[0])),N=parseInt(String(I[1])),D=this._convertToPercentage(b,this._canvasHeight),V=this._convertToPercentage(A,this._canvasWidth),j=this._convertToPercentage(O,this._canvasWidth),F=this._convertToPercentage(R,this._canvasHeight),k=/t=([^&]+)/g.exec(_.id),U=void 0,H=(U=k&&k[1]?k[1].split(\",\"):[null,null])[0]?parseInt(U[0]):U[0],G={active:!1,end:N,endOffset:U[1]?parseInt(U[1]):U[1],format:E,height:F,left:V,source:g,start:M,startOffset:H,top:D,type:y,width:j};this._renderMediaElement(G);var B=d.getProperty(\"seeAlso\");if(B&&B.length){var W=B[0].id;this.waveforms.push(W)}}else x.Logger.warn(\"unable to find suitable format for\",d.id)}}}else x.Logger.warn(\"unable to initialise, missing canvas or content\")},e.prototype._getBody=function(t){for(var e=0;e<t.length;e++){if((i=(n=t[e]).getFormat())&&C.isHLSFormat(i)&&A.canPlayHls())return n}for(e=0;e<t.length;e++){if((i=(n=t[e]).getFormat())&&I.isMpegDashFormat(i)&&!O.isSafari())return n}for(e=0;e<t.length;e++){var n,i;if((i=(n=t[e]).getFormat())&&!C.isHLSFormat(i)&&!I.isMpegDashFormat(i))return n}return null},e.prototype._getDuration=function(){return this.isVirtual()&&m.AVComponent.newRanges?this.timePlanPlayer.getDuration():this._data&&this._data.canvas?Math.floor(this._data.canvas.getDuration()):0},e.prototype.data=function(){return{waveformColor:\"#fff\",waveformBarSpacing:4,waveformBarWidth:2,volume:1}},e.prototype.isVirtual=function(){return this._data.canvas instanceof y.VirtualCanvas},e.prototype.isVisible=function(){return!!this._data.visible},e.prototype.includesVirtualSubCanvas=function(t){if(L.isVirtual(this._data.canvas)&&this._data.canvas&&this._data.canvas.canvases)for(var e=0;e<this._data.canvas.canvases.length;e++){var n=this._data.canvas.canvases[e];if(s.Utils.normaliseUrl(n.id)===t)return!0}return!1},e.prototype.setVisibility=function(t){this._data.visible!==t&&(this._data.visible=t,t?(this._rewind(),this.$playerElement.show()):(this.$playerElement.hide(),this.pause()),this.resize())},e.prototype.viewRange=function(t){this.currentRange!==t&&(x.Logger.log(\"Switching range from \"+this.currentRange+\" to \"+t),this.setCurrentRangeId(t),this._setCurrentTime(this.timePlanPlayer.setRange(t),!0),this._render())},e.prototype.setCurrentRangeId=function(t,e){var n=void 0===e?{}:e;n.autoChanged,n.limitToRange;!this.currentRange&&t&&this.limitToRange,x.Logger.log(\"Setting current range id\",t),t&&this.currentRange!==t?(this.currentRange=t,this.fire(T.Events.RANGE_CHANGED,t)):null===t&&(this.currentRange=void 0,this.fire(T.Events.RANGE_CHANGED,null)),this._render()},e.prototype.setVolume=function(t){this._volume.set({volume:t}),this.timePlanPlayer.setVolume(t)},e.prototype.setLimitToRange=function(t){x.Logger.log(this._data.constrainNavigationToRange),this.limitToRange!==t&&(this.limitToRange=t,this._render())},e.prototype.set=function(t){var e=this;if(m.AVComponent.newRanges&&this.isVirtual())return void 0!==t.range&&this.setCurrentRangeId(t.range.id,{limitToRange:t.limitToRange}),void 0!==t.rangeId&&this.setCurrentRangeId(t.rangeId,{limitToRange:t.limitToRange}),void 0!==t.volume&&this.setVolume(t.volume),void 0!==t.limitToRange&&this.setLimitToRange(t.limitToRange),void(void 0!==t.visible&&this.setVisibility(t.visible));var n=Object.assign({},this._data);this._data=Object.assign(this._data,t);var i=M.diffData(n,this._data);if(i.includes(\"visible\")&&this._data.canvas&&(this._data.visible?(this._rewind(),this.$playerElement.show()):(this.$playerElement.hide(),this.pause()),this.resize()),i.includes(\"volume\")?this._contentAnnotations.forEach((function(t){var n=void 0!==e._data.volume?e._data.volume:1;$(t.element).prop(\"volume\",n),e._volume.set({volume:e._data.volume})})):this.isVisible()&&this._render(),i.includes(\"range\")){if(this._data.helper)if(this._data.range){var r=this._data.range.getDuration();r&&void 0!==r&&((r.start>=this._canvasClockTime||r.end<=this._canvasClockTime)&&this._setCurrentTime(r.start),this._data.autoPlay&&this.play(),this.fire(T.Events.RANGE_CHANGED,this._data.range.id,this._data.range))}else this.fire(T.Events.RANGE_CHANGED,null);i.includes(\"limitToRange\")&&this._render()}},e.prototype._hasRangeChanged=function(){if(!this.isVirtual()||!m.AVComponent.newRanges){var t=this._getRangeForCurrentTime();t&&!this._data.limitToRange&&(!this._data.range||this._data.range&&t.id!==this._data.range.id)&&this.set({range:jQuery.extend(!0,{autoChanged:!0},t)})}},e.prototype._getRangeForCurrentTime=function(t){var e;e=t?t.getRanges():this.ranges;for(var n=0;n<e.length;n++){var i=e[n],r=i.getBehavior();if((!r||\"no-nav\"===r)&&this._rangeSpansCurrentTime(i)){if(this._rangeNavigable(i))return i;for(var a=i.getRanges(),o=0;o<a.length;o++){var s=a[o];if(this._rangeSpansCurrentTime(s))return this._getRangeForCurrentTime(s)}return i.parentRange}}},e.prototype._rangeSpansCurrentTime=function(t){return!!t.spansTime(Math.ceil(this._canvasClockTime)+this._rangeSpanPadding)},e.prototype._rangeNavigable=function(t){var e=t.getBehavior();return!e||\"no-nav\"!==e.toString()},e.prototype._render=function(){if(this.isVirtual()&&m.AVComponent.newRanges&&this.isVisible()){x.Logger.groupCollapsed(\"CanvasInstance._render()\"),x.Logger.log({dataRange:this._data.rangeId,range:this.currentRange,newLimitToRange:this.limitToRange,constraintToRange:this._data.constrainNavigationToRange,autoSelectRange:this._data.autoSelectRange}),this.limitToRange&&this.currentRange?(x.Logger.log(\"Selecting plan...\",this.currentRange),this.timePlanPlayer.selectPlan({rangeId:this.currentRange})):(x.Logger.log(\"Resetting...\"),this.timePlanPlayer.selectPlan({reset:!0}));var t=this._$canvasTimelineContainer.width()/this.timePlanPlayer.getDuration();this._$durationHighlight.show();var e=this.timePlanPlayer.getCurrentRange(),n=e.start,i=e.duration;return this._$canvasTimelineContainer.slider({value:this._canvasClockTime-this.timePlanPlayer.plan.start,max:this.timePlanPlayer.getDuration()}),this._$durationHighlight.css({left:n*t,width:i*t}),x.Logger.groupEnd(),this._updateCurrentTimeDisplay(),this._updateDurationDisplay(),void this._drawWaveform()}if(this._data.limitToRange&&this._data.range?(this._$canvasTimelineContainer.hide(),this._$rangeTimelineContainer.show()):(this._$canvasTimelineContainer.show(),this._$rangeTimelineContainer.hide()),this._data.range||this._$durationHighlight.hide(),this.isVisible()&&(this.isOnlyCanvasInstance||this.isVirtual())){if(this._data.range&&(!this.isVirtual()||!m.AVComponent.newRanges))if(i=this._data.range.getDuration()){var r=this._getDuration(),a=r*(t=this._$canvasTimelineContainer.width()/r),o=(n=i.start*t,i.end*t);(o>a||o<n)&&(o=a);var s=o-n;this.isVirtual()||this.isOnlyCanvasInstance?(this._$durationHighlight.show(),this._$durationHighlight.css({left:n,width:s})):this._$durationHighlight.hide();var u=this;this._$rangeTimelineContainer.data(\"ui-sortable\")&&this._$rangeTimelineContainer.slider(\"destroy\"),this._$rangeTimelineContainer.slider({value:i.start,step:.01,orientation:\"horizontal\",range:\"min\",min:i.start,max:i.end,animate:!1,create:function(t,e){},slide:function(t,e){u._setCurrentTime(e.value)},stop:function(t,e){}})}this._updateCurrentTimeDisplay(),this._updateDurationDisplay(),this._drawWaveform()}},e.prototype.getCanvasId=function(){if(this._data&&this._data.canvas)return this._data.canvas.id},e.prototype._updateHoverPreview=function(t,e,n){var i=e.offset()||{left:0},r=t.pageX-i.left,a=e.find(\".arrow\"),o=e.find(\".hover-highlight\"),s=e.find(\".hover-preview\");o.width(r);var u=e.width(),l=r/u,c=Math.min(n*l);s.find(\".label\").text(b.formatTime(c));var h=s.outerWidth(),p=s.outerHeight(),f=r-.5*h,d=.5*h-6;f<0&&(f=0,d=r-6),f+h>u&&(f=u-h,d=h-(u-r)-6),s.css({left:f,top:-1*p+\"px\"}).show(),a.css({left:d})},e.prototype._previous=function(t){if(m.AVComponent.newRanges&&this.isVirtual()){x.Logger.groupCollapsed(\"prev\");var e=this.timePlanPlayer.previous();return this._setCurrentTime(e),x.Logger.log(\"CanvasInstance.previous()\",e),void x.Logger.groupEnd()}this._data.limitToRange?t?this._isNavigationConstrainedToRange()?this._rewind():this.fire(_.CanvasInstanceEvents.PREVIOUS_RANGE):this._rewind():this._data.range?t?(this.set({range:void 0}),this._rewind()):this.fire(_.CanvasInstanceEvents.PREVIOUS_RANGE):this._rewind()},e.prototype._next=function(){if(m.AVComponent.newRanges&&this.isVirtual()){x.Logger.groupCollapsed(\"next\");var t=this.timePlanPlayer.next();return x.Logger.log(\"CanvasInstance.previous()\",t),this._setCurrentTime(t,!1),void x.Logger.groupEnd()}this._data.limitToRange&&this._isNavigationConstrainedToRange()?this._fastforward():this.fire(_.CanvasInstanceEvents.NEXT_RANGE)},e.prototype.destroy=function(){window.clearInterval(this._highPriorityInterval),window.clearInterval(this._lowPriorityInterval),window.clearInterval(this._canvasClockInterval)},e.prototype._convertToPercentage=function(t,e){return t/e*100},e.prototype._renderMediaElement=function(t){var e,n=this;switch(t.type.toString().toLowerCase()){case\"video\":e=$('<video crossorigin=\"anonymous\" class=\"anno\" />');break;case\"sound\":case\"audio\":e=$('<audio crossorigin=\"anonymous\" class=\"anno\" />');break;default:return}var i=e[0];if(t.format&&\"application/dash+xml\"===t.format.toString()){e.attr(\"data-dashjs-player\",\"\");var r=dashjs.MediaPlayer().create();r.getDebug().setLogToBrowserConsole(!1),this._data.adaptiveAuthEnabled&&r.setXHRWithCredentialsForType(\"MPD\",!0),r.initialize(i,t.source)}else if(t.format&&\"application/vnd.apple.mpegurl\"===t.format.toString())if(Hls.isSupported()){var a=new Hls;a=this._data.adaptiveAuthEnabled?new Hls({xhrSetup:function(t){t.withCredentials=!0}}):new Hls,this._data.adaptiveAuthEnabled,a.loadSource(t.source),a.attachMedia(i)}else i.canPlayType(\"application/vnd.apple.mpegurl\")&&(i.src=t.source);else e.attr(\"src\",t.source);e.css({top:t.top+\"%\",left:t.left+\"%\",width:t.width+\"%\",height:t.height+\"%\"}).hide(),t.element=e,t.timeout=null;var o=this;t.checkForStall=function(){var t=this;this.active?(o._checkMediaSynchronization(),this.element.get(0).readyState>0&&!this.outOfSync?o._playbackStalled(!1,t):(o._playbackStalled(!0,t),this.timeout&&window.clearTimeout(this.timeout),this.timeout=window.setTimeout((function(){t.checkForStall()}),1e3))):o._playbackStalled(!1,t)},this._contentAnnotations.push(t),this.$playerElement&&this._$canvasContainer.append(e),e.on(\"loadedmetadata\",(function(){n._readyMediaCount++,n._readyMediaCount===n._contentAnnotations.length&&(n._data.autoPlay?n.play():n.pause(),n._updateDurationDisplay(),n.fire(T.Events.MEDIA_READY))})),e.attr(\"preload\",\"metadata\"),e.get(0).load(),this._renderSyncIndicator(t)},e.prototype._getWaveformData=function(t){return new Promise((function(e,n){$.ajax({url:t,type:\"GET\",dataType:\"binary\",responseType:\"arraybuffer\",processData:!1}).done((function(t){e(WaveformData.create(t))})).fail((function(){n(new Error(\"Network Error\"))}))}))},e.prototype._renderWaveform=function(t){var e=this;if(void 0===t&&(t=!1),(!this.waveFormInit||t)&&(this.waveFormInit=!0,this.waveforms.length)){var n=this.waveforms.map((function(t){return e._getWaveformData(t)}));Promise.all(n).then((function(t){e._waveformCanvas=document.createElement(\"canvas\"),e._waveformCanvas.classList.add(\"waveform\"),e._$canvasContainer.append(e._waveformCanvas),e.waveformPageX=e._waveformCanvas.getBoundingClientRect().left;var n=e._drawWaveform.bind(e);e._waveformCanvas.addEventListener(\"mousein\",(function(){e.waveformDeltaX=0})),e._$canvasTimelineContainer.on(\"mouseout\",(function(){e.waveformDeltaX=0,requestAnimationFrame(n)})),e._waveformCanvas.addEventListener(\"mouseout\",(function(){e.waveformDeltaX=0,requestAnimationFrame(n)})),e._waveformCanvas.addEventListener(\"mousemove\",(function(t){e.waveformDeltaX=t.clientX-e.waveformPageX,requestAnimationFrame(n)})),e._$canvasTimelineContainer.on(\"mousemove\",(function(t){e.waveformDeltaX=t.clientX-e.waveformPageX,requestAnimationFrame(n)})),e._waveformCanvas.addEventListener(\"click\",(function(){var t=e._waveformCanvas.getBoundingClientRect().width||0;if(t){var n=e.getRangeTiming(),i=n.start,r=n.duration;e._setCurrentTime(S.multiplyTime(S.addTime(i,r),e.waveformDeltaX/t))}})),e._waveformCtx=e._waveformCanvas.getContext(\"2d\"),e._waveformCtx&&(e._waveformCtx.fillStyle=e._data.waveformColor||\"#fff\",e._compositeWaveform=new E.CompositeWaveform(t),e.fire(T.Events.WAVEFORM_READY))})).catch((function(){x.Logger.warn(\"Could not load wave forms.\")}))}},e.prototype.getRangeTiming=function(){if(m.AVComponent.newRanges&&this.isVirtual())return{start:this.timePlanPlayer.plan.start,end:this.timePlanPlayer.plan.end,duration:this.timePlanPlayer.plan.duration,percent:Math.min((this.timePlanPlayer.getTime()-this.timePlanPlayer.plan.start)/this.timePlanPlayer.plan.duration,1)};var t,e=0,n=S.timelineTime(this._compositeWaveform?this._compositeWaveform.duration:-1),i=n;return this._data.range&&(t=this._data.range.getDuration()),this.isVirtual()||(n=this._getDuration()),this._data.limitToRange&&t&&(e=t.start,n=t.end,i=S.minusTime(n,e)),-1===n&&t&&(e=t.start,n=t.end,i=S.minusTime(n,e)),-1===n&&x.Logger.warn(\"Duration not found...\",{start:e,end:n,duration:i,durationObj:t}),{start:e,end:n,duration:S.minusTime(n,e),percent:Math.min((this.getClockTime()-e)/i,1)}},e.prototype._drawWaveform=function(){if(this._renderWaveform(),this._waveformCtx&&this.isVisible()){var t=this.getRangeTiming(),e=t.start,n=t.end,i=t.percent,r=e*this._compositeWaveform.pixelsPerSecond,a=n*this._compositeWaveform.pixelsPerSecond,o=this._waveformCtx.canvas.width,s=this._waveformCtx.canvas.height,u=this._data.waveformBarSpacing,l=this._data.waveformBarWidth,c=Math.floor((a-r)/o*u),h=o/u;this._waveformCtx.clearRect(0,0,o,s),this._waveformCtx.fillStyle=this._data.waveformColor||\"#fff\";var p=o/(n-e),f=[];if(this._contentAnnotations)for(var d=0;d<this._contentAnnotations.length;d++){var g=this._contentAnnotations[d];if(g&&g.element){var v=g.element[0],_=g.startOffest||0;if(g.active)for(var y=0;y<v.buffered.length;y++){var E=v.buffered.length-y-1,T=v.buffered.start(E),C=v.buffered.end(E);f.push([(_+T-e)*p,(_+C-e)*p])}}}var I=[];if(this.isVirtual()&&m.AVComponent.newRanges)for(var P=this.timePlanPlayer.plan,w=this._data.canvas,A=0,b=P.stops;A<b.length;A++){var O=b[A],M=w.durationMap[P.canvases[O.canvasIndex]],L=M.runningDuration-M.duration;I.push({start:(O.start-P.start)/P.duration,end:(O.end-P.start)/P.duration,duration:O.duration,startTime:L+O.canvasTime.start,endTime:L+O.canvasTime.start+O.canvasTime.end})}else I.push({start:0,duration:n-e,end:n,startTime:e});for(var S=0,x=r;x<a;x+=c){var N=R.normalise(x,r,a),D=N*o;I[S].end<N&&S++;var V=I[S],j=N-V.start,F=Math.floor((V.startTime+j*V.duration)*this._compositeWaveform.pixelsPerSecond),$=this._getWaveformMaxAndMin(this._compositeWaveform,F,h),k=this._scaleY($.max-$.min,s),U=D/o<i,H=this.waveformDeltaX/o,G=this._data.waveformColor||\"#fff\",B=(s-k)/2;if(U)G=0===this.waveformDeltaX?\"#14A4C3\":D/o<H?\"#11758e\":\"#14A4C3\";else if(D/o<H)G=\"#86b3c3\";else{G=\"#8a9aa1\";for(var W=0,z=f;W<z.length;W++){var Y=z[W],X=Y[0],q=Y[1];if(D>X&&D<q){G=\"#fff\";break}}}this._waveformCtx.fillStyle=G,this._waveformCtx.fillRect(D,B,l,0|k)}}},e.prototype._getWaveformMaxAndMin=function(t,e,n){for(var i=-127,r=128,a=e;a<e+n;a++){var o=t.max(a),s=t.min(a);o>i&&(i=o),s<r&&(r=s)}return{max:i,min:r}},e.prototype.isLimitedToRange=function(){return this._data.limitToRange},e.prototype.hasCurrentRange=function(){return!!this._data.range},e.prototype._updateCurrentTimeDisplay=function(){var t;if(m.AVComponent.newRanges&&this.isVirtual())this._$canvasTime.text(b.formatTime(this._canvasClockTime-this.timePlanPlayer.getStartTime()));else if(this._data.range&&(t=this._data.range.getDuration()),this._data.limitToRange&&t){var e=this._canvasClockTime-t.start;this._$canvasTime.text(b.formatTime(e))}else this._$canvasTime.text(b.formatTime(this._canvasClockTime))},e.prototype._updateDurationDisplay=function(){var t;m.AVComponent.newRanges&&this.isVirtual()?this._$canvasDuration.text(b.formatTime(this.timePlanPlayer.getDuration())):(this._data.range&&(t=this._data.range.getDuration()),this._data.limitToRange&&t?this._$canvasDuration.text(b.formatTime(t.getLength())):this._$canvasDuration.text(b.formatTime(this._getDuration())))},e.prototype._renderSyncIndicator=function(t){if(m.AVComponent.newRanges&&this.isVirtual())x.Logger.log(\"_renderSyncIndicator\");else{var e=this._convertToPercentage(t.start,this._getDuration()),n=this._convertToPercentage(t.end-t.start,this._getDuration()),i=$('<div class=\"timeline-item\"></div>');i.css({left:e+\"%\",width:n+\"%\"});var r=$('<div class=\"line-wrapper\"></div>');i.appendTo(r),t.timelineElement=i,this.$playerElement&&this._$timelineItemContainer.append(r)}},e.prototype.setCurrentTime=function(t){return x.Logger.log(\"External set current time?\"),this._setCurrentTime(t,!1)},e.prototype.now=function(){return S.fromMs(Date.now())},e.prototype.nowMs=function(){return Date.now()},e.prototype._setCurrentTime=function(t,e){return void 0===e&&(e=!0),a(this,void 0,void 0,(function(){var n,i,r;return o(this,(function(a){switch(a.label){case 0:return m.AVComponent.newRanges&&this.isVirtual()?(this._buffering=!0,[4,this.timePlanPlayer.setTime(t,e)]):[3,2];case 1:return a.sent(),this._buffering=!1,this._canvasClockStartDate=S.toMs(S.minusTime(this.now(),this._canvasClockTime)),this._canvasClockUpdater(),this._highPriorityUpdater(),this._lowPriorityUpdater(),this._synchronizeMedia(),[2];case 2:return n=this.getRangeTiming(),i=n.start,r=n.end,t<i||i>r?[2]:(this._canvasClockTime=t,this._canvasClockStartDate=S.toMs(S.minusTime(this.now(),this._canvasClockTime)),this.logMessage(\"SET CURRENT TIME to: \"+this._canvasClockTime+\" seconds.\"),this._canvasClockUpdater(),this._highPriorityUpdater(),this._lowPriorityUpdater(),this._synchronizeMedia(),[2])}}))}))},e.prototype._rewind=function(t){var e;m.AVComponent.newRanges&&this.isVirtual()?x.Logger.log(\"Rewind\"):(this.pause(),this._data.range&&(e=this._data.range.getDuration()),this._data.limitToRange&&e?this._setCurrentTime(e.start):this._setCurrentTime(0),this._data.limitToRange||this._data&&this._data.helper&&this.set({range:void 0}))},e.prototype._fastforward=function(){var t;m.AVComponent.newRanges&&this.isVirtual()?x.Logger.log(\"Fast forward\"):(this._data.range&&(t=this._data.range.getDuration()),this._data.limitToRange&&t?this._canvasClockTime=S.timelineTime(t.end):this._canvasClockTime=this._getDuration(),this.pause())},e.prototype.play=function(t){return a(this,void 0,void 0,(function(){var e,n,i=this;return o(this,(function(r){switch(r.label){case 0:return this._isPlaying?[2]:m.AVComponent.newRanges&&this.isVirtual()?this.timePlanPlayer.hasEnded()?(this._buffering=!0,[4,this.timePlanPlayer.setTime(this.timePlanPlayer.currentStop.start)]):[3,2]:[3,3];case 1:r.sent(),this._buffering=!1,r.label=2;case 2:return this.timePlanPlayer.play(),[3,4];case 3:e=void 0,this._data.range&&(e=this._data.range.getDuration()),this._data.limitToRange&&e&&this._canvasClockTime>=e.end&&(this._canvasClockTime=e.start),this._canvasClockTime===this._getDuration()&&(this._canvasClockTime=0),r.label=4;case 4:return this._canvasClockStartDate=S.toMs(S.minusTime(this.now(),this._canvasClockTime)),this._highPriorityInterval&&clearInterval(this._highPriorityInterval),this._highPriorityInterval=window.setInterval((function(){i._highPriorityUpdater()}),this._highPriorityFrequency),this._lowPriorityInterval&&clearInterval(this._lowPriorityInterval),this._lowPriorityInterval=window.setInterval((function(){i._lowPriorityUpdater()}),this._lowPriorityFrequency),this._canvasClockInterval&&clearInterval(this._canvasClockInterval),this._canvasClockInterval=window.setInterval((function(){i._canvasClockUpdater()}),this._canvasClockFrequency),this._isPlaying=!0,t||this._synchronizeMedia(),n=this._data&&this._data.content?this._data.content.pause:\"\",this._$playButton.prop(\"title\",n),this._$playButton.find(\"i\").switchClass(\"play\",\"pause\"),this.fire(_.CanvasInstanceEvents.PLAYCANVAS),this.logMessage(\"PLAY canvas\"),[2]}}))}))},e.prototype.pause=function(t){window.clearInterval(this._highPriorityInterval),window.clearInterval(this._lowPriorityInterval),window.clearInterval(this._canvasClockInterval),this._isPlaying=!1,t||(this._highPriorityUpdater(),this._lowPriorityUpdater(),this._synchronizeMedia()),m.AVComponent.newRanges&&this.isVirtual()&&this.timePlanPlayer.pause();var e=this._data&&this._data.content?this._data.content.play:\"\";this._$playButton.prop(\"title\",e),this._$playButton.find(\"i\").switchClass(\"pause\",\"play\"),this.fire(_.CanvasInstanceEvents.PAUSECANVAS),this.logMessage(\"PAUSE canvas\")},e.prototype._isNavigationConstrainedToRange=function(){return this._data.constrainNavigationToRange||!1},e.prototype._canvasClockUpdater=function(){if(m.AVComponent.newRanges&&this.isVirtual()){if(this._buffering)return;var t=S.fromMs(this._canvasClockStartDate);return x.Logger.log(\"CanvasInstance._canvasClockUpdater()\",{startDate:t,advanceToTime:S.minusTime(this.now(),t)}),void(this.timePlanPlayer.advanceToTime(S.minusTime(this.now(),t)).paused&&this.pause())}if(!this._buffering){var e,n=S.fromMs(this._canvasClockStartDate);this._canvasClockTime=S.minusTime(this.now(),n),this._data.range&&(e=this._data.range.getDuration()),this._data.limitToRange&&e&&this._canvasClockTime>=e.end&&this.pause(),this._canvasClockTime>=this._getDuration()&&(this._canvasClockTime=this._getDuration(),this.pause())}},e.prototype._highPriorityUpdater=function(){this._bufferShown&&!this._buffering&&(this.$playerElement.removeClass(\"player--loading\"),this._bufferShown=!1),this._buffering&&!this._bufferShown&&(this.$playerElement.addClass(\"player--loading\"),this._bufferShown=!0),m.AVComponent.newRanges&&this.isVirtual()?(this._$rangeTimelineContainer.slider({value:this._canvasClockTime-this.timePlanPlayer.plan.start}),this._$canvasTimelineContainer.slider({value:this._canvasClockTime-this.timePlanPlayer.plan.start})):(this._$rangeTimelineContainer.slider({value:this._canvasClockTime}),this._$canvasTimelineContainer.slider({value:this._canvasClockTime})),this._updateCurrentTimeDisplay(),this._updateDurationDisplay(),this._drawWaveform()},e.prototype._lowPriorityUpdater=function(){this._updateMediaActiveStates(),this._data.autoSelectRange&&(this.isVirtual()||this.isOnlyCanvasInstance)&&this._hasRangeChanged()},e.prototype._updateMediaActiveStates=function(){if(m.AVComponent.newRanges&&this.isVirtual()){if(this._isPlaying){if(this.timePlanPlayer.isBuffering())return void(this._buffering=!0);this._buffering&&(this._buffering=!1),this.timePlanPlayer.advanceToTime(this._canvasClockTime)}}else for(var t,e=0;e<this._contentAnnotations.length;e++)(t=this._contentAnnotations[e]).start<=this._canvasClockTime&&t.end>=this._canvasClockTime?(this._checkMediaSynchronization(),t.active||(this._synchronizeMedia(),t.active=!0,t.element.show(),t.timelineElement.addClass(\"active\")),t.element[0].currentTime>t.element[0].duration-t.endOffset&&this._pauseMedia(t.element[0])):t.active&&(t.active=!1,t.element.hide(),t.timelineElement.removeClass(\"active\"),this._pauseMedia(t.element[0]))},e.prototype._pauseMedia=function(t){t.pause()},e.prototype._setMediaCurrentTime=function(t,e){isNaN(t.duration)||(t.currentTime=e)},e.prototype._synchronizeMedia=function(){if(!m.AVComponent.newRanges||!this.isVirtual()){for(var t,e=0;e<this._contentAnnotations.length;e++){if(t=this._contentAnnotations[e],this._setMediaCurrentTime(t.element[0],this._canvasClockTime-t.start+t.startOffset),t.start<=this._canvasClockTime&&t.end>=this._canvasClockTime)if(this._isPlaying){if(t.element[0].paused){var n=t.element[0].play();n&&n.catch((function(){}))}}else this._pauseMedia(t.element[0]);else this._pauseMedia(t.element[0]);t.element[0].currentTime>t.element[0].duration-t.endOffset&&this._pauseMedia(t.element[0])}this.logMessage(\"SYNC MEDIA at: \"+this._canvasClockTime+\" seconds.\")}},e.prototype._checkMediaSynchronization=function(){if(m.AVComponent.newRanges&&this.isVirtual())this._isPlaying&&(this.timePlanPlayer.isBuffering()?this._buffering=!0:this._buffering&&(this._buffering=!1));else for(var t,e=0,n=this._contentAnnotations.length;e<n;e++)if((t=this._contentAnnotations[e]).start<=this._canvasClockTime&&t.end>=this._canvasClockTime){this._isPlaying&&(t.element[0].readyState<3?this._buffering=!0:this._buffering&&(this._buffering=!1));var i=this._canvasClockTime-t.start+t.startOffset,r=t.element[0].currentTime;if(Math.abs(r-i)>this._mediaSyncMarginSecs){t.outOfSync=!0;var a=Math.abs(r-i);this.logMessage(\"DETECTED synchronization lag: \"+Math.abs(a)),this._setMediaCurrentTime(t.element[0],i)}else t.outOfSync=!1}},e.prototype._playbackStalled=function(t,e){if(t)this._stallRequestedBy.indexOf(e)<0&&this._stallRequestedBy.push(e),this._isStalled||(this.$playerElement,this._wasPlaying=this._isPlaying,this.pause(!0),this._isStalled=t);else{var n=this._stallRequestedBy.indexOf(e);n>=0&&this._stallRequestedBy.splice(n,1),0===this._stallRequestedBy.length&&(this._isStalled&&this._wasPlaying&&this.play(!0),this._isStalled=t)}},e.prototype.resize=function(){if(this.$playerElement){var t=this._$canvasContainer.width();if(t){this._$canvasTimelineContainer.width(t);var e=this.$playerElement.find(\".options-container\");void 0!==this._data.halveAtWidth&&this.$playerElement.parent().width()<this._data.halveAtWidth?this._$canvasContainer.height(this.$playerElement.parent().height()/2):this._$canvasContainer.height(this.$playerElement.parent().height()-e.height())}if(this._waveformCanvas){var n=this._$canvasContainer.width(),i=this._$canvasContainer.height();this._waveformCanvas.width=n,this._waveformCanvas.height=i,this.waveformPageX=this._waveformCanvas.getBoundingClientRect().left}this._render(),this._drawWaveform()}},e}(u.BaseComponent);e.CanvasInstance=N},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(13),r=n(15),a=n(16),o=n(17);e.extractMediaFromAnnotationBodies=function(t){var e=t.getBody();if(!e.length)return null;for(var n=0;n<e.length;n++){if((u=(s=e[n]).getFormat())&&i.isHLSFormat(u)&&a.canPlayHls())return s}for(n=0;n<e.length;n++){if((u=(s=e[n]).getFormat())&&r.isMpegDashFormat(u)&&!o.isSafari())return s}for(n=0;n<e.length;n++){var s,u;if((u=(s=e[n]).getFormat())&&!i.isHLSFormat(u)&&!r.isMpegDashFormat(u))return s}return null}},function(t,e,n){\"use strict\";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,\"__esModule\",{value:!0});var a=n(10),o=n(4),s=n(2),u=function(t){function e(e){var n=t.call(this,e)||this;return n._lastVolume=1,n._data={volume:1},n._init(),n._resize(),n}return r(e,t),e.prototype._init=function(){var e=this,n=t.prototype._init.call(this);this._$element=$(this.el),n||s.Logger.error(\"Component failed to initialise\"),this._$volumeMute=$('\\n <button class=\"btn volume-mute\" title=\"'+this.options.data.content.mute+'\">\\n <i class=\"av-icon av-icon-mute on\" aria-hidden=\"true\"></i>'+this.options.data.content.mute+\"\\n </button>\\n \"),this._$volumeSlider=$('<div class=\"volume-slider\"></div>'),this._$element.append(this._$volumeMute,this._$volumeSlider);var i=this;return this._$volumeMute.on(\"touchstart click\",(function(t){t.preventDefault(),0!==e._data.volume?(e._lastVolume=e._data.volume,e._data.volume=0):e._data.volume=e._lastVolume,e.fire(o.VolumeEvents.VOLUME_CHANGED,e._data.volume)})),this._$volumeSlider.slider({value:i._data.volume,step:.1,orientation:\"horizontal\",range:\"min\",min:0,max:1,animate:!1,create:function(){},slide:function(t,e){i._data.volume=e.value,0===i._data.volume&&(i._lastVolume=0),i.fire(o.VolumeEvents.VOLUME_CHANGED,i._data.volume)},stop:function(t,e){}}),n},e.prototype.set=function(t){this._data=Object.assign(this._data,t),this._render()},e.prototype._render=function(){if(void 0!==this._data.volume)if(this._$volumeSlider.slider({value:this._data.volume}),0===this._data.volume){var t=this.options.data.content.unmute;this._$volumeMute.prop(\"title\",t),this._$volumeMute.find(\"i\").switchClass(\"on\",\"off\")}else{t=this.options.data.content.mute;this._$volumeMute.prop(\"title\",t),this._$volumeMute.find(\"i\").switchClass(\"off\",\"on\")}},e.prototype._resize=function(){},e}(a.BaseComponent);e.AVVolumeControl=u},function(t,e,n){\"use strict\";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i};Object.defineProperty(e,\"__esModule\",{value:!0});var a=n(6);e.createTimePlansFromManifest=function(t){var e=function(n,o,s){var u,l,c;void 0===o&&(o=[]),void 0===s&&(s=a.timelineTime(0));for(var h={type:\"time-plan\",canvases:[],duration:a.timelineTime(0),items:[],stops:[],rangeOrder:[n.id],end:a.timelineTime(0),start:s,rangeId:n.id,rangeStack:o},p=s,f=r(n.items,n.getCanvasIds()),d=0;d<f.length;d++){var g=f[d];if(\"string\"==typeof g){var v=g.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,g,\"0\",\"0\"],_=v[1],m=v[2],y=v[3];if(!_||void 0===m||void 0===y)continue;var E=t.getSequenceByIndex(0).getCanvasById(_);if(null===E)throw new Error(\"Canvas not found..\");h.canvases.push(E.id);var T=a.canvasTime(parseFloat(m||\"0\")),C=a.canvasTime(parseFloat(y||\"0\")),I=a.timelineTime(C-T);p=a.addTime(I,p);var P={type:\"time-stop\",canvasIndex:d,start:a.minusTime(p,I),end:p,duration:I,rangeId:n.id,rawCanvasSelector:g,canvasTime:{start:T,end:C},rangeStack:o};h.stops.push(P),h.items.push(P)}else{var w=g.getBehavior();if(!w||\"no-nav\"!==w){var A=e(g,r(o,[g.id]),p);p=a.addTime(p,A.duration),(u=h.stops).push.apply(u,A.stops.map((function(t){return i(i({},t),{canvasIndex:t.canvasIndex+h.canvases.length})}))),(l=h.canvases).push.apply(l,A.canvases),h.items.push(A),(c=h.rangeOrder).push.apply(c,A.rangeOrder)}}}return h.end=p,h.duration=a.timelineTime(h.end-h.start),h},n=t.getTopRanges(),o=[];n||(n=t.getAllRanges()),1!==n.length||n[0].id||(n=n[0].getRanges());for(var s=0,u=n;s<u.length;s++){var l=u[s];l.getRanges()[0]&&l.id===l.getRanges()[0].id&&(l=l.getRanges()[0]);var c=e(l,[l.id]);o.push(c)}return o[0]}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(3),r=n(18),a=n(6);e.getMediaSourceFromAnnotationBody=function(t,e,n){var o=e.getType(),s=e.getFormat()||void 0,u=e.id.split(\"#\")[0],l=t.getTarget();if(!l)throw new Error(\"No target\");if(!o)throw new Error(\"Unknown media type\");var c=r.getSpatialComponent(l)||[0,0,n.width||0,n.height||0],h=c[0],p=c[1],f=c[2],d=c[3],g=i.Utils.getTemporalComponent(l)||[0,n.duration],v=g[0],_=g[1],m=e.id.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/)||[void 0,e.id,void 0,void 0],y=m[1],E=m[2],T=m[3];return{type:o,format:s,mediaSource:u,canvasId:n.id,x:h,y:p,width:void 0===f?void 0:parseInt(String(f),10),height:void 0===d?void 0:parseInt(String(d),10),start:a.annotationTime(Number(Number(v).toFixed(2))),end:a.annotationTime(Number(Number(_).toFixed(2))),bodyId:y,offsetStart:void 0===E?void 0:a.canvasTime(parseFloat(E)),offsetEnd:void 0===T?void 0:a.canvasTime(parseFloat(T))}}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.formatTime=function(t){var e,n,i;return i=Math.ceil(t),((e=(e=Math.floor(i/3600))>=10?e:\"0\"+e)>=1?e+\":\":\"\")+(n=(n=Math.floor(i%3600/60))>=10?n:\"0\"+n)+\":\"+(i=(i=Math.floor(i%3600%60))>=10?i:\"0\"+i)}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.normalise=function(t,e,n){return(t-e)/(n-e)}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(11);e.isVirtual=function(t){return!!t&&t instanceof i.VirtualCanvas}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(3);e.getFirstTargetedCanvasId=function t(e){var n;if(e.canvases&&e.canvases.length)n=e.canvases[0];else{var r=e.getRanges();if(r.length)return t(r[0])}if(void 0!==n)return i.Utils.normaliseUrl(n)}},function(t,e,n){t.exports=n(37)},function(t,e,n){\"use strict\";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,\"__esModule\",{value:!0}),i(n(22)),i(n(27)),i(n(29)),i(n(59)),i(n(19)),i(n(9)),i(n(4))},function(t,e){t.exports=function(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}},function(t,e,n){var i=n(8),r=n(43),a=n(48),o=i?i.isConcatSpreadable:void 0;t.exports=function(t){return a(t)||r(t)||!!(o&&t&&t[o])}},function(t,e,n){var i=n(41),r=\"object\"==typeof self&&self&&self.Object===Object&&self,a=i||r||Function(\"return this\")();t.exports=a},function(t,e,n){(function(e){var n=\"object\"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(42))},function(t,e){var n;n=function(){return this}();try{n=n||new Function(\"return this\")()}catch(t){\"object\"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var i=n(44),r=n(24),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=i(function(){return arguments}())?i:function(t){return r(t)&&o.call(t,\"callee\")&&!s.call(t,\"callee\")};t.exports=u},function(t,e,n){var i=n(45),r=n(24);t.exports=function(t){return r(t)&&\"[object Arguments]\"==i(t)}},function(t,e,n){var i=n(8),r=n(46),a=n(47),o=i?i.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?\"[object Undefined]\":\"[object Null]\":o&&o in Object(t)?r(t):a(t)}},function(t,e,n){var i=n(8),r=Object.prototype,a=r.hasOwnProperty,o=r.toString,s=i?i.toStringTag:void 0;t.exports=function(t){var e=a.call(t,s),n=t[s];try{t[s]=void 0;var i=!0}catch(t){}var r=o.call(t);return i&&(e?t[s]=n:delete t[s]),r}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){t.exports=self.fetch||(self.fetch=n(25).default||n(25))},function(t,e,n){\"use strict\";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError(\"Generator is already executing.\");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,\"__esModule\",{value:!0});var a=n(51),o=n(52),s=n(53),u=n(54),l=n(2),c=function(){function t(t,e){switch(void 0===e&&(e={}),this.source=t,this.mediaSource=t.mediaSource,this.type=t.type.toString().toLowerCase(),this.format=t.format?t.format.toString():void 0,this.mediaSyncMarginSecs=e.mediaSyncMarginSecs||1,this.type){case\"video\":this.element=document.createElement(\"video\");break;case\"sound\":case\"audio\":this.element=document.createElement(\"audio\");break;default:return}this.isDash()?this.instance=new a.DashFormat(this.mediaSource,e):this.isHls()?this.instance=new o.HlsFormat(this.mediaSource,e):this.isMpeg()?this.instance=new s.MpegFormat(this.mediaSource,e):this.instance=new u.DefaultFormat(this.mediaSource,e),this.element.classList.add(\"anno\"),this.element.crossOrigin=\"anonymous\",this.element.preload=\"metadata\",this.element.pause(),this.instance.attachTo(this.element),this.element.currentTime=this.source.start}return t.prototype.syncClock=function(t){t>this.element.duration?l.Logger.error(\"Clock synced out of bounds (max: \"+this.element.duration+\", got: \"+t+\")\"):Math.abs(this.element.currentTime-t)>this.mediaSyncMarginSecs&&(this.element.currentTime=t)},t.prototype.getCanvasId=function(){return this.source.canvasId},t.prototype.isWithinRange=function(t){return this.source.start<=t&&this.source.end>=t},t.prototype.load=function(t){return void 0===t&&(t=!1),i(this,void 0,void 0,(function(){var e=this;return r(this,(function(n){switch(n.label){case 0:return t&&this.element.load(),[4,new Promise((function(t){e.element.addEventListener(\"loadedmetadata\",(function(){t()}))}))];case 1:return n.sent(),[2]}}))}))},t.prototype.setSize=function(t,e,n,i){$(this.element).css({top:t+\"%\",left:e+\"%\",width:n+\"%\",height:i+\"%\"})},t.prototype.isDash=function(){return this.format&&\"application/dash+xml\"===this.format.toString()},t.prototype.isHls=function(){return this.format&&\"application/vnd.apple.mpegurl\"===this.format.toString()&&Hls&&Hls.isSupported()},t.prototype.isMpeg=function(){return\"\"!==this.element.canPlayType(\"application/vnd.apple.mpegurl\")},t.prototype.stop=function(){this.element.pause(),this.element.currentTime=this.source.start},t.prototype.play=function(t){return l.Logger.log(\"MediaElement.play(\"+t+\")\"),void 0!==t&&(this.element.currentTime=t),this.element.play()},t.prototype.pause=function(){this.element.pause()},t.prototype.isBuffering=function(){return this.element.readyState<3},t}();e.MediaElement=c},function(t,e,n){\"use strict\";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,\"__esModule\",{value:!0});var a=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,e,n)||this;return i.player=dashjs.MediaPlayer().create(),i.player.getDebug().setLogToBrowserConsole(!1),n.adaptiveAuthEnabled&&i.player.setXHRWithCredentialsForType(\"MPD\",!0),i}return r(e,t),e.prototype.attachTo=function(t){this.player.initialize(t,this.source,!1)},e.prototype.debug=function(){this.player.getDebug().setLogToBrowserConsole(!0),this.player.getDebug().setLogLevel(4)},e}(n(5).MediaFormat);e.DashFormat=a},function(t,e,n){\"use strict\";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,\"__esModule\",{value:!0});var a=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,e,n)||this;return n.adaptiveAuthEnabled?i.hls=new Hls({xhrSetup:function(t){t.withCredentials=!0}}):i.hls=new Hls,i.hls.loadSource(i.source),i}return r(e,t),e.prototype.attachTo=function(t){this.hls.attachMedia(t)},e}(n(5).MediaFormat);e.HlsFormat=a},function(t,e,n){\"use strict\";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,\"__esModule\",{value:!0});var a=function(t){function e(e,n){return void 0===n&&(n={}),t.call(this,e,n)||this}return r(e,t),e.prototype.attachTo=function(t){t.src=this.source},e}(n(5).MediaFormat);e.MpegFormat=a},function(t,e,n){\"use strict\";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,\"__esModule\",{value:!0});var a=function(t){function e(e,n){return void 0===n&&(n={}),t.call(this,e,n)||this}return r(e,t),e}(n(5).MediaFormat);e.DefaultFormat=a},function(t,e){var n,i,r=t.exports={};function a(){throw new Error(\"setTimeout has not been defined\")}function o(){throw new Error(\"clearTimeout has not been defined\")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n=\"function\"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{i=\"function\"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var u,l=[],c=!1,h=-1;function p(){c&&u&&(c=!1,u.length?l=u.concat(l):h=-1,l.length&&f())}function f(){if(!c){var t=s(p);c=!0;for(var e=l.length;e;){for(u=l,l=[];++h<e;)u&&u[h].run();h=-1,e=l.length}u=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new d(t,e)),1!==l.length||c||s(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title=\"browser\",r.browser=!0,r.env={},r.argv=[],r.version=\"\",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error(\"process.binding is not supported\")},r.cwd=function(){return\"/\"},r.chdir=function(t){throw new Error(\"process.chdir is not supported\")},r.umask=function(){return 0}},function(t,e,n){\"use strict\";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError(\"Generator is already executing.\");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i};Object.defineProperty(e,\"__esModule\",{value:!0});var o=n(6),s=n(2),u=function(){function t(t,e,n,i,r){var a=this;this.continuous=!0,this.playing=!1,this._time=o.timelineTime(0),this.media=t,this.plan=e,this.fullPlan=e,this.currentStop=e.stops[0],this.notifyRangeChange=n,this.notifyTimeChange=i,this.notifyPlaying=r,this.logging=!0,this.currentRange=this.currentStop.rangeStack[0],this.setTime(this.currentStop.start),t.onPlay((function(t,e,n){t===a.plan.canvases[a.currentStop.canvasIndex]?a.playing||a.notifyPlaying(!0):n.pause()})),t.onPause((function(t){t===a.plan.canvases[a.currentStop.canvasIndex]&&a.playing&&a.notifyPlaying(!1)}))}return t.prototype.selectPlan=function(t){var e=void 0===t?{}:t,n=e.reset,i=e.rangeId;if(n)return this.initialisePlan(this.fullPlan);if(i){for(var r=[],a=0,o=this.fullPlan.stops;a<o.length;a++){var s=o[a],u=s.rangeStack.indexOf(i);-1!==s.rangeStack.indexOf(i)&&(r=s.rangeStack.slice(1,u+1))}for(var l=this.fullPlan,c=0,h=r;c<h.length;c++)for(var p=h[c],f=0,d=l.items;f<d.length;f++){var g=d[f];if(\"time-plan\"===g.type&&g.rangeId===p){l=g;break}}if(l)return this.initialisePlan(l)}},t.prototype.initialisePlan=function(t){this.plan=t},t.prototype.getCurrentRange=function(){for(var t=this.currentRange,e=this.currentRange===this.currentStop.rangeId,n=e?this.plan.stops:this.fullPlan.stops,i=[],r=[],a=0,o=n;a<o.length;a++){var u=o[a];e?u.rangeId===t&&(i.push(u.start),r.push(u.end)):-1!==u.rangeStack.indexOf(t)&&(i.push(u.start),r.push(u.end))}var l=Math.min.apply(Math,i),c=Math.max.apply(Math,r);return s.Logger.log(\"Range\",{rangeId:t,isRangeWithStop:e,stopsToCheck:n,start:l-this.plan.start,end:c-this.plan.start,duration:c-l}),{start:l-this.plan.start,end:c-this.plan.start,duration:c-l}},t.prototype.getTime=function(){return this._time},t.prototype.setInternalTime=function(t){return this._time=t,this.notifyTimeChange(t),this._time},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.logging&&s.Logger.log.apply(s.Logger,a([\"TimePlanPlayer\"],t))},t.prototype.setContinuousPlayback=function(t){this.continuous=t},t.prototype.setIsPlaying=function(t){this.playing=t},t.prototype.play=function(){return this.log(\"Play\",this.getTime()),this.setIsPlaying(!0),this.media.play(this.plan.canvases[this.currentStop.canvasIndex]),this.getTime()},t.prototype.currentTimelineTime=function(){return this.getTime()},t.prototype.currentMediaTime=function(){s.Logger.log(\"Current media time:\\n - Current start: \"+this.currentStop.start+\"\\n - Current canvas: \"+this.currentStop.canvasTime.start+\"\\n - Current time: \"+this.getTime()+\"\\n \",this);var t=o.minusTime(this.getTime(),this.currentStop.start);return o.annotationTime(o.addTime(t,o.timelineTime(this.currentStop.canvasTime.start)))},t.prototype.pause=function(){return this.log(\"Pause\",this.getTime()),this.setIsPlaying(!1),this.media.pause(),this.getTime()},t.prototype.setVolume=function(t){this.media.setVolume(t)},t.prototype.findStop=function(t){for(var e=0,n=this.plan.stops;e<n.length;e++){var i=n[e];if(i.start-.001<=t&&i.end-.001>t)return i}if(this.plan.stops[this.plan.stops.length-1].end===t)return this.plan.stops[this.plan.stops.length-1]},t.prototype.setTime=function(t,e){return void 0===e&&(e=!0),i(this,void 0,void 0,(function(){var n;return r(this,(function(i){switch(i.label){case 0:return s.Logger.groupCollapsed(\"TimeplanPlayer.setTime(\"+t+\", \"+(e?\"true\":\"false\")+\")\"),this.getTime()===t?[3,2]:(this.log(\"set time\",{from:this.getTime(),to:t}),this.setInternalTime(t),(n=this.findStop(t))&&n!==this.currentStop?(e&&(this.currentRange=n.rangeId),[4,this.advanceToStop(this.currentStop,n)]):[3,2]);case 1:i.sent(),i.label=2;case 2:return s.Logger.groupEnd(),[2]}}))}))},t.prototype.next=function(){for(var t=this.plan.rangeOrder.indexOf(this.currentRange),e=t>=0&&t===this.plan.rangeOrder.length-1?void 0:this.plan.rangeOrder.indexOf(this.currentRange)+1,n=void 0!==e?this.plan.rangeOrder[e]:void 0,i=this.plan.stops.indexOf(this.currentStop),r=0,a=void 0,o=!0;o;){if(r++,!(a=this.plan.stops[i+r])){o=!1;break}if(a.rangeId!==this.currentStop.rangeId){o=!1;break}}return this.playing&&a&&(n=a.rangeId),n&&a&&a.rangeId!==n?(this.playing||-1===this.currentStop.rangeStack.indexOf(n)&&-1!==a.rangeStack.indexOf(n)?(this.currentRange=this.playing?a.rangeId:n,this.setInternalTime(a.start),this.advanceToStop(this.currentStop,a,this.playing?a.rangeId:n)):(this.currentRange=n,this.setInternalTime(this.currentStop.start),this.advanceToStop(this.currentStop,this.currentStop,n)),this.getTime()):(a?(this.setInternalTime(a.start),this.currentRange=a.rangeId,this.advanceToStop(this.currentStop,a,a.rangeId)):this.setInternalTime(this.currentStop.end),this.getTime())},t.prototype.previous=function(){for(var t=0===this.plan.rangeOrder.indexOf(this.currentRange)?void 0:this.plan.rangeOrder.indexOf(this.currentRange)-1,e=void 0!==t?this.plan.rangeOrder[t]:void 0,n=this.plan.stops.indexOf(this.currentStop),i=this.plan.stops[n-1],r=-1,a=!0;a;){var o=this.plan.stops[n+r];if(r--,!o){a=!1;break}if(i.rangeId!==o.rangeId){a=!1;break}i=o}return this.playing&&i&&(e=i.rangeId),0===n?(this.setInternalTime(this.currentStop.start),e&&this.currentStop.rangeId!==e&&(this.currentRange=e,this.advanceToStop(this.currentStop,this.currentStop,e)),this.getTime()):!e||-1!==this.currentStop.rangeStack.indexOf(e)||-1===i.rangeStack.indexOf(e)&&i.rangeId!==e?e&&-1!==this.currentStop.rangeStack.indexOf(e)?(this.setInternalTime(this.currentStop.start),this.currentRange=e,this.advanceToStop(this.currentStop,this.currentStop,e),this.getTime()):this.getTime():(this.setInternalTime(i.start),this.currentRange=e,this.advanceToStop(this.currentStop,i,e),this.getTime())},t.prototype.setRange=function(t){if(s.Logger.log(\"setRange\",t),t===this.currentRange)return this.getTime();if(this.currentRange=t,t===this.currentStop.rangeId)return this.getTime();for(var e=0,n=this.plan.stops;e<n.length;e++){var i=n[e];if(i.rangeId===t){this.setInternalTime(i.start),this.advanceToStop(this.currentStop,i,t);break}}for(var r=0,a=this.plan.stops;r<a.length;r++){var o=a[r];if(-1!==o.rangeStack.indexOf(t)){this.setInternalTime(o.start),this.advanceToStop(this.currentStop,o,t);break}}return this.getTime()},t.prototype.isBuffering=function(){return this.media.isBuffering()},t.prototype.advanceToTime=function(t){s.Logger.group(\"TimeplanPlayer.advanceToTime(\"+t+\")\");var e=this.findStop(t);return e&&this.currentStop!==e?(s.Logger.log(\"advanceToTime.a\"),this.advanceToStop(this.currentStop,e),{buffering:this.isBuffering(),time:t}):(this.playing&&this.currentRange!==this.currentStop.rangeId&&(this.currentRange=this.currentStop.rangeId,this.notifyRangeChange(this.currentStop.rangeId,{from:this.currentStop,to:this.currentStop})),e?(s.Logger.log(\"advanceToTime.c\",{time:this.getTime()}),this.setInternalTime(t),this.media.syncClock(this.currentMediaTime()),s.Logger.groupEnd(),{time:t}):(s.Logger.log(\"advanceToTime.b\"),this.pause(),this.setTime(this.currentStop.end),s.Logger.groupEnd(),{paused:!0,buffering:this.isBuffering(),time:this.currentStop.end}))},t.prototype.hasEnded=function(){return this.currentStop.end===this.getTime()},t.prototype.advanceToStop=function(t,e,n){return i(this,void 0,void 0,(function(){var i;return r(this,(function(r){switch(r.label){case 0:return s.Logger.log(\"TimeplanPlayer.advanceToStop\",{from:t,to:e,rangeId:n}),t===e?(n&&this.notifyRangeChange(n||e.rangeId,{to:e,from:t}),[2]):(this.log(\"advanceToStop\",e.start),this.currentStop=e,i=this.media.seekToMediaTime(this.currentMediaTime()),this.notifyRangeChange(n||e.rangeId,{to:e,from:t}),[4,i]);case 1:return r.sent(),[2]}}))}))},t.prototype.getStartTime=function(){return this.plan.start},t.prototype.getDuration=function(){return this.plan.duration},t}();e.TimePlanPlayer=u},function(t,e,n){\"use strict\";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError(\"Generator is already executing.\");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,\"__esModule\",{value:!0});var a=n(2),o=function(){function t(t){var e=this;this.elements=[],this.playing=!1,this.canvasMap={},this._onPlay=[],this._onPause=[],a.Logger.log(\"Composite media element\",t),this.elements=t;for(var n=function(t){var n=t.getCanvasId();i.canvasMap[n]=i.canvasMap[n]?i.canvasMap[n]:[],i.canvasMap[n].push(t),t.element.addEventListener(\"play\",(function(){e._onPlay.forEach((function(e){return e(n,t.element.currentTime,t)}))})),t.element.addEventListener(\"pause\",(function(){e._onPause.forEach((function(e){return e(n,t.element.currentTime,t)}))}))},i=this,r=0,o=t;r<o.length;r++){n(o[r])}this.activeElement=t[0]}return t.prototype.syncClock=function(t){a.Logger.group(\"CompositeMediaElement.syncClock\"),a.Logger.log(\"syncClock: \"+t),a.Logger.log({fromTime:t,toTime:t,instance:this}),this.activeElement.syncClock(t),a.Logger.groupEnd()},t.prototype.onPlay=function(t){this._onPlay.push(t)},t.prototype.onPause=function(t){this._onPause.push(t)},t.prototype.findElementInRange=function(t,e){if(this.canvasMap[t])for(var n=0,i=this.canvasMap[t];n<i.length;n++){var r=i[n];if(r.isWithinRange(e))return r}},t.prototype.appendTo=function(t){a.Logger.log(\"Appending...\",this.elements.map((function(t){return t.element}))),t.append(this.elements.map((function(t){return t.element})))},t.prototype.load=function(){return i(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,Promise.all(this.elements.map((function(t){return t.load()})))];case 1:return t.sent(),[2]}}))}))},t.prototype.seekToMediaTime=function(t){return i(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this.playing?[4,this.activeElement.play(t)]:[3,2];case 1:return e.sent(),[3,3];case 2:this.activeElement.syncClock(t),e.label=3;case 3:return[2]}}))}))},t.prototype.seekTo=function(t,e){return i(this,void 0,void 0,(function(){var n;return r(this,(function(i){return n=this.findElementInRange(t,e),a.Logger.log(\"CompositeMediaElement.seekTo()\",{canvasId:n?n.source.canvasId:null,newElement:n}),n&&n!==this.activeElement&&(this.activeElement.stop(),this.activeElement=n),[2,this.seekToMediaTime(e)]}))}))},t.prototype.play=function(t,e){return i(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return this.playing=!0,t&&void 0!==e?[4,this.seekTo(t,e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2,this.activeElement.play(e)]}}))}))},t.prototype.pause=function(){this.playing=!1,this.activeElement.pause()},t.prototype.setVolume=function(t){for(var e=0,n=this.elements;e<n.length;e++){n[e].element.volume=t}},t.prototype.isBuffering=function(){return this.activeElement.isBuffering()},t}();e.CompositeMediaElement=o},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=function(){function t(t){var e=this;this.length=0,this.duration=0,this.pixelsPerSecond=Number.MAX_VALUE,this.secondsPerPixel=Number.MAX_VALUE,this.timeIndex={},this.minIndex={},this.maxIndex={},this._waveforms=[],t.forEach((function(t){e._waveforms.push({start:e.length,end:e.length+t.adapter.length,waveform:t}),e.length+=t.adapter.length,e.duration+=t.duration,e.pixelsPerSecond=Math.min(e.pixelsPerSecond,t.pixels_per_second),e.secondsPerPixel=Math.min(e.secondsPerPixel,t.seconds_per_pixel)}))}return t.prototype.min=function(t){if(void 0===this.minIndex[t]){var e=this._find(t);this.minIndex[t]=e?e.waveform.min_sample(t-e.start):0}return this.minIndex[t]},t.prototype.max=function(t){if(void 0===this.maxIndex[t]){var e=this._find(t);this.maxIndex[t]=e?e.waveform.max_sample(t-e.start):0}return this.maxIndex[t]},t.prototype._find=function(t){if(void 0===this.timeIndex[t]){var e=this._waveforms.find((function(e){return t>=e.start&&t<e.end}));if(!e)return null;this.timeIndex[t]=e}return this.timeIndex[t]},t}();e.CompositeWaveform=i},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(16),r=n(30),a=n(60),o=n(20),s=n(28),u=n(32),l=n(35),c=n(31),h=n(18),p=n(26),f=n(14),d=n(13),g=n(61),v=n(15),_=n(17),m=n(34),y=n(33),E=n(12);e.AVComponentUtils={canPlayHls:i.canPlayHls,createTimePlansFromManifest:r.createTimePlansFromManifest,debounce:a.debounce,diffData:o.diffData,diff:o.diffData,extractMediaFromAnnotationBodies:s.extractMediaFromAnnotationBodies,formatTime:u.formatTime,getFirstTargetedCanvasId:l.getFirstTargetedCanvasId,getMediaSourceFromAnnotationBody:c.getMediaSourceFromAnnotationBody,getSpatialComponent:h.getSpatialComponent,getTimestamp:p.getTimestamp,hlsMimeTypes:f.hlsMimeTypes,hlsMediaTypes:f.hlsMimeTypes,isHLSFormat:d.isHLSFormat,isIE:g.isIE,isMpegDashFormat:v.isMpegDashFormat,isSafari:_.isSafari,isVirtual:m.isVirtual,normalise:y.normalise,normalize:y.normalise,normalizeNumber:y.normalise,normaliseNumber:y.normalise,retargetTemporalComponent:E.retargetTemporalComponent}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.debounce=function(t,e){return e=e||100,function(){if(!t.debouncing){var n=Array.prototype.slice.apply(arguments);t.lastReturnVal=t.apply(window,n),t.debouncing=!0}return clearTimeout(t.debounceTimeout),t.debounceTimeout=setTimeout((function(){t.debouncing=!1}),e),t.lastReturnVal}}},function(t,e,n){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.isIE=function(){var t=window.navigator.userAgent,e=t.indexOf(\"MSIE \");if(e>0)return parseInt(t.substring(e+5,t.indexOf(\".\",e)),10);if(t.indexOf(\"Trident/\")>0){var n=t.indexOf(\"rv:\");return parseInt(t.substring(n+3,t.indexOf(\".\",n)),10)}var i=t.indexOf(\"Edge/\");return i>0&&parseInt(t.substring(i+5,t.indexOf(\".\",i)),10)}}])}));\ndefine(\"lib/IIIFAVComponent.js\", function(){});\n\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-avcenterpanel-module/AVCenterPanel',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/CenterPanel\", \"../uv-shared-module/Position\", \"../../Utils\", \"manifesto.js\", \"@iiif/iiif-av-component\"], function (require, exports, BaseEvents_1, CenterPanel_1, Position_1, Utils_1, manifesto_js_1, iiif_av_component_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var AVCenterPanel = /** @class */ (function (_super) {\r\n __extends(AVCenterPanel, _super);\r\n function AVCenterPanel($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this._mediaReady = false;\r\n _this._isThumbsViewOpen = false;\r\n _this.attributionPosition = Position_1.Position.BOTTOM_RIGHT;\r\n return _this;\r\n }\r\n AVCenterPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('avCenterPanel');\r\n _super.prototype.create.call(this);\r\n var that = this;\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE, function (resources) {\r\n that.openMedia(resources);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this._viewCanvas(canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RANGE_CHANGED, function (range) {\r\n console.log(\"range changed\");\r\n if (!_this._observeRangeChanges()) {\r\n return;\r\n }\r\n _this._whenMediaReady(function () {\r\n that._viewRange(range);\r\n that._setTitle();\r\n });\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.METRIC_CHANGED, function () {\r\n _this._whenMediaReady(function () {\r\n if (_this.avcomponent) {\r\n _this.avcomponent.set({\r\n limitToRange: _this._limitToRange(),\r\n constrainNavigationToRange: _this._limitToRange()\r\n });\r\n }\r\n });\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CREATED, function () {\r\n _this._setTitle();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_THUMBS_VIEW, function () {\r\n _this._isThumbsViewOpen = true;\r\n _this._whenMediaReady(function () {\r\n if (_this.avcomponent) {\r\n _this.avcomponent.set({\r\n virtualCanvasEnabled: false\r\n });\r\n var canvas = _this.extension.helper.getCurrentCanvas();\r\n if (canvas) {\r\n _this._viewCanvas(_this.extension.helper.canvasIndex);\r\n }\r\n }\r\n });\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_TREE_VIEW, function () {\r\n _this._isThumbsViewOpen = false;\r\n _this._whenMediaReady(function () {\r\n if (_this.avcomponent) {\r\n _this.avcomponent.set({\r\n virtualCanvasEnabled: true\r\n });\r\n }\r\n });\r\n });\r\n this._createAVComponent();\r\n };\r\n AVCenterPanel.prototype._createAVComponent = function () {\r\n var _this = this;\r\n this.$avcomponent = $('<div class=\"iiif-av-component\"></div>');\r\n this.$content.prepend(this.$avcomponent);\r\n // @ts-ignore\r\n this.avcomponent = new iiif_av_component_1.AVComponent({\r\n target: this.$avcomponent[0],\r\n // @ts-ignore\r\n posterImageExpanded: this.options.posterImageExpanded\r\n });\r\n this.avcomponent.on('mediaready', function () {\r\n console.log('mediaready');\r\n _this._mediaReady = true;\r\n }, false);\r\n this.avcomponent.on('rangechanged', function (rangeId) {\r\n if (rangeId) {\r\n _this._setTitle();\r\n var range = _this.extension.helper.getRangeById(rangeId);\r\n if (range) {\r\n var currentRange = _this.extension.helper.getCurrentRange();\r\n if (range !== currentRange) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.RANGE_CHANGED, range);\r\n }\r\n }\r\n else {\r\n _this.component.publish(BaseEvents_1.BaseEvents.RANGE_CHANGED, null);\r\n }\r\n }\r\n else {\r\n _this.component.publish(BaseEvents_1.BaseEvents.RANGE_CHANGED, null);\r\n }\r\n }, false);\r\n };\r\n AVCenterPanel.prototype._observeRangeChanges = function () {\r\n return !this._isThumbsViewOpen;\r\n };\r\n AVCenterPanel.prototype._setTitle = function () {\r\n var _this = this;\r\n var title = '';\r\n var value;\r\n var label;\r\n // get the current range or canvas title\r\n var currentRange = this.extension.helper.getCurrentRange();\r\n if (currentRange) {\r\n label = currentRange.getLabel();\r\n }\r\n else {\r\n label = this.extension.helper.getCurrentCanvas().getLabel();\r\n }\r\n value = manifesto_js_1.LanguageMap.getValue(label);\r\n if (value) {\r\n title = value;\r\n }\r\n if (Utils.Bools.getBool(this.config.options.includeParentInTitleEnabled, false)) {\r\n // get the parent range or manifest's title\r\n if (currentRange) {\r\n if (currentRange.parentRange) {\r\n label = currentRange.parentRange.getLabel();\r\n value = manifesto_js_1.LanguageMap.getValue(label);\r\n }\r\n }\r\n else {\r\n value = this.extension.helper.getLabel();\r\n }\r\n if (value) {\r\n title += this.content.delimiter + value;\r\n }\r\n }\r\n this.title = title;\r\n // set subtitle\r\n var groups = this.extension.helper.getMetadata({\r\n range: currentRange\r\n });\r\n for (var i = 0; i < groups.length; i++) {\r\n var group = groups[i];\r\n var item = group.items.find(function (el) {\r\n if (el.label) {\r\n var label_1 = manifesto_js_1.LanguageMap.getValue(el.label);\r\n if (label_1 && label_1.toLowerCase() === _this.config.options.subtitleMetadataField) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n });\r\n if (item) {\r\n // @ts-ignore\r\n this.subtitle = manifesto_js_1.LanguageMap.getValue(item.value);\r\n break;\r\n }\r\n }\r\n this.$title.text(Utils_1.UVUtils.sanitize(this.title));\r\n this.resize(false);\r\n };\r\n AVCenterPanel.prototype._isCurrentResourceAccessControlled = function () {\r\n var canvas = this.extension.helper.getCurrentCanvas();\r\n return canvas.externalResource.isAccessControlled();\r\n };\r\n AVCenterPanel.prototype.openMedia = function (resources) {\r\n var _this = this;\r\n this.extension.getExternalResources(resources).then(function () {\r\n if (_this.avcomponent) {\r\n // reset if the media has already been loaded (degraded flow has happened)\r\n if (_this.extension.helper.canvasIndex === _this._lastCanvasIndex) {\r\n _this.avcomponent.reset();\r\n }\r\n _this._lastCanvasIndex = _this.extension.helper.canvasIndex;\r\n _this.avcomponent.set({\r\n helper: _this.extension.helper,\r\n adaptiveAuthEnabled: _this._isCurrentResourceAccessControlled(),\r\n autoPlay: _this.config.options.autoPlay,\r\n autoSelectRange: true,\r\n constrainNavigationToRange: _this._limitToRange(),\r\n content: _this.content,\r\n defaultAspectRatio: 0.56,\r\n doubleClickMS: 350,\r\n limitToRange: _this._limitToRange(),\r\n posterImageRatio: _this.config.options.posterImageRatio\r\n });\r\n _this.resize();\r\n }\r\n });\r\n };\r\n AVCenterPanel.prototype._limitToRange = function () {\r\n return !this.extension.isDesktopMetric();\r\n };\r\n AVCenterPanel.prototype._whenMediaReady = function (cb) {\r\n var _this = this;\r\n Utils.Async.waitFor(function () {\r\n return _this._mediaReady;\r\n }, cb);\r\n };\r\n AVCenterPanel.prototype._viewRange = function (range) {\r\n var _this = this;\r\n this._whenMediaReady(function () {\r\n if (range && _this.avcomponent) {\r\n _this.avcomponent.playRange(range.id);\r\n }\r\n // don't resize the av component to avoid expensively redrawing waveforms\r\n _this.resize(false);\r\n });\r\n };\r\n AVCenterPanel.prototype._viewCanvas = function (canvasIndex) {\r\n var _this = this;\r\n this._whenMediaReady(function () {\r\n var canvas = _this.extension.helper.getCanvasByIndex(canvasIndex);\r\n if (_this.avcomponent) {\r\n _this.avcomponent.showCanvas(canvas.id);\r\n }\r\n });\r\n };\r\n AVCenterPanel.prototype.resize = function (resizeAVComponent) {\r\n if (resizeAVComponent === void 0) { resizeAVComponent = true; }\r\n _super.prototype.resize.call(this);\r\n if (resizeAVComponent && this.avcomponent) {\r\n this.$avcomponent.height(this.$content.height());\r\n this.avcomponent.resize();\r\n }\r\n };\r\n return AVCenterPanel;\r\n }(CenterPanel_1.CenterPanel));\r\n exports.AVCenterPanel = AVCenterPanel;\r\n});\r\n//# sourceMappingURL=AVCenterPanel.js.map\n", "define('modules/uv-shared-module/InformationArgs',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var InformationArgs = /** @class */ (function () {\r\n function InformationArgs(informationType, param) {\r\n this.informationType = informationType;\r\n this.param = param;\r\n }\r\n return InformationArgs;\r\n }());\r\n exports.InformationArgs = InformationArgs;\r\n});\r\n//# sourceMappingURL=InformationArgs.js.map\n", "define('modules/uv-shared-module/InformationType',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var InformationType;\r\n (function (InformationType) {\r\n InformationType[InformationType[\"AUTH_CORS_ERROR\"] = 0] = \"AUTH_CORS_ERROR\";\r\n InformationType[InformationType[\"DEGRADED_RESOURCE\"] = 1] = \"DEGRADED_RESOURCE\";\r\n })(InformationType = exports.InformationType || (exports.InformationType = {}));\r\n});\r\n//# sourceMappingURL=InformationType.js.map\n", "define('modules/uv-shared-module/LoginWarningMessages',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var LoginWarningMessages = /** @class */ (function () {\r\n function LoginWarningMessages() {\r\n }\r\n LoginWarningMessages.FORBIDDEN = \"forbiddenResourceMessage\";\r\n return LoginWarningMessages;\r\n }());\r\n exports.LoginWarningMessages = LoginWarningMessages;\r\n});\r\n//# sourceMappingURL=LoginWarningMessages.js.map\n", "define('modules/uv-shared-module/Auth09',[\"require\", \"exports\", \"manifesto.js\", \"./BaseEvents\", \"./InformationArgs\", \"./InformationType\", \"./LoginWarningMessages\"], function (require, exports, manifesto_js_1, BaseEvents_1, InformationArgs_1, InformationType_1, LoginWarningMessages_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Auth09 = /** @class */ (function () {\r\n function Auth09() {\r\n }\r\n Auth09.loadExternalResources = function (resourcesToLoad, storageStrategy) {\r\n return new Promise(function (resolve) {\r\n manifesto_js_1.Utils.loadExternalResourcesAuth09(resourcesToLoad, storageStrategy, Auth09.clickThrough, Auth09.restricted, Auth09.login, Auth09.getAccessToken, Auth09.storeAccessToken, Auth09.getStoredAccessToken, Auth09.handleExternalResourceResponse).then(function (r) {\r\n resolve(r);\r\n })['catch'](function (error) {\r\n switch (error.name) {\r\n case manifesto_js_1.StatusCode.AUTHORIZATION_FAILED.toString():\r\n Auth09.publish(BaseEvents_1.BaseEvents.LOGIN_FAILED);\r\n break;\r\n case manifesto_js_1.StatusCode.FORBIDDEN.toString():\r\n Auth09.publish(BaseEvents_1.BaseEvents.FORBIDDEN);\r\n break;\r\n case manifesto_js_1.StatusCode.RESTRICTED.toString():\r\n // do nothing\r\n break;\r\n default:\r\n Auth09.publish(BaseEvents_1.BaseEvents.SHOW_MESSAGE, [error.message || error]);\r\n }\r\n });\r\n });\r\n };\r\n Auth09.clickThrough = function (resource) {\r\n return new Promise(function (resolve) {\r\n Auth09.publish(BaseEvents_1.BaseEvents.SHOW_CLICKTHROUGH_DIALOGUE, [{\r\n resource: resource,\r\n acceptCallback: function () {\r\n if (resource.clickThroughService) {\r\n var win_1 = window.open(resource.clickThroughService.id);\r\n var pollTimer_1 = window.setInterval(function () {\r\n if (win_1 && win_1.closed) {\r\n window.clearInterval(pollTimer_1);\r\n Auth09.publish(BaseEvents_1.BaseEvents.CLICKTHROUGH);\r\n resolve();\r\n }\r\n }, 500);\r\n }\r\n }\r\n }]);\r\n });\r\n };\r\n Auth09.restricted = function (resource) {\r\n return new Promise(function (resolve, reject) {\r\n Auth09.publish(BaseEvents_1.BaseEvents.SHOW_RESTRICTED_DIALOGUE, [{\r\n resource: resource,\r\n acceptCallback: function () {\r\n Auth09.publish(BaseEvents_1.BaseEvents.LOAD_FAILED);\r\n reject(resource);\r\n }\r\n }]);\r\n });\r\n };\r\n Auth09.login = function (resource) {\r\n return new Promise(function (resolve) {\r\n var options = {};\r\n if (resource.status === HTTPStatusCode.FORBIDDEN) {\r\n options.warningMessage = LoginWarningMessages_1.LoginWarningMessages.FORBIDDEN;\r\n options.showCancelButton = true;\r\n }\r\n Auth09.publish(BaseEvents_1.BaseEvents.SHOW_LOGIN_DIALOGUE, [{\r\n resource: resource,\r\n loginCallback: function () {\r\n if (resource.loginService) {\r\n var win_2 = window.open(resource.loginService.id + \"?t=\" + new Date().getTime());\r\n var pollTimer_2 = window.setInterval(function () {\r\n if (win_2 && win_2.closed) {\r\n window.clearInterval(pollTimer_2);\r\n Auth09.publish(BaseEvents_1.BaseEvents.LOGIN);\r\n resolve();\r\n }\r\n }, 500);\r\n }\r\n },\r\n logoutCallback: function () {\r\n if (resource.logoutService) {\r\n var win_3 = window.open(resource.logoutService.id + \"?t=\" + new Date().getTime());\r\n var pollTimer_3 = window.setInterval(function () {\r\n if (win_3 && win_3.closed) {\r\n window.clearInterval(pollTimer_3);\r\n Auth09.publish(BaseEvents_1.BaseEvents.LOGOUT);\r\n resolve();\r\n }\r\n }, 500);\r\n }\r\n },\r\n options: options\r\n }]);\r\n });\r\n };\r\n Auth09.getAccessToken = function (resource, rejectOnError) {\r\n return new Promise(function (resolve, reject) {\r\n if (resource.tokenService) {\r\n var serviceUri = resource.tokenService.id;\r\n // pick an identifier for this message. We might want to keep track of sent messages\r\n var msgId = serviceUri + \"|\" + new Date().getTime();\r\n var receiveAccessToken_1 = function (e) {\r\n window.removeEventListener(\"message\", receiveAccessToken_1);\r\n var token = e.data;\r\n if (token.error) {\r\n if (rejectOnError) {\r\n reject(token.errorDescription);\r\n }\r\n else {\r\n resolve(undefined);\r\n }\r\n }\r\n else {\r\n resolve(token);\r\n }\r\n };\r\n window.addEventListener(\"message\", receiveAccessToken_1, false);\r\n var tokenUri = serviceUri + \"?messageId=\" + msgId;\r\n $('#commsFrame').prop('src', tokenUri);\r\n }\r\n else {\r\n reject('Token service not found');\r\n }\r\n });\r\n };\r\n Auth09.storeAccessToken = function (resource, token, storageStrategy) {\r\n return new Promise(function (resolve, reject) {\r\n if (resource.tokenService) {\r\n Utils.Storage.set(resource.tokenService.id, token, token.expiresIn, new Utils.StorageType(storageStrategy));\r\n resolve();\r\n }\r\n else {\r\n reject('Token service not found');\r\n }\r\n });\r\n };\r\n Auth09.getStoredAccessToken = function (resource, storageStrategy) {\r\n return new Promise(function (resolve, reject) {\r\n var foundItems = [];\r\n var item = null;\r\n // try to match on the tokenService, if the resource has one:\r\n if (resource.tokenService) {\r\n item = Utils.Storage.get(resource.tokenService.id, new Utils.StorageType(storageStrategy));\r\n }\r\n if (item) {\r\n foundItems.push(item);\r\n }\r\n else {\r\n // find an access token for the domain\r\n var domain = Utils.Urls.getUrlParts(resource.dataUri).hostname;\r\n var items = Utils.Storage.getItems(new Utils.StorageType(storageStrategy));\r\n for (var i = 0; i < items.length; i++) {\r\n item = items[i];\r\n if (item.key.includes(domain)) {\r\n foundItems.push(item);\r\n }\r\n }\r\n }\r\n // sort by expiresAt, earliest to most recent.\r\n foundItems = foundItems.sort(function (a, b) {\r\n return a.expiresAt - b.expiresAt;\r\n });\r\n var foundToken;\r\n if (foundItems.length) {\r\n foundToken = foundItems[foundItems.length - 1].value;\r\n }\r\n resolve(foundToken);\r\n });\r\n };\r\n Auth09.handleExternalResourceResponse = function (resource) {\r\n return new Promise(function (resolve, reject) {\r\n resource.isResponseHandled = true;\r\n if (resource.status === HTTPStatusCode.OK) {\r\n resolve(resource);\r\n }\r\n else if (resource.status === HTTPStatusCode.MOVED_TEMPORARILY) {\r\n resolve(resource);\r\n Auth09.publish(BaseEvents_1.BaseEvents.RESOURCE_DEGRADED, [resource]);\r\n }\r\n else {\r\n if (resource.error.status === HTTPStatusCode.UNAUTHORIZED ||\r\n resource.error.status === HTTPStatusCode.INTERNAL_SERVER_ERROR) {\r\n // if the browser doesn't support CORS\r\n if (!Modernizr.cors) {\r\n var informationArgs = new InformationArgs_1.InformationArgs(InformationType_1.InformationType.AUTH_CORS_ERROR, null);\r\n Auth09.publish(BaseEvents_1.BaseEvents.SHOW_INFORMATION, [informationArgs]);\r\n resolve(resource);\r\n }\r\n else {\r\n reject(resource.error.statusText);\r\n }\r\n }\r\n else if (resource.error.status === HTTPStatusCode.FORBIDDEN) {\r\n var error = new Error();\r\n error.message = \"Forbidden\";\r\n error.name = manifesto_js_1.StatusCode.FORBIDDEN.toString();\r\n reject(error);\r\n }\r\n else {\r\n reject(resource.error.statusText);\r\n }\r\n }\r\n });\r\n };\r\n Auth09.handleDegraded = function (resource) {\r\n var informationArgs = new InformationArgs_1.InformationArgs(InformationType_1.InformationType.DEGRADED_RESOURCE, resource);\r\n Auth09.publish(BaseEvents_1.BaseEvents.SHOW_INFORMATION, [informationArgs]);\r\n };\r\n return Auth09;\r\n }());\r\n exports.Auth09 = Auth09;\r\n});\r\n//# sourceMappingURL=Auth09.js.map\n", "define('modules/uv-shared-module/Auth1',[\"require\", \"exports\", \"manifesto.js\", \"./BaseEvents\", \"../../Utils\", \"./InformationArgs\", \"./InformationType\"], function (require, exports, manifesto_js_1, BaseEvents_1, Utils_1, InformationArgs_1, InformationType_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Auth1 = /** @class */ (function () {\r\n function Auth1() {\r\n }\r\n Auth1.loadExternalResources = function (resourcesToLoad, storageStrategy, options) {\r\n return new Promise(function (resolve) {\r\n Auth1.storageStrategy = storageStrategy;\r\n // set all resources to Auth API V1\r\n resourcesToLoad = resourcesToLoad.map(function (resource) {\r\n resource.authAPIVersion = 1;\r\n resource.options = options;\r\n return resource;\r\n });\r\n manifesto_js_1.Utils.loadExternalResourcesAuth1(resourcesToLoad, Auth1.openContentProviderInteraction, Auth1.openTokenService, Auth1.getStoredAccessToken, Auth1.userInteractedWithContentProvider, Auth1.getContentProviderInteraction, Auth1.handleMovedTemporarily, Auth1.showOutOfOptionsMessages).then(function (r) {\r\n resolve(r);\r\n })['catch'](function (error) {\r\n switch (error.name) {\r\n case manifesto_js_1.StatusCode.AUTHORIZATION_FAILED.toString():\r\n Auth1.publish(BaseEvents_1.BaseEvents.LOGIN_FAILED);\r\n break;\r\n case manifesto_js_1.StatusCode.FORBIDDEN.toString():\r\n Auth1.publish(BaseEvents_1.BaseEvents.FORBIDDEN);\r\n break;\r\n case manifesto_js_1.StatusCode.RESTRICTED.toString():\r\n // do nothing\r\n break;\r\n default:\r\n Auth1.publish(BaseEvents_1.BaseEvents.SHOW_MESSAGE, [error.message || error]);\r\n }\r\n });\r\n });\r\n };\r\n Auth1.getCookieServiceUrl = function (service) {\r\n return service.id + \"?origin=\" + Auth1.getOrigin();\r\n };\r\n Auth1.openContentProviderInteraction = function (service) {\r\n var cookieServiceUrl = Auth1.getCookieServiceUrl(service);\r\n return window.open(cookieServiceUrl);\r\n };\r\n // determine the postMessage-style origin for a URL\r\n Auth1.getOrigin = function (url) {\r\n var urlHolder = window.location;\r\n if (url) {\r\n urlHolder = document.createElement('a');\r\n urlHolder.href = url;\r\n }\r\n return urlHolder.protocol + \"//\" + urlHolder.hostname + (urlHolder.port ? ':' + urlHolder.port : '');\r\n };\r\n Auth1.userInteractedWithContentProvider = function (contentProviderWindow) {\r\n return new Promise(function (resolve) {\r\n // What happens here is forever a mystery to a client application.\r\n // It can but wait.\r\n var poll = window.setInterval(function () {\r\n if (contentProviderWindow.closed) {\r\n window.clearInterval(poll);\r\n resolve(true);\r\n }\r\n }, 500);\r\n });\r\n };\r\n Auth1.handleMovedTemporarily = function (resource) {\r\n return new Promise(function (resolve) {\r\n Auth1.showDegradedMessage(resource);\r\n resource.isResponseHandled = true;\r\n resolve();\r\n });\r\n };\r\n Auth1.showDegradedMessage = function (resource) {\r\n var informationArgs = new InformationArgs_1.InformationArgs(InformationType_1.InformationType.DEGRADED_RESOURCE, resource);\r\n Auth1.publish(BaseEvents_1.BaseEvents.SHOW_INFORMATION, [informationArgs]);\r\n };\r\n Auth1.storeAccessToken = function (resource, token) {\r\n return new Promise(function (resolve, reject) {\r\n if (resource.tokenService) {\r\n Utils.Storage.set(resource.tokenService.id, token, token.expiresIn, new Utils.StorageType(Auth1.storageStrategy));\r\n resolve();\r\n }\r\n else {\r\n reject('Token service not found');\r\n }\r\n });\r\n };\r\n Auth1.getStoredAccessToken = function (resource) {\r\n return new Promise(function (resolve) {\r\n var foundItems = [];\r\n var item = null;\r\n // try to match on the tokenService, if the resource has one:\r\n if (resource.tokenService) {\r\n item = Utils.Storage.get(resource.tokenService.id, new Utils.StorageType(Auth1.storageStrategy));\r\n }\r\n if (item) {\r\n foundItems.push(item);\r\n }\r\n else {\r\n // find an access token for the domain\r\n var domain = Utils.Urls.getUrlParts(resource.dataUri).hostname;\r\n var items = Utils.Storage.getItems(new Utils.StorageType(Auth1.storageStrategy));\r\n for (var i = 0; i < items.length; i++) {\r\n item = items[i];\r\n if (item.key.includes(domain)) {\r\n foundItems.push(item);\r\n }\r\n }\r\n }\r\n // sort by expiresAt, earliest to most recent.\r\n foundItems = foundItems.sort(function (a, b) {\r\n return a.expiresAt - b.expiresAt;\r\n });\r\n var foundToken = null;\r\n if (foundItems.length) {\r\n foundToken = foundItems[foundItems.length - 1].value;\r\n }\r\n resolve(foundToken);\r\n });\r\n };\r\n Auth1.getContentProviderInteraction = function (resource, service) {\r\n return new Promise(function (resolve) {\r\n // if the info bar has already been shown for degraded logins\r\n if (resource.isResponseHandled && !resource.authHoldingPage) {\r\n Auth1.showDegradedMessage(resource);\r\n resolve(null);\r\n }\r\n else if (resource.authHoldingPage) {\r\n // redirect holding page\r\n resource.authHoldingPage.location.href = Auth1.getCookieServiceUrl(service);\r\n resolve(resource.authHoldingPage);\r\n }\r\n else {\r\n Auth1.publish(BaseEvents_1.BaseEvents.SHOW_AUTH_DIALOGUE, [{\r\n service: service,\r\n closeCallback: function () {\r\n resolve(null);\r\n },\r\n confirmCallback: function () {\r\n var win = Auth1.openContentProviderInteraction(service);\r\n resolve(win);\r\n },\r\n cancelCallback: function () {\r\n resolve(null);\r\n }\r\n }]);\r\n }\r\n });\r\n };\r\n Auth1.openTokenService = function (resource, tokenService) {\r\n // use a Promise across a postMessage call. Discuss...\r\n return new Promise(function (resolve, reject) {\r\n // if necessary, the client can decide not to trust this origin\r\n var serviceOrigin = Auth1.getOrigin(tokenService.id);\r\n var messageId = new Date().getTime();\r\n Auth1.messages[messageId] = {\r\n \"resolve\": resolve,\r\n \"reject\": reject,\r\n \"serviceOrigin\": serviceOrigin,\r\n \"resource\": resource\r\n };\r\n window.addEventListener(\"message\", Auth1.receiveToken, false);\r\n var tokenUrl = tokenService.id + \"?messageId=\" + messageId + \"&origin=\" + Auth1.getOrigin();\r\n // load the access token service url in the #commsFrame iframe.\r\n // when the message event listener (Auth1.receiveToken) receives a message from the iframe\r\n // it looks in Auth1.messages to find a corresponding message id with the same origin.\r\n // if found, it stores the returned access token, resolves and deletes the message.\r\n // resolving the message resolves the openTokenService promise.\r\n $('#commsFrame').prop('src', tokenUrl);\r\n // reject any unhandled messages after a configurable timeout\r\n var postMessageTimeout = 5000;\r\n setTimeout(function () {\r\n if (Auth1.messages[messageId]) {\r\n Auth1.messages[messageId].reject(\"Message unhandled after \" + postMessageTimeout + \"ms, rejecting\");\r\n delete Auth1.messages[messageId];\r\n }\r\n }, postMessageTimeout);\r\n });\r\n };\r\n Auth1.receiveToken = function (event) {\r\n if (event.data.hasOwnProperty(\"messageId\")) {\r\n var message_1 = Auth1.messages[event.data.messageId];\r\n if (message_1 && event.origin == message_1.serviceOrigin) {\r\n // Any message with a messageId is a success\r\n Auth1.storeAccessToken(message_1.resource, event.data).then(function () {\r\n message_1.resolve(event.data); // resolves openTokenService with the token\r\n delete Auth1.messages[event.data.messageId];\r\n return;\r\n });\r\n }\r\n }\r\n };\r\n Auth1.showOutOfOptionsMessages = function (resource, service) {\r\n // if the UV is already showing the info bar, no need to show an error message.\r\n if (resource.status == HTTPStatusCode.MOVED_TEMPORARILY) {\r\n return;\r\n }\r\n var errorMessage = \"\";\r\n if (service.getFailureHeader()) {\r\n errorMessage += '<p>' + service.getFailureHeader() + '</p>';\r\n }\r\n if (service.getFailureDescription()) {\r\n errorMessage += service.getFailureDescription();\r\n }\r\n Auth1.publish(BaseEvents_1.BaseEvents.SHOW_MESSAGE, [Utils_1.UVUtils.sanitize(errorMessage)]);\r\n };\r\n Auth1.messages = {};\r\n return Auth1;\r\n }());\r\n exports.Auth1 = Auth1;\r\n});\r\n//# sourceMappingURL=Auth1.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/Dialogue',[\"require\", \"exports\", \"./BaseView\", \"./BaseEvents\"], function (require, exports, BaseView_1, BaseEvents_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Dialogue = /** @class */ (function (_super) {\r\n __extends(Dialogue, _super);\r\n function Dialogue($element) {\r\n var _this = _super.call(this, $element, false, false) || this;\r\n _this.allowClose = true;\r\n _this.isActive = false;\r\n _this.isUnopened = true;\r\n return _this;\r\n }\r\n Dialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('dialogue');\r\n _super.prototype.create.call(this);\r\n // events.\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CLOSE_ACTIVE_DIALOGUE, function () {\r\n if (_this.isActive) {\r\n if (_this.allowClose) {\r\n _this.close();\r\n }\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ESCAPE, function () {\r\n if (_this.isActive) {\r\n if (_this.allowClose) {\r\n _this.close();\r\n }\r\n }\r\n });\r\n this.$top = $('<div class=\"top\"></div>');\r\n this.$element.append(this.$top);\r\n this.$closeButton = $('<button type=\"button\" class=\"btn btn-default close\" tabindex=\"0\">' + this.content.close + '</button>');\r\n this.$middle = $('<div class=\"middle\"></div>');\r\n this.$element.append(this.$middle);\r\n this.$content = $('<div class=\"content\"></div>');\r\n this.$middle.append(this.$content);\r\n this.$buttons = $('<div class=\"buttons\"></div>');\r\n this.$middle.append(this.$buttons);\r\n this.$bottom = $('<div class=\"bottom\"></div>');\r\n this.$element.append(this.$bottom);\r\n if (this.config.topCloseButtonEnabled) {\r\n this.$top.append(this.$closeButton);\r\n }\r\n else {\r\n this.$buttons.append(this.$closeButton);\r\n }\r\n this.$closeButton.on('click', function (e) {\r\n e.preventDefault();\r\n _this.close();\r\n });\r\n this.returnFunc = this.close;\r\n };\r\n Dialogue.prototype.enableClose = function () {\r\n this.allowClose = true;\r\n this.$closeButton.show();\r\n };\r\n Dialogue.prototype.disableClose = function () {\r\n this.allowClose = false;\r\n this.$closeButton.hide();\r\n };\r\n Dialogue.prototype.setDockedPosition = function () {\r\n var top = Math.floor(this.extension.height() - this.$element.outerHeight(true));\r\n var left = 0;\r\n var arrowLeft = 0;\r\n var normalisedPos = 0;\r\n if (this.$triggerButton) {\r\n var verticalPadding = 4;\r\n var horizontalPadding = 2;\r\n var a = this.$triggerButton.offset().top;\r\n var b = this.extension.$element.offset().top;\r\n var d = this.$element.outerHeight(true);\r\n var e = (a - b) - d;\r\n top = e + verticalPadding;\r\n var f = this.$triggerButton.offset().left;\r\n var g = this.extension.$element.offset().left;\r\n var h = f - g;\r\n normalisedPos = Utils.Maths.normalise(h, 0, this.extension.width());\r\n left = Math.floor((this.extension.width() * normalisedPos) - ((this.$element.width()) * normalisedPos)) + horizontalPadding;\r\n arrowLeft = Math.floor(this.$element.width() * normalisedPos);\r\n }\r\n this.$bottom.css('backgroundPosition', arrowLeft + 'px 0px');\r\n this.$element.css({\r\n 'top': top,\r\n 'left': left\r\n });\r\n };\r\n Dialogue.prototype.open = function (triggerButton) {\r\n var _this = this;\r\n this.$element.attr('aria-hidden', 'false');\r\n this.$element.show();\r\n if (triggerButton) {\r\n this.$triggerButton = $(triggerButton);\r\n this.$bottom.show();\r\n }\r\n else {\r\n this.$bottom.hide();\r\n }\r\n this.isActive = true;\r\n // set the focus to the default button.\r\n setTimeout(function () {\r\n var $defaultButton = _this.$element.find('.default');\r\n if ($defaultButton.length) {\r\n $defaultButton.focus();\r\n }\r\n else {\r\n // if there's no default button, focus on the first visible input\r\n var $input = _this.$element.find('input:visible').first();\r\n if ($input.length) {\r\n $input.focus();\r\n }\r\n else {\r\n // if there's no visible first input, focus on the close button\r\n _this.$closeButton.focus();\r\n }\r\n }\r\n }, 1);\r\n this.component.publish(BaseEvents_1.BaseEvents.SHOW_OVERLAY);\r\n if (this.isUnopened) {\r\n this.isUnopened = false;\r\n this.afterFirstOpen();\r\n }\r\n this.resize();\r\n };\r\n Dialogue.prototype.afterFirstOpen = function () {\r\n };\r\n Dialogue.prototype.close = function () {\r\n if (!this.isActive)\r\n return;\r\n this.$element.attr('aria-hidden', 'true');\r\n this.$element.hide();\r\n this.isActive = false;\r\n this.component.publish(this.closeCommand);\r\n this.component.publish(BaseEvents_1.BaseEvents.HIDE_OVERLAY);\r\n };\r\n Dialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$element.css({\r\n 'top': Math.floor((this.extension.height() / 2) - (this.$element.height() / 2)),\r\n 'left': Math.floor((this.extension.width() / 2) - (this.$element.width() / 2))\r\n });\r\n };\r\n return Dialogue;\r\n }(BaseView_1.BaseView));\r\n exports.Dialogue = Dialogue;\r\n});\r\n//# sourceMappingURL=Dialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/AuthDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\", \"../../Utils\"], function (require, exports, BaseEvents_1, Dialogue_1, Utils_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var AuthDialogue = /** @class */ (function (_super) {\r\n __extends(AuthDialogue, _super);\r\n function AuthDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n AuthDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('authDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_AUTH_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_AUTH_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function (e) {\r\n _this.closeCallback = e.closeCallback;\r\n _this.confirmCallback = e.confirmCallback;\r\n _this.cancelCallback = e.cancelCallback;\r\n _this.service = e.service;\r\n _this.open();\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.$title = $('<h1></h1>');\r\n this.$content.append(this.$title);\r\n this.$content.append('\\\r\n <div>\\\r\n <p class=\"message scroll\"></p>\\\r\n </div>');\r\n this.$buttons.prepend(this._buttonsToAdd());\r\n this.$message = this.$content.find('.message');\r\n this.$confirmButton = this.$buttons.find('.confirm');\r\n this.$confirmButton.text(this.content.confirm);\r\n this.$cancelButton = this.$buttons.find('.close');\r\n this.$cancelButton.text(this.content.cancel);\r\n this.$element.hide();\r\n this.$confirmButton.on('click', function (e) {\r\n e.preventDefault();\r\n if (_this.confirmCallback) {\r\n _this.confirmCallback();\r\n }\r\n _this.close();\r\n });\r\n this.$cancelButton.on('click', function (e) {\r\n e.preventDefault();\r\n if (_this.cancelCallback) {\r\n _this.cancelCallback();\r\n }\r\n _this.close();\r\n });\r\n };\r\n AuthDialogue.prototype.open = function () {\r\n _super.prototype.open.call(this);\r\n var header = this.service.getHeader();\r\n var description = this.service.getDescription();\r\n var confirmLabel = this.service.getConfirmLabel();\r\n if (header) {\r\n this.$title.text(Utils_1.UVUtils.sanitize(header));\r\n }\r\n if (description) {\r\n this.$message.html(Utils_1.UVUtils.sanitize(description));\r\n this.$message.targetBlank();\r\n this.$message.find('a').on('click', function () {\r\n var url = $(this).attr('href');\r\n this.component.publish(BaseEvents_1.BaseEvents.EXTERNAL_LINK_CLICKED, url);\r\n });\r\n }\r\n if (confirmLabel) {\r\n this.$confirmButton.text(Utils_1.UVUtils.sanitize(confirmLabel));\r\n }\r\n this.resize();\r\n };\r\n AuthDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n AuthDialogue.prototype._buttonsToAdd = function () {\r\n var buttonsToAdd = '<a class=\"confirm btn btn-primary\" href=\"#\" target=\"_parent\"></a>';\r\n // If the top button is enabled, add an additional close button for consistency.\r\n if (this.config.topCloseButtonEnabled) {\r\n buttonsToAdd += '<button class=\"close btn btn-default\"></button>';\r\n }\r\n return buttonsToAdd;\r\n };\r\n return AuthDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.AuthDialogue = AuthDialogue;\r\n});\r\n//# sourceMappingURL=AuthDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/ClickThroughDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\"], function (require, exports, BaseEvents_1, Dialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ClickThroughDialogue = /** @class */ (function (_super) {\r\n __extends(ClickThroughDialogue, _super);\r\n function ClickThroughDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n ClickThroughDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('clickThroughDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_CLICKTHROUGH_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_CLICKTHROUGH_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function (params) {\r\n _this.acceptCallback = params.acceptCallback;\r\n _this.resource = params.resource;\r\n _this.open();\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.$title = $('<h1></h1>');\r\n this.$content.append(this.$title);\r\n this.$content.append('\\\n <div>\\\n <p class=\"message scroll\"></p>\\\n <div class=\"buttons\">\\\n <a class=\"acceptTerms btn btn-primary\" href=\"#\" target=\"_parent\"></a>\\\n </div>\\\n </div>');\r\n this.$message = this.$content.find(\".message\");\r\n this.$acceptTermsButton = this.$content.find(\".acceptTerms\");\r\n // TODO: get from config this.$acceptTermsButton.text(this.content.acceptTerms); // figure out config\r\n this.$acceptTermsButton.text(\"Accept Terms and Open\");\r\n this.$element.hide();\r\n this.$acceptTermsButton.on('click', function (e) {\r\n e.preventDefault();\r\n _this.close();\r\n _this.component.publish(BaseEvents_1.BaseEvents.ACCEPT_TERMS);\r\n if (_this.acceptCallback)\r\n _this.acceptCallback();\r\n });\r\n };\r\n ClickThroughDialogue.prototype.open = function () {\r\n _super.prototype.open.call(this);\r\n if (this.resource.clickThroughService) {\r\n this.$title.text(this.resource.clickThroughService.getProperty('label'));\r\n this.$message.html(this.resource.clickThroughService.getProperty('description'));\r\n this.$message.targetBlank();\r\n }\r\n this.$message.find('a').on('click', function () {\r\n var url = $(this).attr('href');\r\n this.component.publish(BaseEvents_1.BaseEvents.EXTERNAL_LINK_CLICKED, url);\r\n });\r\n this.resize();\r\n };\r\n ClickThroughDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return ClickThroughDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.ClickThroughDialogue = ClickThroughDialogue;\r\n});\r\n//# sourceMappingURL=ClickThroughDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/LoginDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\"], function (require, exports, BaseEvents_1, Dialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var LoginDialogue = /** @class */ (function (_super) {\r\n __extends(LoginDialogue, _super);\r\n function LoginDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n LoginDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('loginDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_LOGIN_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_LOGIN_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function (e) {\r\n _this.loginCallback = e.loginCallback;\r\n _this.logoutCallback = e.logoutCallback;\r\n _this.options = e.options;\r\n _this.resource = e.resource;\r\n _this.open();\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.$title = $('<h1></h1>');\r\n this.$content.append(this.$title);\r\n this.$content.append('\\\n <div>\\\n <p class=\"message scroll\"></p>\\\n <div class=\"buttons\">\\\n <a class=\"logout btn btn-primary\" href=\"#\" target=\"_parent\"></a>\\\n <a class=\"login btn btn-primary\" href=\"#\" target=\"_parent\"></a>\\\n <a class=\"cancel btn btn-primary\" href=\"#\"></a>\\\n </div>\\\n </div>');\r\n this.$message = this.$content.find('.message');\r\n this.$loginButton = this.$content.find('.login');\r\n this.$loginButton.text(this.content.login);\r\n this.$logoutButton = this.$content.find('.logout');\r\n this.$logoutButton.text(this.content.logout);\r\n this.$cancelButton = this.$content.find('.cancel');\r\n this.$cancelButton.text(this.content.cancel);\r\n this.$element.hide();\r\n this.$loginButton.on('click', function (e) {\r\n e.preventDefault();\r\n _this.close();\r\n if (_this.loginCallback)\r\n _this.loginCallback();\r\n });\r\n this.$logoutButton.on('click', function (e) {\r\n e.preventDefault();\r\n _this.close();\r\n if (_this.logoutCallback)\r\n _this.logoutCallback();\r\n });\r\n this.$cancelButton.on('click', function (e) {\r\n e.preventDefault();\r\n _this.close();\r\n });\r\n this.updateLogoutButton();\r\n };\r\n LoginDialogue.prototype.open = function () {\r\n _super.prototype.open.call(this);\r\n var message = \"\";\r\n if (this.resource.loginService) {\r\n this.$title.text(this.resource.loginService.getProperty('label'));\r\n message = this.resource.loginService.getProperty('description');\r\n }\r\n if (this.options.warningMessage) {\r\n message = '<span class=\"warning\">' + this.extension.data.config.content[this.options.warningMessage] + '</span><span class=\"description\">' + message + '</span>';\r\n }\r\n this.updateLogoutButton();\r\n this.$message.html(message);\r\n this.$message.targetBlank();\r\n this.$message.find('a').on('click', function () {\r\n var url = $(this).attr('href');\r\n this.component.publish(BaseEvents_1.BaseEvents.EXTERNAL_LINK_CLICKED, url);\r\n });\r\n if (this.options.showCancelButton) {\r\n this.$cancelButton.show();\r\n }\r\n else {\r\n this.$cancelButton.hide();\r\n }\r\n this.resize();\r\n };\r\n LoginDialogue.prototype.updateLogoutButton = function () {\r\n if (this.extension.isLoggedIn) {\r\n this.$logoutButton.show();\r\n }\r\n else {\r\n this.$logoutButton.hide();\r\n }\r\n };\r\n LoginDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return LoginDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.LoginDialogue = LoginDialogue;\r\n});\r\n//# sourceMappingURL=LoginDialogue.js.map\n", "define('modules/uv-shared-module/StringValue',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var StringValue = /** @class */ (function () {\r\n function StringValue(value) {\r\n this.value = \"\";\r\n if (value) {\r\n this.value = value.toLowerCase();\r\n }\r\n }\r\n StringValue.prototype.toString = function () {\r\n return this.value;\r\n };\r\n return StringValue;\r\n }());\r\n exports.StringValue = StringValue;\r\n});\r\n//# sourceMappingURL=StringValue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/MetricType',[\"require\", \"exports\", \"./StringValue\"], function (require, exports, StringValue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var MetricType = /** @class */ (function (_super) {\r\n __extends(MetricType, _super);\r\n function MetricType() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MetricType.DESKTOP = new MetricType(\"desktop\");\r\n MetricType.MOBILELANDSCAPE = new MetricType(\"mobilelandscape\");\r\n MetricType.MOBILEPORTRAIT = new MetricType(\"mobileportrait\");\r\n MetricType.NONE = new MetricType(\"none\");\r\n MetricType.WATCH = new MetricType(\"watch\");\r\n return MetricType;\r\n }(StringValue_1.StringValue));\r\n exports.MetricType = MetricType;\r\n});\r\n//# sourceMappingURL=MetricType.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/RestrictedDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\"], function (require, exports, BaseEvents_1, Dialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var RestrictedDialogue = /** @class */ (function (_super) {\r\n __extends(RestrictedDialogue, _super);\r\n function RestrictedDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n RestrictedDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('restrictedDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_RESTRICTED_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_RESTRICTED_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function (e) {\r\n _this.acceptCallback = e.acceptCallback;\r\n _this.options = e.options;\r\n _this.resource = e.resource;\r\n _this.open();\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.$title = $('<h1></h1>');\r\n this.$content.append(this.$title);\r\n this.$content.append('\\\n <div>\\\n <p class=\"message scroll\"></p>\\\n <div class=\"buttons\">\\\n <a class=\"cancel btn btn-primary\" href=\"#\" target=\"_parent\"></a>\\\n </div>\\\n </div>');\r\n this.$message = this.$content.find('.message');\r\n this.$message.targetBlank();\r\n // todo: revisit?\r\n //this.$nextVisibleButton = this.$content.find('.nextvisible');\r\n //this.$nextVisibleButton.text(this.content.nextVisibleItem);\r\n this.$cancelButton = this.$content.find('.cancel');\r\n this.$cancelButton.text(this.content.cancel);\r\n this.$element.hide();\r\n this.$cancelButton.on('click', function (e) {\r\n e.preventDefault();\r\n _this.close();\r\n });\r\n };\r\n RestrictedDialogue.prototype.open = function () {\r\n _super.prototype.open.call(this);\r\n this.isAccepted = false;\r\n var message = \"\";\r\n if (this.resource.restrictedService) {\r\n this.$title.text(this.resource.restrictedService.getProperty('label'));\r\n message = this.resource.restrictedService.getProperty('description');\r\n }\r\n this.$message.html(message);\r\n this.$message.targetBlank();\r\n this.$message.find('a').on('click', function () {\r\n var url = $(this).attr('href');\r\n this.component.publish(BaseEvents_1.BaseEvents.EXTERNAL_LINK_CLICKED, url);\r\n });\r\n this.resize();\r\n };\r\n RestrictedDialogue.prototype.close = function () {\r\n _super.prototype.close.call(this);\r\n if (!this.isAccepted && this.acceptCallback) {\r\n this.isAccepted = true;\r\n this.acceptCallback();\r\n }\r\n };\r\n RestrictedDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return RestrictedDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.RestrictedDialogue = RestrictedDialogue;\r\n});\r\n//# sourceMappingURL=RestrictedDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/GenericDialogue',[\"require\", \"exports\", \"./BaseEvents\", \"./Dialogue\"], function (require, exports, BaseEvents_1, Dialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var GenericDialogue = /** @class */ (function (_super) {\r\n __extends(GenericDialogue, _super);\r\n function GenericDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n GenericDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('genericDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_GENERIC_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_GENERIC_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function (params) {\r\n _this.acceptCallback = params.acceptCallback;\r\n _this.showMessage(params);\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.$message = $('<p></p>');\r\n this.$content.append(this.$message);\r\n this.$acceptButton = $(\"\\n <button class=\\\"btn btn-primary accept default\\\">\\n \" + this.content.ok + \"\\n </button>\\n \");\r\n this.$buttons.append(this.$acceptButton);\r\n // Hide the redundant close button\r\n this.$buttons.find('.close').hide();\r\n this.$acceptButton.onPressed(function () {\r\n _this.accept();\r\n });\r\n this.returnFunc = function () {\r\n if (_this.isActive) {\r\n _this.accept();\r\n }\r\n };\r\n this.$element.hide();\r\n };\r\n GenericDialogue.prototype.accept = function () {\r\n this.component.publish(BaseEvents_1.BaseEvents.CLOSE_ACTIVE_DIALOGUE);\r\n if (this.acceptCallback)\r\n this.acceptCallback();\r\n };\r\n GenericDialogue.prototype.showMessage = function (params) {\r\n this.$message.html(params.message);\r\n if (params.buttonText) {\r\n this.$acceptButton.text(params.buttonText);\r\n }\r\n else {\r\n this.$acceptButton.text(this.content.ok);\r\n }\r\n if (params.allowClose === false) {\r\n this.disableClose();\r\n }\r\n this.open();\r\n };\r\n GenericDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return GenericDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.GenericDialogue = GenericDialogue;\r\n});\r\n//# sourceMappingURL=GenericDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/Shell',[\"require\", \"exports\", \"./BaseEvents\", \"./BaseView\", \"./GenericDialogue\"], function (require, exports, BaseEvents_1, BaseView_1, GenericDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Shell = /** @class */ (function (_super) {\r\n __extends(Shell, _super);\r\n function Shell($element) {\r\n return _super.call(this, $element, true, true) || this;\r\n }\r\n Shell.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_OVERLAY, function () {\r\n _this.$overlays.show();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_OVERLAY, function () {\r\n _this.$overlays.hide();\r\n });\r\n this.$headerPanel = $('<div class=\"headerPanel\"></div>');\r\n this.$element.append(this.$headerPanel);\r\n this.$mainPanel = $('<div class=\"mainPanel\"></div>');\r\n this.$element.append(this.$mainPanel);\r\n this.$centerPanel = $('<div class=\"centerPanel\"></div>');\r\n this.$mainPanel.append(this.$centerPanel);\r\n this.$leftPanel = $('<div class=\"leftPanel\"></div>');\r\n this.$mainPanel.append(this.$leftPanel);\r\n this.$rightPanel = $('<div class=\"rightPanel\"></div>');\r\n this.$mainPanel.append(this.$rightPanel);\r\n this.$footerPanel = $('<div class=\"footerPanel\"></div>');\r\n this.$element.append(this.$footerPanel);\r\n this.$mobileFooterPanel = $('<div class=\"mobileFooterPanel\"></div>');\r\n this.$element.append(this.$mobileFooterPanel);\r\n this.$overlays = $('<div class=\"overlays\"></div>');\r\n this.$element.append(this.$overlays);\r\n this.$genericDialogue = $('<div class=\"overlay genericDialogue\" aria-hidden=\"true\"></div>');\r\n this.$overlays.append(this.$genericDialogue);\r\n this.$overlays.on('click', function (e) {\r\n if ($(e.target).hasClass('overlays')) {\r\n e.preventDefault();\r\n _this.component.publish(BaseEvents_1.BaseEvents.CLOSE_ACTIVE_DIALOGUE);\r\n }\r\n });\r\n // create shared views.\r\n new GenericDialogue_1.GenericDialogue(this.$genericDialogue);\r\n };\r\n Shell.prototype.resize = function () {\r\n var _this = this;\r\n _super.prototype.resize.call(this);\r\n setTimeout(function () {\r\n _this.$overlays.width(_this.extension.width());\r\n _this.$overlays.height(_this.extension.height());\r\n }, 1);\r\n var mainHeight = this.$element.height() - parseInt(this.$mainPanel.css('paddingTop'))\r\n - (this.$headerPanel.is(':visible') ? this.$headerPanel.height() : 0)\r\n - (this.$footerPanel.is(':visible') ? this.$footerPanel.height() : 0)\r\n - (this.$mobileFooterPanel.is(':visible') ? this.$mobileFooterPanel.height() : 0);\r\n this.$mainPanel.height(mainHeight);\r\n };\r\n return Shell;\r\n }(BaseView_1.BaseView));\r\n exports.Shell = Shell;\r\n});\r\n//# sourceMappingURL=Shell.js.map\n", "define('SynchronousRequire',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SynchronousRequire = /** @class */ (function () {\r\n function SynchronousRequire() {\r\n }\r\n SynchronousRequire.load = function (deps, cb) {\r\n var loaders = [];\r\n for (var i = 0; i < deps.length; i++) {\r\n var depLoader = new DependencyLoader(i, deps[i], deps, cb);\r\n loaders.push(depLoader);\r\n }\r\n var sequence = Promise.resolve();\r\n loaders.forEach(function (loader) {\r\n sequence = sequence.then(function () {\r\n return loader.load();\r\n });\r\n });\r\n return sequence;\r\n };\r\n return SynchronousRequire;\r\n }());\r\n exports.SynchronousRequire = SynchronousRequire;\r\n var DependencyLoader = /** @class */ (function () {\r\n function DependencyLoader(index, dep, deps, cb) {\r\n this._dep = dep;\r\n this._deps = deps;\r\n this._cb = cb;\r\n this._index = index;\r\n }\r\n DependencyLoader.prototype.getDependencyIndex = function (dep) {\r\n return this._deps.findIndex(function (el) { return el.includes(dep); });\r\n };\r\n DependencyLoader.prototype.load = function () {\r\n var that = this;\r\n return new Promise(function (resolve) {\r\n // @ts-ignore\r\n requirejs([that._dep], function (dep) {\r\n that._cb(that._index, dep);\r\n resolve();\r\n });\r\n });\r\n };\r\n return DependencyLoader;\r\n }());\r\n exports.DependencyLoader = DependencyLoader;\r\n});\r\n//# sourceMappingURL=SynchronousRequire.js.map\n", "define('modules/uv-shared-module/BaseExtension',[\"require\", \"exports\", \"@iiif/manifold\", \"@iiif/vocabulary\", \"../../Utils\", \"./Auth09\", \"./Auth1\", \"../uv-dialogues-module/AuthDialogue\", \"./BaseEvents\", \"../uv-dialogues-module/ClickThroughDialogue\", \"../uv-dialogues-module/LoginDialogue\", \"./MetricType\", \"../uv-dialogues-module/RestrictedDialogue\", \"./Shell\", \"../../SynchronousRequire\"], function (require, exports, manifold_1, vocabulary_1, Utils_1, Auth09_1, Auth1_1, AuthDialogue_1, BaseEvents_1, ClickThroughDialogue_1, LoginDialogue_1, MetricType_1, RestrictedDialogue_1, Shell_1, SynchronousRequire_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var BaseExtension = /** @class */ (function () {\r\n function BaseExtension() {\r\n this.isCreated = false;\r\n this.isLoggedIn = false;\r\n this.metric = MetricType_1.MetricType.NONE;\r\n this.metrics = [];\r\n this.shifted = false;\r\n this.tabbing = false;\r\n }\r\n BaseExtension.prototype.create = function () {\r\n var _this = this;\r\n var that = this;\r\n Auth09_1.Auth09.publish = this.component.publish;\r\n Auth1_1.Auth1.publish = this.component.publish;\r\n this.$element = $(this.component.options.target);\r\n this.$element.data(\"component\", this.component);\r\n this.fire(BaseEvents_1.BaseEvents.CREATE, {\r\n data: this.data,\r\n settings: this.getSettings(),\r\n preview: this.getSharePreview()\r\n });\r\n this._parseMetrics();\r\n this._initLocales();\r\n // add/remove classes.\r\n this.$element.empty();\r\n this.$element.removeClass();\r\n this.$element.addClass('uv');\r\n if (this.data.locales) {\r\n this.$element.addClass(this.data.locales[0].name.toLowerCase());\r\n }\r\n this.$element.addClass(this.name);\r\n this.$element.addClass('browser-' + window.browserDetect.browser);\r\n this.$element.addClass('browser-version-' + window.browserDetect.version);\r\n this.$element.prop('tabindex', 0);\r\n if (this.data.embedded) {\r\n this.$element.addClass('embedded');\r\n }\r\n if (this.isMobile()) {\r\n this.$element.addClass('mobile');\r\n }\r\n // todo: deprecate?\r\n if (this.data.isLightbox) {\r\n this.$element.addClass('lightbox');\r\n }\r\n if (Utils.Documents.supportsFullscreen()) {\r\n this.$element.addClass('fullscreen-supported');\r\n }\r\n this.$element.on('mousemove', function (e) {\r\n _this.mouseX = e.pageX;\r\n _this.mouseY = e.pageY;\r\n });\r\n // events\r\n if (!this.data.isReload) {\r\n var visibilityProp = Utils.Documents.getHiddenProp();\r\n if (visibilityProp) {\r\n var event_1 = visibilityProp.replace(/[H|h]idden/, '') + 'visibilitychange';\r\n document.addEventListener(event_1, function () {\r\n // resize after a tab has been shown (fixes safari layout issue)\r\n if (!Utils.Documents.isHidden()) {\r\n _this.resize();\r\n }\r\n });\r\n }\r\n if (Utils.Bools.getBool(this.data.config.options.dropEnabled, true)) {\r\n this.$element.on('drop', (function (e) {\r\n e.preventDefault();\r\n var dropUrl = e.originalEvent.dataTransfer.getData('URL');\r\n var a = Utils.Urls.getUrlParts(dropUrl);\r\n var iiifResourceUri = Utils.Urls.getQuerystringParameterFromString('manifest', a.search);\r\n if (!iiifResourceUri) {\r\n // look for collection param\r\n iiifResourceUri = Utils.Urls.getQuerystringParameterFromString('collection', a.search);\r\n }\r\n //var canvasUri = Utils.Urls.getQuerystringParameterFromString('canvas', url.search);\r\n if (iiifResourceUri) {\r\n _this.fire(BaseEvents_1.BaseEvents.DROP, iiifResourceUri);\r\n var data = {};\r\n data.iiifResourceUri = iiifResourceUri;\r\n _this.reload(data);\r\n }\r\n }));\r\n }\r\n this.$element.on('dragover', (function (e) {\r\n // allow drop\r\n e.preventDefault();\r\n }));\r\n // keyboard events.\r\n this.$element.on('keyup keydown', function (e) {\r\n _this.shifted = e.shiftKey;\r\n _this.tabbing = e.keyCode === KeyCodes.KeyDown.Tab;\r\n });\r\n this.$element.on('keydown', function (e) {\r\n var event = null;\r\n var preventDefault = true;\r\n if (!e.ctrlKey && !e.altKey && !e.shiftKey) {\r\n if (e.keyCode === KeyCodes.KeyDown.Enter) {\r\n event = BaseEvents_1.BaseEvents.RETURN;\r\n preventDefault = false;\r\n }\r\n if (e.keyCode === KeyCodes.KeyDown.Escape)\r\n event = BaseEvents_1.BaseEvents.ESCAPE;\r\n if (e.keyCode === KeyCodes.KeyDown.PageUp)\r\n event = BaseEvents_1.BaseEvents.PAGE_UP;\r\n if (e.keyCode === KeyCodes.KeyDown.PageDown)\r\n event = BaseEvents_1.BaseEvents.PAGE_DOWN;\r\n if (e.keyCode === KeyCodes.KeyDown.End)\r\n event = BaseEvents_1.BaseEvents.END;\r\n if (e.keyCode === KeyCodes.KeyDown.Home)\r\n event = BaseEvents_1.BaseEvents.HOME;\r\n if (e.keyCode === KeyCodes.KeyDown.NumpadPlus || e.keyCode === 171 || e.keyCode === KeyCodes.KeyDown.Equals) {\r\n event = BaseEvents_1.BaseEvents.PLUS;\r\n preventDefault = false;\r\n }\r\n if (e.keyCode === KeyCodes.KeyDown.NumpadMinus || e.keyCode === 173 || e.keyCode === KeyCodes.KeyDown.Dash) {\r\n event = BaseEvents_1.BaseEvents.MINUS;\r\n preventDefault = false;\r\n }\r\n if (that.useArrowKeysToNavigate()) {\r\n if (e.keyCode === KeyCodes.KeyDown.LeftArrow)\r\n event = BaseEvents_1.BaseEvents.LEFT_ARROW;\r\n if (e.keyCode === KeyCodes.KeyDown.UpArrow)\r\n event = BaseEvents_1.BaseEvents.UP_ARROW;\r\n if (e.keyCode === KeyCodes.KeyDown.RightArrow)\r\n event = BaseEvents_1.BaseEvents.RIGHT_ARROW;\r\n if (e.keyCode === KeyCodes.KeyDown.DownArrow)\r\n event = BaseEvents_1.BaseEvents.DOWN_ARROW;\r\n }\r\n }\r\n if (event) {\r\n if (preventDefault) {\r\n e.preventDefault();\r\n }\r\n _this.component.publish(event);\r\n }\r\n });\r\n }\r\n this.component.subscribe(BaseEvents_1.BaseEvents.EXIT_FULLSCREEN, function () {\r\n if (_this.isOverlayActive()) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.ESCAPE);\r\n }\r\n _this.component.publish(BaseEvents_1.BaseEvents.ESCAPE);\r\n _this.component.publish(BaseEvents_1.BaseEvents.RESIZE);\r\n });\r\n this.$element.append('<a href=\"/\" id=\"top\"></a>');\r\n this.$element.append('<iframe id=\"commsFrame\" style=\"display:none\"></iframe>');\r\n //this.$element.append('<div id=\"debug\"><span id=\"watch\">Watch</span><span id=\"mobile-portrait\">Mobile Portrait</span><span id=\"mobile-landscape\">Mobile Landscape</span><span id=\"desktop\">Desktop</span></div>');\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ACCEPT_TERMS, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.ACCEPT_TERMS);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LOGIN_FAILED, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.LOGIN_FAILED);\r\n _this.showMessage(_this.data.config.content.authorisationFailedMessage);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LOGIN, function () {\r\n _this.isLoggedIn = true;\r\n _this.fire(BaseEvents_1.BaseEvents.LOGIN);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LOGOUT, function () {\r\n _this.isLoggedIn = false;\r\n _this.fire(BaseEvents_1.BaseEvents.LOGOUT);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.BOOKMARK, function () {\r\n _this.bookmark();\r\n _this.fire(BaseEvents_1.BaseEvents.BOOKMARK);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGE_FAILED, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGE_FAILED);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this.data.canvasIndex = canvasIndex;\r\n _this.lastCanvasIndex = _this.helper.canvasIndex;\r\n _this.helper.canvasIndex = canvasIndex;\r\n _this.fire(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.data.canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CLICKTHROUGH, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.CLICKTHROUGH);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CLOSE_ACTIVE_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.CLOSE_ACTIVE_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CLOSE_LEFT_PANEL, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.CLOSE_LEFT_PANEL);\r\n _this.resize();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CLOSE_RIGHT_PANEL, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.CLOSE_RIGHT_PANEL);\r\n _this.resize();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.COLLECTION_INDEX_CHANGED, function (collectionIndex) {\r\n _this.data.collectionIndex = collectionIndex;\r\n _this.fire(BaseEvents_1.BaseEvents.COLLECTION_INDEX_CHANGED, _this.data.collectionIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CREATED, function () {\r\n _this.isCreated = true;\r\n _this.fire(BaseEvents_1.BaseEvents.CREATED);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.DOWN_ARROW, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.DOWN_ARROW);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.DOWNLOAD, function (obj) {\r\n _this.fire(BaseEvents_1.BaseEvents.DOWNLOAD, obj);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.END, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.END);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ESCAPE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.ESCAPE);\r\n if (_this.isFullScreen() && !_this.isOverlayActive()) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN);\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.EXTERNAL_LINK_CLICKED, function (url) {\r\n _this.fire(BaseEvents_1.BaseEvents.EXTERNAL_LINK_CLICKED, url);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.FEEDBACK, function () {\r\n _this.feedback();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.FORBIDDEN, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.FORBIDDEN);\r\n _this.component.publish(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_DOWNLOAD_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_DOWNLOAD_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_EMBED_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_EMBED_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_EXTERNALCONTENT_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_EXTERNALCONTENT_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_GENERIC_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_GENERIC_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_HELP_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_HELP_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_INFORMATION, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_INFORMATION);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_LOGIN_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_LOGIN_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_OVERLAY, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_OVERLAY);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_RESTRICTED_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_RESTRICTED_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_SETTINGS_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HIDE_SETTINGS_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HOME, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.HOME);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFT_ARROW, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.LEFT_ARROW);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_FINISH, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_FINISH);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_START, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_START);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_FINISH, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_FINISH);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_START, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_START);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LOAD_FAILED, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.LOAD_FAILED);\r\n if (!that.lastCanvasIndex == null && that.lastCanvasIndex !== that.helper.canvasIndex) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, that.lastCanvasIndex);\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.MANIFEST_INDEX_CHANGED, function (manifestIndex) {\r\n _this.data.manifestIndex = manifestIndex;\r\n _this.fire(BaseEvents_1.BaseEvents.MANIFEST_INDEX_CHANGED, _this.data.manifestIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.NOT_FOUND, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.NOT_FOUND);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.OPEN);\r\n var openUri = Utils.Strings.format(_this.data.config.options.openTemplate, _this.helper.manifestUri);\r\n window.open(openUri);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_LEFT_PANEL, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.OPEN_LEFT_PANEL);\r\n _this.resize();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_RIGHT_PANEL, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.OPEN_RIGHT_PANEL);\r\n _this.resize();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.PAGE_DOWN, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.PAGE_DOWN);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.PAGE_UP, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.PAGE_UP);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RANGE_CHANGED, function (range) {\r\n if (range) {\r\n _this.data.rangeId = range.id;\r\n _this.helper.rangeId = range.id;\r\n _this.fire(BaseEvents_1.BaseEvents.RANGE_CHANGED, _this.data.rangeId);\r\n }\r\n else {\r\n _this.data.rangeId = undefined;\r\n _this.helper.rangeId = undefined;\r\n _this.fire(BaseEvents_1.BaseEvents.RANGE_CHANGED, null);\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RESOURCE_DEGRADED, function (resource) {\r\n _this.fire(BaseEvents_1.BaseEvents.RESOURCE_DEGRADED);\r\n Auth09_1.Auth09.handleDegraded(resource);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RETURN, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.RETURN);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RIGHT_ARROW, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.RIGHT_ARROW);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RIGHTPANEL_COLLAPSE_FULL_FINISH, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.RIGHTPANEL_COLLAPSE_FULL_FINISH);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RIGHTPANEL_COLLAPSE_FULL_START, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.RIGHTPANEL_COLLAPSE_FULL_START);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RIGHTPANEL_EXPAND_FULL_FINISH, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.RIGHTPANEL_EXPAND_FULL_FINISH);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RIGHTPANEL_EXPAND_FULL_START, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.RIGHTPANEL_EXPAND_FULL_START);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SEQUENCE_INDEX_CHANGED, function (sequenceIndex) {\r\n _this.data.sequenceIndex = sequenceIndex;\r\n _this.fire(BaseEvents_1.BaseEvents.SEQUENCE_INDEX_CHANGED, _this.data.sequenceIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SETTINGS_CHANGED, function (args) {\r\n _this.fire(BaseEvents_1.BaseEvents.SETTINGS_CHANGED, args);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_DOWNLOAD_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_DOWNLOAD_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_EMBED_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_EMBED_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_EXTERNALCONTENT_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_EXTERNALCONTENT_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_GENERIC_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_GENERIC_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_HELP_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_HELP_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_INFORMATION, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_INFORMATION);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_LOGIN_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_LOGIN_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_CLICKTHROUGH_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_CLICKTHROUGH_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_MESSAGE, function (message) {\r\n _this.showMessage(message);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_RESTRICTED_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_RESTRICTED_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_OVERLAY, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_OVERLAY);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_SETTINGS_DIALOGUE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_SETTINGS_DIALOGUE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_TERMS_OF_USE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.SHOW_TERMS_OF_USE);\r\n var terms = _this.helper.getLicense();\r\n if (!terms) {\r\n var requiredStatement = _this.helper.getRequiredStatement();\r\n if (requiredStatement && requiredStatement.value) {\r\n terms = requiredStatement.value;\r\n }\r\n }\r\n if (terms) {\r\n _this.showMessage(terms);\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.THUMB_SELECTED, function (thumb) {\r\n _this.fire(BaseEvents_1.BaseEvents.THUMB_SELECTED, thumb.index);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN, function () {\r\n $('#top').focus();\r\n _this.component.isFullScreen = !_this.component.isFullScreen;\r\n if (_this.component.isFullScreen) {\r\n _this.$element.addClass('fullscreen');\r\n }\r\n else {\r\n _this.$element.removeClass('fullscreen');\r\n }\r\n _this.fire(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN, {\r\n isFullScreen: _this.component.isFullScreen,\r\n overrideFullScreen: _this.data.config.options.overrideFullScreen\r\n });\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.UP_ARROW, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.UP_ARROW);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.UPDATE_SETTINGS, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.UPDATE_SETTINGS);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.VIEW_FULL_TERMS, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.VIEW_FULL_TERMS);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.WINDOW_UNLOAD, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.WINDOW_UNLOAD);\r\n });\r\n // create shell and shared views.\r\n this.shell = new Shell_1.Shell(this.$element);\r\n // dependencies\r\n this.getDependencies(function (deps) {\r\n _this.loadDependencies(deps);\r\n });\r\n };\r\n BaseExtension.prototype.createModules = function () {\r\n this.$authDialogue = $('<div class=\"overlay auth\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$authDialogue);\r\n this.authDialogue = new AuthDialogue_1.AuthDialogue(this.$authDialogue);\r\n this.$clickThroughDialogue = $('<div class=\"overlay clickthrough\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$clickThroughDialogue);\r\n this.clickThroughDialogue = new ClickThroughDialogue_1.ClickThroughDialogue(this.$clickThroughDialogue);\r\n this.$restrictedDialogue = $('<div class=\"overlay login\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$restrictedDialogue);\r\n this.restrictedDialogue = new RestrictedDialogue_1.RestrictedDialogue(this.$restrictedDialogue);\r\n this.$loginDialogue = $('<div class=\"overlay login\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$loginDialogue);\r\n this.loginDialogue = new LoginDialogue_1.LoginDialogue(this.$loginDialogue);\r\n };\r\n BaseExtension.prototype.modulesCreated = function () {\r\n };\r\n BaseExtension.prototype.getDependencies = function (cb) {\r\n var that = this;\r\n var depsUri = this.data.root + '/lib/' + this.name + '-dependencies';\r\n // check if the deps are already loaded\r\n var scripts = $('script[data-requiremodule]')\r\n .filter(function () {\r\n var attr = $(this).attr('data-requiremodule');\r\n return (attr.indexOf(that.name) !== -1 && attr.indexOf('dependencies') !== -1);\r\n });\r\n if (!scripts.length) {\r\n // @ts-ignore\r\n requirejs([depsUri], function (getDeps) {\r\n // getDeps is a function that accepts a file format.\r\n // it uses this to determine which dependencies are appropriate\r\n // for example, 'application/vnd.apple.mpegurl' for the AV extension\r\n // would return hls.min.js, and not dash.all.min.js.\r\n var canvas = that.helper.getCurrentCanvas();\r\n var mediaFormats = that.getMediaFormats(canvas);\r\n var formats = [];\r\n if (mediaFormats && mediaFormats.length) {\r\n formats = mediaFormats.map(function (f) {\r\n return f.getFormat().toString();\r\n });\r\n }\r\n var deps = getDeps(formats);\r\n var baseUri = that.data.root + '/lib/';\r\n // for each dependency, prepend baseUri unless it starts with a ! which indicates to ignore it.\r\n // check for a requirejs.config that sets a specific path, such as the PDF extension\r\n if (deps.sync) {\r\n for (var i = 0; i < deps.sync.length; i++) {\r\n var dep = deps.sync[i];\r\n if (!dep.startsWith('!')) {\r\n deps.sync[i] = baseUri + dep;\r\n }\r\n }\r\n }\r\n if (deps.async) {\r\n for (var i = 0; i < deps.async.length; i++) {\r\n var dep = deps.async[i];\r\n if (!dep.startsWith('!')) {\r\n deps.async[i] = baseUri + dep;\r\n }\r\n }\r\n }\r\n cb(deps);\r\n });\r\n }\r\n else {\r\n cb(null);\r\n }\r\n };\r\n BaseExtension.prototype.loadDependencies = function (deps) {\r\n var that = this;\r\n if (!deps) {\r\n that.dependenciesLoaded();\r\n }\r\n else if (deps.sync) {\r\n // load each sync script.\r\n // necessary for cases like this: https://github.com/mrdoob/three.js/issues/9602\r\n // then load the async scripts\r\n SynchronousRequire_1.SynchronousRequire.load(deps.sync, that.dependencyLoaded).then(function () {\r\n if (deps.async) {\r\n // @ts-ignore\r\n requirejs(deps.async, function () {\r\n that.dependenciesLoaded(arguments);\r\n });\r\n }\r\n else {\r\n that.dependenciesLoaded();\r\n }\r\n });\r\n }\r\n else if (deps.async) {\r\n // @ts-ignore\r\n requirejs(deps.async, function () {\r\n that.dependenciesLoaded(arguments);\r\n });\r\n }\r\n else {\r\n that.dependenciesLoaded();\r\n }\r\n };\r\n BaseExtension.prototype.dependencyLoaded = function (index, dep) {\r\n };\r\n BaseExtension.prototype.dependenciesLoaded = function () {\r\n var _this = this;\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n this.createModules();\r\n this.modulesCreated();\r\n this.component.publish(BaseEvents_1.BaseEvents.RESIZE); // initial sizing\r\n setTimeout(function () {\r\n _this.render();\r\n _this.component.publish(BaseEvents_1.BaseEvents.CREATED);\r\n _this._setDefaultFocus();\r\n }, 1);\r\n };\r\n BaseExtension.prototype.render = function () {\r\n if (!this.isCreated || (this.data.collectionIndex !== this.helper.collectionIndex)) {\r\n this.component.publish(BaseEvents_1.BaseEvents.COLLECTION_INDEX_CHANGED, this.data.collectionIndex);\r\n }\r\n if (!this.isCreated || (this.data.manifestIndex !== this.helper.manifestIndex)) {\r\n this.component.publish(BaseEvents_1.BaseEvents.MANIFEST_INDEX_CHANGED, this.data.manifestIndex);\r\n }\r\n if (!this.isCreated || (this.data.sequenceIndex !== this.helper.sequenceIndex)) {\r\n this.component.publish(BaseEvents_1.BaseEvents.SEQUENCE_INDEX_CHANGED, this.data.sequenceIndex);\r\n }\r\n if (!this.isCreated || (this.data.canvasIndex !== this.helper.canvasIndex)) {\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, this.data.canvasIndex);\r\n }\r\n if (!this.isCreated || (this.data.rangeId !== this.helper.rangeId)) {\r\n if (this.data.rangeId) {\r\n var range = this.helper.getRangeById(this.data.rangeId);\r\n if (range) {\r\n this.component.publish(BaseEvents_1.BaseEvents.RANGE_CHANGED, range);\r\n }\r\n else {\r\n console.warn('range id not found:', this.data.rangeId);\r\n }\r\n }\r\n }\r\n };\r\n BaseExtension.prototype._setDefaultFocus = function () {\r\n var _this = this;\r\n setTimeout(function () {\r\n if (_this.data.config.options.allowStealFocus) {\r\n $('[tabindex=0]').focus();\r\n }\r\n }, 1);\r\n };\r\n BaseExtension.prototype.width = function () {\r\n return this.$element.width();\r\n };\r\n BaseExtension.prototype.height = function () {\r\n return this.$element.height();\r\n };\r\n BaseExtension.prototype.exitFullScreen = function () {\r\n this.component.publish(BaseEvents_1.BaseEvents.EXIT_FULLSCREEN);\r\n };\r\n BaseExtension.prototype.fire = function (name) {\r\n var args = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n args[_i - 1] = arguments[_i];\r\n }\r\n this.component.fire(name, arguments[1]);\r\n };\r\n BaseExtension.prototype.redirect = function (uri) {\r\n this.fire(BaseEvents_1.BaseEvents.REDIRECT, uri);\r\n };\r\n BaseExtension.prototype.refresh = function () {\r\n this.fire(BaseEvents_1.BaseEvents.REFRESH, null);\r\n };\r\n BaseExtension.prototype._initLocales = function () {\r\n var availableLocales = this.data.config.localisation.locales.slice(0);\r\n var configuredLocales = this.data.locales;\r\n var finalLocales = [];\r\n // loop through configuredLocales array (those passed in when initialising the UV component)\r\n // if availableLocales (those available in each extension's l10n directory) contains a configured locale, add it to finalLocales.\r\n // if the configured locale has a label, substitute it\r\n // mark locale as added.\r\n // if limitLocales is disabled,\r\n // loop through remaining availableLocales and add to finalLocales.\r\n if (configuredLocales) {\r\n configuredLocales.forEach(function (configuredLocale) {\r\n var match = availableLocales.filter(function (item) { return item.name === configuredLocale.name; });\r\n if (match.length) {\r\n var m = match[0];\r\n if (configuredLocale.label)\r\n m.label = configuredLocale.label;\r\n m.added = true;\r\n finalLocales.push(m);\r\n }\r\n });\r\n var limitLocales = Utils.Bools.getBool(this.data.config.options.limitLocales, false);\r\n if (!limitLocales) {\r\n availableLocales.forEach(function (availableLocale) {\r\n if (!availableLocale.added) {\r\n finalLocales.push(availableLocale);\r\n }\r\n delete availableLocale.added;\r\n });\r\n }\r\n this.data.locales = finalLocales;\r\n }\r\n else {\r\n console.warn(\"No locales configured\");\r\n }\r\n };\r\n BaseExtension.prototype._parseMetrics = function () {\r\n var metrics = this.data.config.options.metrics;\r\n if (metrics) {\r\n for (var i = 0; i < metrics.length; i++) {\r\n var m = metrics[i];\r\n if (typeof (m.type) === \"string\") {\r\n m.type = new MetricType_1.MetricType(m.type);\r\n }\r\n this.metrics.push(m);\r\n }\r\n }\r\n };\r\n BaseExtension.prototype._updateMetric = function () {\r\n var _this = this;\r\n setTimeout(function () {\r\n // loop through all metrics\r\n // find one that matches the current dimensions\r\n // if a metric is found, and it's not the current metric, set it to be the current metric and publish a METRIC_CHANGED event\r\n // if no metric is found, set MetricType.NONE to be the current metric and publish a METRIC_CHANGED event\r\n var metricFound = false;\r\n for (var i = 0; i < _this.metrics.length; i++) {\r\n var metric = _this.metrics[i];\r\n // if the current width and height is within this metric's defined range\r\n if (_this.width() >= metric.minWidth && _this.width() <= metric.maxWidth &&\r\n _this.height() >= metric.minHeight && _this.height() <= metric.maxHeight) {\r\n metricFound = true;\r\n if (_this.metric !== metric.type) {\r\n _this.metric = metric.type;\r\n _this.component.publish(BaseEvents_1.BaseEvents.METRIC_CHANGED);\r\n }\r\n }\r\n }\r\n if (!metricFound) {\r\n if (_this.metric !== MetricType_1.MetricType.NONE) {\r\n _this.metric = MetricType_1.MetricType.NONE;\r\n _this.component.publish(BaseEvents_1.BaseEvents.METRIC_CHANGED);\r\n }\r\n }\r\n }, 1);\r\n };\r\n BaseExtension.prototype.resize = function () {\r\n this._updateMetric();\r\n this.component.publish(BaseEvents_1.BaseEvents.RESIZE);\r\n };\r\n // re-bootstraps the application with new querystring params\r\n BaseExtension.prototype.reload = function (data) {\r\n this.component.publish(BaseEvents_1.BaseEvents.RELOAD, data);\r\n };\r\n BaseExtension.prototype.isSeeAlsoEnabled = function () {\r\n return this.data.config.options.seeAlsoEnabled !== false;\r\n };\r\n BaseExtension.prototype.getShareUrl = function () {\r\n // If not embedded on an external domain (this causes CORS errors when fetching parent url)\r\n if (!this.data.embedded) {\r\n // Use the current page URL with hash params\r\n if (Utils.Documents.isInIFrame()) {\r\n return parent.document.location.href;\r\n }\r\n else {\r\n return document.location.href;\r\n }\r\n }\r\n else {\r\n // If there's a `related` property of format `text/html` in the manifest\r\n if (this.helper.hasRelatedPage()) {\r\n // Use the `related` property in the URL box\r\n var related = this.helper.getRelated();\r\n if (related && related.length) {\r\n related = related[0];\r\n }\r\n return related['@id'];\r\n }\r\n }\r\n return null;\r\n };\r\n BaseExtension.prototype.getIIIFShareUrl = function (shareManifests) {\r\n if (shareManifests === void 0) { shareManifests = false; }\r\n var manifestUri = shareManifests && this.helper.manifest ? this.helper.manifest.id : this.helper.manifestUri;\r\n return manifestUri + \"?manifest=\" + manifestUri;\r\n };\r\n BaseExtension.prototype.addTimestamp = function (uri) {\r\n return uri + \"?t=\" + Utils.Dates.getTimeStamp();\r\n };\r\n BaseExtension.prototype.getDomain = function () {\r\n var parts = Utils.Urls.getUrlParts(this.helper.manifestUri);\r\n return parts.host;\r\n };\r\n BaseExtension.prototype.getAppUri = function () {\r\n var parts = Utils.Urls.getUrlParts(document.location.href);\r\n var origin = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '');\r\n var pathname = parts.pathname;\r\n if (!pathname.startsWith('/')) {\r\n pathname = '/' + pathname;\r\n }\r\n pathname = pathname.substr(0, pathname.lastIndexOf('/') + 1); // remove the file name\r\n var appUri = origin + pathname;\r\n var root = '';\r\n if (!Utils.Documents.isInIFrame()) {\r\n root = this.data.root || '';\r\n if (root.startsWith('./')) {\r\n root = root.substr(2);\r\n }\r\n if (root && !root.endsWith('/')) {\r\n root += '/';\r\n }\r\n }\r\n // if root is a URL, use that instead of appUri.\r\n if (Utils_1.UVUtils.isValidUrl(root)) {\r\n return root + 'uv.html';\r\n }\r\n return appUri + root + 'uv.html';\r\n };\r\n BaseExtension.prototype.getSettings = function () {\r\n if (Utils.Bools.getBool(this.data.config.options.saveUserSettings, false)) {\r\n var settings = Utils.Storage.get(\"uv.settings\", Utils.StorageType.local);\r\n if (settings) {\r\n return $.extend(this.data.config.options, settings.value);\r\n }\r\n }\r\n return this.data.config.options;\r\n };\r\n BaseExtension.prototype.updateSettings = function (settings) {\r\n if (Utils.Bools.getBool(this.data.config.options.saveUserSettings, false)) {\r\n var storedSettings = Utils.Storage.get(\"uv.settings\", Utils.StorageType.local);\r\n if (storedSettings) {\r\n settings = $.extend(storedSettings.value, settings);\r\n }\r\n // store for ten years\r\n Utils.Storage.set(\"uv.settings\", settings, 315360000, Utils.StorageType.local);\r\n }\r\n this.data.config.options = $.extend(this.data.config.options, settings);\r\n };\r\n BaseExtension.prototype.getLocale = function () {\r\n return this.helper.options.locale;\r\n };\r\n BaseExtension.prototype.getSharePreview = function () {\r\n var title = this.helper.getLabel();\r\n // todo: use getThumb (when implemented)\r\n var canvas = this.helper.getCurrentCanvas();\r\n var thumbnail = canvas.getProperty('thumbnail');\r\n if (!thumbnail || !(typeof (thumbnail) === 'string')) {\r\n thumbnail = canvas.getCanonicalImageUri(this.data.config.options.bookmarkThumbWidth);\r\n }\r\n return {\r\n title: title,\r\n image: thumbnail\r\n };\r\n };\r\n BaseExtension.prototype.getPagedIndices = function (canvasIndex) {\r\n if (canvasIndex === void 0) { canvasIndex = this.helper.canvasIndex; }\r\n return [canvasIndex];\r\n };\r\n BaseExtension.prototype.getCurrentCanvases = function () {\r\n var indices = this.getPagedIndices(this.helper.canvasIndex);\r\n var canvases = [];\r\n for (var i = 0; i < indices.length; i++) {\r\n var index = indices[i];\r\n var canvas = this.helper.getCanvasByIndex(index);\r\n canvases.push(canvas);\r\n }\r\n return canvases;\r\n };\r\n BaseExtension.prototype.getCanvasLabels = function (label) {\r\n var indices = this.getPagedIndices();\r\n var labels = \"\";\r\n if (indices.length === 1) {\r\n labels = label;\r\n }\r\n else {\r\n for (var i = 1; i <= indices.length; i++) {\r\n if (labels.length)\r\n labels += \",\";\r\n labels += label + \" \" + i;\r\n }\r\n }\r\n return labels;\r\n };\r\n BaseExtension.prototype.getCurrentCanvasRange = function () {\r\n //var rangePath: string = this.currentRangePath ? this.currentRangePath : '';\r\n //var range: Range = this.helper.getCanvasRange(this.helper.getCurrentCanvas(), rangePath);\r\n var range = this.helper.getCanvasRange(this.helper.getCurrentCanvas());\r\n return range;\r\n };\r\n // todo: move to manifold?\r\n BaseExtension.prototype.getExternalResources = function (resources) {\r\n var _this = this;\r\n var indices = this.getPagedIndices();\r\n var resourcesToLoad = [];\r\n indices.forEach(function (index) {\r\n var canvas = _this.helper.getCanvasByIndex(index);\r\n var r;\r\n if (!canvas.externalResource) {\r\n r = new manifold_1.ExternalResource(canvas, {\r\n authApiVersion: _this.data.config.options.authAPIVersion\r\n });\r\n }\r\n else {\r\n r = canvas.externalResource;\r\n }\r\n // reload resources if passed\r\n if (resources) {\r\n var found = resources.find(function (f) {\r\n return f.dataUri === r.dataUri;\r\n });\r\n if (found) {\r\n resourcesToLoad.push(found);\r\n }\r\n else {\r\n resourcesToLoad.push(r);\r\n }\r\n }\r\n else {\r\n resourcesToLoad.push(r);\r\n }\r\n });\r\n var storageStrategy = this.data.config.options.tokenStorage;\r\n var authAPIVersion = this.data.config.options.authAPIVersion;\r\n // if using auth api v1\r\n if (authAPIVersion === 1) {\r\n return new Promise(function (resolve) {\r\n var options = {\r\n locale: _this.helper.options.locale\r\n };\r\n Auth1_1.Auth1.loadExternalResources(resourcesToLoad, storageStrategy, options).then(function (r) {\r\n _this.resources = r.map(function (resource) {\r\n return _this._prepareResourceData(resource);\r\n });\r\n resolve(_this.resources);\r\n });\r\n });\r\n }\r\n else {\r\n return new Promise(function (resolve) {\r\n Auth09_1.Auth09.loadExternalResources(resourcesToLoad, storageStrategy).then(function (r) {\r\n _this.resources = r.map(function (resource) {\r\n return _this._prepareResourceData(resource);\r\n });\r\n resolve(_this.resources);\r\n });\r\n });\r\n }\r\n };\r\n // copy useful properties over to the data object to be opened in center panel's openMedia method\r\n // this is the info.json if there is one, which can be opened natively by openseadragon.\r\n BaseExtension.prototype._prepareResourceData = function (resource) {\r\n resource.data.hasServiceDescriptor = resource.hasServiceDescriptor();\r\n // if the data isn't an info.json, give it the necessary viewing properties\r\n if (!resource.hasServiceDescriptor()) {\r\n resource.data.id = resource.dataUri;\r\n resource.data.width = resource.width;\r\n resource.data.height = resource.height;\r\n }\r\n resource.data.index = resource.index;\r\n return Utils.Objects.toPlainObject(resource.data);\r\n };\r\n BaseExtension.prototype.getMediaFormats = function (canvas) {\r\n var annotations = canvas.getContent();\r\n if (annotations && annotations.length) {\r\n var annotation = annotations[0];\r\n return annotation.getBody();\r\n }\r\n else {\r\n // legacy IxIF compatibility\r\n var body = {\r\n id: canvas.id,\r\n type: canvas.getType(),\r\n getFormat: function () {\r\n return '';\r\n }\r\n };\r\n return [body];\r\n }\r\n };\r\n BaseExtension.prototype.viewCanvas = function (canvasIndex) {\r\n if (this.helper.isCanvasIndexOutOfRange(canvasIndex)) {\r\n this.showMessage(this.data.config.content.canvasIndexOutOfRange);\r\n return;\r\n }\r\n this.component.publish(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE);\r\n };\r\n BaseExtension.prototype.showMessage = function (message, acceptCallback, buttonText, allowClose) {\r\n this.closeActiveDialogue();\r\n this.component.publish(BaseEvents_1.BaseEvents.SHOW_GENERIC_DIALOGUE, {\r\n message: message,\r\n acceptCallback: acceptCallback,\r\n buttonText: buttonText,\r\n allowClose: allowClose\r\n });\r\n };\r\n BaseExtension.prototype.closeActiveDialogue = function () {\r\n this.component.publish(BaseEvents_1.BaseEvents.CLOSE_ACTIVE_DIALOGUE);\r\n };\r\n BaseExtension.prototype.isOverlayActive = function () {\r\n return this.shell.$overlays.is(':visible');\r\n };\r\n BaseExtension.prototype.isDesktopMetric = function () {\r\n return this.metric.toString() === MetricType_1.MetricType.DESKTOP.toString();\r\n };\r\n BaseExtension.prototype.isWatchMetric = function () {\r\n return this.metric.toString() === MetricType_1.MetricType.WATCH.toString();\r\n };\r\n BaseExtension.prototype.isCatchAllMetric = function () {\r\n return this.metric.toString() === MetricType_1.MetricType.NONE.toString();\r\n };\r\n // todo: use redux in manifold to get reset state\r\n BaseExtension.prototype.viewManifest = function (manifest) {\r\n var data = {};\r\n data.iiifResourceUri = this.helper.manifestUri;\r\n data.collectionIndex = this.helper.getCollectionIndex(manifest);\r\n data.manifestIndex = manifest.index;\r\n data.sequenceIndex = 0;\r\n data.canvasIndex = 0;\r\n this.reload(data);\r\n };\r\n // todo: use redux in manifold to get reset state\r\n BaseExtension.prototype.viewCollection = function (collection) {\r\n var data = {};\r\n //data.iiifResourceUri = this.helper.iiifResourceUri;\r\n data.iiifResourceUri = collection.parentCollection ? collection.parentCollection.id : this.helper.manifestUri;\r\n data.collectionIndex = collection.index;\r\n data.manifestIndex = 0;\r\n data.sequenceIndex = 0;\r\n data.canvasIndex = 0;\r\n this.reload(data);\r\n };\r\n BaseExtension.prototype.isFullScreen = function () {\r\n return this.component.isFullScreen;\r\n };\r\n BaseExtension.prototype.isHeaderPanelEnabled = function () {\r\n return Utils.Bools.getBool(this.data.config.options.headerPanelEnabled, true);\r\n };\r\n BaseExtension.prototype.isLeftPanelEnabled = function () {\r\n if (Utils.Bools.getBool(this.data.config.options.leftPanelEnabled, true)) {\r\n if (this.helper.hasParentCollection()) {\r\n return true;\r\n }\r\n else if (this.helper.isMultiCanvas()) {\r\n var viewingHint = this.helper.getViewingHint();\r\n if (!viewingHint || (viewingHint && viewingHint.toString() !== vocabulary_1.ViewingHint.CONTINUOUS.toString())) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n BaseExtension.prototype.isRightPanelEnabled = function () {\r\n return Utils.Bools.getBool(this.data.config.options.rightPanelEnabled, true);\r\n };\r\n BaseExtension.prototype.isFooterPanelEnabled = function () {\r\n return Utils.Bools.getBool(this.data.config.options.footerPanelEnabled, true);\r\n };\r\n BaseExtension.prototype.isMobile = function () {\r\n return $.browser.mobile;\r\n };\r\n BaseExtension.prototype.useArrowKeysToNavigate = function () {\r\n return Utils.Bools.getBool(this.data.config.options.useArrowKeysToNavigate, true);\r\n };\r\n BaseExtension.prototype.bookmark = function () {\r\n // override for each extension\r\n };\r\n BaseExtension.prototype.feedback = function () {\r\n this.fire(BaseEvents_1.BaseEvents.FEEDBACK, this.data);\r\n };\r\n BaseExtension.prototype.getAlternateLocale = function () {\r\n var alternateLocale = null;\r\n if (this.data.locales && this.data.locales.length > 1) {\r\n alternateLocale = this.data.locales[1];\r\n }\r\n return alternateLocale;\r\n };\r\n BaseExtension.prototype.getSerializedLocales = function () {\r\n if (this.data.locales) {\r\n return this.serializeLocales(this.data.locales);\r\n }\r\n return null;\r\n };\r\n BaseExtension.prototype.serializeLocales = function (locales) {\r\n var serializedLocales = '';\r\n for (var i = 0; i < locales.length; i++) {\r\n var l = locales[i];\r\n if (i > 0)\r\n serializedLocales += ',';\r\n serializedLocales += l.name;\r\n if (l.label) {\r\n serializedLocales += ':' + l.label;\r\n }\r\n }\r\n return serializedLocales;\r\n };\r\n BaseExtension.prototype.changeLocale = function (locale) {\r\n // re-order locales so the passed locale is first\r\n var data = {};\r\n if (this.data.locales) {\r\n data.locales = this.data.locales.slice(0);\r\n var fromIndex = data.locales.findIndex(function (l) {\r\n return l.name === locale;\r\n });\r\n var toIndex = 0;\r\n data.locales.splice(toIndex, 0, data.locales.splice(fromIndex, 1)[0]);\r\n this.reload(data);\r\n }\r\n };\r\n return BaseExtension;\r\n }());\r\n exports.BaseExtension = BaseExtension;\r\n});\r\n//# sourceMappingURL=BaseExtension.js.map\n", "!function(t,e){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define('lib/GalleryComponent.js',[],e);else{var i=e();for(var n in i)(\"object\"==typeof exports?exports:t)[n]=i[n]}}(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,\"a\",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p=\"\",i(i.s=0)}([function(t,e,i){t.exports=i(1)},function(t,e,i){\"use strict\";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,\"__esModule\",{value:!0});var a=i(2),r=i(3),s=i(4),l=function(t){function e(e){var i=t.call(this,e)||this;return i._data=i.data(),i._data=i.options.data,i._init(),i._resize(),i}return o(e,t),e.prototype._init=function(){var e=this;t.prototype._init.call(this),this._$element=$(this.el),this._$header=$('<div class=\"header\"></div>'),this._$element.append(this._$header),this._$leftOptions=$('<div class=\"left\"></div>'),this._$header.append(this._$leftOptions),this._$rightOptions=$('<div class=\"right\"></div>'),this._$header.append(this._$rightOptions),this._$sizeDownButton=$('<input class=\"btn btn-default size-down\" type=\"button\" value=\"-\" />'),this._$leftOptions.append(this._$sizeDownButton),this._$sizeRange=$('<input type=\"range\" name=\"size\" min=\"1\" max=\"10\" value=\"'+this.options.data.initialZoom+'\" />'),this._$leftOptions.append(this._$sizeRange),this._$sizeUpButton=$('<input class=\"btn btn-default size-up\" type=\"button\" value=\"+\" />'),this._$leftOptions.append(this._$sizeUpButton),this._$multiSelectOptions=$('<div class=\"multiSelectOptions\"></div>'),this._$rightOptions.append(this._$multiSelectOptions),this._$selectAllButton=$('<div class=\"multiSelectAll\"><input id=\"multiSelectAll\" type=\"checkbox\" tabindex=\"0\" /><label for=\"multiSelectAll\">'+this.options.data.content.selectAll+\"</label></div>\"),this._$multiSelectOptions.append(this._$selectAllButton),this._$selectAllButtonCheckbox=$(this._$selectAllButton.find(\"input:checkbox\")),this._$selectButton=$('<a class=\"select\" href=\"#\">'+this.options.data.content.select+\"</a>\"),this._$multiSelectOptions.append(this._$selectButton),this._$main=$('<div class=\"main\"></div>'),this._$element.append(this._$main),this._$thumbs=$('<div class=\"thumbs\"></div>'),this._$main.append(this._$thumbs),this._$sizeDownButton.on(\"click\",(function(){var t=Number(e._$sizeRange.val())-1;t>=Number(e._$sizeRange.attr(\"min\"))&&(e._$sizeRange.val(t.toString()),e._$sizeRange.trigger(\"change\"),e.fire(u.DECREASE_SIZE))})),this._$sizeUpButton.on(\"click\",(function(){var t=Number(e._$sizeRange.val())+1;t<=Number(e._$sizeRange.attr(\"max\"))&&(e._$sizeRange.val(t.toString()),e._$sizeRange.trigger(\"change\"),e.fire(u.INCREASE_SIZE))})),this._$sizeRange.on(\"change\",(function(){e._updateThumbs(),e._scrollToThumb(e._getSelectedThumbIndex())})),this._$selectAllButton.checkboxButton((function(t){var i=e._getMultiSelectState();i&&(t?i.selectAll(!0):i.selectAll(!1)),e.set(e.options.data)})),this._$selectButton.on(\"click\",(function(){var t=e._getMultiSelectState();if(t){var i=t.getAllSelectedCanvases().map((function(t){return t.id}));e.fire(u.MULTISELECTION_MADE,i)}})),this._setRange(),$.templates({galleryThumbsTemplate:'\\t\\t\\t\\t<div class=\"{{:~galleryThumbClassName()}}\" data-src=\"{{>uri}}\" data-index=\"{{>index}}\" data-visible=\"{{>visible}}\" data-width=\"{{>width}}\" data-height=\"{{>height}}\" data-initialwidth=\"{{>initialWidth}}\" data-initialheight=\"{{>initialHeight}}\">\\t\\t\\t\\t\\t\\t<div class=\"wrap\" style=\"width:{{>initialWidth}}px; height:{{>initialHeight}}px\" data-link=\"class{merge:multiSelected toggle=\\'multiSelected\\'}\">\\t\\t\\t\\t\\t\\t{^{if multiSelectEnabled}}\\t\\t\\t\\t\\t\\t\\t\\t<input id=\"thumb-checkbox-{{>id}}\" type=\"checkbox\" data-link=\"checked{:multiSelected ? \\'checked\\' : \\'\\'}\" class=\"multiSelect\" />\\t\\t\\t\\t\\t\\t{{/if}}\\t\\t\\t\\t\\t\\t</div>\\t\\t\\t\\t\\t\\t<div class=\"info\">\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"index\" style=\"width:{{>initialWidth}}px\">{{:#index + 1}}</span>\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"label\" style=\"width:{{>initialWidth}}px\" title=\"{{>label}}\">{{>label}} </span>\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"searchResults\" title=\"{{:~galleryThumbSearchResultsTitle()}}\">{{>data.searchResults}}</span>\\t\\t\\t\\t\\t\\t</div>\\t\\t\\t\\t</div>'});var i=this;return $.views.helpers({galleryThumbClassName:function(){var t=\"thumb preLoad\";return 0===this.data.index&&(t+=\" first\"),this.data.uri||(t+=\" placeholder\"),t},galleryThumbSearchResultsTitle:function(){var t=Number(this.data.data.searchResults);return t?t>1?s.Strings.format(i.options.data.content.searchResults,t.toString()):s.Strings.format(i.options.data.content.searchResult,t.toString()):null}}),this._$main.on(\"scroll\",(function(){e._updateThumbs()}),this.options.data.scrollStopDuration),this.options.data.sizingEnabled||this._$sizeRange.hide(),!0},e.prototype.data=function(){return{chunkedResizingThreshold:400,content:{searchResult:\"{0} search result\",searchResults:\"{0} search results\",select:\"Select\",selectAll:\"Select All\"},debug:!1,helper:null,imageFadeInDuration:300,initialZoom:6,minLabelWidth:20,pageModeEnabled:!1,scrollStopDuration:100,searchResults:[],sizingEnabled:!0,thumbHeight:320,thumbLoadPadding:3,thumbWidth:200,viewingDirection:a.ViewingDirection.LEFT_TO_RIGHT}},e.prototype.set=function(t){if(this._data=Object.assign(this._data,t),this._data.helper&&void 0!==this._data.thumbWidth&&void 0!==this._data.thumbHeight&&(this._thumbs=this._data.helper.getThumbs(this._data.thumbWidth,this._data.thumbHeight)),this._data.viewingDirection&&(this._data.viewingDirection===a.ViewingDirection.BOTTOM_TO_TOP&&this._thumbs.reverse(),this._$thumbs.addClass(this._data.viewingDirection)),this._data.searchResults&&this._data.searchResults.length)for(var e=0;e<this._data.searchResults.length;e++){var i=this._data.searchResults[e],n=this._thumbs.filter((function(t){return t.index===i.canvasIndex}))[0],o=$.extend(!0,{},n.data);o.searchResults=i.rects.length,n.data=o}this._thumbsCache=null,this._createThumbs(),this._data.helper&&this.selectIndex(this._data.helper.canvasIndex);var r=this._getMultiSelectState();if(r&&r.isEnabled){this._$multiSelectOptions.show(),this._$thumbs.addClass(\"multiSelect\");for(e=0;e<r.canvases.length;e++){var s=r.canvases[e];n=this._getThumbByCanvas(s);this._setThumbMultiSelected(n,s.multiSelected)}for(e=0;e<r.ranges.length;e++)for(var l=r.ranges[e],u=this._getThumbsByRange(l),c=0;c<u.length;c++){n=u[c];this._setThumbMultiSelected(n,l.multiSelected)}}else this._$multiSelectOptions.hide(),this._$thumbs.removeClass(\"multiSelect\");this._update()},e.prototype._update=function(){var t=this._getMultiSelectState();t&&t.isEnabled&&(this._$selectAllButtonCheckbox.prop(\"checked\",t.allSelected()),t.getAll().filter((function(t){return t.multiSelected})).length>0?this._$selectButton.show():this._$selectButton.hide())},e.prototype._getMultiSelectState=function(){return this._data.helper?this._data.helper.getMultiSelectState():null},e.prototype._createThumbs=function(){var t=this;if(this._thumbs){this._$thumbs.undelegate(\".thumb\",\"click\"),this._$thumbs.empty();for(var e=this._getMultiSelectState(),i=[],n=0;n<this._thumbs.length;n++){var o=(c=this._thumbs[n]).width,a=c.height;c.initialWidth=o,i.push(a),c.multiSelectEnabled=!!e&&e.isEnabled}for(var r=s.Maths.median(i),l=0;l<this._thumbs.length;l++){var c;(c=this._thumbs[l]).initialHeight=r}if(this._$thumbs.link($.templates.galleryThumbsTemplate,this._thumbs),e&&!e.isEnabled)this._$thumbs.delegate(\".thumb\",\"click\",(function(e){e.preventDefault();var i=$.view(this).data;t.fire(u.THUMB_SELECTED,i)}));else for(var h=this._$thumbs.find(\".thumb\"),d=function(){var t=p;$(h[f]).checkboxButton((function(e){var i=$.view(this).data;t._setThumbMultiSelected(i,!i.multiSelected);var n=t.options.data.helper.getCanvasRange(i.data),o=t._getMultiSelectState();o&&(n?o.selectRange(n,i.multiSelected):o.selectCanvas(i.data,i.multiSelected)),t._update(),t.fire(u.THUMB_MULTISELECTED,i)}))},p=this,f=0;f<h.length;f++)d()}},e.prototype._getThumbByCanvas=function(t){return this._thumbs.filter((function(e){return e.data.id===t.id}))[0]},e.prototype._sizeThumb=function(t){var e=t.data().initialwidth,i=t.data().initialheight,n=Number(e),o=Number(i),a=Math.floor(n*this._range),r=Math.floor(o*this._range),s=t.find(\".wrap\"),l=t.find(\".label\"),u=t.find(\".index\"),c=t.find(\".searchResults\"),h=a;this._data.searchResults&&this._data.searchResults.length&&(c.show(),h=a-c.outerWidth(),void 0!==this._data.minLabelWidth&&h<this._data.minLabelWidth?(c.hide(),h=a):c.show()),this._data.pageModeEnabled?(u.hide(),l.show()):(u.show(),l.hide()),s.outerWidth(a),s.outerHeight(r),u.outerWidth(h),l.outerWidth(h)},e.prototype._loadThumb=function(t,e){var i=t.find(\".wrap\");if(!i.hasClass(\"loading\")&&!i.hasClass(\"loaded\")){t.removeClass(\"preLoad\");var n=t.attr(\"data-visible\"),o=this._data.imageFadeInDuration||0;if(\"false\"!==n){i.addClass(\"loading\");var a=t.attr(\"data-src\"),r=$('<img class=\"thumbImage\" src=\"'+a+'\" />');r.hide(),r.on(\"load\",(function(){$(this).fadeIn(o,(function(){$(this).parent().switchClass(\"loading\",\"loaded\")}))})),i.prepend(r),e&&e(r)}else i.addClass(\"hidden\")}},e.prototype._getThumbsByRange=function(t){var e=[];if(!this._data.helper)return e;for(var i=0;i<this._thumbs.length;i++){var n=this._thumbs[i],o=n.data,a=this._data.helper.getCanvasRange(o,t.path);a&&a.id===t.id&&e.push(n)}return e},e.prototype._updateThumbs=function(){var t=!!this._data.debug;this._setRange();var e=this._$main.scrollTop(),i=e+this._$main.height();t&&console.log(\"scrollTop %s, scrollBottom %s\",e,i);for(var n=this._getAllThumbs(),o=0,a=0;a<n.length;a++){var r=$(n[a]),s=r.position().top,l=r.outerHeight(),u=s+l,c=l*this._data.thumbLoadPadding;s<=i+c&&u>=e-c?(o+=1,this._sizeThumb(r),r.addClass(\"insideScrollArea\"),this._loadThumb(r)):r.removeClass(\"insideScrollArea\")}t&&console.log(\"number of thumbs to update: \"+o)},e.prototype._getSelectedThumbIndex=function(){return Number(this._$selectedThumb.data(\"index\"))},e.prototype._getAllThumbs=function(){return this._thumbsCache||(this._thumbsCache=this._$thumbs.find(\".thumb\")),this._thumbsCache},e.prototype._getThumbByIndex=function(t){return this._$thumbs.find('[data-index=\"'+t+'\"]')},e.prototype._scrollToThumb=function(t){var e=this._getThumbByIndex(t);this._$main.scrollTop(e.position().top)},e.prototype.selectIndex=function(t){this._thumbs&&this._thumbs.length&&(this._getAllThumbs().removeClass(\"selected\"),this._$selectedThumb=this._getThumbByIndex(t),this._$selectedThumb.addClass(\"selected\"),this._scrollToThumb(t),this._updateThumbs())},e.prototype._setRange=function(){var t=s.Maths.normalise(Number(this._$sizeRange.val()),0,10);this._range=s.Maths.clamp(t,.05,1)},e.prototype._setThumbMultiSelected=function(t,e){$.observable(t).setProperty(\"multiSelected\",e)},e.prototype._resize=function(){},e}(r.BaseComponent);e.GalleryComponent=l;var u=function(){function t(){}return t.DECREASE_SIZE=\"decreaseSize\",t.INCREASE_SIZE=\"increaseSize\",t.MULTISELECTION_MADE=\"multiSelectionMade\",t.THUMB_SELECTED=\"thumbSelected\",t.THUMB_MULTISELECTED=\"thumbMultiSelected\",t}()},function(t,e,i){\"use strict\";var n,o,a,r,s,l,u,c,h;i.r(e),i.d(e,\"AnnotationMotivation\",(function(){return n})),i.d(e,\"Behavior\",(function(){return o})),i.d(e,\"ExternalResourceType\",(function(){return a})),i.d(e,\"IIIFResourceType\",(function(){return r})),i.d(e,\"MediaType\",(function(){return s})),i.d(e,\"RenderingFormat\",(function(){return l})),i.d(e,\"ServiceProfile\",(function(){return u})),i.d(e,\"ViewingDirection\",(function(){return c})),i.d(e,\"ViewingHint\",(function(){return h})),function(t){t.BOOKMARKING=\"oa:bookmarking\",t.CLASSIFYING=\"oa:classifying\",t.COMMENTING=\"oa:commenting\",t.DESCRIBING=\"oa:describing\",t.EDITING=\"oa:editing\",t.HIGHLIGHTING=\"oa:highlighting\",t.IDENTIFYING=\"oa:identifying\",t.LINKING=\"oa:linking\",t.MODERATING=\"oa:moderating\",t.PAINTING=\"sc:painting\",t.QUESTIONING=\"oa:questioning\",t.REPLYING=\"oa:replying\",t.TAGGING=\"oa:tagging\",t.TRANSCRIBING=\"oad:transcribing\"}(n||(n={})),function(t){t.AUTO_ADVANCE=\"auto-advance\",t.CONTINUOUS=\"continuous\",t.FACING_PAGES=\"facing-pages\",t.HIDDEN=\"hidden\",t.INDIVIDUALS=\"individuals\",t.MULTI_PART=\"multi-part\",t.NO_NAV=\"no-nav\",t.NON_PAGED=\"non-paged\",t.PAGED=\"paged\",t.REPEAT=\"repeat\",t.SEQUENCE=\"sequence\",t.THUMBNAIL_NAV=\"thumbnail-nav\",t.TOGETHER=\"together\",t.UNORDERED=\"unordered\"}(o||(o={})),function(t){t.CANVAS=\"canvas\",t.CHOICE=\"choice\",t.CONTENT_AS_TEXT=\"contentastext\",t.DOCUMENT=\"document\",t.IMAGE=\"image\",t.MOVING_IMAGE=\"movingimage\",t.PDF=\"pdf\",t.PHYSICAL_OBJECT=\"physicalobject\",t.SOUND=\"sound\",t.TEXTUALBODY=\"textualbody\",t.VIDEO=\"video\"}(a||(a={})),function(t){t.ANNOTATION=\"annotation\",t.CANVAS=\"canvas\",t.COLLECTION=\"collection\",t.MANIFEST=\"manifest\",t.RANGE=\"range\",t.SEQUENCE=\"sequence\"}(r||(r={})),function(t){t.AUDIO_MP4=\"audio/mp4\",t.CORTO=\"application/corto\",t.DRACO=\"application/draco\",t.GLTF=\"model/gltf+json\",t.JPG=\"image/jpeg\",t.M3U8=\"application/vnd.apple.mpegurl\",t.MP3=\"audio/mp3\",t.MPEG_DASH=\"application/dash+xml\",t.OBJ=\"text/plain\",t.PDF=\"application/pdf\",t.PLY=\"application/ply\",t.THREEJS=\"application/vnd.threejs+json\",t.VIDEO_MP4=\"video/mp4\",t.WEBM=\"video/webm\"}(s||(s={})),function(t){t.DOC=\"application/msword\",t.DOCX=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",t.PDF=\"application/pdf\"}(l||(l={})),function(t){t.IMAGE_0_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/compliance.html#level0\",t.IMAGE_0_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/compliance.html#level1\",t.IMAGE_0_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/compliance.html#level2\",t.IMAGE_0_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/conformance.html#level0\",t.IMAGE_0_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/conformance.html#level1\",t.IMAGE_0_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/conformance.html#level2\",t.IMAGE_1_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\",t.IMAGE_1_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1\",t.IMAGE_1_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2\",t.IMAGE_1_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0\",t.IMAGE_1_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1\",t.IMAGE_1_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2\",t.IMAGE_1_LEVEL_0=\"http://iiif.io/api/image/1/level0.json\",t.IMAGE_1_PROFILE_LEVEL_0=\"http://iiif.io/api/image/1/profiles/level0.json\",t.IMAGE_1_LEVEL_1=\"http://iiif.io/api/image/1/level1.json\",t.IMAGE_1_PROFILE_LEVEL_1=\"http://iiif.io/api/image/1/profiles/level1.json\",t.IMAGE_1_LEVEL_2=\"http://iiif.io/api/image/1/level2.json\",t.IMAGE_1_PROFILE_LEVEL_2=\"http://iiif.io/api/image/1/profiles/level2.json\",t.IMAGE_2_LEVEL_0=\"http://iiif.io/api/image/2/level0.json\",t.IMAGE_2_PROFILE_LEVEL_0=\"http://iiif.io/api/image/2/profiles/level0.json\",t.IMAGE_2_LEVEL_1=\"http://iiif.io/api/image/2/level1.json\",t.IMAGE_2_PROFILE_LEVEL_1=\"http://iiif.io/api/image/2/profiles/level1.json\",t.IMAGE_2_LEVEL_2=\"http://iiif.io/api/image/2/level2.json\",t.IMAGE_2_PROFILE_LEVEL_2=\"http://iiif.io/api/image/2/profiles/level2.json\",t.AUTH_0_CLICK_THROUGH=\"http://iiif.io/api/auth/0/login/clickthrough\",t.AUTH_0_LOGIN=\"http://iiif.io/api/auth/0/login\",t.AUTH_0_LOGOUT=\"http://iiif.io/api/auth/0/logout\",t.AUTH_0_RESTRICTED=\"http://iiif.io/api/auth/0/login/restricted\",t.AUTH_0_TOKEN=\"http://iiif.io/api/auth/0/token\",t.AUTH_1_CLICK_THROUGH=\"http://iiif.io/api/auth/1/clickthrough\",t.AUTH_1_EXTERNAL=\"http://iiif.io/api/auth/1/external\",t.AUTH_1_KIOSK=\"http://iiif.io/api/auth/1/kiosk\",t.AUTH_1_LOGIN=\"http://iiif.io/api/auth/1/login\",t.AUTH_1_LOGOUT=\"http://iiif.io/api/auth/1/logout\",t.AUTH_1_PROBE=\"http://iiif.io/api/auth/1/probe\",t.AUTH_1_TOKEN=\"http://iiif.io/api/auth/1/token\",t.SEARCH_0=\"http://iiif.io/api/search/0/search\",t.SEARCH_0_AUTO_COMPLETE=\"http://iiif.io/api/search/0/autocomplete\",t.SEARCH_1=\"http://iiif.io/api/search/1/search\",t.SEARCH_1_AUTO_COMPLETE=\"http://iiif.io/api/search/1/autocomplete\",t.TRACKING_EXTENSIONS=\"http://universalviewer.io/tracking-extensions-profile\",t.UI_EXTENSIONS=\"http://universalviewer.io/ui-extensions-profile\",t.PRINT_EXTENSIONS=\"http://universalviewer.io/print-extensions-profile\",t.SHARE_EXTENSIONS=\"http://universalviewer.io/share-extensions-profile\",t.OTHER_MANIFESTATIONS=\"http://iiif.io/api/otherManifestations.json\",t.IXIF=\"http://wellcomelibrary.org/ld/ixif/0/alpha.json\"}(u||(u={})),function(t){t.BOTTOM_TO_TOP=\"bottom-to-top\",t.LEFT_TO_RIGHT=\"left-to-right\",t.RIGHT_TO_LEFT=\"right-to-left\",t.TOP_TO_BOTTOM=\"top-to-bottom\"}(c||(c={})),function(t){t.CONTINUOUS=\"continuous\",t.INDIVIDUALS=\"individuals\",t.NON_PAGED=\"non-paged\",t.PAGED=\"paged\",t.TOP=\"top\"}(h||(h={}))},function(t,e,i){\"use strict\";i.r(e),i.d(e,\"BaseComponent\",(function(){return n}));var n=function(){function t(t){this.options=t,this.options.data=Object.assign({},this.data(),t.data)}return t.prototype._init=function(){return this.el=this.options.target,this.el?(this.el.innerHTML=\"\",!0):(console.warn(\"element not found\"),!1)},t.prototype.data=function(){return{}},t.prototype.on=function(t,e,i){var n=this._e||(this._e={});(n[t]||(n[t]=[])).push({fn:e,ctx:i})},t.prototype.fire=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=[].slice.call(arguments,1),o=((this._e||(this._e={}))[t]||[]).slice(),a=0,r=o.length;a<r;a++)o[a].fn.apply(o[a].ctx,n)},t.prototype._resize=function(){},t.prototype.set=function(t){},t}()},function(t,e,i){\"use strict\";i.r(e),i.d(e,\"Async\",(function(){return o})),i.d(e,\"Bools\",(function(){return a})),i.d(e,\"Clipboard\",(function(){return r})),i.d(e,\"Colors\",(function(){return s})),i.d(e,\"Dates\",(function(){return l})),i.d(e,\"Device\",(function(){return u})),i.d(e,\"Documents\",(function(){return c})),i.d(e,\"Events\",(function(){return h})),i.d(e,\"Files\",(function(){return d})),i.d(e,\"Keyboard\",(function(){return p})),i.d(e,\"Maths\",(function(){return f})),i.d(e,\"Size\",(function(){return m})),i.d(e,\"Dimensions\",(function(){return _})),i.d(e,\"Numbers\",(function(){return g})),i.d(e,\"Objects\",(function(){return E})),i.d(e,\"Storage\",(function(){return b})),i.d(e,\"StorageItem\",(function(){return v})),i.d(e,\"StorageType\",(function(){return n})),i.d(e,\"Strings\",(function(){return S})),i.d(e,\"Urls\",(function(){return T}));var n,o=function(){function t(){}return t.waitFor=function(e,i,n,o,a,r){o||(o=200),a||(a=100),r||(r=0),(r+=1)>a?n&&n():e()?i():setTimeout((function(){t.waitFor(e,i,n,o,a,r)}),o)},t}(),a=function(){function t(){}return t.getBool=function(t,e){return null==t?e:t},t}(),r=function(){function t(){}return t.supportsCopy=function(){return document.queryCommandSupported&&document.queryCommandSupported(\"copy\")},t.copy=function(e){e=t.convertBrToNewLine(e);var i=document.createElement(\"textarea\");i.value=e,t.hideButKeepEnabled(i),document.body.appendChild(i),i.focus(),i.select(),document.execCommand(\"copy\"),document.body.removeChild(i)},t.hideButKeepEnabled=function(t){t.style.position=\"fixed\",t.style.top=\"0\",t.style.left=\"0\",t.style.width=\"2em\",t.style.height=\"2em\",t.style.padding=\"0\",t.style.border=\"none\",t.style.outline=\"none\",t.style.boxShadow=\"none\",t.style.background=\"transparent\"},t.convertBrToNewLine=function(t){return t=t.replace(/<br\\s*[\\/]?>/gi,\"\\n\")},t}(),s=function(){function t(){}return t.float32ColorToARGB=function(t){return[(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t._componentToHex=function(t){var e=t.toString(16);return 1==e.length?\"0\"+e:e},t.rgbToHexString=function(e){return t.coalesce(e),\"#\"+t._componentToHex(e[0])+t._componentToHex(e[1])+t._componentToHex(e[2])},t.argbToHexString=function(e){return\"#\"+t._componentToHex(e[0])+t._componentToHex(e[1])+t._componentToHex(e[2])+t._componentToHex(e[3])},t.coalesce=function(t){for(var e=1;e<t.length;e++)void 0===t[e]&&(t[e]=t[e-1])},t}(),l=function(){function t(){}return t.getTimeStamp=function(){return(new Date).getTime()},t}(),u=function(){function t(){}return t.getPixelRatio=function(t){return(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)},t.isTouch=function(){return!!(\"ontouchstart\"in window)||window.navigator.msMaxTouchPoints>0},t}(),c=function(){function t(){}return t.isInIFrame=function(){try{return window.self!==window.top}catch(t){return!0}},t.supportsFullscreen=function(){var t=document.documentElement;return void 0!==(t.requestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullScreen||t.msRequestFullscreen)},t.isHidden=function(){return!!t.getHiddenProp()},t.getHiddenProp=function(){var t=[\"webkit\",\"moz\",\"ms\",\"o\"];if(\"hidden\"in document)return\"hidden\";for(var e=0;e<t.length;e++)if(t[e]+\"Hidden\"in document)return t[e]+\"Hidden\";return null},t}(),h=function(){function t(){}return t.debounce=function(t,e){return e=e||100,function(){if(!t.debouncing){var i=Array.prototype.slice.apply(arguments);t.lastReturnVal=t.apply(window,i),t.debouncing=!0}return clearTimeout(t.debounceTimeout),t.debounceTimeout=setTimeout((function(){t.debouncing=!1}),e),t.lastReturnVal}},t}(),d=function(){function t(){}return t.simplifyMimeType=function(t){switch(t){case\"text/plain\":return\"txt\";case\"image/jpeg\":return\"jpg\";case\"application/msword\":return\"doc\";case\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":return\"docx\";default:var e=t.split(\"/\");return e[e.length-1]}},t}(),p=function(){function t(){}return t.getCharCode=function(t){return\"number\"==typeof t.which?t.which:t.keyCode},t}(),f=function(){function t(){}return t.normalise=function(t,e,i){return(t-e)/(i-e)},t.median=function(t){t.sort((function(t,e){return t-e}));var e=Math.floor(t.length/2);return t.length%2?t[e]:(t[e-1]+t[e])/2},t.clamp=function(t,e,i){return Math.min(Math.max(t,e),i)},t}(),m=function(t,e){this.width=t,this.height=e},_=function(){function t(){}return t.fitRect=function(t,e,i,n){var o,a=0,r=0;return e/t<n/i?(a=t*(o=i/t),r=e*o):(a=t*(o=n/e),r=e*o),new m(Math.floor(a),Math.floor(r))},t.hitRect=function(t,e,i,n,o,a){return o>t&&o<t+i&&a>e&&a<e+n},t}(),g=function(){function t(){}return t.numericalInput=function(t){return 46==t.keyCode||8==t.keyCode||9==t.keyCode||27==t.keyCode||65==t.keyCode&&!0===t.ctrlKey||t.keyCode>=35&&t.keyCode<=39||(!(t.shiftKey||(t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105))||(t.preventDefault(),!1))},t}(),E=function(){function t(){}return t.toPlainObject=function(t){t=Object(t);var e={};for(var i in t)e[i]=t[i];return e},t}(),b=function(){function t(){}return t.clear=function(t){switch(void 0===t&&(t=n.MEMORY),t){case n.MEMORY:this._memoryStorage={};break;case n.SESSION:sessionStorage.clear();break;case n.LOCAL:localStorage.clear()}},t.clearExpired=function(t){void 0===t&&(t=n.MEMORY);for(var e=this.getItems(t),i=0;i<e.length;i++){var o=e[i];this._isExpired(o)&&this.remove(o.key)}},t.get=function(t,e){void 0===e&&(e=n.MEMORY);var i=null;switch(e){case n.MEMORY:i=this._memoryStorage[t];break;case n.SESSION:i=sessionStorage.getItem(t);break;case n.LOCAL:i=localStorage.getItem(t)}if(!i)return null;var o=null;try{o=JSON.parse(i)}catch(t){return null}return o?this._isExpired(o)?null:(o.key=t,o):null},t._isExpired=function(t){return!((new Date).getTime()<t.expiresAt)},t.getItems=function(t){void 0===t&&(t=n.MEMORY);var e=[];switch(t){case n.MEMORY:for(var i=Object.keys(this._memoryStorage),o=0;o<i.length;o++){(r=this.get(i[o],n.MEMORY))&&e.push(r)}break;case n.SESSION:for(o=0;o<sessionStorage.length;o++){if(a=sessionStorage.key(o))(r=this.get(a,n.SESSION))&&e.push(r)}break;case n.LOCAL:for(o=0;o<localStorage.length;o++){var a,r;if(a=localStorage.key(o))(r=this.get(a,n.LOCAL))&&e.push(r)}}return e},t.remove=function(t,e){switch(void 0===e&&(e=n.MEMORY),e){case n.MEMORY:delete this._memoryStorage[t];break;case n.SESSION:sessionStorage.removeItem(t);break;case n.LOCAL:localStorage.removeItem(t)}},t.set=function(t,e,i,o){void 0===o&&(o=n.MEMORY);var a=1e3*i,r=new v;switch(r.value=e,r.expiresAt=(new Date).getTime()+a,o){case n.MEMORY:this._memoryStorage[t]=JSON.stringify(r);break;case n.SESSION:sessionStorage.setItem(t,JSON.stringify(r));break;case n.LOCAL:localStorage.setItem(t,JSON.stringify(r))}return r},t._memoryStorage={},t}(),v=function(){};!function(t){t.MEMORY=\"memory\",t.SESSION=\"session\",t.LOCAL=\"local\"}(n||(n={}));var S=function(){function t(){}return t.ellipsis=function(t,e){if(t.length<=e)return t;var i=t.substr(0,e),n=i.lastIndexOf(\" \");return-1!=n&&(i=i.substr(0,Math.min(i.length,n))),i+\"…\"},t.htmlDecode=function(t){var e=document.createElement(\"div\");return e.innerHTML=t,e.firstChild.nodeValue},t.format=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0;n<e.length;n++){var o=new RegExp(\"\\\\{\"+n+\"\\\\}\",\"gm\");t=t.replace(o,e[n])}return t},t.isAlphanumeric=function(t){return/^[a-zA-Z0-9]*$/.test(t)},t.toCssClass=function(t){return t.replace(/[^a-z0-9]/g,(function(t){var e=t.charCodeAt(0);return 32==e?\"-\":e>=65&&e<=90?\"_\"+t.toLowerCase():\"__\"+(\"000\"+e.toString(16)).slice(-4)}))},t.toFileName=function(t){return t.replace(/[^a-z0-9]/gi,\"_\").toLowerCase()},t.utf8_to_b64=function(t){return window.btoa(unescape(encodeURIComponent(t)))},t}(),T=function(){function t(){}return t.getHashParameter=function(t,e){return e||(e=window.document),e&&e.location?this.getHashParameterFromString(t,e.location.hash):null},t.getHashParameterFromString=function(t,e){var i=new RegExp(\"#.*[?&]\"+t+\"=([^&]+)(&|$)\").exec(e);return i?decodeURIComponent(i[1].replace(/\\+/g,\" \")):null},t.setHashParameter=function(t,e,i){if(i||(i=window.document),i&&i.location){var n=\"#?\"+this.updateURIKeyValuePair(i.location.hash.replace(\"#?\",\"\"),t,e),o=i.URL;-1!=o.indexOf(\"#\")&&(o=o.substr(0,o.indexOf(\"#\"))),i.location.replace(o+n)}},t.getQuerystringParameter=function(t,e){return e||(e=window),this.getQuerystringParameterFromString(t,e.location.search)},t.getQuerystringParameterFromString=function(t,e){t=t.replace(/[\\[]/,\"\\\\[\").replace(/[\\]]/,\"\\\\]\");var i=new RegExp(\"[\\\\?&]\"+t+\"=([^&#]*)\").exec(e);return i?decodeURIComponent(i[1].replace(/\\+/g,\" \")):null},t.setQuerystringParameter=function(t,e,i){if(i||(i=window.document),i&&i.location){var n=this.updateURIKeyValuePair(i.location.hash.replace(\"#?\",\"\"),t,e);window.location.search=n}},t.updateURIKeyValuePair=function(t,e,i){e=encodeURIComponent(e),i=encodeURIComponent(i);var n=t.split(\"&\");\"\"==n[0]&&n.shift();for(var o,a=n.length;a--;)if((o=n[a].split(\"=\"))[0]==e){o[1]=i,n[a]=o.join(\"=\");break}return a<0&&(n[n.length]=[e,i].join(\"=\")),n.join(\"&\")},t.getUrlParts=function(t){var e=document.createElement(\"a\");return e.href=t,e},t.convertToRelativeUrl=function(t){var e=this.getUrlParts(t),i=e.pathname+e.searchWithin;return i.startsWith(\"/\")||(i=\"/\"+i),i},t}()}])}));\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-contentleftpanel-module/GalleryView',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/BaseView\", \"@iiif/iiif-gallery-component\"], function (require, exports, BaseEvents_1, BaseView_1, iiif_gallery_component_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var GalleryView = /** @class */ (function (_super) {\r\n __extends(GalleryView, _super);\r\n function GalleryView($element) {\r\n var _this = _super.call(this, $element, true, true) || this;\r\n _this.isOpen = false;\r\n return _this;\r\n }\r\n GalleryView.prototype.create = function () {\r\n this.setConfig('contentLeftPanel');\r\n _super.prototype.create.call(this);\r\n // search preview doesn't work well with the gallery because it loads thumbs in \"chunks\"\r\n // this.component.subscribe(Events.SEARCH_PREVIEW_START, (e, canvasIndex) => {\r\n // this.galleryComponent.searchPreviewStart(canvasIndex);\r\n // });\r\n // this.component.subscribe(Events.SEARCH_PREVIEW_FINISH, () => {\r\n // this.galleryComponent.searchPreviewFinish();\r\n // });\r\n this.$gallery = $('<div class=\"iiif-gallery-component\"></div>');\r\n this.$element.append(this.$gallery);\r\n // stencil.js demo\r\n // const gallery = document.createElement('iiif-gallery');\r\n // gallery.setAttribute('manifest', this.extension.helper.manifest.id);\r\n // this.$element[0].appendChild(gallery);\r\n };\r\n GalleryView.prototype.setup = function () {\r\n var that = this;\r\n this.galleryComponent = new iiif_gallery_component_1.GalleryComponent({\r\n target: this.$gallery[0]\r\n });\r\n this.galleryComponent.on('thumbSelected', function (thumb) {\r\n that.component.publish(BaseEvents_1.BaseEvents.GALLERY_THUMB_SELECTED, thumb);\r\n that.component.publish(BaseEvents_1.BaseEvents.THUMB_SELECTED, thumb);\r\n }, false);\r\n this.galleryComponent.on('decreaseSize', function () {\r\n that.component.publish(BaseEvents_1.BaseEvents.GALLERY_DECREASE_SIZE);\r\n }, false);\r\n this.galleryComponent.on('increaseSize', function () {\r\n that.component.publish(BaseEvents_1.BaseEvents.GALLERY_INCREASE_SIZE);\r\n }, false);\r\n };\r\n GalleryView.prototype.databind = function () {\r\n this.galleryComponent.options.data = this.galleryData;\r\n this.galleryComponent.set(this.galleryData);\r\n this.resize();\r\n };\r\n GalleryView.prototype.show = function () {\r\n var _this = this;\r\n this.isOpen = true;\r\n this.$element.show();\r\n // todo: would be better to have no imperative methods on components and use a reactive pattern\r\n setTimeout(function () {\r\n _this.galleryComponent.selectIndex(_this.extension.helper.canvasIndex);\r\n }, 10);\r\n };\r\n GalleryView.prototype.hide = function () {\r\n this.isOpen = false;\r\n this.$element.hide();\r\n };\r\n GalleryView.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n var $main = this.$gallery.find('.main');\r\n var $header = this.$gallery.find('.header');\r\n $main.height(this.$element.height() - $header.height());\r\n };\r\n return GalleryView;\r\n }(BaseView_1.BaseView));\r\n exports.GalleryView = GalleryView;\r\n});\r\n//# sourceMappingURL=GalleryView.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/BaseExpandPanel',[\"require\", \"exports\", \"./BaseView\"], function (require, exports, BaseView_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var BaseExpandPanel = /** @class */ (function (_super) {\r\n __extends(BaseExpandPanel, _super);\r\n function BaseExpandPanel($element) {\r\n var _this = _super.call(this, $element, false, true) || this;\r\n _this.isExpanded = false;\r\n _this.isFullyExpanded = false;\r\n _this.isUnopened = true;\r\n _this.autoToggled = false;\r\n _this.expandFullEnabled = true;\r\n return _this;\r\n }\r\n BaseExpandPanel.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n this.$top = $('<div class=\"top\"></div>');\r\n this.$element.append(this.$top);\r\n this.$title = $('<div class=\"title\"></div>');\r\n this.$title.prop('title', this.content.title);\r\n this.$top.append(this.$title);\r\n this.$expandFullButton = $('<a class=\"expandFullButton\" tabindex=\"0\"></a>');\r\n this.$expandFullButton.prop('title', this.content.expandFull);\r\n this.$top.append(this.$expandFullButton);\r\n if (!Utils.Bools.getBool(this.config.options.expandFullEnabled, true)) {\r\n this.$expandFullButton.hide();\r\n }\r\n this.$collapseButton = $('<div class=\"collapseButton\" tabindex=\"0\"></div>');\r\n this.$collapseButton.prop('title', this.content.collapse);\r\n this.$top.append(this.$collapseButton);\r\n this.$closed = $('<div class=\"closed\"></div>');\r\n this.$element.append(this.$closed);\r\n this.$expandButton = $('<a class=\"expandButton\" tabindex=\"0\"></a>');\r\n this.$expandButton.prop('title', this.content.expand);\r\n this.$closed.append(this.$expandButton);\r\n this.$closedTitle = $('<a class=\"title\"></a>');\r\n this.$closedTitle.prop('title', this.content.title);\r\n this.$closed.append(this.$closedTitle);\r\n this.$main = $('<div class=\"main\"></div>');\r\n this.$element.append(this.$main);\r\n this.$expandButton.onPressed(function () {\r\n _this.toggle();\r\n });\r\n this.$expandFullButton.onPressed(function () {\r\n _this.expandFull();\r\n });\r\n this.$closedTitle.onPressed(function () {\r\n _this.toggle();\r\n });\r\n this.$title.onPressed(function () {\r\n if (_this.isFullyExpanded) {\r\n _this.collapseFull();\r\n }\r\n else {\r\n _this.toggle();\r\n }\r\n });\r\n this.$collapseButton.onPressed(function () {\r\n if (_this.isFullyExpanded) {\r\n _this.collapseFull();\r\n }\r\n else {\r\n _this.toggle();\r\n }\r\n });\r\n this.$top.hide();\r\n this.$main.hide();\r\n };\r\n BaseExpandPanel.prototype.init = function () {\r\n _super.prototype.init.call(this);\r\n };\r\n BaseExpandPanel.prototype.setTitle = function (title) {\r\n this.$title.text(title);\r\n this.$closedTitle.text(title);\r\n };\r\n BaseExpandPanel.prototype.toggle = function (autoToggled) {\r\n var _this = this;\r\n (autoToggled) ? this.autoToggled = true : this.autoToggled = false;\r\n // if collapsing, hide contents immediately.\r\n if (this.isExpanded) {\r\n this.$top.attr('aria-hidden', 'true');\r\n this.$main.attr('aria-hidden', 'true');\r\n this.$closed.attr('aria-hidden', 'false');\r\n this.$top.hide();\r\n this.$main.hide();\r\n this.$closed.show();\r\n }\r\n this.$element.stop().animate({\r\n width: this.getTargetWidth(),\r\n left: this.getTargetLeft()\r\n }, this.options.panelAnimationDuration, function () {\r\n _this.toggled();\r\n });\r\n };\r\n BaseExpandPanel.prototype.toggled = function () {\r\n this.toggleStart();\r\n this.isExpanded = !this.isExpanded;\r\n // if expanded show content when animation finished.\r\n if (this.isExpanded) {\r\n this.$top.attr('aria-hidden', 'false');\r\n this.$main.attr('aria-hidden', 'false');\r\n this.$closed.attr('aria-hidden', 'true');\r\n this.$closed.hide();\r\n this.$top.show();\r\n this.$main.show();\r\n }\r\n this.toggleFinish();\r\n this.isUnopened = false;\r\n };\r\n BaseExpandPanel.prototype.expandFull = function () {\r\n var _this = this;\r\n if (!this.isExpanded) {\r\n this.toggled();\r\n }\r\n var targetWidth = this.getFullTargetWidth();\r\n var targetLeft = this.getFullTargetLeft();\r\n this.expandFullStart();\r\n this.$element.stop().animate({\r\n width: targetWidth,\r\n left: targetLeft\r\n }, this.options.panelAnimationDuration, function () {\r\n _this.expandFullFinish();\r\n });\r\n };\r\n BaseExpandPanel.prototype.collapseFull = function () {\r\n var _this = this;\r\n var targetWidth = this.getTargetWidth();\r\n var targetLeft = this.getTargetLeft();\r\n this.collapseFullStart();\r\n this.$element.stop().animate({\r\n width: targetWidth,\r\n left: targetLeft\r\n }, this.options.panelAnimationDuration, function () {\r\n _this.collapseFullFinish();\r\n });\r\n };\r\n BaseExpandPanel.prototype.getTargetWidth = function () {\r\n return 0;\r\n };\r\n BaseExpandPanel.prototype.getTargetLeft = function () {\r\n return 0;\r\n };\r\n BaseExpandPanel.prototype.getFullTargetWidth = function () {\r\n return 0;\r\n };\r\n BaseExpandPanel.prototype.getFullTargetLeft = function () {\r\n return 0;\r\n };\r\n BaseExpandPanel.prototype.toggleStart = function () {\r\n };\r\n BaseExpandPanel.prototype.toggleFinish = function () {\r\n if (this.isExpanded && !this.autoToggled) {\r\n this.focusCollapseButton();\r\n }\r\n else {\r\n this.focusExpandButton();\r\n }\r\n };\r\n BaseExpandPanel.prototype.expandFullStart = function () {\r\n };\r\n BaseExpandPanel.prototype.expandFullFinish = function () {\r\n this.isFullyExpanded = true;\r\n this.$expandFullButton.hide();\r\n this.focusCollapseButton();\r\n };\r\n BaseExpandPanel.prototype.collapseFullStart = function () {\r\n };\r\n BaseExpandPanel.prototype.collapseFullFinish = function () {\r\n this.isFullyExpanded = false;\r\n if (this.expandFullEnabled) {\r\n this.$expandFullButton.show();\r\n }\r\n this.focusExpandFullButton();\r\n };\r\n BaseExpandPanel.prototype.focusExpandButton = function () {\r\n var _this = this;\r\n setTimeout(function () {\r\n _this.$expandButton.focus();\r\n }, 1);\r\n };\r\n BaseExpandPanel.prototype.focusExpandFullButton = function () {\r\n var _this = this;\r\n setTimeout(function () {\r\n _this.$expandFullButton.focus();\r\n }, 1);\r\n };\r\n BaseExpandPanel.prototype.focusCollapseButton = function () {\r\n var _this = this;\r\n setTimeout(function () {\r\n _this.$collapseButton.focus();\r\n }, 1);\r\n };\r\n BaseExpandPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$main.height(this.$element.parent().height() - this.$top.outerHeight(true));\r\n };\r\n return BaseExpandPanel;\r\n }(BaseView_1.BaseView));\r\n exports.BaseExpandPanel = BaseExpandPanel;\r\n});\r\n//# sourceMappingURL=BaseExpandPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/LeftPanel',[\"require\", \"exports\", \"./BaseEvents\", \"./BaseExpandPanel\"], function (require, exports, BaseEvents_1, BaseExpandPanel_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var LeftPanel = /** @class */ (function (_super) {\r\n __extends(LeftPanel, _super);\r\n function LeftPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n LeftPanel.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n this.$element.width(this.options.panelCollapsedWidth);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.TOGGLE_EXPAND_LEFT_PANEL, function () {\r\n if (_this.isFullyExpanded) {\r\n _this.collapseFull();\r\n }\r\n else {\r\n _this.expandFull();\r\n }\r\n });\r\n };\r\n LeftPanel.prototype.init = function () {\r\n _super.prototype.init.call(this);\r\n var shouldOpenPanel = Utils.Bools.getBool(this.extension.getSettings().leftPanelOpen, this.options.panelOpen);\r\n if (shouldOpenPanel) {\r\n this.toggle(true);\r\n }\r\n };\r\n LeftPanel.prototype.getTargetWidth = function () {\r\n if (this.isFullyExpanded || !this.isExpanded) {\r\n return this.options.panelExpandedWidth;\r\n }\r\n else {\r\n return this.options.panelCollapsedWidth;\r\n }\r\n };\r\n LeftPanel.prototype.getFullTargetWidth = function () {\r\n return this.$element.parent().width();\r\n };\r\n LeftPanel.prototype.toggleFinish = function () {\r\n _super.prototype.toggleFinish.call(this);\r\n if (this.isExpanded) {\r\n this.component.publish(BaseEvents_1.BaseEvents.OPEN_LEFT_PANEL);\r\n }\r\n else {\r\n this.component.publish(BaseEvents_1.BaseEvents.CLOSE_LEFT_PANEL);\r\n }\r\n this.extension.updateSettings({ leftPanelOpen: this.isExpanded });\r\n };\r\n LeftPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n if (this.isFullyExpanded) {\r\n this.$element.width(this.$element.parent().width());\r\n }\r\n };\r\n return LeftPanel;\r\n }(BaseExpandPanel_1.BaseExpandPanel));\r\n exports.LeftPanel = LeftPanel;\r\n});\r\n//# sourceMappingURL=LeftPanel.js.map\n", "define('extensions/uv-seadragon-extension/Mode',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Mode = /** @class */ (function () {\r\n function Mode(value) {\r\n this.value = value;\r\n }\r\n Mode.prototype.toString = function () {\r\n return this.value;\r\n };\r\n Mode.image = new Mode(\"image\");\r\n Mode.page = new Mode(\"page\");\r\n return Mode;\r\n }());\r\n exports.Mode = Mode;\r\n});\r\n//# sourceMappingURL=Mode.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/ThumbsView',[\"require\", \"exports\", \"./BaseEvents\", \"./BaseView\", \"@iiif/vocabulary\"], function (require, exports, BaseEvents_1, BaseView_1, vocabulary_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ThumbsView = /** @class */ (function (_super) {\r\n __extends(ThumbsView, _super);\r\n function ThumbsView($element) {\r\n var _this = _super.call(this, $element, true, true) || this;\r\n _this.isCreated = false;\r\n _this.isOpen = false;\r\n return _this;\r\n }\r\n ThumbsView.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (index) {\r\n _this.selectIndex(parseInt(index));\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LOGIN, function () {\r\n _this.loadThumbs();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CLICKTHROUGH, function () {\r\n _this.loadThumbs();\r\n });\r\n this.$thumbs = $('<div class=\"thumbs\"></div>');\r\n this.$element.append(this.$thumbs);\r\n var viewingDirection = this.extension.helper.getViewingDirection() || vocabulary_1.ViewingDirection.LEFT_TO_RIGHT;\r\n this.$thumbs.addClass(viewingDirection.toString()); // defaults to \"left-to-right\"\r\n var that = this;\r\n $.templates({\r\n thumbsTemplate: '<div id=\"thumb{{>index}}\" class=\"{{:~className()}}\" data-src=\"{{>uri}}\" data-visible=\"{{>visible}}\" data-index=\"{{>index}}\">\\\n <div class=\"wrap\" style=\"height:{{>height + ~extraHeight()}}px\"></div>\\\n <div class=\"info\">\\\n <span class=\"index\">{{:#index + 1}}</span>\\\n <span class=\"label\" title=\"{{>label}}\">{{>label}} </span>\\\n <span class=\"searchResults\" title=\"{{:~searchResultsTitle()}}\">{{>data.searchResults}}</span>\\\n </div>\\\n </div>\\\n {{if ~separator()}} \\\n <div class=\"separator\"></div> \\\n {{/if}}'\r\n });\r\n var extraHeight = this.options.thumbsExtraHeight;\r\n $.views.helpers({\r\n separator: function () {\r\n return false;\r\n },\r\n extraHeight: function () {\r\n return extraHeight;\r\n },\r\n className: function () {\r\n var className = \"thumb\";\r\n if (this.data.index === 0) {\r\n className += \" first\";\r\n }\r\n if (!this.data.uri) {\r\n className += \" placeholder\";\r\n }\r\n var viewingDirection = that.extension.helper.getViewingDirection();\r\n if (viewingDirection && (viewingDirection.toString() === vocabulary_1.ViewingDirection.LEFT_TO_RIGHT.toString() || viewingDirection.toString() === vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString())) {\r\n className += \" twoCol\";\r\n }\r\n else if (that.extension.helper.isPaged()) {\r\n className += \" twoCol\";\r\n }\r\n else {\r\n className += \" oneCol\";\r\n }\r\n return className;\r\n },\r\n searchResultsTitle: function () {\r\n var searchResults = Number(this.data.data.searchResults);\r\n if (searchResults) {\r\n if (searchResults > 1) {\r\n return Utils.Strings.format(that.content.searchResults, searchResults.toString());\r\n }\r\n return Utils.Strings.format(that.content.searchResult, searchResults.toString());\r\n }\r\n return '';\r\n }\r\n });\r\n // use unevent to detect scroll stop.\r\n this.$element.on('scroll', function () {\r\n _this.scrollStop();\r\n }, 100);\r\n this.resize();\r\n };\r\n ThumbsView.prototype.databind = function () {\r\n if (!this.thumbs)\r\n return;\r\n this._$thumbsCache = null; // delete cache\r\n this.createThumbs();\r\n // do initial load to show padlocks\r\n this.loadThumbs(0);\r\n this.selectIndex(this.extension.helper.canvasIndex);\r\n };\r\n ThumbsView.prototype.createThumbs = function () {\r\n var that = this;\r\n if (!this.thumbs)\r\n return;\r\n // get median height\r\n var heights = [];\r\n for (var i = 0; i < this.thumbs.length; i++) {\r\n var thumb = this.thumbs[i];\r\n heights.push(thumb.height);\r\n }\r\n var medianHeight = Utils.Maths.median(heights);\r\n for (var i = 0; i < this.thumbs.length; i++) {\r\n var thumb = this.thumbs[i];\r\n thumb.height = medianHeight;\r\n }\r\n this.$thumbs.link($.templates.thumbsTemplate, this.thumbs);\r\n this.$thumbs.undelegate('.thumb', 'click');\r\n this.$thumbs.delegate(\".thumb\", \"click\", function (e) {\r\n e.preventDefault();\r\n var data = $.view(this).data;\r\n that.lastThumbClickedIndex = data.index;\r\n that.component.publish(BaseEvents_1.BaseEvents.THUMB_SELECTED, data);\r\n });\r\n this.setLabel();\r\n this.isCreated = true;\r\n };\r\n ThumbsView.prototype.scrollStop = function () {\r\n var scrollPos = 1 / ((this.$thumbs.height() - this.$element.height()) / this.$element.scrollTop());\r\n if (scrollPos > 1)\r\n scrollPos = 1;\r\n var thumbRangeMid = Math.floor((this.thumbs.length - 1) * scrollPos);\r\n this.loadThumbs(thumbRangeMid);\r\n };\r\n ThumbsView.prototype.loadThumbs = function (index) {\r\n if (index === void 0) { index = this.extension.helper.canvasIndex; }\r\n if (!this.thumbs || !this.thumbs.length)\r\n return;\r\n var thumbType;\r\n // get the type of the canvas content\r\n var canvas = this.extension.helper.getCanvasByIndex(index);\r\n var annotations = canvas.getContent();\r\n if (annotations.length) {\r\n var annotation = annotations[0];\r\n var body = annotation.getBody();\r\n if (body.length) {\r\n // @ts-ignore\r\n var type = body[0].getType();\r\n if (type) {\r\n thumbType = type.toString().toLowerCase();\r\n }\r\n }\r\n }\r\n var thumbRangeMid = index;\r\n var thumbLoadRange = this.options.thumbsLoadRange;\r\n var thumbRange = {\r\n start: (thumbRangeMid > thumbLoadRange) ? thumbRangeMid - thumbLoadRange : 0,\r\n end: (thumbRangeMid < (this.thumbs.length - 1) - thumbLoadRange) ? thumbRangeMid + thumbLoadRange : this.thumbs.length - 1\r\n };\r\n var fadeDuration = this.options.thumbsImageFadeInDuration;\r\n var that = this;\r\n for (var i = thumbRange.start; i <= thumbRange.end; i++) {\r\n var $thumb = this.getThumbByIndex(i);\r\n var $wrap = $thumb.find('.wrap');\r\n // if no img has been added yet\r\n if (!$wrap.hasClass('loading') && !$wrap.hasClass('loaded')) {\r\n var visible = $thumb.attr('data-visible');\r\n if (visible !== \"false\") {\r\n $wrap.removeClass('loadingFailed');\r\n $wrap.addClass('loading');\r\n if (thumbType) {\r\n $wrap.addClass(thumbType);\r\n }\r\n var src = $thumb.attr('data-src');\r\n if (that.config.options.thumbsCacheInvalidation && that.config.options.thumbsCacheInvalidation.enabled) {\r\n src += that.config.options.thumbsCacheInvalidation.paramType + \"t=\" + Utils.Dates.getTimeStamp();\r\n }\r\n var $img = $('<img src=\"' + src + '\" alt=\"\"/>');\r\n // fade in on load.\r\n $img.hide();\r\n $img.on('load', function () {\r\n $(this).fadeIn(fadeDuration, function () {\r\n $(this).parent().switchClass('loading', 'loaded');\r\n });\r\n });\r\n $img.on('error', function () {\r\n $(this).parent().switchClass('loading', 'loadingFailed');\r\n });\r\n $wrap.append($img);\r\n }\r\n else {\r\n $wrap.addClass('hidden');\r\n }\r\n }\r\n }\r\n };\r\n ThumbsView.prototype.show = function () {\r\n var _this = this;\r\n this.isOpen = true;\r\n this.$element.show();\r\n setTimeout(function () {\r\n _this.selectIndex(_this.extension.helper.canvasIndex);\r\n }, 1);\r\n };\r\n ThumbsView.prototype.hide = function () {\r\n this.isOpen = false;\r\n this.$element.hide();\r\n };\r\n ThumbsView.prototype.isPDF = function () {\r\n var canvas = this.extension.helper.getCurrentCanvas();\r\n var type = canvas.getType();\r\n if (type) {\r\n return (type.toString().includes(\"pdf\"));\r\n }\r\n return false;\r\n };\r\n ThumbsView.prototype.setLabel = function () {\r\n $(this.$thumbs).find('span.index').hide();\r\n $(this.$thumbs).find('span.label').show();\r\n };\r\n ThumbsView.prototype.addSelectedClassToThumbs = function (index) {\r\n this.getThumbByIndex(index).addClass('selected');\r\n };\r\n ThumbsView.prototype.selectIndex = function (index) {\r\n // may be authenticating\r\n if (index === -1)\r\n return;\r\n if (!this.thumbs || !this.thumbs.length)\r\n return;\r\n this.getAllThumbs().removeClass('selected');\r\n this.$selectedThumb = this.getThumbByIndex(index);\r\n this.addSelectedClassToThumbs(index);\r\n var indices = this.extension.getPagedIndices(index);\r\n // scroll to thumb if the index change didn't originate\r\n // within the thumbs view.\r\n if (!~indices.indexOf(this.lastThumbClickedIndex)) {\r\n this.$element.scrollTop(this.$selectedThumb.position().top);\r\n }\r\n // make sure visible images are loaded.\r\n this.loadThumbs(index);\r\n };\r\n ThumbsView.prototype.getAllThumbs = function () {\r\n if (!this._$thumbsCache) {\r\n this._$thumbsCache = this.$thumbs.find('.thumb');\r\n }\r\n return this._$thumbsCache;\r\n };\r\n ThumbsView.prototype.getThumbByIndex = function (canvasIndex) {\r\n return this.$thumbs.find('[data-index=\"' + canvasIndex + '\"]');\r\n };\r\n ThumbsView.prototype.scrollToThumb = function (canvasIndex) {\r\n var $thumb = this.getThumbByIndex(canvasIndex);\r\n this.$element.scrollTop($thumb.position().top);\r\n };\r\n ThumbsView.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return ThumbsView;\r\n }(BaseView_1.BaseView));\r\n exports.ThumbsView = ThumbsView;\r\n});\r\n//# sourceMappingURL=ThumbsView.js.map\n", "define('extensions/uv-seadragon-extension/Events',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Events = /** @class */ (function () {\r\n function Events() {\r\n }\r\n Events.namespace = 'openseadragonExtension.';\r\n Events.CURRENT_VIEW_URI = Events.namespace + 'currentViewUri';\r\n Events.IMAGE_SEARCH = Events.namespace + 'imageSearch';\r\n Events.MODE_CHANGED = Events.namespace + 'modeChanged';\r\n Events.NEXT_SEARCH_RESULT = Events.namespace + 'nextSearchResult';\r\n Events.NEXT_IMAGES_SEARCH_RESULT_UNAVAILABLE = Events.namespace + 'nextImagesSearchResultUnavailable';\r\n Events.PREV_IMAGES_SEARCH_RESULT_UNAVAILABLE = Events.namespace + 'prevImagesSearchResultUnavailable';\r\n Events.PAGE_SEARCH = Events.namespace + 'pageSearch';\r\n Events.PAGING_TOGGLED = Events.namespace + 'pagingToggled';\r\n Events.PREV_SEARCH_RESULT = Events.namespace + 'prevSearchResult';\r\n Events.PRINT = Events.namespace + 'print';\r\n Events.ROTATE = Events.namespace + 'rotate';\r\n Events.SEADRAGON_ANIMATION_FINISH = Events.namespace + 'animationFinish';\r\n Events.SEADRAGON_ANIMATION_START = Events.namespace + 'animationStart';\r\n Events.SEADRAGON_ANIMATION = Events.namespace + 'animation';\r\n Events.SEADRAGON_OPEN = Events.namespace + 'open';\r\n Events.SEADRAGON_RESIZE = Events.namespace + 'resize';\r\n Events.SEADRAGON_ROTATION = Events.namespace + 'rotationChanged';\r\n Events.SEARCH_PREVIEW_FINISH = Events.namespace + 'searchPreviewFinish';\r\n Events.SEARCH_PREVIEW_START = Events.namespace + 'searchPreviewStart';\r\n Events.SEARCH = Events.namespace + 'search';\r\n Events.XYWH_CHANGED = Events.namespace + 'xywhChanged';\r\n Events.ZOOM_IN = Events.namespace + 'zoomIn';\r\n Events.ZOOM_OUT = Events.namespace + 'zoomOut';\r\n return Events;\r\n }());\r\n exports.Events = Events;\r\n});\r\n//# sourceMappingURL=Events.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-contentleftpanel-module/ThumbsView',[\"require\", \"exports\", \"../uv-shared-module/ThumbsView\", \"../../extensions/uv-seadragon-extension/Events\", \"../../extensions/uv-seadragon-extension/Mode\"], function (require, exports, ThumbsView_1, Events_1, Mode_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ThumbsView = /** @class */ (function (_super) {\r\n __extends(ThumbsView, _super);\r\n function ThumbsView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ThumbsView.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('contentLeftPanel');\r\n _super.prototype.create.call(this);\r\n // todo: this should be a setting\r\n this.component.subscribe(Events_1.Events.MODE_CHANGED, function () {\r\n _this.setLabel();\r\n });\r\n this.component.subscribe(Events_1.Events.SEARCH_PREVIEW_START, function (canvasIndex) {\r\n _this.searchPreviewStart(canvasIndex);\r\n });\r\n this.component.subscribe(Events_1.Events.SEARCH_PREVIEW_FINISH, function () {\r\n _this.searchPreviewFinish();\r\n });\r\n if (this.extension.helper.isPaged()) {\r\n this.$thumbs.addClass('paged');\r\n }\r\n var that = this;\r\n $.views.helpers({\r\n separator: function () {\r\n // two thumbs per line\r\n if (that.extension.helper.isPaged()) {\r\n return ((this.data.index - 1) % 2 == 0) ? false : true;\r\n }\r\n return true; // default to one thumbnail per row\r\n }\r\n });\r\n };\r\n ThumbsView.prototype.addSelectedClassToThumbs = function (index) {\r\n var indices = this.extension.getPagedIndices(index);\r\n for (var i = 0; i < indices.length; i++) {\r\n this.getThumbByIndex(indices[i]).addClass('selected');\r\n }\r\n };\r\n ThumbsView.prototype.isPageModeEnabled = function () {\r\n // todo: move getMode to BaseExtension. call it getIndexingMode which can be Label or Index\r\n if (typeof this.extension.getMode === \"function\") {\r\n return this.config.options.pageModeEnabled && this.extension.getMode().toString() === Mode_1.Mode.page.toString();\r\n }\r\n return this.config.options.pageModeEnabled;\r\n };\r\n ThumbsView.prototype.searchPreviewStart = function (canvasIndex) {\r\n this.scrollToThumb(canvasIndex);\r\n var $thumb = this.getThumbByIndex(canvasIndex);\r\n $thumb.addClass('searchpreview');\r\n };\r\n ThumbsView.prototype.searchPreviewFinish = function () {\r\n this.scrollToThumb(this.extension.helper.canvasIndex);\r\n this.getAllThumbs().removeClass('searchpreview');\r\n };\r\n ThumbsView.prototype.setLabel = function () {\r\n if (this.isPDF()) {\r\n $(this.$thumbs).find('span.index').hide();\r\n $(this.$thumbs).find('span.label').hide();\r\n }\r\n else {\r\n if (this.isPageModeEnabled()) {\r\n $(this.$thumbs).find('span.index').hide();\r\n $(this.$thumbs).find('span.label').show();\r\n }\r\n else {\r\n $(this.$thumbs).find('span.index').show();\r\n $(this.$thumbs).find('span.label').hide();\r\n }\r\n }\r\n };\r\n return ThumbsView;\r\n }(ThumbsView_1.ThumbsView));\r\n exports.ThumbsView = ThumbsView;\r\n});\r\n//# sourceMappingURL=ThumbsView.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-contentleftpanel-module/TreeView',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/BaseView\"], function (require, exports, BaseEvents_1, BaseView_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var TreeView = /** @class */ (function (_super) {\r\n __extends(TreeView, _super);\r\n function TreeView($element) {\r\n var _this = _super.call(this, $element, true, true) || this;\r\n _this.isOpen = false;\r\n return _this;\r\n }\r\n TreeView.prototype.create = function () {\r\n this.setConfig('contentLeftPanel');\r\n _super.prototype.create.call(this);\r\n this.$tree = $('<div class=\"iiif-tree-component\"></div>');\r\n this.$element.append(this.$tree);\r\n };\r\n TreeView.prototype.setup = function () {\r\n var that = this;\r\n // @ts-ignore\r\n this.treeComponent = new IIIFComponents.TreeComponent({\r\n target: this.$tree[0],\r\n data: this.treeData\r\n });\r\n this.treeComponent.on('treeNodeSelected', function (node) {\r\n that.component.publish(BaseEvents_1.BaseEvents.TREE_NODE_SELECTED, node);\r\n }, false);\r\n this.treeComponent.on('treeNodeMultiSelected', function (node) {\r\n that.component.publish(BaseEvents_1.BaseEvents.TREE_NODE_MULTISELECTED, node);\r\n }, false);\r\n };\r\n TreeView.prototype.databind = function () {\r\n this.treeComponent.set(this.treeData);\r\n this.resize();\r\n };\r\n TreeView.prototype.show = function () {\r\n this.isOpen = true;\r\n this.$element.show();\r\n };\r\n TreeView.prototype.hide = function () {\r\n this.isOpen = false;\r\n this.$element.hide();\r\n };\r\n TreeView.prototype.selectNode = function (node) {\r\n if (!this.treeComponent.selectedNode) {\r\n this.treeComponent.expandParents(node, true);\r\n var link = this.$tree.find(\"#tree-link-\" + node.id)[0];\r\n if (link) {\r\n link.scrollIntoViewIfNeeded();\r\n }\r\n }\r\n this.treeComponent.selectNode(node);\r\n };\r\n TreeView.prototype.expandNode = function (node, expanded) {\r\n this.treeComponent.expandNode(node, expanded);\r\n };\r\n TreeView.prototype.getAllNodes = function () {\r\n return this.treeComponent.getAllNodes();\r\n };\r\n TreeView.prototype.deselectCurrentNode = function () {\r\n this.treeComponent.deselectCurrentNode();\r\n };\r\n TreeView.prototype.getNodeById = function (id) {\r\n return this.treeComponent.getNodeById(id);\r\n };\r\n TreeView.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return TreeView;\r\n }(BaseView_1.BaseView));\r\n exports.TreeView = TreeView;\r\n});\r\n//# sourceMappingURL=TreeView.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-contentleftpanel-module/ContentLeftPanel',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"./GalleryView\", \"../uv-shared-module/LeftPanel\", \"../../extensions/uv-seadragon-extension/Mode\", \"./ThumbsView\", \"./TreeView\", \"@iiif/vocabulary\", \"manifesto.js\", \"@iiif/manifold\"], function (require, exports, BaseEvents_1, GalleryView_1, LeftPanel_1, Mode_1, ThumbsView_1, TreeView_1, vocabulary_1, manifesto_js_1, manifold_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ContentLeftPanel = /** @class */ (function (_super) {\r\n __extends(ContentLeftPanel, _super);\r\n function ContentLeftPanel($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this.expandFullEnabled = false;\r\n _this.isThumbsViewOpen = false;\r\n _this.isTreeViewOpen = false;\r\n _this.treeSortType = manifold_1.TreeSortType.NONE;\r\n return _this;\r\n }\r\n ContentLeftPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('contentLeftPanel');\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SETTINGS_CHANGED, function () {\r\n _this.databind();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.GALLERY_THUMB_SELECTED, function () {\r\n _this.collapseFull();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.METRIC_CHANGED, function () {\r\n if (!_this.extension.isDesktopMetric()) {\r\n if (_this.isFullyExpanded) {\r\n _this.collapseFull();\r\n }\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATIONS, function () {\r\n _this.databindThumbsView();\r\n _this.databindGalleryView();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATIONS_CLEARED, function () {\r\n _this.databindThumbsView();\r\n _this.databindGalleryView();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATIONS_EMPTY, function () {\r\n _this.databindThumbsView();\r\n _this.databindGalleryView();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function () {\r\n if (_this.isFullyExpanded) {\r\n _this.collapseFull();\r\n }\r\n _this.selectCurrentTreeNode();\r\n _this.updateTreeTabBySelection();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RANGE_CHANGED, function () {\r\n if (_this.isFullyExpanded) {\r\n _this.collapseFull();\r\n }\r\n _this.selectCurrentTreeNode();\r\n _this.updateTreeTabBySelection();\r\n });\r\n this.$tabs = $('<div class=\"tabs\"></div>');\r\n this.$main.append(this.$tabs);\r\n this.$treeButton = $('<a class=\"index tab\" tabindex=\"0\">' + this.content.index + '</a>');\r\n this.$tabs.append(this.$treeButton);\r\n this.$thumbsButton = $('<a class=\"thumbs tab\" tabindex=\"0\">' + this.content.thumbnails + '</a>');\r\n this.$thumbsButton.prop('title', this.content.thumbnails);\r\n this.$tabs.append(this.$thumbsButton);\r\n this.$tabsContent = $('<div class=\"tabsContent\"></div>');\r\n this.$main.append(this.$tabsContent);\r\n this.$options = $('<div class=\"options\"></div>');\r\n this.$tabsContent.append(this.$options);\r\n this.$topOptions = $('<div class=\"top\"></div>');\r\n this.$options.append(this.$topOptions);\r\n this.$treeSelect = $('<select aria-label=\"' + this.content.manifestRanges + '\"></select>');\r\n this.$topOptions.append(this.$treeSelect);\r\n this.$bottomOptions = $('<div class=\"bottom\"></div>');\r\n this.$options.append(this.$bottomOptions);\r\n this.$leftOptions = $('<div class=\"left\"></div>');\r\n this.$bottomOptions.append(this.$leftOptions);\r\n this.$rightOptions = $('<div class=\"right\"></div>');\r\n this.$bottomOptions.append(this.$rightOptions);\r\n this.$treeViewOptions = $('<div class=\"treeView\"></div>');\r\n this.$leftOptions.append(this.$treeViewOptions);\r\n this.$sortByLabel = $('<span class=\"sort\">' + this.content.sortBy + '</span>');\r\n this.$treeViewOptions.append(this.$sortByLabel);\r\n this.$sortButtonGroup = $('<div class=\"btn-group\"></div>');\r\n this.$treeViewOptions.append(this.$sortButtonGroup);\r\n this.$sortByDateButton = $('<button class=\"btn\" tabindex=\"0\">' + this.content.date + '</button>');\r\n this.$sortButtonGroup.append(this.$sortByDateButton);\r\n this.$sortByVolumeButton = $('<button class=\"btn\" tabindex=\"0\">' + this.content.volume + '</button>');\r\n this.$sortButtonGroup.append(this.$sortByVolumeButton);\r\n this.$views = $('<div class=\"views\"></div>');\r\n this.$tabsContent.append(this.$views);\r\n this.$treeView = $('<div class=\"treeView\"></div>');\r\n this.$views.append(this.$treeView);\r\n this.$thumbsView = $('<div class=\"thumbsView\" tabindex=\"0\"></div>');\r\n this.$views.append(this.$thumbsView);\r\n this.$galleryView = $('<div class=\"galleryView\"></div>');\r\n this.$views.append(this.$galleryView);\r\n this.$treeSelect.hide();\r\n this.$treeSelect.change(function () {\r\n _this.databindTreeView();\r\n _this.selectCurrentTreeNode();\r\n _this.updateTreeTabBySelection();\r\n });\r\n this.$sortByDateButton.on('click', function () {\r\n _this.sortByDate();\r\n });\r\n this.$sortByVolumeButton.on('click', function () {\r\n _this.sortByVolume();\r\n });\r\n this.$treeViewOptions.hide();\r\n this.$treeButton.onPressed(function () {\r\n _this.openTreeView();\r\n });\r\n this.$thumbsButton.onPressed(function () {\r\n _this.openThumbsView();\r\n });\r\n this.setTitle(this.content.title);\r\n this.$sortByVolumeButton.addClass('on');\r\n var tabOrderConfig = this.options.tabOrder;\r\n if (tabOrderConfig) {\r\n // sort tabs\r\n tabOrderConfig = tabOrderConfig.toLowerCase();\r\n tabOrderConfig = tabOrderConfig.replace(/ /g, \"\");\r\n var tabOrder = tabOrderConfig.split(',');\r\n if (tabOrder[0] === 'thumbs') {\r\n this.$treeButton.before(this.$thumbsButton);\r\n this.$thumbsButton.addClass('first');\r\n }\r\n else {\r\n this.$treeButton.addClass('first');\r\n }\r\n }\r\n };\r\n ContentLeftPanel.prototype.createTreeView = function () {\r\n this.treeView = new TreeView_1.TreeView(this.$treeView);\r\n this.treeView.treeData = this.getTreeData();\r\n this.treeView.setup();\r\n this.databindTreeView();\r\n // populate the tree select drop down when there are multiple top-level ranges\r\n var topRanges = this.extension.helper.getTopRanges();\r\n if (topRanges.length > 1) {\r\n for (var i = 0; i < topRanges.length; i++) {\r\n var range = topRanges[i];\r\n this.$treeSelect.append('<option value=\"' + range.id + '\">' + manifesto_js_1.LanguageMap.getValue(range.getLabel()) + '</option>');\r\n }\r\n }\r\n this.updateTreeViewOptions();\r\n };\r\n ContentLeftPanel.prototype.databind = function () {\r\n this.databindThumbsView();\r\n this.databindTreeView();\r\n this.databindGalleryView();\r\n };\r\n ContentLeftPanel.prototype.updateTreeViewOptions = function () {\r\n var treeData = this.getTree();\r\n if (!treeData) {\r\n return;\r\n }\r\n if (this.isCollection() && this.extension.helper.treeHasNavDates(treeData)) {\r\n this.$treeViewOptions.show();\r\n }\r\n else {\r\n this.$treeViewOptions.hide();\r\n }\r\n if (this.$treeSelect.find('option').length) {\r\n this.$treeSelect.show();\r\n }\r\n else {\r\n this.$treeSelect.hide();\r\n }\r\n };\r\n ContentLeftPanel.prototype.sortByDate = function () {\r\n this.treeSortType = manifold_1.TreeSortType.DATE;\r\n this.treeView.treeData = this.getTreeData();\r\n this.treeView.databind();\r\n this.selectCurrentTreeNode();\r\n this.$sortByDateButton.addClass('on');\r\n this.$sortByVolumeButton.removeClass('on');\r\n this.resize();\r\n };\r\n ContentLeftPanel.prototype.sortByVolume = function () {\r\n this.treeSortType = manifold_1.TreeSortType.NONE;\r\n this.treeView.treeData = this.getTreeData();\r\n this.treeView.databind();\r\n this.selectCurrentTreeNode();\r\n this.$sortByDateButton.removeClass('on');\r\n this.$sortByVolumeButton.addClass('on');\r\n this.resize();\r\n };\r\n ContentLeftPanel.prototype.isCollection = function () {\r\n var treeData = this.getTree();\r\n if (treeData) {\r\n return treeData.data.type === manifesto_js_1.TreeNodeType.COLLECTION.toString();\r\n }\r\n throw new Error(\"Tree not available\");\r\n };\r\n ContentLeftPanel.prototype.databindTreeView = function () {\r\n if (!this.treeView)\r\n return;\r\n this.treeView.treeData = this.getTreeData();\r\n this.treeView.databind();\r\n this.selectCurrentTreeNode();\r\n };\r\n ContentLeftPanel.prototype.getTreeData = function () {\r\n return {\r\n autoExpand: this._isTreeAutoExpanded(),\r\n branchNodesExpandOnClick: Utils.Bools.getBool(this.config.options.branchNodesExpandOnClick, true),\r\n branchNodesSelectable: Utils.Bools.getBool(this.config.options.branchNodesSelectable, false),\r\n helper: this.extension.helper,\r\n topRangeIndex: this.getSelectedTopRangeIndex(),\r\n treeSortType: this.treeSortType\r\n };\r\n };\r\n ContentLeftPanel.prototype._isTreeAutoExpanded = function () {\r\n var autoExpandTreeEnabled = Utils.Bools.getBool(this.config.options.autoExpandTreeEnabled, false);\r\n var autoExpandTreeIfFewerThan = this.config.options.autoExpandTreeIfFewerThan || 0;\r\n if (autoExpandTreeEnabled) {\r\n // get total number of tree nodes\r\n var flatTree = this.extension.helper.getFlattenedTree();\r\n if (flatTree && flatTree.length < autoExpandTreeIfFewerThan) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n ContentLeftPanel.prototype.updateTreeTabByCanvasIndex = function () {\r\n // update tab to current top range label (if there is one)\r\n var topRanges = this.extension.helper.getTopRanges();\r\n if (topRanges.length > 1) {\r\n var index = this.getCurrentCanvasTopRangeIndex();\r\n if (index === -1) {\r\n return;\r\n }\r\n var currentRange = topRanges[index];\r\n this.setTreeTabTitle(manifesto_js_1.LanguageMap.getValue(currentRange.getLabel()));\r\n }\r\n else {\r\n this.setTreeTabTitle(this.content.index);\r\n }\r\n };\r\n ContentLeftPanel.prototype.setTreeTabTitle = function (title) {\r\n this.$treeButton.text(title);\r\n this.$treeButton.prop('title', title);\r\n };\r\n ContentLeftPanel.prototype.updateTreeTabBySelection = function () {\r\n var title = null;\r\n var topRanges = this.extension.helper.getTopRanges();\r\n if (topRanges.length > 1) {\r\n if (this.treeView) {\r\n title = this.getSelectedTree().text();\r\n }\r\n else {\r\n title = manifesto_js_1.LanguageMap.getValue(topRanges[0].getLabel());\r\n }\r\n }\r\n if (title) {\r\n this.setTreeTabTitle(title);\r\n }\r\n else {\r\n this.setTreeTabTitle(this.content.index);\r\n }\r\n };\r\n ContentLeftPanel.prototype.getViewingHint = function () {\r\n return this.extension.helper.getViewingHint();\r\n };\r\n ContentLeftPanel.prototype.getViewingDirection = function () {\r\n return this.extension.helper.getViewingDirection();\r\n };\r\n ContentLeftPanel.prototype.createThumbsView = function () {\r\n this.thumbsView = new ThumbsView_1.ThumbsView(this.$thumbsView);\r\n this.databindThumbsView();\r\n };\r\n ContentLeftPanel.prototype.databindThumbsView = function () {\r\n if (!this.thumbsView)\r\n return;\r\n var width;\r\n var height;\r\n var viewingHint = this.getViewingHint();\r\n var viewingDirection = this.getViewingDirection();\r\n if (viewingDirection && (viewingDirection.toString() === vocabulary_1.ViewingDirection.LEFT_TO_RIGHT.toString() || viewingDirection.toString() === vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString())) {\r\n width = this.config.options.twoColThumbWidth;\r\n height = this.config.options.twoColThumbHeight;\r\n }\r\n else if (viewingHint && viewingHint.toString() === vocabulary_1.ViewingHint.PAGED.toString()) {\r\n width = this.config.options.twoColThumbWidth;\r\n height = this.config.options.twoColThumbHeight;\r\n }\r\n else {\r\n width = this.config.options.oneColThumbWidth;\r\n height = this.config.options.oneColThumbHeight;\r\n }\r\n var thumbs = this.extension.helper.getThumbs(width, height);\r\n if (viewingDirection && viewingDirection.toString() === vocabulary_1.ViewingDirection.BOTTOM_TO_TOP.toString()) {\r\n thumbs.reverse();\r\n }\r\n // add a search result icon for pages with results\r\n var searchResults = this.extension.annotations;\r\n if (searchResults && searchResults.length) {\r\n var _loop_1 = function (i) {\r\n var searchResult = searchResults[i];\r\n // find the thumb with the same canvasIndex and add the searchResult\r\n var thumb = thumbs.en().where(function (t) { return t.index === searchResult.canvasIndex; }).first();\r\n if (thumb) {\r\n // clone the data so searchResults isn't persisted on the canvas.\r\n var data = $.extend(true, {}, thumb.data);\r\n data.searchResults = searchResult.rects.length;\r\n thumb.data = data;\r\n }\r\n };\r\n for (var i = 0; i < searchResults.length; i++) {\r\n _loop_1(i);\r\n }\r\n }\r\n this.thumbsView.thumbs = thumbs;\r\n this.thumbsView.databind();\r\n };\r\n ContentLeftPanel.prototype.createGalleryView = function () {\r\n this.galleryView = new GalleryView_1.GalleryView(this.$galleryView);\r\n this.galleryView.galleryData = this.getGalleryData();\r\n this.galleryView.setup();\r\n this.databindGalleryView();\r\n };\r\n ContentLeftPanel.prototype.databindGalleryView = function () {\r\n if (!this.galleryView)\r\n return;\r\n this.galleryView.galleryData = this.getGalleryData();\r\n this.galleryView.databind();\r\n };\r\n ContentLeftPanel.prototype.getGalleryData = function () {\r\n return {\r\n helper: this.extension.helper,\r\n chunkedResizingThreshold: this.config.options.galleryThumbChunkedResizingThreshold,\r\n content: this.config.content,\r\n debug: false,\r\n imageFadeInDuration: 300,\r\n initialZoom: 6,\r\n minLabelWidth: 20,\r\n pageModeEnabled: this.isPageModeEnabled(),\r\n scrollStopDuration: 100,\r\n searchResults: this.extension.annotations,\r\n sizingEnabled: Modernizr.inputtypes.range,\r\n thumbHeight: this.config.options.galleryThumbHeight,\r\n thumbLoadPadding: this.config.options.galleryThumbLoadPadding,\r\n thumbWidth: this.config.options.galleryThumbWidth,\r\n viewingDirection: this.getViewingDirection()\r\n };\r\n };\r\n ContentLeftPanel.prototype.isPageModeEnabled = function () {\r\n // todo: checks if the panel is being used in the openseadragon extension.\r\n // pass a `isPageModeEnabled` function to the panel's constructor instead?\r\n if (typeof this.extension.getMode === \"function\") {\r\n return Utils.Bools.getBool(this.config.options.pageModeEnabled, true) && this.extension.getMode().toString() === Mode_1.Mode.page.toString();\r\n }\r\n return Utils.Bools.getBool(this.config.options.pageModeEnabled, true);\r\n };\r\n ContentLeftPanel.prototype.getSelectedTree = function () {\r\n return this.$treeSelect.find(':selected');\r\n };\r\n ContentLeftPanel.prototype.getSelectedTopRangeIndex = function () {\r\n var topRangeIndex = this.getSelectedTree().index();\r\n if (topRangeIndex === -1) {\r\n topRangeIndex = 0;\r\n }\r\n return topRangeIndex;\r\n };\r\n ContentLeftPanel.prototype.getTree = function () {\r\n var topRangeIndex = this.getSelectedTopRangeIndex();\r\n return this.extension.helper.getTree(topRangeIndex, manifold_1.TreeSortType.NONE);\r\n };\r\n ContentLeftPanel.prototype.toggleFinish = function () {\r\n _super.prototype.toggleFinish.call(this);\r\n if (this.isUnopened) {\r\n var treeEnabled = Utils.Bools.getBool(this.config.options.treeEnabled, true);\r\n var thumbsEnabled = Utils.Bools.getBool(this.config.options.thumbsEnabled, true);\r\n var treeData = this.getTree();\r\n if (!treeData || !treeData.nodes.length) {\r\n treeEnabled = false;\r\n }\r\n // hide the tabs if either tree or thumbs are disabled\r\n if (!treeEnabled || !thumbsEnabled)\r\n this.$tabs.hide();\r\n if (thumbsEnabled && this.defaultToThumbsView()) {\r\n this.openThumbsView();\r\n }\r\n else if (treeEnabled) {\r\n this.openTreeView();\r\n }\r\n }\r\n };\r\n ContentLeftPanel.prototype.defaultToThumbsView = function () {\r\n var defaultToTreeEnabled = Utils.Bools.getBool(this.config.options.defaultToTreeEnabled, false);\r\n var defaultToTreeIfGreaterThan = this.config.options.defaultToTreeIfGreaterThan || 0;\r\n var treeData = this.getTree();\r\n if (defaultToTreeEnabled) {\r\n if (treeData && treeData.nodes.length > defaultToTreeIfGreaterThan) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n ContentLeftPanel.prototype.expandFullStart = function () {\r\n _super.prototype.expandFullStart.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_START);\r\n };\r\n ContentLeftPanel.prototype.expandFullFinish = function () {\r\n _super.prototype.expandFullFinish.call(this);\r\n if (this.$treeButton.hasClass('on')) {\r\n this.openTreeView();\r\n }\r\n else if (this.$thumbsButton.hasClass('on')) {\r\n this.openThumbsView();\r\n }\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_FINISH);\r\n };\r\n ContentLeftPanel.prototype.collapseFullStart = function () {\r\n _super.prototype.collapseFullStart.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_START);\r\n };\r\n ContentLeftPanel.prototype.collapseFullFinish = function () {\r\n _super.prototype.collapseFullFinish.call(this);\r\n // todo: write a more generic tabs system with base tab class.\r\n // thumbsView may not necessarily have been created yet.\r\n // replace thumbsView with galleryView.\r\n if (this.$thumbsButton.hasClass('on')) {\r\n this.openThumbsView();\r\n }\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_FINISH);\r\n };\r\n ContentLeftPanel.prototype.openTreeView = function () {\r\n this.isTreeViewOpen = true;\r\n this.isThumbsViewOpen = false;\r\n if (!this.treeView) {\r\n this.createTreeView();\r\n }\r\n this.$treeButton.addClass('on');\r\n this.$thumbsButton.removeClass('on');\r\n this.treeView.show();\r\n if (this.thumbsView)\r\n this.thumbsView.hide();\r\n if (this.galleryView)\r\n this.galleryView.hide();\r\n this.updateTreeViewOptions();\r\n this.selectCurrentTreeNode();\r\n this.resize();\r\n this.treeView.resize();\r\n this.component.publish(BaseEvents_1.BaseEvents.OPEN_TREE_VIEW);\r\n };\r\n ContentLeftPanel.prototype.openThumbsView = function () {\r\n this.isTreeViewOpen = false;\r\n this.isThumbsViewOpen = true;\r\n if (!this.thumbsView) {\r\n this.createThumbsView();\r\n }\r\n if (this.isFullyExpanded && !this.galleryView) {\r\n this.createGalleryView();\r\n }\r\n this.$treeButton.removeClass('on');\r\n this.$thumbsButton.addClass('on');\r\n if (this.treeView)\r\n this.treeView.hide();\r\n this.$treeSelect.hide();\r\n this.$treeViewOptions.hide();\r\n this.resize();\r\n if (this.isFullyExpanded) {\r\n this.thumbsView.hide();\r\n if (this.galleryView)\r\n this.galleryView.show();\r\n if (this.galleryView)\r\n this.galleryView.resize();\r\n }\r\n else {\r\n if (this.galleryView)\r\n this.galleryView.hide();\r\n this.thumbsView.show();\r\n this.thumbsView.resize();\r\n }\r\n this.component.publish(BaseEvents_1.BaseEvents.OPEN_THUMBS_VIEW);\r\n };\r\n ContentLeftPanel.prototype.selectTopRangeIndex = function (index) {\r\n this.$treeSelect.prop('selectedIndex', index);\r\n };\r\n ContentLeftPanel.prototype.getCurrentCanvasTopRangeIndex = function () {\r\n var topRangeIndex = -1;\r\n var range = this.extension.getCurrentCanvasRange();\r\n if (range) {\r\n topRangeIndex = Number(range.path.split('/')[0]);\r\n }\r\n return topRangeIndex;\r\n };\r\n ContentLeftPanel.prototype.selectCurrentTreeNode = function () {\r\n // todo: merge selectCurrentTreeNodeByCanvas and selectCurrentTreeNodeByRange\r\n // the openseadragon extension should keep track of the current range instead of using canvas index\r\n if (this.extension.name === 'uv-seadragon-extension') {\r\n this.selectCurrentTreeNodeByCanvas();\r\n }\r\n else {\r\n this.selectCurrentTreeNodeByRange();\r\n }\r\n };\r\n ContentLeftPanel.prototype.selectCurrentTreeNodeByRange = function () {\r\n if (this.treeView) {\r\n var range = this.extension.helper.getCurrentRange();\r\n var node = null;\r\n if (range && range.treeNode) {\r\n node = this.treeView.getNodeById(range.treeNode.id);\r\n }\r\n if (node) {\r\n this.treeView.selectNode(node);\r\n }\r\n else {\r\n this.selectTreeNodeByManifest();\r\n }\r\n }\r\n };\r\n ContentLeftPanel.prototype.selectCurrentTreeNodeByCanvas = function () {\r\n if (this.treeView) {\r\n var node = null;\r\n var currentCanvasTopRangeIndex = this.getCurrentCanvasTopRangeIndex();\r\n var selectedTopRangeIndex = this.getSelectedTopRangeIndex();\r\n var usingCorrectTree = currentCanvasTopRangeIndex === selectedTopRangeIndex;\r\n var range = null;\r\n if (currentCanvasTopRangeIndex !== -1) {\r\n range = this.extension.getCurrentCanvasRange();\r\n //range = this.extension.helper.getCurrentRange();\r\n if (range && range.treeNode) {\r\n node = this.treeView.getNodeById(range.treeNode.id);\r\n }\r\n }\r\n // use manifest root node\r\n // if (!node){\r\n // id = this.extension.helper.manifest.defaultTree.id;\r\n // node = this.treeView.getNodeById(id);\r\n // }\r\n if (node && usingCorrectTree) {\r\n this.treeView.selectNode(node);\r\n }\r\n else {\r\n range = this.extension.helper.getCurrentRange();\r\n if (range && range.treeNode) {\r\n node = this.treeView.getNodeById(range.treeNode.id);\r\n }\r\n if (node) {\r\n this.treeView.selectNode(node);\r\n }\r\n else {\r\n this.selectTreeNodeByManifest();\r\n }\r\n }\r\n }\r\n };\r\n // fall through to this is there's no current range or canvas\r\n ContentLeftPanel.prototype.selectTreeNodeByManifest = function () {\r\n var _this = this;\r\n var collectionIndex = this.extension.helper.collectionIndex;\r\n var manifestIndex = this.extension.helper.manifestIndex;\r\n var allNodes = this.treeView.getAllNodes();\r\n var nodeFound = false;\r\n allNodes.map(function (node) {\r\n if (node.isCollection() && node.data.index === collectionIndex) {\r\n _this.treeView.selectNode(node);\r\n _this.treeView.expandNode(node, true);\r\n nodeFound = true;\r\n }\r\n if (node.isManifest() && node.data.index === manifestIndex) {\r\n _this.treeView.selectNode(node);\r\n nodeFound = true;\r\n }\r\n });\r\n if (!nodeFound) {\r\n this.treeView.deselectCurrentNode();\r\n }\r\n };\r\n ContentLeftPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$tabsContent.height(this.$main.height() - (this.$tabs.is(':visible') ? this.$tabs.height() : 0) - this.$tabsContent.verticalPadding());\r\n this.$views.height(this.$tabsContent.height() - this.$options.outerHeight());\r\n };\r\n return ContentLeftPanel;\r\n }(LeftPanel_1.LeftPanel));\r\n exports.ContentLeftPanel = ContentLeftPanel;\r\n});\r\n//# sourceMappingURL=ContentLeftPanel.js.map\n", "define('modules/uv-shared-module/DownloadOption',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var DownloadOption;\r\n (function (DownloadOption) {\r\n DownloadOption[\"CANVAS_RENDERINGS\"] = \"canvasRenderings\";\r\n DownloadOption[\"CURRENT_VIEW\"] = \"currentView\";\r\n DownloadOption[\"ENTIRE_DOCUMENT_AS_PDF\"] = \"entireDocumentAsPdf\";\r\n DownloadOption[\"ENTIRE_DOCUMENT_AS_TEXT\"] = \"entireDocumentAsText\";\r\n DownloadOption[\"ENTIRE_FILE_AS_ORIGINAL\"] = \"entireFileAsOriginal\";\r\n DownloadOption[\"IMAGE_RENDERINGS\"] = \"imageRenderings\";\r\n DownloadOption[\"MANIFEST_RENDERINGS\"] = \"manifestRenderings\";\r\n DownloadOption[\"RANGE_RENDERINGS\"] = \"rangeRenderings\";\r\n DownloadOption[\"SELECTION\"] = \"selection\";\r\n //SEQUENCE_RENDERINGS = \"sequenceRenderings\",\r\n DownloadOption[\"UNKNOWN\"] = \"unknown\";\r\n DownloadOption[\"WHOLE_IMAGE_HIGH_RES\"] = \"wholeImageHighRes\";\r\n DownloadOption[\"WHOLE_IMAGE_LOW_RES\"] = \"wholeImageLowRes\";\r\n DownloadOption[\"WHOLE_IMAGES_HIGH_RES\"] = \"wholeImagesHighRes\";\r\n })(DownloadOption = exports.DownloadOption || (exports.DownloadOption = {}));\r\n});\r\n//# sourceMappingURL=DownloadOption.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/DownloadDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\", \"../uv-shared-module/DownloadOption\", \"manifesto.js\"], function (require, exports, BaseEvents_1, Dialogue_1, DownloadOption_1, manifesto_js_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var DownloadDialogue = /** @class */ (function (_super) {\r\n __extends(DownloadDialogue, _super);\r\n function DownloadDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n DownloadDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('downloadDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_DOWNLOAD_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_DOWNLOAD_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function (triggerButton) {\r\n _this.open(triggerButton);\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n // create ui.\r\n this.$title = $('<h1>' + this.content.title + '</h1>');\r\n this.$content.append(this.$title);\r\n this.$noneAvailable = $('<div class=\"noneAvailable\">' + this.content.noneAvailable + '</div>');\r\n this.$content.append(this.$noneAvailable);\r\n this.$downloadOptions = $('<ol class=\"options\"></ol>');\r\n this.$content.append(this.$downloadOptions);\r\n this.$footer = $('<div class=\"footer\"></div>');\r\n this.$content.append(this.$footer);\r\n this.$termsOfUseButton = $('<a href=\"#\">' + this.extension.data.config.content.termsOfUse + '</a>');\r\n this.$footer.append(this.$termsOfUseButton);\r\n this.$termsOfUseButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.SHOW_TERMS_OF_USE);\r\n });\r\n // hide\r\n this.$element.hide();\r\n this.updateTermsOfUseButton();\r\n };\r\n DownloadDialogue.prototype.addEntireFileDownloadOptions = function () {\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.ENTIRE_FILE_AS_ORIGINAL)) {\r\n this.$downloadOptions.empty();\r\n // \r\n // add each file src\r\n var canvas = this.extension.helper.getCurrentCanvas();\r\n var renderingFound = false;\r\n var renderings = canvas.getRenderings();\r\n for (var i = 0; i < renderings.length; i++) {\r\n var rendering = renderings[i];\r\n var renderingFormat = rendering.getFormat();\r\n var format = '';\r\n if (renderingFormat) {\r\n format = renderingFormat.toString();\r\n }\r\n this.addEntireFileDownloadOption(rendering.id, manifesto_js_1.LanguageMap.getValue(rendering.getLabel()), format);\r\n renderingFound = true;\r\n }\r\n if (!renderingFound) {\r\n var annotationFound = false;\r\n var annotations = canvas.getContent();\r\n for (var i = 0; i < annotations.length; i++) {\r\n var annotation = annotations[i];\r\n var body = annotation.getBody();\r\n if (body.length) {\r\n var format = body[0].getFormat();\r\n if (format) {\r\n this.addEntireFileDownloadOption(body[0].id, '', format.toString());\r\n annotationFound = true;\r\n }\r\n }\r\n }\r\n if (!annotationFound) {\r\n this.addEntireFileDownloadOption(canvas.id, '', '');\r\n }\r\n }\r\n }\r\n };\r\n DownloadDialogue.prototype.addEntireFileDownloadOption = function (uri, label, format) {\r\n var fileType;\r\n if (format) {\r\n fileType = Utils.Files.simplifyMimeType(format);\r\n }\r\n else {\r\n fileType = this.getFileExtension(uri);\r\n }\r\n if (!label) {\r\n label = this.content.entireFileAsOriginal;\r\n }\r\n if (fileType) {\r\n label += \" (\" + fileType + \")\";\r\n }\r\n this.$downloadOptions.append('<li><a href=\"' + uri + '\" target=\"_blank\" download tabindex=\"0\">' + label + '</li>');\r\n };\r\n DownloadDialogue.prototype.resetDynamicDownloadOptions = function () {\r\n this.renderingUrls = [];\r\n this.renderingUrlsCount = 0;\r\n this.$downloadOptions.find('li.dynamic').remove();\r\n };\r\n DownloadDialogue.prototype.getDownloadOptionsForRenderings = function (resource, defaultLabel, type) {\r\n var downloadOptions = [];\r\n if (!resource) {\r\n return downloadOptions;\r\n }\r\n var renderings = resource.getRenderings();\r\n for (var i = 0; i < renderings.length; i++) {\r\n var rendering = renderings[i];\r\n if (rendering) {\r\n var label = manifesto_js_1.LanguageMap.getValue(rendering.getLabel(), this.extension.getLocale());\r\n var currentId = \"downloadOption\" + ++this.renderingUrlsCount;\r\n if (label) {\r\n label += \" ({0})\";\r\n }\r\n else {\r\n label = defaultLabel;\r\n }\r\n var mime = Utils.Files.simplifyMimeType(rendering.getFormat().toString());\r\n label = Utils.Strings.format(label, mime);\r\n this.renderingUrls[currentId] = rendering.id;\r\n var $button = $('<li class=\"option dynamic\"><input id=\"' + currentId + '\" data-mime=\"' + mime + '\" title=\"' + label + '\" type=\"radio\" name=\"downloadOptions\" tabindex=\"0\" /><label for=\"' + currentId + '\">' + label + '</label></li>');\r\n downloadOptions.push({\r\n type: type,\r\n button: $button\r\n });\r\n }\r\n }\r\n return downloadOptions;\r\n };\r\n DownloadDialogue.prototype.getSelectedOption = function () {\r\n return this.$downloadOptions.find(\"li.option input:checked\");\r\n };\r\n DownloadDialogue.prototype.getCurrentResourceId = function () {\r\n var canvas = this.extension.helper.getCurrentCanvas();\r\n return canvas.externalResource.data.id;\r\n };\r\n DownloadDialogue.prototype.getCurrentResourceFormat = function () {\r\n var id = this.getCurrentResourceId();\r\n return id.substr(id.lastIndexOf('.') + 1).toLowerCase();\r\n };\r\n DownloadDialogue.prototype.updateNoneAvailable = function () {\r\n if (!this.$downloadOptions.find('li:visible').length) {\r\n this.$noneAvailable.show();\r\n }\r\n else {\r\n // select first option.\r\n this.$noneAvailable.hide();\r\n }\r\n };\r\n DownloadDialogue.prototype.updateTermsOfUseButton = function () {\r\n var requiredStatement = this.extension.helper.getRequiredStatement();\r\n if (Utils.Bools.getBool(this.extension.data.config.options.termsOfUseEnabled, false) && requiredStatement && requiredStatement.value) {\r\n this.$termsOfUseButton.show();\r\n }\r\n else {\r\n this.$termsOfUseButton.hide();\r\n }\r\n };\r\n DownloadDialogue.prototype.getFileExtension = function (fileUri) {\r\n var extension = fileUri.split('.').pop();\r\n // if it's not a valid file extension\r\n if (extension.length > 5 || extension.indexOf('/') !== -1) {\r\n return null;\r\n }\r\n return extension;\r\n };\r\n DownloadDialogue.prototype.isMediaDownloadEnabled = function () {\r\n return this.extension.helper.isUIEnabled('mediaDownload');\r\n };\r\n DownloadDialogue.prototype.isDownloadOptionAvailable = function (option) {\r\n switch (option) {\r\n case DownloadOption_1.DownloadOption.ENTIRE_FILE_AS_ORIGINAL:\r\n return this.isMediaDownloadEnabled();\r\n }\r\n return true;\r\n };\r\n DownloadDialogue.prototype.close = function () {\r\n _super.prototype.close.call(this);\r\n };\r\n DownloadDialogue.prototype.resize = function () {\r\n this.setDockedPosition();\r\n };\r\n return DownloadDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.DownloadDialogue = DownloadDialogue;\r\n});\r\n//# sourceMappingURL=DownloadDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-av-extension/DownloadDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/DownloadDialogue\", \"../../modules/uv-shared-module/DownloadOption\", \"../../modules/uv-shared-module/BaseEvents\"], function (require, exports, DownloadDialogue_1, DownloadOption_1, BaseEvents_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var DownloadDialogue = /** @class */ (function (_super) {\r\n __extends(DownloadDialogue, _super);\r\n function DownloadDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n DownloadDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('downloadDialogue');\r\n _super.prototype.create.call(this);\r\n this.$entireFileAsOriginal = $('<li class=\"option single\"><input id=\"' + DownloadOption_1.DownloadOption.ENTIRE_FILE_AS_ORIGINAL + '\" type=\"radio\" name=\"downloadOptions\" tabindex=\"0\" /><label id=\"' + DownloadOption_1.DownloadOption.ENTIRE_FILE_AS_ORIGINAL + 'label\" for=\"' + DownloadOption_1.DownloadOption.ENTIRE_FILE_AS_ORIGINAL + '\"></label></li>');\r\n this.$downloadOptions.append(this.$entireFileAsOriginal);\r\n this.$entireFileAsOriginal.hide();\r\n this.$downloadButton = $('<a class=\"btn btn-primary\" href=\"#\" tabindex=\"0\">' + this.content.download + '</a>');\r\n this.$buttons.prepend(this.$downloadButton);\r\n this.$imageOptionsContainer = $('<li class=\"group image\"></li>');\r\n this.$imageOptions = $('<ul></ul>');\r\n this.$imageOptionsContainer.append(this.$imageOptions);\r\n this.$canvasOptionsContainer = $('<li class=\"group canvas\"></li>');\r\n this.$canvasOptions = $('<ul></ul>');\r\n this.$canvasOptionsContainer.append(this.$canvasOptions);\r\n this.$manifestOptionsContainer = $('<li class=\"group manifest\"></li>');\r\n this.$manifestOptions = $('<ul></ul>');\r\n this.$manifestOptionsContainer.append(this.$manifestOptions);\r\n var that = this;\r\n this.$downloadButton.on('click', function (e) {\r\n e.preventDefault();\r\n var $selectedOption = that.getSelectedOption();\r\n var id = $selectedOption.attr('id');\r\n var label = $selectedOption.attr('title');\r\n var type = DownloadOption_1.DownloadOption.UNKNOWN;\r\n if (_this.renderingUrls[id]) {\r\n window.open(_this.renderingUrls[id]);\r\n }\r\n else {\r\n var id_1 = _this.getCurrentResourceId();\r\n window.open(id_1);\r\n }\r\n _this.component.publish(BaseEvents_1.BaseEvents.DOWNLOAD, {\r\n \"type\": type,\r\n \"label\": label\r\n });\r\n _this.close();\r\n });\r\n };\r\n DownloadDialogue.prototype._isAdaptive = function () {\r\n var format = this.getCurrentResourceFormat();\r\n return format === 'mpd' || format === 'm3u8';\r\n };\r\n DownloadDialogue.prototype.open = function (triggerButton) {\r\n _super.prototype.open.call(this, triggerButton);\r\n var canvas = this.extension.helper.getCurrentCanvas();\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.ENTIRE_FILE_AS_ORIGINAL) && !this._isAdaptive()) {\r\n var $input = this.$entireFileAsOriginal.find('input');\r\n var $label = this.$entireFileAsOriginal.find('label');\r\n var label = Utils.Strings.format(this.content.entireFileAsOriginalWithFormat, this.getCurrentResourceFormat());\r\n $label.text(label);\r\n $input.prop('title', label);\r\n this.$entireFileAsOriginal.show();\r\n }\r\n this.resetDynamicDownloadOptions();\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.RANGE_RENDERINGS)) {\r\n if (canvas.ranges && canvas.ranges.length) {\r\n for (var i = 0; i < canvas.ranges.length; i++) {\r\n var range = canvas.ranges[i];\r\n var renderingOptions = this.getDownloadOptionsForRenderings(range, this.content.entireFileAsOriginal, DownloadOption_1.DownloadOption.CANVAS_RENDERINGS);\r\n this.addDownloadOptionsForRenderings(renderingOptions);\r\n }\r\n }\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.IMAGE_RENDERINGS)) {\r\n var images = canvas.getImages();\r\n if (images.length) {\r\n this.$downloadOptions.append(this.$imageOptionsContainer);\r\n }\r\n for (var i = 0; i < images.length; i++) {\r\n var renderingOptions = this.getDownloadOptionsForRenderings(images[i].getResource(), this.content.entireFileAsOriginal, DownloadOption_1.DownloadOption.IMAGE_RENDERINGS);\r\n this.addDownloadOptionsForRenderings(renderingOptions);\r\n }\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.CANVAS_RENDERINGS)) {\r\n var renderingOptions = this.getDownloadOptionsForRenderings(canvas, this.content.entireFileAsOriginal, DownloadOption_1.DownloadOption.CANVAS_RENDERINGS);\r\n if (renderingOptions.length) {\r\n this.$downloadOptions.append(this.$canvasOptionsContainer);\r\n this.addDownloadOptionsForRenderings(renderingOptions);\r\n }\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.MANIFEST_RENDERINGS)) {\r\n var renderingOptions = this.getDownloadOptionsForRenderings(this.extension.helper.getCurrentSequence(), this.content.entireDocument, DownloadOption_1.DownloadOption.MANIFEST_RENDERINGS);\r\n if (!renderingOptions.length) {\r\n renderingOptions = this.getDownloadOptionsForRenderings(this.extension.helper.manifest, this.content.entireDocument, DownloadOption_1.DownloadOption.MANIFEST_RENDERINGS);\r\n }\r\n if (renderingOptions.length) {\r\n this.$downloadOptions.append(this.$manifestOptionsContainer);\r\n this.addDownloadOptionsForRenderings(renderingOptions);\r\n }\r\n }\r\n if (this.$downloadOptions.length) {\r\n this.$entireFileAsOriginal.hide();\r\n }\r\n if (!this.$downloadOptions.find('li.option:visible').length) {\r\n this.$noneAvailable.show();\r\n this.$downloadButton.hide();\r\n }\r\n else {\r\n // select first option.\r\n this.$downloadOptions.find('li.option input:visible:first').prop('checked', true);\r\n this.$noneAvailable.hide();\r\n this.$downloadButton.show();\r\n }\r\n this.resize();\r\n };\r\n DownloadDialogue.prototype.addDownloadOptionsForRenderings = function (renderingOptions) {\r\n var _this = this;\r\n renderingOptions.forEach(function (option) {\r\n switch (option.type) {\r\n case DownloadOption_1.DownloadOption.IMAGE_RENDERINGS:\r\n _this.$imageOptions.append(option.button);\r\n break;\r\n case DownloadOption_1.DownloadOption.CANVAS_RENDERINGS:\r\n _this.$canvasOptions.append(option.button);\r\n break;\r\n case DownloadOption_1.DownloadOption.MANIFEST_RENDERINGS:\r\n _this.$manifestOptions.append(option.button);\r\n break;\r\n }\r\n });\r\n };\r\n DownloadDialogue.prototype.isDownloadOptionAvailable = function (option) {\r\n return this.isMediaDownloadEnabled();\r\n };\r\n return DownloadDialogue;\r\n }(DownloadDialogue_1.DownloadDialogue));\r\n exports.DownloadDialogue = DownloadDialogue;\r\n});\r\n//# sourceMappingURL=DownloadDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/FooterPanel',[\"require\", \"exports\", \"./BaseEvents\", \"./BaseView\"], function (require, exports, BaseEvents_1, BaseView_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var FooterPanel = /** @class */ (function (_super) {\r\n __extends(FooterPanel, _super);\r\n function FooterPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n FooterPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('footerPanel');\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN, function () {\r\n _this.updateFullScreenButton();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.METRIC_CHANGED, function () {\r\n _this.updateMinimisedButtons();\r\n _this.updateMoreInfoButton();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SETTINGS_CHANGED, function () {\r\n _this.updateDownloadButton();\r\n });\r\n this.$options = $('<div class=\"options\"></div>');\r\n this.$element.append(this.$options);\r\n this.$feedbackButton = $(\"\\n <button class=\\\"feedback btn imageBtn\\\" title=\\\"\" + this.content.feedback + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon uv-icon-feedback\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.feedback + \"\\n </button>\\n \");\r\n this.$options.prepend(this.$feedbackButton);\r\n this.$openButton = $(\"\\n <button class=\\\"open btn imageBtn\\\" title=\\\"\" + this.content.open + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon-open\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.open + \"\\n </button>\\n \");\r\n this.$options.prepend(this.$openButton);\r\n this.$bookmarkButton = $(\"\\n <button class=\\\"bookmark btn imageBtn\\\" title=\\\"\" + this.content.bookmark + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon uv-icon-bookmark\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.bookmark + \"\\n </button>\\n \");\r\n this.$options.prepend(this.$bookmarkButton);\r\n this.$shareButton = $(\"\\n <button class=\\\"share btn imageBtn\\\" title=\\\"\" + this.content.share + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon uv-icon-share\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.share + \"\\n </button>\\n \");\r\n this.$options.append(this.$shareButton);\r\n this.$embedButton = $(\"\\n <button class=\\\"embed btn imageBtn\\\" title=\\\"\" + this.content.embed + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon uv-icon-embed\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.embed + \"\\n </button>\\n \");\r\n this.$options.append(this.$embedButton);\r\n this.$downloadButton = $(\"\\n <button class=\\\"download btn imageBtn\\\" title=\\\"\" + this.content.download + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon uv-icon-download\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.download + \"\\n </button>\\n \");\r\n this.$options.prepend(this.$downloadButton);\r\n this.$moreInfoButton = $(\"\\n <button class=\\\"moreInfo btn imageBtn\\\" title=\\\"\" + this.content.moreInfo + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon uv-icon-more-info\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.moreInfo + \"\\n </button>\\n \");\r\n this.$options.prepend(this.$moreInfoButton);\r\n this.$fullScreenBtn = $(\"\\n <button class=\\\"fullScreen btn imageBtn\\\" title=\\\"\" + this.content.fullScreen + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon uv-icon-fullscreen\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.fullScreen + \"\\n </button>\\n \");\r\n this.$options.append(this.$fullScreenBtn);\r\n this.$openButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.OPEN);\r\n });\r\n this.$feedbackButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.FEEDBACK);\r\n });\r\n this.$bookmarkButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.BOOKMARK);\r\n });\r\n this.$shareButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.SHOW_SHARE_DIALOGUE, _this.$shareButton);\r\n });\r\n this.$embedButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.SHOW_EMBED_DIALOGUE, _this.$embedButton);\r\n });\r\n this.$downloadButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.SHOW_DOWNLOAD_DIALOGUE, _this.$downloadButton);\r\n });\r\n this.$moreInfoButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.SHOW_MOREINFO_DIALOGUE, _this.$moreInfoButton);\r\n });\r\n this.$fullScreenBtn.on('click', function (e) {\r\n e.preventDefault();\r\n _this.component.publish(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN);\r\n });\r\n if (!Utils.Bools.getBool(this.options.embedEnabled, true)) {\r\n this.$embedButton.hide();\r\n }\r\n this.updateMoreInfoButton();\r\n this.updateOpenButton();\r\n this.updateFeedbackButton();\r\n this.updateBookmarkButton();\r\n this.updateEmbedButton();\r\n this.updateDownloadButton();\r\n this.updateFullScreenButton();\r\n this.updateShareButton();\r\n this.updateMinimisedButtons();\r\n };\r\n FooterPanel.prototype.updateMinimisedButtons = function () {\r\n // if configured to always minimise buttons\r\n if (Utils.Bools.getBool(this.options.minimiseButtons, false)) {\r\n this.$options.addClass('minimiseButtons');\r\n return;\r\n }\r\n // otherwise, check metric\r\n if (!this.extension.isDesktopMetric()) {\r\n this.$options.addClass('minimiseButtons');\r\n }\r\n else {\r\n this.$options.removeClass('minimiseButtons');\r\n }\r\n };\r\n FooterPanel.prototype.updateMoreInfoButton = function () {\r\n var configEnabled = Utils.Bools.getBool(this.options.moreInfoEnabled, false);\r\n if (configEnabled && !this.extension.isDesktopMetric() && !this.extension.isCatchAllMetric()) {\r\n this.$moreInfoButton.show();\r\n }\r\n else {\r\n this.$moreInfoButton.hide();\r\n }\r\n };\r\n FooterPanel.prototype.updateOpenButton = function () {\r\n var configEnabled = Utils.Bools.getBool(this.options.openEnabled, false);\r\n if (configEnabled && Utils.Documents.isInIFrame()) {\r\n this.$openButton.show();\r\n }\r\n else {\r\n this.$openButton.hide();\r\n }\r\n };\r\n FooterPanel.prototype.updateFullScreenButton = function () {\r\n if (!Utils.Bools.getBool(this.options.fullscreenEnabled, true) || !Utils.Documents.supportsFullscreen()) {\r\n this.$fullScreenBtn.hide();\r\n return;\r\n }\r\n if (this.extension.data.isLightbox) {\r\n this.$fullScreenBtn.addClass('lightbox');\r\n }\r\n if (this.extension.isFullScreen()) {\r\n this.$fullScreenBtn.switchClass('fullScreen', 'exitFullscreen');\r\n this.$fullScreenBtn.find('i').switchClass('uv-icon-fullscreen', 'uv-icon-exit-fullscreen');\r\n this.$fullScreenBtn.attr('title', this.content.exitFullScreen);\r\n $(this.$fullScreenBtn[0].firstChild.nextSibling.nextSibling).replaceWith(this.content.exitFullScreen);\r\n }\r\n else {\r\n this.$fullScreenBtn.switchClass('exitFullscreen', 'fullScreen');\r\n this.$fullScreenBtn.find('i').switchClass('uv-icon-exit-fullscreen', 'uv-icon-fullscreen');\r\n this.$fullScreenBtn.attr('title', this.content.fullScreen);\r\n $(this.$fullScreenBtn[0].firstChild.nextSibling.nextSibling).replaceWith(this.content.fullScreen);\r\n }\r\n };\r\n FooterPanel.prototype.updateEmbedButton = function () {\r\n if (this.extension.helper.isUIEnabled('embed') && Utils.Bools.getBool(this.options.embedEnabled, false)) {\r\n // current jquery version sets display to 'inline' in mobile version, while this should remain hidden (see media query)\r\n if (!this.extension.isMobile()) {\r\n this.$embedButton.show();\r\n }\r\n }\r\n else {\r\n this.$embedButton.hide();\r\n }\r\n };\r\n FooterPanel.prototype.updateShareButton = function () {\r\n if (this.extension.helper.isUIEnabled('share') && Utils.Bools.getBool(this.options.shareEnabled, true)) {\r\n this.$shareButton.show();\r\n }\r\n else {\r\n this.$shareButton.hide();\r\n }\r\n };\r\n FooterPanel.prototype.updateDownloadButton = function () {\r\n var configEnabled = Utils.Bools.getBool(this.options.downloadEnabled, true);\r\n if (configEnabled) {\r\n this.$downloadButton.show();\r\n }\r\n else {\r\n this.$downloadButton.hide();\r\n }\r\n };\r\n FooterPanel.prototype.updateFeedbackButton = function () {\r\n var configEnabled = Utils.Bools.getBool(this.options.feedbackEnabled, false);\r\n if (configEnabled) {\r\n this.$feedbackButton.show();\r\n }\r\n else {\r\n this.$feedbackButton.hide();\r\n }\r\n };\r\n FooterPanel.prototype.updateBookmarkButton = function () {\r\n var configEnabled = Utils.Bools.getBool(this.options.bookmarkEnabled, false);\r\n if (configEnabled) {\r\n this.$bookmarkButton.show();\r\n }\r\n else {\r\n this.$bookmarkButton.hide();\r\n }\r\n };\r\n FooterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return FooterPanel;\r\n }(BaseView_1.BaseView));\r\n exports.FooterPanel = FooterPanel;\r\n});\r\n//# sourceMappingURL=FooterPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-avmobilefooterpanel-module/MobileFooter',[\"require\", \"exports\", \"../uv-shared-module/FooterPanel\"], function (require, exports, FooterPanel_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var FooterPanel = /** @class */ (function (_super) {\r\n __extends(FooterPanel, _super);\r\n function FooterPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n FooterPanel.prototype.create = function () {\r\n this.setConfig('mobileFooterPanel');\r\n _super.prototype.create.call(this);\r\n };\r\n FooterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$options.css('left', Math.floor((this.$element.width() / 2) - (this.$options.width() / 2)));\r\n };\r\n return FooterPanel;\r\n }(FooterPanel_1.FooterPanel));\r\n exports.FooterPanel = FooterPanel;\r\n});\r\n//# sourceMappingURL=MobileFooter.js.map\n", "define('modules/uv-shared-module/Information',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Information = /** @class */ (function () {\r\n function Information(message, actions) {\r\n this.message = message;\r\n this.actions = actions;\r\n }\r\n return Information;\r\n }());\r\n exports.Information = Information;\r\n});\r\n//# sourceMappingURL=Information.js.map\n", "define('modules/uv-shared-module/InformationAction',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var InformationAction = /** @class */ (function () {\r\n function InformationAction() {\r\n }\r\n return InformationAction;\r\n }());\r\n exports.InformationAction = InformationAction;\r\n});\r\n//# sourceMappingURL=InformationAction.js.map\n", "define('modules/uv-shared-module/InformationFactory',[\"require\", \"exports\", \"./BaseEvents\", \"./Information\", \"./InformationAction\", \"./InformationType\"], function (require, exports, BaseEvents_1, Information_1, InformationAction_1, InformationType_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var InformationFactory = /** @class */ (function () {\r\n function InformationFactory(extension) {\r\n this.extension = extension;\r\n }\r\n InformationFactory.prototype.Get = function (args) {\r\n var _this = this;\r\n switch (args.informationType) {\r\n case (InformationType_1.InformationType.AUTH_CORS_ERROR):\r\n return new Information_1.Information(this.extension.data.config.content.authCORSError, []);\r\n case (InformationType_1.InformationType.DEGRADED_RESOURCE):\r\n var actions = [];\r\n var loginAction = new InformationAction_1.InformationAction();\r\n var label = args.param.loginService.getConfirmLabel();\r\n if (!label) {\r\n label = this.extension.data.config.content.fallbackDegradedLabel;\r\n }\r\n loginAction.label = label;\r\n var resource_1 = args.param;\r\n loginAction.action = function () {\r\n resource_1.authHoldingPage = window.open(\"\", \"_blank\");\r\n _this.extension.component.publish(BaseEvents_1.BaseEvents.HIDE_INFORMATION);\r\n _this.extension.component.publish(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE, [[resource_1]]);\r\n };\r\n actions.push(loginAction);\r\n var message = args.param.loginService.getServiceLabel();\r\n if (!message) {\r\n message = this.extension.data.config.content.fallbackDegradedMessage;\r\n }\r\n return new Information_1.Information(message, actions);\r\n }\r\n };\r\n return InformationFactory;\r\n }());\r\n exports.InformationFactory = InformationFactory;\r\n});\r\n//# sourceMappingURL=InformationFactory.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/HeaderPanel',[\"require\", \"exports\", \"./BaseEvents\", \"./BaseView\", \"../uv-shared-module/InformationFactory\"], function (require, exports, BaseEvents_1, BaseView_1, InformationFactory_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var HeaderPanel = /** @class */ (function (_super) {\r\n __extends(HeaderPanel, _super);\r\n function HeaderPanel($element) {\r\n return _super.call(this, $element, false, false) || this;\r\n }\r\n HeaderPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('headerPanel');\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_INFORMATION, function (args) {\r\n _this.showInformation(args);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_INFORMATION, function () {\r\n _this.hideInformation();\r\n });\r\n this.$options = $('<div class=\"options\"></div>');\r\n this.$element.append(this.$options);\r\n this.$centerOptions = $('<div class=\"centerOptions\"></div>');\r\n this.$options.append(this.$centerOptions);\r\n this.$rightOptions = $('<div class=\"rightOptions\"></div>');\r\n this.$options.append(this.$rightOptions);\r\n //this.$helpButton = $('<a href=\"#\" class=\"action help\">' + this.content.help + '</a>');\r\n //this.$rightOptions.append(this.$helpButton);\r\n this.$localeToggleButton = $('<a class=\"localeToggle\" tabindex=\"0\"></a>');\r\n this.$rightOptions.append(this.$localeToggleButton);\r\n this.$settingsButton = $(\"\\n <button class=\\\"btn imageBtn settings\\\" tabindex=\\\"0\\\" title=\\\"\" + this.content.settings + \"\\\">\\n <i class=\\\"uv-icon-settings\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.settings + \"\\n </button>\\n \");\r\n this.$settingsButton.attr('title', this.content.settings);\r\n this.$rightOptions.append(this.$settingsButton);\r\n this.$informationBox = $('<div class=\"informationBox\" aria-hidden=\"true\"> \\\n <div class=\"message\"></div> \\\n <div class=\"actions\"></div> \\\n <button type=\"button\" class=\"close\" aria-label=\"Close\"> \\\n <span aria-hidden=\"true\">×</span>\\\n </button> \\\n </div>');\r\n this.$element.append(this.$informationBox);\r\n this.$informationBox.hide();\r\n this.$informationBox.find('.close').attr('title', this.content.close);\r\n this.$informationBox.find('.close').on('click', function (e) {\r\n e.preventDefault();\r\n _this.component.publish(BaseEvents_1.BaseEvents.HIDE_INFORMATION);\r\n });\r\n this.$localeToggleButton.on('click', function () {\r\n _this.extension.changeLocale(String(_this.$localeToggleButton.data('locale')));\r\n });\r\n this.$settingsButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.SHOW_SETTINGS_DIALOGUE);\r\n });\r\n if (!Utils.Bools.getBool(this.options.centerOptionsEnabled, true)) {\r\n this.$centerOptions.hide();\r\n }\r\n this.updateLocaleToggle();\r\n this.updateSettingsButton();\r\n };\r\n HeaderPanel.prototype.updateLocaleToggle = function () {\r\n if (!this.localeToggleIsVisible()) {\r\n this.$localeToggleButton.hide();\r\n return;\r\n }\r\n var alternateLocale = this.extension.getAlternateLocale();\r\n var text = alternateLocale.name.split('-')[0].toUpperCase();\r\n this.$localeToggleButton.data('locale', alternateLocale.name);\r\n this.$localeToggleButton.attr('title', alternateLocale.label);\r\n this.$localeToggleButton.text(text);\r\n };\r\n HeaderPanel.prototype.updateSettingsButton = function () {\r\n var settingsEnabled = Utils.Bools.getBool(this.options.settingsButtonEnabled, true);\r\n if (!settingsEnabled) {\r\n this.$settingsButton.hide();\r\n }\r\n else {\r\n this.$settingsButton.show();\r\n }\r\n };\r\n HeaderPanel.prototype.localeToggleIsVisible = function () {\r\n var locales = this.extension.data.locales;\r\n if (locales) {\r\n return locales.length > 1 && Utils.Bools.getBool(this.options.localeToggleEnabled, false);\r\n }\r\n return false;\r\n };\r\n HeaderPanel.prototype.showInformation = function (args) {\r\n var informationFactory = new InformationFactory_1.InformationFactory(this.extension);\r\n this.information = informationFactory.Get(args);\r\n var $message = this.$informationBox.find('.message');\r\n $message.html(this.information.message).find('a').attr('target', '_top');\r\n var $actions = this.$informationBox.find('.actions');\r\n $actions.empty();\r\n for (var i = 0; i < this.information.actions.length; i++) {\r\n var action = this.information.actions[i];\r\n var $action = $('<a href=\"#\" class=\"btn btn-default\">' + action.label + '</a>');\r\n $action.on('click', action.action);\r\n $actions.append($action);\r\n }\r\n this.$informationBox.attr('aria-hidden', 'false');\r\n this.$informationBox.show();\r\n this.$element.addClass('showInformation');\r\n this.extension.resize();\r\n };\r\n HeaderPanel.prototype.hideInformation = function () {\r\n this.$element.removeClass('showInformation');\r\n this.$informationBox.attr('aria-hidden', 'true');\r\n this.$informationBox.hide();\r\n this.extension.resize();\r\n };\r\n HeaderPanel.prototype.getSettings = function () {\r\n return this.extension.getSettings();\r\n };\r\n HeaderPanel.prototype.updateSettings = function (settings) {\r\n this.extension.updateSettings(settings);\r\n this.component.publish(BaseEvents_1.BaseEvents.UPDATE_SETTINGS, settings);\r\n };\r\n HeaderPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n var headerWidth = this.$element.width();\r\n var center = headerWidth / 2;\r\n var containerWidth = this.$centerOptions.outerWidth();\r\n var pos = center - (containerWidth / 2);\r\n this.$centerOptions.css({\r\n left: pos\r\n });\r\n if (this.$informationBox.is(':visible')) {\r\n var $actions = this.$informationBox.find('.actions');\r\n var $message = this.$informationBox.find('.message');\r\n $message.width(Math.floor(this.$element.width()) - Math.ceil($message.horizontalMargins()) - Math.ceil($actions.outerWidth(true)) - Math.ceil(this.$informationBox.find('.close').outerWidth(true)) - 2);\r\n $message.text(this.information.message);\r\n }\r\n // hide toggle buttons below minimum width\r\n if (this.extension.width() < this.extension.data.config.options.minWidthBreakPoint) {\r\n if (this.localeToggleIsVisible())\r\n this.$localeToggleButton.hide();\r\n }\r\n else {\r\n if (this.localeToggleIsVisible())\r\n this.$localeToggleButton.show();\r\n }\r\n };\r\n return HeaderPanel;\r\n }(BaseView_1.BaseView));\r\n exports.HeaderPanel = HeaderPanel;\r\n});\r\n//# sourceMappingURL=HeaderPanel.js.map\n", "!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(\"IIIFMetadataComponent\",[],t):\"object\"==typeof exports?exports.IIIFMetadataComponent=t():e.IIIFMetadataComponent=t()}(\"undefined\"!=typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o,a=n(2),s=n(3),u=n(4);!function(e){e.LINES=\"lines\",e.CHARS=\"chars\"}(o=t.LimitType||(t.LimitType={}));var c=function(e){function t(t){var n=e.call(this,t)||this;return n._data=n.data(),n._data=n.options.data,n._init(),n._resize(),n}return i(t,e),t.prototype._init=function(){return e.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},t.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:o.LINES,limitToRange:!1,manifestDisplayOrder:\"\",manifestExclude:\"\",range:null,rtlLanguageCodes:\"ar, ara, dv, div, he, heb, ur, urd\",sanitizer:function(e){return e},showAllLanguages:!1}},t.prototype._getManifestGroup=function(){return this._metadataGroups.filter((function(e){return e.resource.isManifest()}))[0]},t.prototype._getCanvasGroups=function(){return this._metadataGroups.filter((function(e){return e.resource.isCanvas()}))},t.prototype.set=function(e){var t=this;if(this._data=Object.assign(this._data,e),this._data&&this._data.helper){var n,r={canvases:this._data.canvases,licenseFormatter:this._data.licenseFormatter,range:this._data.range};if(this._metadataGroups=this._data.helper.getMetadata(r),this._data.manifestDisplayOrder)(n=this._getManifestGroup()).items=this._sortItems(n.items,this._readCSV(this._data.manifestDisplayOrder));if(this._data.canvasDisplayOrder)this._getCanvasGroups().forEach((function(e,n){e.items=t._sortItems(e.items,t._readCSV(t._data.canvasDisplayOrder))}));if(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)(n=this._getManifestGroup()).items=this._exclude(n.items,this._readCSV(this._data.manifestExclude));if(this._data.canvasExclude)this._getCanvasGroups().forEach((function(e,n){e.items=t._exclude(e.items,t._readCSV(t._data.canvasExclude))}));if(this._data.limitToRange){var i=[];this._metadataGroups.forEach((function(e,t){e.resource.isRange()&&i.push(e)})),i.length&&(this._metadataGroups=i)}this._render()}},t.prototype._sortItems=function(e,t){var n=this,r=[],i=e.slice(0);return t.forEach((function(e,t){var o=i.filter((function(t){return n._normalise(t.getLabel())===e}))[0];if(o){r.push(o);var a=i.indexOf(o);a>-1&&i.splice(a,1)}})),i.forEach((function(e,t){r.push(e)})),r},t.prototype._sortGroups=function(e,t){var n=[],r=e.slice(0);return t.forEach((function(e,t){var i=r.filter((function(t){return t.resource.getIIIFResourceType().toLowerCase()==e.toLowerCase()}))[0];if(i){n.push(i);var o=r.indexOf(i);o>-1&&r.splice(o,1)}})),n},t.prototype._label=function(e,t){e.forEach((function(e,n){e.label=t[n]}))},t.prototype._exclude=function(e,t){var n=this;return t.forEach((function(t,r){var i=e.filter((function(e){return n._normalise(e.getLabel())===t}))[0];if(i){var o=e.indexOf(i);o>-1&&e.splice(o,1)}})),e},t.prototype._normalise=function(e){return e?e.toLowerCase().replace(/ /g,\"\"):null},t.prototype._render=function(){var e=this;this._metadataGroups.length?(this._$noData.hide(),this._$metadataGroups.empty(),this._metadataGroups.forEach((function(t,n){var r=e._buildMetadataGroup(t);e._$metadataGroups.append(r);var i=r.find(\".value\");e._data.limit&&e._data.content&&(e._data.limitType===o.LINES?i.toggleExpandTextByLines(e._data.limit,e._data.content.less,e._data.content.more,(function(){})):e._data.limitType===o.CHARS&&i.ellipsisHtmlFixed(e._data.limit,(function(){})))}))):this._$noData.show()},t.prototype._buildMetadataGroup=function(e){var t=this._$metadataGroupTemplate.clone(),n=t.find(\">.header\");if(this._data.content)if(e.resource.isManifest()&&this._data.content.manifestHeader)(i=this._sanitize(this._data.content.manifestHeader))&&n.html(i);else if(e.resource.isSequence()&&this._data.content.sequenceHeader){(i=this._sanitize(this._data.content.sequenceHeader))&&n.html(i)}else if(e.resource.isRange()&&this._data.content.rangeHeader){(i=this._sanitize(this._data.content.rangeHeader))&&n.html(i)}else if(e.resource.isCanvas()&&(e.label||this._data.content.canvasHeader)){var r=e.label||this._data.content.canvasHeader;n.html(this._sanitize(r))}else if(e.resource.isAnnotation()&&this._data.content.imageHeader){var i;(i=this._sanitize(this._data.content.imageHeader))&&n.html(i)}n.text()||n.hide();for(var o=t.find(\".items\"),a=0;a<e.items.length;a++){var s=e.items[a],u=this._buildMetadataItem(s);o.append(u)}return t},t.prototype._buildMetadataItem=function(e){var t,n=this._$metadataItemTemplate.clone(),r=n.find(\".label\"),i=n.find(\".values\"),o=e.getLabel(),a=o,s=new RegExp(\"/w+:(/?/?)[^s]+/gm\",\"i\");if(this._data.content&&a&&e.isRootLevel)switch(a.toLowerCase()){case\"attribution\":a=this._data.content.attribution;break;case\"description\":a=this._data.content.description;break;case\"license\":a=this._data.content.license;break;case\"logo\":a=this._data.content.logo}if(a=this._sanitize(a),r.html(a),this._addReadingDirection(r,this._getLabelLocale(e)),n.addClass(u.Strings.toCssClass(a)),o&&\"license\"===o.toLowerCase()&&null!==s.exec(e.value[0].value))t=this._buildMetadataItemURIValue(e.value[0].value),i.append(t);else if(this._data.showAllLanguages&&e.value&&e.value.length>1)for(var c=0;c<e.value.length;c++){var p=e.value[c];t=this._buildMetadataItemValue(p.value,p.locale),i.append(t)}else{var f=this._getValueLocale(e),h=!1;for(c=0;c<e.value.length;c++){var p=e.value[c];f.toLowerCase()===p.locale.toLowerCase()&&(h=!0,t=this._buildMetadataItemValue(p.value,p.locale),i.append(t))}if(!h)(p=e.value[0])&&(t=this._buildMetadataItemValue(p.value,p.locale),i.append(t))}this._data.copyToClipboardEnabled&&u.Clipboard.supportsCopy()&&r.text()&&this._addCopyButton(n,r,i);var d=this;return n.on(\"click\",\"a.iiif-viewer-link\",(function(e){e.preventDefault();var t=$(e.target),n=t.attr(\"data-uv-navigate\")||t.prop(\"href\");d.fire(l.IIIF_VIEWER_LINK_CLICKED,n)})),n.on(\"click\",\"[data-uv-navigate]\",(function(e){e.preventDefault();var t=$(e.target).attr(\"data-uv-navigate\")||null;t&&d.fire(l.IIIF_VIEWER_LINK_CLICKED,t)})),n},t.prototype._getLabelLocale=function(e){if(!this._data||!this._data.helper)return\"\";var t=this._data.helper.options.locale;if(e.label.length){var n=e.label[0].locale;if(n.toLowerCase()!==t.toLowerCase())return n}return t},t.prototype._getValueLocale=function(e){return this._data&&this._data.helper?this._data.helper.options.locale:\"\"},t.prototype._buildMetadataItemValue=function(e,t){e=(e=this._sanitize(e)).replace(\"\\n\",\"<br>\");var n=this._$metadataItemValueTemplate.clone();return n.html(e),n.find(\"a\").each((function(){var e=$(this);e.hasClass(\"iiif-viewer-link\")||e.prop(\"target\",\"_blank\")})),t&&this._addReadingDirection(n,t),n},t.prototype._buildMetadataItemURIValue=function(e){e=this._sanitize(e);var t=this._$metadataItemURIValueTemplate.clone();return t.prop(\"href\",e),t.text(e),t},t.prototype._addReadingDirection=function(e,t){t=a.Utils.getInexactLocale(t),this._readCSV(this._data.rtlLanguageCodes).filter((function(e){return e===t})).length>0&&(e.prop(\"dir\",\"rtl\"),e.addClass(\"rtl\"))},t.prototype._addCopyButton=function(e,t,n){var r=this._$copyTextTemplate.clone(),i=r.children();t.append(r),u.Device.isTouch()?r.show():(e.on(\"mouseenter\",(function(){r.show()})),e.on(\"mouseleave\",(function(){r.hide()})),r.on(\"mouseleave\",(function(){i.hide()})));var o=this,a=n.text();r.on(\"click\",(function(e){o._copyItemValues(r,a)}))},t.prototype._copyItemValues=function(e,t){u.Clipboard.copy(t);var n=e.find(\".copiedText\");n.show(),setTimeout((function(){n.hide()}),this._data.copiedMessageDuration)},t.prototype._readCSV=function(e,t){void 0===t&&(t=!0);var n=[];if(e&&(n=e.split(\",\"),t))for(var r=0;r<n.length;r++)n[r]=this._normalise(n[r]);return n},t.prototype._sanitize=function(e){return this._data.sanitizer?this._data.sanitizer(e):null},t.prototype._resize=function(){},t}(s.BaseComponent);t.MetadataComponent=c;var l=function(){function e(){}return e.IIIF_VIEWER_LINK_CLICKED=\"iiifViewerLinkClicked\",e}();t.Events=l},function(e,t,n){\"undefined\"!=typeof self&&self,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=4)}([function(e,t,n){\"use strict\";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,\"__esModule\",{value:!0}),r(n(6)),r(n(7)),r(n(8)),r(n(9)),r(n(10)),r(n(11)),r(n(12)),r(n(13)),r(n(14)),r(n(15)),r(n(16)),r(n(17)),r(n(18)),r(n(19)),r(n(20)),r(n(21)),r(n(22)),r(n(23)),r(n(24)),r(n(25)),r(n(26)),r(n(27)),r(n(28)),r(n(29)),r(n(30)),r(n(31)),r(n(32)),r(n(2))},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.BOOKMARKING=\"oa:bookmarking\",e.CLASSIFYING=\"oa:classifying\",e.COMMENTING=\"oa:commenting\",e.DESCRIBING=\"oa:describing\",e.EDITING=\"oa:editing\",e.HIGHLIGHTING=\"oa:highlighting\",e.IDENTIFYING=\"oa:identifying\",e.LINKING=\"oa:linking\",e.MODERATING=\"oa:moderating\",e.PAINTING=\"sc:painting\",e.QUESTIONING=\"oa:questioning\",e.REPLYING=\"oa:replying\",e.TAGGING=\"oa:tagging\",e.TRANSCRIBING=\"oad:transcribing\"}(t.AnnotationMotivation||(t.AnnotationMotivation={})),function(e){e.AUTO_ADVANCE=\"auto-advance\",e.CONTINUOUS=\"continuous\",e.FACING_PAGES=\"facing-pages\",e.HIDDEN=\"hidden\",e.INDIVIDUALS=\"individuals\",e.MULTI_PART=\"multi-part\",e.NO_NAV=\"no-nav\",e.NON_PAGED=\"non-paged\",e.PAGED=\"paged\",e.REPEAT=\"repeat\",e.SEQUENCE=\"sequence\",e.THUMBNAIL_NAV=\"thumbnail-nav\",e.TOGETHER=\"together\",e.UNORDERED=\"unordered\"}(t.Behavior||(t.Behavior={})),function(e){e.CANVAS=\"canvas\",e.CHOICE=\"choice\",e.CONTENT_AS_TEXT=\"contentastext\",e.DOCUMENT=\"document\",e.IMAGE=\"image\",e.MOVING_IMAGE=\"movingimage\",e.PDF=\"pdf\",e.PHYSICAL_OBJECT=\"physicalobject\",e.SOUND=\"sound\",e.TEXTUALBODY=\"textualbody\",e.VIDEO=\"video\"}(t.ExternalResourceType||(t.ExternalResourceType={})),function(e){e.ANNOTATION=\"annotation\",e.CANVAS=\"canvas\",e.COLLECTION=\"collection\",e.MANIFEST=\"manifest\",e.RANGE=\"range\",e.SEQUENCE=\"sequence\"}(t.IIIFResourceType||(t.IIIFResourceType={})),function(e){e.AUDIO_MP4=\"audio/mp4\",e.CORTO=\"application/corto\",e.DRACO=\"application/draco\",e.GLTF=\"model/gltf+json\",e.JPG=\"image/jpeg\",e.M3U8=\"application/vnd.apple.mpegurl\",e.MP3=\"audio/mp3\",e.MPEG_DASH=\"application/dash+xml\",e.OBJ=\"text/plain\",e.PDF=\"application/pdf\",e.PLY=\"application/ply\",e.THREEJS=\"application/vnd.threejs+json\",e.VIDEO_MP4=\"video/mp4\",e.WEBM=\"video/webm\"}(t.MediaType||(t.MediaType={})),function(e){e.DOC=\"application/msword\",e.DOCX=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",e.PDF=\"application/pdf\"}(t.RenderingFormat||(t.RenderingFormat={})),function(e){e.IMAGE_0_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/compliance.html#level0\",e.IMAGE_0_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/compliance.html#level1\",e.IMAGE_0_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/compliance.html#level2\",e.IMAGE_0_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/conformance.html#level0\",e.IMAGE_0_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/conformance.html#level1\",e.IMAGE_0_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/conformance.html#level2\",e.IMAGE_1_COMPLIANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\",e.IMAGE_1_COMPLIANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1\",e.IMAGE_1_COMPLIANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2\",e.IMAGE_1_CONFORMANCE_LEVEL_0=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0\",e.IMAGE_1_CONFORMANCE_LEVEL_1=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1\",e.IMAGE_1_CONFORMANCE_LEVEL_2=\"http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2\",e.IMAGE_1_LEVEL_0=\"http://iiif.io/api/image/1/level0.json\",e.IMAGE_1_PROFILE_LEVEL_0=\"http://iiif.io/api/image/1/profiles/level0.json\",e.IMAGE_1_LEVEL_1=\"http://iiif.io/api/image/1/level1.json\",e.IMAGE_1_PROFILE_LEVEL_1=\"http://iiif.io/api/image/1/profiles/level1.json\",e.IMAGE_1_LEVEL_2=\"http://iiif.io/api/image/1/level2.json\",e.IMAGE_1_PROFILE_LEVEL_2=\"http://iiif.io/api/image/1/profiles/level2.json\",e.IMAGE_2_LEVEL_0=\"http://iiif.io/api/image/2/level0.json\",e.IMAGE_2_PROFILE_LEVEL_0=\"http://iiif.io/api/image/2/profiles/level0.json\",e.IMAGE_2_LEVEL_1=\"http://iiif.io/api/image/2/level1.json\",e.IMAGE_2_PROFILE_LEVEL_1=\"http://iiif.io/api/image/2/profiles/level1.json\",e.IMAGE_2_LEVEL_2=\"http://iiif.io/api/image/2/level2.json\",e.IMAGE_2_PROFILE_LEVEL_2=\"http://iiif.io/api/image/2/profiles/level2.json\",e.AUTH_0_CLICK_THROUGH=\"http://iiif.io/api/auth/0/login/clickthrough\",e.AUTH_0_LOGIN=\"http://iiif.io/api/auth/0/login\",e.AUTH_0_LOGOUT=\"http://iiif.io/api/auth/0/logout\",e.AUTH_0_RESTRICTED=\"http://iiif.io/api/auth/0/login/restricted\",e.AUTH_0_TOKEN=\"http://iiif.io/api/auth/0/token\",e.AUTH_1_CLICK_THROUGH=\"http://iiif.io/api/auth/1/clickthrough\",e.AUTH_1_EXTERNAL=\"http://iiif.io/api/auth/1/external\",e.AUTH_1_KIOSK=\"http://iiif.io/api/auth/1/kiosk\",e.AUTH_1_LOGIN=\"http://iiif.io/api/auth/1/login\",e.AUTH_1_LOGOUT=\"http://iiif.io/api/auth/1/logout\",e.AUTH_1_PROBE=\"http://iiif.io/api/auth/1/probe\",e.AUTH_1_TOKEN=\"http://iiif.io/api/auth/1/token\",e.SEARCH_0=\"http://iiif.io/api/search/0/search\",e.SEARCH_0_AUTO_COMPLETE=\"http://iiif.io/api/search/0/autocomplete\",e.SEARCH_1=\"http://iiif.io/api/search/1/search\",e.SEARCH_1_AUTO_COMPLETE=\"http://iiif.io/api/search/1/autocomplete\",e.TRACKING_EXTENSIONS=\"http://universalviewer.io/tracking-extensions-profile\",e.UI_EXTENSIONS=\"http://universalviewer.io/ui-extensions-profile\",e.PRINT_EXTENSIONS=\"http://universalviewer.io/print-extensions-profile\",e.SHARE_EXTENSIONS=\"http://universalviewer.io/share-extensions-profile\",e.OTHER_MANIFESTATIONS=\"http://iiif.io/api/otherManifestations.json\",e.IXIF=\"http://wellcomelibrary.org/ld/ixif/0/alpha.json\"}(t.ServiceProfile||(t.ServiceProfile={})),function(e){e.BOTTOM_TO_TOP=\"bottom-to-top\",e.LEFT_TO_RIGHT=\"left-to-right\",e.RIGHT_TO_LEFT=\"right-to-left\",e.TOP_TO_BOTTOM=\"top-to-bottom\"}(t.ViewingDirection||(t.ViewingDirection={})),function(e){e.CONTINUOUS=\"continuous\",e.INDIVIDUALS=\"individuals\",e.NON_PAGED=\"non-paged\",e.PAGED=\"paged\",e.TOP=\"top\"}(t.ViewingHint||(t.ViewingHint={}))},function(e,t,n){\"use strict\";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=n(1),s=n(33);n(34);var u=function(){function e(){}return e.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(\";\")[0]).trim()},e.getImageQuality=function(e){return e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_LEVEL_1||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_LEVEL_2||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?\"native\":\"default\"},e.getInexactLocale=function(e){return-1!==e.indexOf(\"-\")?e.substr(0,e.indexOf(\"-\")):e},e.getLocalisedValue=function(e,t){if(!Array.isArray(e))return e;for(var n=0;n<e.length;n++){var r=e[n];if(t===r[\"@language\"])return r[\"@value\"]}var i=t.substr(0,t.indexOf(\"-\"));for(n=0;n<e.length;n++){var o=e[n];if(o[\"@language\"]===i)return o[\"@value\"]}return null},e.generateTreeNodeIds=function(t,n){var r;void 0===n&&(n=0),r=t.parentNode?t.parentNode.id+\"-\"+n:\"0\",t.id=r;for(var i=0;i<t.nodes.length;i++){var o=t.nodes[i];e.generateTreeNodeIds(o,i)}},e.normaliseType=function(e){return-1!==(e=e.toLowerCase()).indexOf(\":\")?e.split(\":\")[1]:e},e.normaliseUrl=function(e){return-1!==(e=e.substr(e.indexOf(\"://\"))).indexOf(\"#\")&&(e=e.split(\"#\")[0]),e},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(e,t){return o.Deserialiser.parse(e,t)},e.checkStatus=function(e){if(e.ok)return e;var t=new Error(e.statusText);return t.response=e,Promise.reject(t)},e.loadManifest=function(t){return new Promise((function(n){fetch(t).then(e.checkStatus).then((function(e){return e.json()})).then((function(e){n(e)}))}))},e.loadExternalResourcesAuth1=function(t,n,r,i,o,a,s,u){return new Promise((function(c,l){var p=t.map((function(t){return e.loadExternalResourceAuth1(t,n,r,i,o,a,s,u)}));Promise.all(p).then((function(){c(t)})).catch((function(e){l(e)}))}))},e.loadExternalResourceAuth1=function(t,n,o,a,u,c,l,p){return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:return[4,a(t)];case 1:return(r=i.sent())?[4,t.getData(r)]:[3,6];case 2:return i.sent(),t.status!==s.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,n,o,u,c,l,p)];case 4:i.sent(),i.label=5;case 5:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return i.sent(),t.status!==s.MOVED_TEMPORARILY&&t.status!==s.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,n,o,u,c,l,p)];case 8:i.sent(),i.label=9;case 9:if(t.status===s.OK||t.status===s.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}}))}))},e.doAuthChain=function(t,n,o,a,u,c,l){return r(this,void 0,void 0,(function(){var r,p,f,h,d,_,g,v;return i(this,(function(i){switch(i.label){case 0:return t.isAccessControlled()?((r=t.externalService)&&(r.options=t.options),(p=t.kioskService)&&(p.options=t.options),(f=t.clickThroughService)&&(f.options=t.options),(h=t.loginService)&&(h.options=t.options),t.isResponseHandled||t.status!==s.MOVED_TEMPORARILY?[3,2]:[4,c(t)]):[2,t];case 1:return i.sent(),[2,t];case 2:return d=null,_=null,(d=r)?(_=d,[4,e.attemptResourceWithToken(t,o,d)]):[3,4];case 3:return i.sent(),[2,t];case 4:return(d=p)?(_=d,(g=n(d))?[4,a(g)]:[3,7]):[3,7];case 5:return i.sent(),[4,e.attemptResourceWithToken(t,o,d)];case 6:return i.sent(),[2,t];case 7:return(d=f)?(_=d,[4,u(t,d)]):[3,11];case 8:return(v=i.sent())?[4,a(v)]:[3,11];case 9:return i.sent(),[4,e.attemptResourceWithToken(t,o,d)];case 10:return i.sent(),[2,t];case 11:return(d=h)?(_=d,[4,u(t,d)]):[3,15];case 12:return(v=i.sent())?[4,a(v)]:[3,15];case 13:return i.sent(),[4,e.attemptResourceWithToken(t,o,d)];case 14:return i.sent(),[2,t];case 15:return _&&l(t,_),[2]}}))}))},e.attemptResourceWithToken=function(e,t,n){return r(this,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return(r=n.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,t(e,r)]:[3,3];case 1:return(o=i.sent())&&o.accessToken?[4,e.getData(o)]:[3,3];case 2:return i.sent(),[2,e];case 3:return[2]}}))}))},e.loadExternalResourcesAuth09=function(t,n,r,i,o,a,s,u,c,l){return new Promise((function(p,f){var h=t.map((function(t){return e.loadExternalResourceAuth09(t,n,r,i,o,a,s,u,c,l)}));Promise.all(h).then((function(){p(t)})).catch((function(e){f(e)}))}))},e.loadExternalResourceAuth09=function(t,n,r,i,o,a,u,c,l,p){return new Promise((function(f,h){p&&p.pessimisticAccessControl?t.getData().then((function(){t.isAccessControlled()?t.clickThroughService?(f(r(t)),f(i(t))):o(t).then((function(){a(t,!0).then((function(n){t.getData(n).then((function(){f(l(t))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))}))})).catch((function(t){h(e.createInternalServerError(t))})):f(t)})).catch((function(t){h(e.createInternalServerError(t))})):c(t,n).then((function(p){p?t.getData(p).then((function(){t.status===s.OK?f(l(t)):e.authorize(t,n,r,i,o,a,u,c).then((function(){f(l(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())})):e.authorize(t,n,r,i,o,a,u,c).then((function(){f(l(t))})).catch((function(t){h(e.createAuthorizationFailedError())}))})).catch((function(t){h(e.createAuthorizationFailedError())}))}))},e.createError=function(e,t){var n=new Error;return n.message=t,n.name=String(e),n},e.createAuthorizationFailedError=function(){return e.createError(o.StatusCode.AUTHORIZATION_FAILED,\"Authorization failed\")},e.createRestrictedError=function(){return e.createError(o.StatusCode.RESTRICTED,\"Restricted\")},e.createInternalServerError=function(t){return e.createError(o.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,n,r,i,o,a,u,c){return new Promise((function(l,p){t.getData().then((function(){t.isAccessControlled()?c(t,n).then((function(c){c?t.getData(c).then((function(){t.status===s.OK?l(t):e.showAuthInteraction(t,n,r,i,o,a,u,l,p)})).catch((function(t){p(e.createInternalServerError(t))})):a(t,!1).then((function(c){c?u(t,c,n).then((function(){t.getData(c).then((function(){t.status===s.OK?l(t):e.showAuthInteraction(t,n,r,i,o,a,u,l,p)})).catch((function(t){p(e.createInternalServerError(t))}))})).catch((function(t){p(e.createInternalServerError(t))})):e.showAuthInteraction(t,n,r,i,o,a,u,l,p)}))})).catch((function(t){p(e.createInternalServerError(t))})):l(t)}))}))},e.showAuthInteraction=function(t,n,r,i,o,a,u,c,l){t.status!==s.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?r(t).then((function(){a(t,!0).then((function(r){u(t,r,n).then((function(){t.getData(r).then((function(){c(t)})).catch((function(t){l(e.createInternalServerError(t))}))})).catch((function(t){l(e.createInternalServerError(t))}))})).catch((function(t){l(e.createInternalServerError(t))}))})):o(t).then((function(){a(t,!0).then((function(r){u(t,r,n).then((function(){t.getData(r).then((function(){c(t)})).catch((function(t){l(e.createInternalServerError(t))}))})).catch((function(t){l(e.createInternalServerError(t))}))})).catch((function(t){l(e.createInternalServerError(t))}))})):c(t)},e.getService=function(e,t){for(var n=this.getServices(e),r=0;r<n.length;r++){var i=n[r];if(i.getProfile()===t)return i}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 i=0;i<Object.keys(t).length;i++)if(\"object\"==typeof t[Object.keys(t)[i]]){var o=e.traverseAndFind(t[Object.keys(t)[i]],n,r);if(null!=o)return o}},e.getServices=function(e){var t,n=[];if(!(t=e.__jsonld?e.__jsonld.service:e.service))return n;Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var i=t[r];if(\"string\"==typeof i){var a=this.getResourceById(e.options.resource,i);a&&n.push(new o.Service(a.__jsonld||a,e.options))}else n.push(new o.Service(i,e.options))}return n},e.getTemporalComponent=function(e){var t=/t=([^&]+)/g.exec(e),n=null;return t&&t[1]&&(n=t[1].split(\",\")),n},e}();t.Utils=u},function(e,t,n){\"use strict\";n.r(t),t.default=function(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in i.open(t.method||\"get\",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,(function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+\",\"+n:n})),n(u())},i.onerror=r,i.withCredentials=\"include\"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)}))}},function(e,t,n){e.exports=n(5)},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(0));var r=n(2);t.loadManifest=function(e){return r.Utils.loadManifest(e)},t.parseManifest=function(e,t){return r.Utils.parseManifest(e,t)}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=function(){function e(e){this.__jsonld=e,this.context=this.getProperty(\"context\"),this.id=this.getProperty(\"id\")}return e.prototype.getProperty=function(e){var t=null;return this.__jsonld&&((t=this.__jsonld[e])||(t=this.__jsonld[\"@\"+e])),t},e}();t.JSONLDResource=r},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=n(1),s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.options=n,r}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty(\"type\"))},t.prototype.getLabel=function(){var e=this.getProperty(\"label\");return e?o.LanguageMap.parse(e,this.options.locale):[]},t.prototype.getDefaultLabel=function(){return o.LanguageMap.getValue(this.getLabel())},t.prototype.getMetadata=function(){var e=this.getProperty(\"metadata\"),t=[];if(!e)return t;for(var n=0;n<e.length;n++){var r=e[n],i=new o.LabelValuePair(this.options.locale);i.parse(r),t.push(i)}return t},t.prototype.getRendering=function(e){for(var t=this.getRenderings(),n=0;n<t.length;n++){var r=t[n];if(r.getFormat()===e)return r}return null},t.prototype.getRenderings=function(){var e,t=[];if(!(e=this.__jsonld?this.__jsonld.rendering:this.rendering))return t;Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++){var r=e[n];t.push(new o.Rendering(r,this.options))}return t},t.prototype.getService=function(e){return o.Utils.getService(this,e)},t.prototype.getServices=function(){return o.Utils.getServices(this)},t.prototype.getThumbnail=function(){var e=this.getProperty(\"thumbnail\");return Array.isArray(e)&&(e=e[0]),e?new o.Thumbnail(e,this.options):null},t.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},t.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},t.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},t}(o.JSONLDResource);t.ManifestResource=s},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty(\"format\");return e?e.toLowerCase():null},t.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 o.Annotation(n,this.options);e.push(r)}return e},t.prototype.getType=function(){var e=this.getProperty(\"type\");return e?o.Utils.normaliseType(e):null},t.prototype.getWidth=function(){return this.getProperty(\"width\")},t.prototype.getHeight=function(){return this.getProperty(\"height\")},t.prototype.getMaxWidth=function(){return this.getProperty(\"maxWidth\")},t.prototype.getMaxHeight=function(){return this.getProperty(\"maxHeight\")?null:this.getMaxWidth()},t}(o.ManifestResource);t.Resource=a},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=n(1),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;r.index=-1,r.isLoaded=!1;var i={defaultLabel:\"-\",locale:\"en-GB\",resource:r,pessimisticAccessControl:!1};return r.options=Object.assign(i,n),r}return i(t,e),t.prototype.getAttribution=function(){var e=this.getProperty(\"attribution\");return e?o.LanguageMap.parse(e,this.options.locale):[]},t.prototype.getDescription=function(){var e=this.getProperty(\"description\");return e?o.LanguageMap.parse(e,this.options.locale):[]},t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty(\"type\"))},t.prototype.getLogo=function(){var e=this.getProperty(\"logo\");return e?\"string\"==typeof e?e:(Array.isArray(e)&&e.length&&(e=e[0]),e[\"@id\"]||e.id):null},t.prototype.getLicense=function(){return o.Utils.getLocalisedValue(this.getProperty(\"license\"),this.options.locale)},t.prototype.getNavDate=function(){return new Date(this.getProperty(\"navDate\"))},t.prototype.getRelated=function(){return this.getProperty(\"related\")},t.prototype.getSeeAlso=function(){return this.getProperty(\"seeAlso\")},t.prototype.getTrackingLabel=function(){var e=this.getService(a.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty(\"trackingLabel\"):\"\"},t.prototype.getDefaultTree=function(){return this.defaultTree=new o.TreeNode(\"root\"),this.defaultTree.data=this,this.defaultTree},t.prototype.getRequiredStatement=function(){var e=null,t=this.getProperty(\"requiredStatement\");if(t)(e=new o.LabelValuePair(this.options.locale)).parse(t);else{var n=this.getAttribution();n&&((e=new o.LabelValuePair(this.options.locale)).value=n)}return e},t.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},t.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},t.prototype.load=function(){var e=this;return new Promise((function(t){if(e.isLoaded)t(e);else{var n=e.options;n.navDate=e.getNavDate();var r=e.__jsonld.id;r||(r=e.__jsonld[\"@id\"]),o.Utils.loadManifest(r).then((function(r){e.parentLabel=o.LanguageMap.getValue(e.getLabel(),n.locale);var i=o.Deserialiser.parse(r,n);(e=Object.assign(e,i)).index=n.index,t(e)}))}}))},t}(o.ManifestResource);t.IIIFResource=s},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getBody=function(){var e=[],t=this.getProperty(\"body\");if(t)if(Array.isArray(t))for(var n=0;n<t.length;n++)if((a=t[n]).items)for(var r=0;r<a.items.length;r++){var i=a.items[r];e.push(new o.AnnotationBody(i,this.options))}else e.push(new o.AnnotationBody(a,this.options));else if(t.items)for(n=0;n<t.items.length;n++){var a=t.items[n];e.push(new o.AnnotationBody(a,this.options))}else e.push(new o.AnnotationBody(t,this.options));return e},t.prototype.getMotivation=function(){return this.getProperty(\"motivation\")||null},t.prototype.getOn=function(){return this.getProperty(\"on\")},t.prototype.getTarget=function(){return this.getProperty(\"target\")},t.prototype.getResource=function(){return new o.Resource(this.getProperty(\"resource\"),this.options)},t}(o.ManifestResource);t.Annotation=a},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getFormat=function(){var e=this.getProperty(\"format\");return e?o.Utils.getMediaType(e):null},t.prototype.getType=function(){return this.getProperty(\"type\")?o.Utils.normaliseType(this.getProperty(\"type\")):null},t.prototype.getWidth=function(){return this.getProperty(\"width\")},t.prototype.getHeight=function(){return this.getProperty(\"height\")},t}(o.ManifestResource);t.AnnotationBody=a},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=function(e){function t(t,n,r){var i=e.call(this,n)||this;return i.label=t,i.options=r,i}return i(t,e),t.prototype.getIIIFResourceType=function(){return o.Utils.normaliseType(this.getProperty(\"type\"))},t.prototype.getLabel=function(){return this.label},t.prototype.getResources=function(){var e=this;return this.getProperty(\"resources\").map((function(t){return new o.Annotation(t,e.options)}))},t.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\"]),o.Utils.loadManifest(r).then((function(n){e.__jsonld=n,e.context=e.getProperty(\"context\"),e.id=e.getProperty(\"id\"),e.isLoaded=!0,t(e)})).catch(n)}}))},t}(o.JSONLDResource);t.AnnotationList=a},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getItems=function(){return this.getProperty(\"items\")},t}(n(0).ManifestResource);t.AnnotationPage=o},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getCanonicalImageUri=function(e){var t,n=null,r=\"default\",i=e;if(this.externalResource&&this.externalResource.data&&this.externalResource.data[\"@id\"])n=this.externalResource.data[\"@id\"],i||(i=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 a=this.getImages();if(a&&a.length){var s=a[0].getResource(),u=s.getServices();if(i||(i=s.getWidth()),u.length){var c=u[0];n=c.id,r=o.Utils.getImageQuality(c.getProfile())}else if(i===s.getWidth())return s.id}if(!n){var l=this.getProperty(\"thumbnail\");if(l){if(\"string\"==typeof l)return l;if(l[\"@id\"])return l[\"@id\"];if(l.length)return l[0].id}}}return t=i+\",\",n&&n.endsWith(\"/\")&&(n=n.substr(0,n.length-1)),[n,\"full\",t,0,r+\".jpg\"].join(\"/\")},t.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(e){return e.maxWidth}))[0])&&(t=new o.Size(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},t.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var n=null;if(t.length&&(n=new o.AnnotationPage(t[0],this.options)),!n)return e;for(var r=n.getItems(),i=0;i<r.length;i++){var a=r[i],s=new o.Annotation(a,this.options);e.push(s)}return e},t.prototype.getDuration=function(){return this.getProperty(\"duration\")},t.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 o.Annotation(n,this.options);e.push(r)}return e},t.prototype.getIndex=function(){return this.getProperty(\"index\")},t.prototype.getOtherContent=function(){var e=this,t=(Array.isArray(this.getProperty(\"otherContent\"))?this.getProperty(\"otherContent\"):[this.getProperty(\"otherContent\")]).filter((function(e){return e&&\"string\"==typeof(t=e[\"@type\"])&&t.toLowerCase()==t.toLowerCase();var t})).map((function(t,n){return new o.AnnotationList(t.label||\"Annotation list \"+n,t,e.options)})).map((function(e){return e.load()}));return Promise.all(t)},t.prototype.getWidth=function(){return this.getProperty(\"width\")},t.prototype.getHeight=function(){return this.getProperty(\"height\")},t}(o.Resource);t.Canvas=a},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(1),a=n(0),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.items=[],r._collections=null,r._manifests=null,t.__collection=r,r}return i(t,e),t.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter((function(e){return e.isCollection()}))},t.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter((function(e){return e.isManifest()}))},t.prototype.getCollectionByIndex=function(e){for(var t,n=this.getCollections(),r=0;r<n.length;r++){var i=n[r];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error(\"Collection index not found\")},t.prototype.getManifestByIndex=function(e){for(var t,n=this.getManifests(),r=0;r<n.length;r++){var i=n[r];i.index===e&&(t=i)}if(t)return t.options.index=e,t.load();throw new Error(\"Manifest index not found\")},t.prototype.getTotalCollections=function(){return this.getCollections().length},t.prototype.getTotalManifests=function(){return this.getManifests().length},t.prototype.getTotalItems=function(){return this.items.length},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")?this.getProperty(\"viewingDirection\"):o.ViewingDirection.LEFT_TO_RIGHT},t.prototype.getDefaultTree=function(){return e.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},t.prototype._parseManifests=function(e){if(e.getManifests()&&e.getManifests().length)for(var t=0;t<e.getManifests().length;t++){var n=e.getManifests()[t],r=n.getDefaultTree();r.label=n.parentLabel||a.LanguageMap.getValue(n.getLabel(),this.options.locale)||\"manifest \"+(t+1),r.navDate=n.getNavDate(),r.data.id=n.id,r.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),e.defaultTree.addNode(r)}},t.prototype._parseCollections=function(e){if(e.getCollections()&&e.getCollections().length)for(var t=0;t<e.getCollections().length;t++){var n=e.getCollections()[t],r=n.getDefaultTree();r.label=n.parentLabel||a.LanguageMap.getValue(n.getLabel(),this.options.locale)||\"collection \"+(t+1),r.navDate=n.getNavDate(),r.data.id=n.id,r.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),e.defaultTree.addNode(r)}},t}(a.IIIFResource);t.Collection=s},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=function(){function e(e,t){this.start=e,this.end=t}return e.prototype.getLength=function(){return this.end-this.start},e}();t.Duration=r},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(0),i=function(){function e(e){this.defaultLocale=e}return e.prototype.parse=function(e){this.resource=e,this.label=r.LanguageMap.parse(this.resource.label,this.defaultLocale),this.value=r.LanguageMap.parse(this.resource.value,this.defaultLocale)},e.prototype.getLabel=function(){return this.label?r.LanguageMap.getValue(this.label,this.defaultLocale):null},e.prototype.setLabel=function(e){var t=this;if(this.label&&this.label.length){var n=this.label.filter((function(e){return e.locale===t.defaultLocale||e.locale===r.Utils.getInexactLocale(t.defaultLocale)}))[0];n&&(n.value=e)}},e.prototype.getValue=function(){if(this.value){var e=this.defaultLocale;return this.label&&this.label.length&&this.label[0].locale&&(e=this.label[0].locale),r.LanguageMap.getValue(this.value,e)}return null},e.prototype.setValue=function(e){var t=this;if(this.value&&this.value.length){var n=this.value.filter((function(e){return e.locale===t.defaultLocale||e.locale===r.Utils.getInexactLocale(t.defaultLocale)}))[0];n&&(n.value=e)}},e}();t.LabelValuePair=i},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Language=function(e,t){Array.isArray(e)?1===e.length?this.value=e[0]:this.value=e.join(\"<br/>\"):this.value=e,this.locale=t}},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.parse=function(e,t){var n,r=[];if(!e)return r;if(Array.isArray(e))for(var i=0;i<e.length;i++){var a=e[i];n=\"string\"==typeof a?new o.Language(a,t):new o.Language(a[\"@value\"],a[\"@language\"]||t),r.push(n)}else{if(\"string\"==typeof e)return n=new o.Language(e,t),r.push(n),r;e[\"@value\"]?(n=new o.Language(e[\"@value\"],e[\"@language\"]||t),r.push(n)):Object.keys(e).forEach((function(t){if(!e[t].length)throw new Error(\"language must have a value\");n=new o.Language(e[t],t),r.push(n)}))}return r},t.getValue=function(e,t){if(e.length){if(t){var n=e.filter((function(e){return e.locale===t||o.Utils.getInexactLocale(e.locale)===o.Utils.getInexactLocale(t)}))[0];if(n)return n.value}return e[0].value}return null},t}(Array);t.LanguageMap=a},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(1),a=n(0),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;if(r.index=0,r._allRanges=null,r.items=[],r._topRanges=[],r.__jsonld.structures&&r.__jsonld.structures.length)for(var i=r._getTopRanges(),o=0;o<i.length;o++){var a=i[o];r._parseRanges(a,String(o))}return r}return i(t,e),t.prototype.getPosterCanvas=function(){var e=this.getProperty(\"posterCanvas\");return e&&(e=new a.Canvas(e,this.options)),e},t.prototype.getBehavior=function(){var e=this.getProperty(\"behavior\");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getDefaultTree=function(){if(e.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),!this.isLoaded)return this.defaultTree;var t=this.getTopRanges();return t.length&&t[0].getTree(this.defaultTree),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},t.prototype._getTopRanges=function(){var e=[];if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var t=0;t<this.__jsonld.structures.length;t++){var n=this.__jsonld.structures[t];n.viewingHint===o.ViewingHint.TOP&&e.push(n)}if(!e.length){var r={};r.ranges=this.__jsonld.structures,e.push(r)}}return e},t.prototype.getTopRanges=function(){return this._topRanges},t.prototype._getRangeById=function(e){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var t=0;t<this.__jsonld.structures.length;t++){var n=this.__jsonld.structures[t];if(n[\"@id\"]===e||n.id===e)return n}return null},t.prototype._parseRanges=function(e,t,n){var r,i=null;if(\"string\"==typeof e&&(i=e,e=this._getRangeById(i)),e){(r=new a.Range(e,this.options)).parentRange=n,r.path=t,n?n.items.push(r):this._topRanges.push(r);var o=e.items||e.members;if(o)for(var s=0;s<o.length;s++){var u=o[s];if(u[\"@type\"]&&\"sc:range\"===u[\"@type\"].toLowerCase()||u.type&&\"range\"===u.type.toLowerCase())this._parseRanges(u,t+\"/\"+s,r);else if(u[\"@type\"]&&\"sc:canvas\"===u[\"@type\"].toLowerCase()||u.type&&\"canvas\"===u.type.toLowerCase()){r.canvases||(r.canvases=[]);var c=u.id||u[\"@id\"];r.canvases.push(c)}}else if(e.ranges)for(s=0;s<e.ranges.length;s++)this._parseRanges(e.ranges[s],t+\"/\"+s,r)}else console.warn(\"Range:\",i,\"does not exist\")},t.prototype.getAllRanges=function(){if(null!=this._allRanges)return this._allRanges;this._allRanges=[];for(var e=this.getTopRanges(),t=function(t){var r=e[t];r.id&&n._allRanges.push(r);var i=function(e,t){e.add(t);var n=t.getRanges();return n.length?n.reduce(i,e):e},o=Array.from(r.getRanges().reduce(i,new Set));n._allRanges=n._allRanges.concat(o)},n=this,r=0;r<e.length;r++)t(r);return this._allRanges},t.prototype.getRangeById=function(e){for(var t=this.getAllRanges(),n=0;n<t.length;n++){var r=t[n];if(r.id===e)return r}return null},t.prototype.getRangeByPath=function(e){for(var t=this.getAllRanges(),n=0;n<t.length;n++){var r=t[n];if(r.path===e)return r}return null},t.prototype.getSequences=function(){if(this.items.length)return this.items;var e=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(e)for(var t=0;t<e.length;t++){var n=e[t],r=new a.Sequence(n,this.options);this.items.push(r)}else this.__jsonld.items&&(r=new a.Sequence(this.__jsonld.items,this.options),this.items.push(r));return this.items},t.prototype.getSequenceByIndex=function(e){return this.getSequences()[e]},t.prototype.getTotalSequences=function(){return this.getSequences().length},t.prototype.getManifestType=function(){var e=this.getService(o.ServiceProfile.UI_EXTENSIONS);return e?e.getProperty(\"manifestType\"):a.ManifestType.EMPTY},t.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();if(e)return e===o.ViewingHint.PAGED;var t=this.getBehavior();return!!t&&t===o.Behavior.PAGED},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t}(a.IIIFResource);t.Manifest=s},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.EMPTY=\"\",e.MANUSCRIPT=\"manuscript\",e.MONOGRAPH=\"monograph\"}(t.ManifestType||(t.ManifestType={}))},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=n(1),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._ranges=null,r.canvases=null,r.items=[],r}return i(t,e),t.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:this.canvases?this.canvases:[]},t.prototype.getDuration=function(){var e,t;if(this.canvases&&this.canvases.length)for(var n=0;n<this.canvases.length;n++){var r=this.canvases[n],i=o.Utils.getTemporalComponent(r);i&&i.length>1&&(0===n&&(e=Number(i[0])),n===this.canvases.length-1&&(t=Number(i[1])))}else{var a=this.getRanges();for(n=0;n<a.length;n++){var s=a[n].getDuration();s&&(0===n&&(e=s.start),n===a.length-1&&(t=s.end))}}if(void 0!==e&&void 0!==t)return new o.Duration(e,t)},t.prototype.getRanges=function(){return this._ranges?this._ranges:this._ranges=this.items.filter((function(e){return e.isRange()}))},t.prototype.getBehavior=function(){var e=this.getProperty(\"behavior\");return Array.isArray(e)&&(e=e[0]),e||null},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t.prototype.getTree=function(e){e.data=this,this.treeNode=e;var t=this.getRanges();if(t&&t.length)for(var n=0;n<t.length;n++){var r=t[n],i=new o.TreeNode;e.addNode(i),this._parseTreeNode(i,r)}return o.Utils.generateTreeNodeIds(e),e},t.prototype.spansTime=function(e){var t=this.getDuration();return!!(t&&e>=t.start&&e<=t.end)},t.prototype._parseTreeNode=function(e,t){e.label=o.LanguageMap.getValue(t.getLabel(),this.options.locale),e.data=t,e.data.type=o.Utils.normaliseType(o.TreeNodeType.RANGE),t.treeNode=e;var n=t.getRanges();if(n&&n.length)for(var r=0;r<n.length;r++){var i=n[r];if(i.getBehavior()!==a.Behavior.NO_NAV){var s=new o.TreeNode;e.addNode(s),this._parseTreeNode(s,i)}}},t}(o.ManifestResource);t.Range=s},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getFormat=function(){return this.getProperty(\"format\")},t}(n(0).ManifestResource);t.Rendering=o},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(1),a=n(0),s=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.items=[],r._thumbnails=null,r}return i(t,e),t.prototype.getCanvases=function(){if(this.items.length)return this.items;var e=this.__jsonld.canvases||this.__jsonld.elements;if(e)for(var t=0;t<e.length;t++){var n=e[t];(r=new a.Canvas(n,this.options)).index=t,this.items.push(r)}else if(this.__jsonld)for(t=0;t<this.__jsonld.length;t++){var r;n=this.__jsonld[t],(r=new a.Canvas(n,this.options)).index=t,this.items.push(r)}return this.items},t.prototype.getCanvasById=function(e){for(var t=0;t<this.getTotalCanvases();t++){var n=this.getCanvasByIndex(t),r=a.Utils.normaliseUrl(n.id);if(a.Utils.normaliseUrl(e)===r)return n}return null},t.prototype.getCanvasByIndex=function(e){return this.getCanvases()[e]},t.prototype.getCanvasIndexById=function(e){for(var t=0;t<this.getTotalCanvases();t++)if(this.getCanvasByIndex(t).id===e)return t;return null},t.prototype.getCanvasIndexByLabel=function(e,t){e=e.trim(),isNaN(e)||(e=parseInt(e,10).toString(),t&&(e+=\"r\"));for(var n,r,i,o=/(\\d*)\\D+(\\d*)/,s=0;s<this.getTotalCanvases();s++){var u=this.getCanvasByIndex(s);if(a.LanguageMap.getValue(u.getLabel(),this.options.locale)===e)return s;if((n=o.exec(e))&&(r=n[1],(i=n[2])&&new RegExp(\"^\"+r+\"\\\\D+\"+i+\"$\").test(u.getLabel().toString())))return s}return-1},t.prototype.getLastCanvasLabel=function(e){for(var t=this.getTotalCanvases()-1;t>=0;t--){var n=this.getCanvasByIndex(t),r=a.LanguageMap.getValue(n.getLabel(),this.options.locale);if(e){if(/^[a-zA-Z0-9]*$/.test(r))return r}else if(r)return r}return this.options.defaultLabel},t.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},t.prototype.getNextPageIndex=function(e,t){var n;if(t){var r=this.getPagedIndices(e),i=this.getViewingDirection();n=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?r[0]+1:r[r.length-1]+1}else n=e+1;return n>this.getLastPageIndex()?-1:n},t.prototype.getPagedIndices=function(e,t){var n=[];if(t){n=this.isFirstCanvas(e)||this.isLastCanvas(e)?[e]:e%2?[e,e+1]:[e-1,e];var r=this.getViewingDirection();r&&r===o.ViewingDirection.RIGHT_TO_LEFT&&(n=n.reverse())}else n.push(e);return n},t.prototype.getPrevPageIndex=function(e,t){var n;if(t){var r=this.getPagedIndices(e),i=this.getViewingDirection();n=i&&i===o.ViewingDirection.RIGHT_TO_LEFT?r[r.length-1]-1:r[0]-1}else n=e-1;return n},t.prototype.getStartCanvasIndex=function(){var e=this.getStartCanvas();if(e)for(var t=0;t<this.getTotalCanvases();t++)if(this.getCanvasByIndex(t).id===e)return t;return 0},t.prototype.getThumbs=function(e,t){for(var n=[],r=this.getTotalCanvases(),i=0;i<r;i++){var o=this.getCanvasByIndex(i),s=new a.Thumb(e,o);n.push(s)}return n},t.prototype.getThumbnails=function(){if(null!=this._thumbnails)return this._thumbnails;this._thumbnails=[];for(var e=this.getCanvases(),t=0;t<e.length;t++){var n=e[t].getThumbnail();n&&this._thumbnails.push(n)}return this._thumbnails},t.prototype.getStartCanvas=function(){return this.getProperty(\"startCanvas\")},t.prototype.getTotalCanvases=function(){return this.getCanvases().length},t.prototype.getViewingDirection=function(){return this.getProperty(\"viewingDirection\")?this.getProperty(\"viewingDirection\"):this.options.resource.getViewingDirection?this.options.resource.getViewingDirection():null},t.prototype.getViewingHint=function(){return this.getProperty(\"viewingHint\")},t.prototype.isCanvasIndexOutOfRange=function(e){return e>this.getTotalCanvases()-1},t.prototype.isFirstCanvas=function(e){return 0===e},t.prototype.isLastCanvas=function(e){return e===this.getTotalCanvases()-1},t.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},t.prototype.isPagingEnabled=function(){var e=this.getViewingHint();return!!e&&e===o.ViewingHint.PAGED},t.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2==0},t}(a.ManifestResource);t.Sequence=s},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(0),i=function(){function e(){}return e.parse=function(e,t){return\"string\"==typeof e&&(e=JSON.parse(e)),this.parseJson(e,t)},e.parseJson=function(e,t){var n;if(t&&t.navDate&&!isNaN(t.navDate.getTime())&&(e.navDate=t.navDate.toString()),e[\"@type\"])switch(e[\"@type\"]){case\"sc:Collection\":n=this.parseCollection(e,t);break;case\"sc:Manifest\":n=this.parseManifest(e,t);break;default:return null}else switch(e.type){case\"Collection\":n=this.parseCollection(e,t);break;case\"Manifest\":n=this.parseManifest(e,t);break;default:return null}return n.isLoaded=!0,n},e.parseCollection=function(e,t){var n=new r.Collection(e,t);return t?(n.index=t.index||0,t.resource&&(n.parentCollection=t.resource.parentCollection)):n.index=0,this.parseCollections(n,t),this.parseManifests(n,t),this.parseItems(n,t),n},e.parseCollections=function(e,t){var n;if(e.__jsonld.collections?n=e.__jsonld.collections:e.__jsonld.items&&(n=e.__jsonld.items.filter((function(e){return\"collection\"===e.type.toLowerCase()}))),n)for(var r=0;r<n.length;r++){t&&(t.index=r);var i=this.parseCollection(n[r],t);i.index=r,i.parentCollection=e,e.items.push(i)}},e.parseManifest=function(e,t){return new r.Manifest(e,t)},e.parseManifests=function(e,t){var n;if(e.__jsonld.manifests?n=e.__jsonld.manifests:e.__jsonld.items&&(n=e.__jsonld.items.filter((function(e){return\"manifest\"===e.type.toLowerCase()}))),n)for(var r=0;r<n.length;r++){var i=this.parseManifest(n[r],t);i.index=r,i.parentCollection=e,e.items.push(i)}},e.parseItem=function(e,t){if(e[\"@type\"]){if(\"sc:manifest\"===e[\"@type\"].toLowerCase())return this.parseManifest(e,t);if(\"sc:collection\"===e[\"@type\"].toLowerCase())return this.parseCollection(e,t)}else if(e.type){if(\"manifest\"===e.type.toLowerCase())return this.parseManifest(e,t);if(\"collection\"===e.type.toLowerCase())return this.parseCollection(e,t)}return null},e.parseItems=function(e,t){var n=e.__jsonld.members||e.__jsonld.items;if(n)for(var r=function(r){t&&(t.index=r);var o=i.parseItem(n[r],t);return o?e.items.filter((function(e){return e.id===o.id}))[0]?\"continue\":(o.index=r,o.parentCollection=e,void e.items.push(o)):{value:void 0}},i=this,o=0;o<n.length;o++){var a=r(o);if(\"object\"==typeof a)return a.value}},e}();t.Deserialiser=i},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=n(0),a=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t.prototype.getProfile=function(){var e=this.getProperty(\"profile\");return e||(e=this.getProperty(\"dcterms:conformsTo\")),Array.isArray(e)?e[0]:e},t.prototype.getConfirmLabel=function(){return o.Utils.getLocalisedValue(this.getProperty(\"confirmLabel\"),this.options.locale)},t.prototype.getDescription=function(){return o.Utils.getLocalisedValue(this.getProperty(\"description\"),this.options.locale)},t.prototype.getFailureDescription=function(){return o.Utils.getLocalisedValue(this.getProperty(\"failureDescription\"),this.options.locale)},t.prototype.getFailureHeader=function(){return o.Utils.getLocalisedValue(this.getProperty(\"failureHeader\"),this.options.locale)},t.prototype.getHeader=function(){return o.Utils.getLocalisedValue(this.getProperty(\"header\"),this.options.locale)},t.prototype.getServiceLabel=function(){return o.Utils.getLocalisedValue(this.getProperty(\"label\"),this.options.locale)},t.prototype.getInfoUri=function(){var e=this.id;return e.endsWith(\"/\")||(e+=\"/\"),e+\"info.json\"},t}(o.ManifestResource);t.Service=a},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.Size=function(e,t){this.width=e,this.height=t}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e[e.AUTHORIZATION_FAILED=1]=\"AUTHORIZATION_FAILED\",e[e.FORBIDDEN=2]=\"FORBIDDEN\",e[e.INTERNAL_SERVER_ERROR=3]=\"INTERNAL_SERVER_ERROR\",e[e.RESTRICTED=4]=\"RESTRICTED\"}(t.StatusCode||(t.StatusCode={}))},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(0);t.Thumb=function(e,t){this.data=t,this.index=t.index,this.width=e;var n=t.getHeight()/t.getWidth();this.height=n?Math.floor(this.width*n):e,this.uri=t.getCanonicalImageUri(e),this.label=r.LanguageMap.getValue(t.getLabel())}},function(e,t,n){\"use strict\";var r,i=this&&this.__extends||(r=function(e,t){return(r=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])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,\"__esModule\",{value:!0});var o=function(e){function t(t,n){return e.call(this,t,n)||this}return i(t,e),t}(n(0).Resource);t.Thumbnail=o},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var r=n(0),i=function(){function e(e,t){this.label=e,this.data=t||{},this.nodes=[]}return e.prototype.addNode=function(e){this.nodes.push(e),e.parentNode=this},e.prototype.isCollection=function(){return this.data.type===r.Utils.normaliseType(r.TreeNodeType.COLLECTION)},e.prototype.isManifest=function(){return this.data.type===r.Utils.normaliseType(r.TreeNodeType.MANIFEST)},e.prototype.isRange=function(){return this.data.type===r.Utils.normaliseType(r.TreeNodeType.RANGE)},e}();t.TreeNode=i},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),function(e){e.COLLECTION=\"collection\",e.MANIFEST=\"manifest\",e.RANGE=\"range\"}(t.TreeNodeType||(t.TreeNodeType={}))},function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.CONTINUE=100,t.SWITCHING_PROTOCOLS=101,t.PROCESSING=102,t.OK=200,t.CREATED=201,t.ACCEPTED=202,t.NON_AUTHORITATIVE_INFORMATION=203,t.NO_CONTENT=204,t.RESET_CONTENT=205,t.PARTIAL_CONTENT=206,t.MULTI_STATUS=207,t.MULTIPLE_CHOICES=300,t.MOVED_PERMANENTLY=301,t.MOVED_TEMPORARILY=302,t.SEE_OTHER=303,t.NOT_MODIFIED=304,t.USE_PROXY=305,t.TEMPORARY_REDIRECT=307,t.BAD_REQUEST=400,t.UNAUTHORIZED=401,t.PAYMENT_REQUIRED=402,t.FORBIDDEN=403,t.NOT_FOUND=404,t.METHOD_NOT_ALLOWED=405,t.NOT_ACCEPTABLE=406,t.PROXY_AUTHENTICATION_REQUIRED=407,t.REQUEST_TIME_OUT=408,t.CONFLICT=409,t.GONE=410,t.LENGTH_REQUIRED=411,t.PRECONDITION_FAILED=412,t.REQUEST_ENTITY_TOO_LARGE=413,t.REQUEST_URI_TOO_LARGE=414,t.UNSUPPORTED_MEDIA_TYPE=415,t.REQUESTED_RANGE_NOT_SATISFIABLE=416,t.EXPECTATION_FAILED=417,t.IM_A_TEAPOT=418,t.UNPROCESSABLE_ENTITY=422,t.LOCKED=423,t.FAILED_DEPENDENCY=424,t.UNORDERED_COLLECTION=425,t.UPGRADE_REQUIRED=426,t.PRECONDITION_REQUIRED=428,t.TOO_MANY_REQUESTS=429,t.REQUEST_HEADER_FIELDS_TOO_LARGE=431,t.INTERNAL_SERVER_ERROR=500,t.NOT_IMPLEMENTED=501,t.BAD_GATEWAY=502,t.SERVICE_UNAVAILABLE=503,t.GATEWAY_TIME_OUT=504,t.HTTP_VERSION_NOT_SUPPORTED=505,t.VARIANT_ALSO_NEGOTIATES=506,t.INSUFFICIENT_STORAGE=507,t.BANDWIDTH_LIMIT_EXCEEDED=509,t.NOT_EXTENDED=510,t.NETWORK_AUTHENTICATION_REQUIRED=511}])},function(e,t,n){e.exports=window.fetch||(window.fetch=n(3).default||n(3))}])},function(e,t,n){\"use strict\";n.r(t),n.d(t,\"BaseComponent\",(function(){return r}));var r=function(){function e(e){this.options=e,this.options.data=Object.assign({},this.data(),e.data)}return e.prototype._init=function(){return this.el=this.options.target,this.el?(this.el.innerHTML=\"\",!0):(console.warn(\"element not found\"),!1)},e.prototype.data=function(){return{}},e.prototype.on=function(e,t,n){var r=this._e||(this._e={});(r[e]||(r[e]=[])).push({fn:t,ctx:n})},e.prototype.fire=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=[].slice.call(arguments,1),i=((this._e||(this._e={}))[e]||[]).slice(),o=0,a=i.length;o<a;o++)i[o].fn.apply(i[o].ctx,r)},e.prototype._resize=function(){},e.prototype.set=function(e){},e}()},function(e,t,n){\"use strict\";n.r(t),n.d(t,\"Async\",(function(){return i})),n.d(t,\"Bools\",(function(){return o})),n.d(t,\"Clipboard\",(function(){return a})),n.d(t,\"Colors\",(function(){return s})),n.d(t,\"Dates\",(function(){return u})),n.d(t,\"Device\",(function(){return c})),n.d(t,\"Documents\",(function(){return l})),n.d(t,\"Events\",(function(){return p})),n.d(t,\"Files\",(function(){return f})),n.d(t,\"Keyboard\",(function(){return h})),n.d(t,\"Maths\",(function(){return d})),n.d(t,\"Size\",(function(){return _})),n.d(t,\"Dimensions\",(function(){return g})),n.d(t,\"Numbers\",(function(){return v})),n.d(t,\"Objects\",(function(){return y})),n.d(t,\"Storage\",(function(){return E})),n.d(t,\"StorageItem\",(function(){return m})),n.d(t,\"StorageType\",(function(){return r})),n.d(t,\"Strings\",(function(){return I})),n.d(t,\"Urls\",(function(){return O}));var r,i=function(){function e(){}return e.waitFor=function(t,n,r,i,o,a){i||(i=200),o||(o=100),a||(a=0),(a+=1)>o?r&&r():t()?n():setTimeout((function(){e.waitFor(t,n,r,i,o,a)}),i)},e}(),o=function(){function e(){}return e.getBool=function(e,t){return null==e?t:e},e}(),a=function(){function e(){}return e.supportsCopy=function(){return document.queryCommandSupported&&document.queryCommandSupported(\"copy\")},e.copy=function(t){t=e.convertBrToNewLine(t);var n=document.createElement(\"textarea\");n.value=t,e.hideButKeepEnabled(n),document.body.appendChild(n),n.focus(),n.select(),document.execCommand(\"copy\"),document.body.removeChild(n)},e.hideButKeepEnabled=function(e){e.style.position=\"fixed\",e.style.top=\"0\",e.style.left=\"0\",e.style.width=\"2em\",e.style.height=\"2em\",e.style.padding=\"0\",e.style.border=\"none\",e.style.outline=\"none\",e.style.boxShadow=\"none\",e.style.background=\"transparent\"},e.convertBrToNewLine=function(e){return e=e.replace(/<br\\s*[\\/]?>/gi,\"\\n\")},e}(),s=function(){function e(){}return e.float32ColorToARGB=function(e){return[(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},e._componentToHex=function(e){var t=e.toString(16);return 1==t.length?\"0\"+t:t},e.rgbToHexString=function(t){return e.coalesce(t),\"#\"+e._componentToHex(t[0])+e._componentToHex(t[1])+e._componentToHex(t[2])},e.argbToHexString=function(t){return\"#\"+e._componentToHex(t[0])+e._componentToHex(t[1])+e._componentToHex(t[2])+e._componentToHex(t[3])},e.coalesce=function(e){for(var t=1;t<e.length;t++)void 0===e[t]&&(e[t]=e[t-1])},e}(),u=function(){function e(){}return e.getTimeStamp=function(){return(new Date).getTime()},e}(),c=function(){function e(){}return e.getPixelRatio=function(e){return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},e.isTouch=function(){return!!(\"ontouchstart\"in window)||window.navigator.msMaxTouchPoints>0},e}(),l=function(){function e(){}return e.isInIFrame=function(){try{return window.self!==window.top}catch(e){return!0}},e.supportsFullscreen=function(){var e=document.documentElement;return void 0!==(e.requestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullScreen||e.msRequestFullscreen)},e.isHidden=function(){return!!e.getHiddenProp()},e.getHiddenProp=function(){var e=[\"webkit\",\"moz\",\"ms\",\"o\"];if(\"hidden\"in document)return\"hidden\";for(var t=0;t<e.length;t++)if(e[t]+\"Hidden\"in document)return e[t]+\"Hidden\";return null},e}(),p=function(){function e(){}return e.debounce=function(e,t){return t=t||100,function(){if(!e.debouncing){var n=Array.prototype.slice.apply(arguments);e.lastReturnVal=e.apply(window,n),e.debouncing=!0}return clearTimeout(e.debounceTimeout),e.debounceTimeout=setTimeout((function(){e.debouncing=!1}),t),e.lastReturnVal}},e}(),f=function(){function e(){}return e.simplifyMimeType=function(e){switch(e){case\"text/plain\":return\"txt\";case\"image/jpeg\":return\"jpg\";case\"application/msword\":return\"doc\";case\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":return\"docx\";default:var t=e.split(\"/\");return t[t.length-1]}},e}(),h=function(){function e(){}return e.getCharCode=function(e){return\"number\"==typeof e.which?e.which:e.keyCode},e}(),d=function(){function e(){}return e.normalise=function(e,t,n){return(e-t)/(n-t)},e.median=function(e){e.sort((function(e,t){return e-t}));var t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2},e.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)},e}(),_=function(e,t){this.width=e,this.height=t},g=function(){function e(){}return e.fitRect=function(e,t,n,r){var i,o=0,a=0;return t/e<r/n?(o=e*(i=n/e),a=t*i):(o=e*(i=r/t),a=t*i),new _(Math.floor(o),Math.floor(a))},e.hitRect=function(e,t,n,r,i,o){return i>e&&i<e+n&&o>t&&o<t+r},e}(),v=function(){function e(){}return e.numericalInput=function(e){return 46==e.keyCode||8==e.keyCode||9==e.keyCode||27==e.keyCode||65==e.keyCode&&!0===e.ctrlKey||e.keyCode>=35&&e.keyCode<=39||(!(e.shiftKey||(e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105))||(e.preventDefault(),!1))},e}(),y=function(){function e(){}return e.toPlainObject=function(e){e=Object(e);var t={};for(var n in e)t[n]=e[n];return t},e}(),E=function(){function e(){}return e.clear=function(e){switch(void 0===e&&(e=r.MEMORY),e){case r.MEMORY:this._memoryStorage={};break;case r.SESSION:sessionStorage.clear();break;case r.LOCAL:localStorage.clear()}},e.clearExpired=function(e){void 0===e&&(e=r.MEMORY);for(var t=this.getItems(e),n=0;n<t.length;n++){var i=t[n];this._isExpired(i)&&this.remove(i.key)}},e.get=function(e,t){void 0===t&&(t=r.MEMORY);var n=null;switch(t){case r.MEMORY:n=this._memoryStorage[e];break;case r.SESSION:n=sessionStorage.getItem(e);break;case r.LOCAL:n=localStorage.getItem(e)}if(!n)return null;var i=null;try{i=JSON.parse(n)}catch(e){return null}return i?this._isExpired(i)?null:(i.key=e,i):null},e._isExpired=function(e){return!((new Date).getTime()<e.expiresAt)},e.getItems=function(e){void 0===e&&(e=r.MEMORY);var t=[];switch(e){case r.MEMORY:for(var n=Object.keys(this._memoryStorage),i=0;i<n.length;i++){(a=this.get(n[i],r.MEMORY))&&t.push(a)}break;case r.SESSION:for(i=0;i<sessionStorage.length;i++){if(o=sessionStorage.key(i))(a=this.get(o,r.SESSION))&&t.push(a)}break;case r.LOCAL:for(i=0;i<localStorage.length;i++){var o,a;if(o=localStorage.key(i))(a=this.get(o,r.LOCAL))&&t.push(a)}}return t},e.remove=function(e,t){switch(void 0===t&&(t=r.MEMORY),t){case r.MEMORY:delete this._memoryStorage[e];break;case r.SESSION:sessionStorage.removeItem(e);break;case r.LOCAL:localStorage.removeItem(e)}},e.set=function(e,t,n,i){void 0===i&&(i=r.MEMORY);var o=1e3*n,a=new m;switch(a.value=t,a.expiresAt=(new Date).getTime()+o,i){case r.MEMORY:this._memoryStorage[e]=JSON.stringify(a);break;case r.SESSION:sessionStorage.setItem(e,JSON.stringify(a));break;case r.LOCAL:localStorage.setItem(e,JSON.stringify(a))}return a},e._memoryStorage={},e}(),m=function(){};!function(e){e.MEMORY=\"memory\",e.SESSION=\"session\",e.LOCAL=\"local\"}(r||(r={}));var I=function(){function e(){}return e.ellipsis=function(e,t){if(e.length<=t)return e;var n=e.substr(0,t),r=n.lastIndexOf(\" \");return-1!=r&&(n=n.substr(0,Math.min(n.length,r))),n+\"…\"},e.htmlDecode=function(e){var t=document.createElement(\"div\");return t.innerHTML=e,t.firstChild.nodeValue},e.format=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var i=new RegExp(\"\\\\{\"+r+\"\\\\}\",\"gm\");e=e.replace(i,t[r])}return e},e.isAlphanumeric=function(e){return/^[a-zA-Z0-9]*$/.test(e)},e.toCssClass=function(e){return e.replace(/[^a-z0-9]/g,(function(e){var t=e.charCodeAt(0);return 32==t?\"-\":t>=65&&t<=90?\"_\"+e.toLowerCase():\"__\"+(\"000\"+t.toString(16)).slice(-4)}))},e.toFileName=function(e){return e.replace(/[^a-z0-9]/gi,\"_\").toLowerCase()},e.utf8_to_b64=function(e){return window.btoa(unescape(encodeURIComponent(e)))},e}(),O=function(){function e(){}return e.getHashParameter=function(e,t){return t||(t=window.document),t&&t.location?this.getHashParameterFromString(e,t.location.hash):null},e.getHashParameterFromString=function(e,t){var n=new RegExp(\"#.*[?&]\"+e+\"=([^&]+)(&|$)\").exec(t);return n?decodeURIComponent(n[1].replace(/\\+/g,\" \")):null},e.setHashParameter=function(e,t,n){if(n||(n=window.document),n&&n.location){var r=\"#?\"+this.updateURIKeyValuePair(n.location.hash.replace(\"#?\",\"\"),e,t),i=n.URL;-1!=i.indexOf(\"#\")&&(i=i.substr(0,i.indexOf(\"#\"))),n.location.replace(i+r)}},e.getQuerystringParameter=function(e,t){return t||(t=window),this.getQuerystringParameterFromString(e,t.location.search)},e.getQuerystringParameterFromString=function(e,t){e=e.replace(/[\\[]/,\"\\\\[\").replace(/[\\]]/,\"\\\\]\");var n=new RegExp(\"[\\\\?&]\"+e+\"=([^&#]*)\").exec(t);return n?decodeURIComponent(n[1].replace(/\\+/g,\" \")):null},e.setQuerystringParameter=function(e,t,n){if(n||(n=window.document),n&&n.location){var r=this.updateURIKeyValuePair(n.location.hash.replace(\"#?\",\"\"),e,t);window.location.search=r}},e.updateURIKeyValuePair=function(e,t,n){t=encodeURIComponent(t),n=encodeURIComponent(n);var r=e.split(\"&\");\"\"==r[0]&&r.shift();for(var i,o=r.length;o--;)if((i=r[o].split(\"=\"))[0]==t){i[1]=n,r[o]=i.join(\"=\");break}return o<0&&(r[r.length]=[t,n].join(\"=\")),r.join(\"&\")},e.getUrlParts=function(e){var t=document.createElement(\"a\");return t.href=e,t},e.convertToRelativeUrl=function(e){var t=this.getUrlParts(e),n=t.pathname+t.searchWithin;return n.startsWith(\"/\")||(n=\"/\"+n),n},e}()}])}));\ndefine(\"lib/IIIFMetadataComponent.js\", function(){});\n\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-shared-module/RightPanel',[\"require\", \"exports\", \"./BaseEvents\", \"./BaseExpandPanel\"], function (require, exports, BaseEvents_1, BaseExpandPanel_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var RightPanel = /** @class */ (function (_super) {\r\n __extends(RightPanel, _super);\r\n function RightPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n RightPanel.prototype.create = function () {\r\n _super.prototype.create.call(this);\r\n this.$element.width(this.options.panelCollapsedWidth);\r\n };\r\n RightPanel.prototype.init = function () {\r\n var _this = this;\r\n _super.prototype.init.call(this);\r\n var shouldOpenPanel = Utils.Bools.getBool(this.extension.getSettings().rightPanelOpen, this.options.panelOpen);\r\n if (shouldOpenPanel) {\r\n this.toggle(true);\r\n }\r\n this.component.subscribe(BaseEvents_1.BaseEvents.TOGGLE_EXPAND_RIGHT_PANEL, function () {\r\n if (_this.isFullyExpanded) {\r\n _this.collapseFull();\r\n }\r\n else {\r\n _this.expandFull();\r\n }\r\n });\r\n };\r\n RightPanel.prototype.getTargetWidth = function () {\r\n return this.isExpanded ? this.options.panelCollapsedWidth : this.options.panelExpandedWidth;\r\n };\r\n RightPanel.prototype.getTargetLeft = function () {\r\n return this.isExpanded ? this.$element.parent().width() - this.options.panelCollapsedWidth : this.$element.parent().width() - this.options.panelExpandedWidth;\r\n };\r\n RightPanel.prototype.toggleFinish = function () {\r\n _super.prototype.toggleFinish.call(this);\r\n if (this.isExpanded) {\r\n this.component.publish(BaseEvents_1.BaseEvents.OPEN_RIGHT_PANEL);\r\n }\r\n else {\r\n this.component.publish(BaseEvents_1.BaseEvents.CLOSE_RIGHT_PANEL);\r\n }\r\n this.extension.updateSettings({ rightPanelOpen: this.isExpanded });\r\n };\r\n RightPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$element.css({\r\n 'left': Math.floor(this.$element.parent().width() - this.$element.outerWidth())\r\n });\r\n };\r\n return RightPanel;\r\n }(BaseExpandPanel_1.BaseExpandPanel));\r\n exports.RightPanel = RightPanel;\r\n});\r\n//# sourceMappingURL=RightPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-moreinforightpanel-module/MoreInfoRightPanel',[\"require\", \"exports\", \"@iiif/iiif-metadata-component\", \"@iiif/manifold\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/RightPanel\", \"../../Utils\"], function (require, exports, iiif_metadata_component_1, manifold_1, BaseEvents_1, RightPanel_1, Utils_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var MoreInfoRightPanel = /** @class */ (function (_super) {\r\n __extends(MoreInfoRightPanel, _super);\r\n function MoreInfoRightPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n MoreInfoRightPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('moreInfoRightPanel');\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function () {\r\n _this.databind();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RANGE_CHANGED, function () {\r\n _this.databind();\r\n });\r\n this.setTitle(this.config.content.title);\r\n this.$metadata = $('<div class=\"iiif-metadata-component\"></div>');\r\n this.$main.append(this.$metadata);\r\n this.metadataComponent = new iiif_metadata_component_1.MetadataComponent({\r\n target: this.$metadata[0],\r\n data: this._getData()\r\n });\r\n this.metadataComponent.on('iiifViewerLinkClicked', function (href) {\r\n // get the hash param.\r\n var rangeId = Utils.Urls.getHashParameterFromString('rid', href);\r\n if (rangeId) {\r\n var range = _this.extension.helper.getRangeById(rangeId);\r\n if (range) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.RANGE_CHANGED, range);\r\n }\r\n }\r\n }, false);\r\n };\r\n MoreInfoRightPanel.prototype.toggleFinish = function () {\r\n _super.prototype.toggleFinish.call(this);\r\n this.databind();\r\n };\r\n MoreInfoRightPanel.prototype.databind = function () {\r\n this.metadataComponent.set(this._getData());\r\n };\r\n MoreInfoRightPanel.prototype._getCurrentRange = function () {\r\n return this.extension.helper.getCurrentRange();\r\n };\r\n MoreInfoRightPanel.prototype._getData = function () {\r\n return {\r\n canvasDisplayOrder: this.config.options.canvasDisplayOrder,\r\n canvases: this.extension.getCurrentCanvases(),\r\n canvasExclude: this.config.options.canvasExclude,\r\n canvasLabels: this.extension.getCanvasLabels(this.content.page),\r\n content: this.config.content,\r\n copiedMessageDuration: 2000,\r\n copyToClipboardEnabled: Utils.Bools.getBool(this.config.options.copyToClipboardEnabled, false),\r\n helper: this.extension.helper,\r\n licenseFormatter: new manifold_1.UriLabeller(this.config.license ? this.config.license : {}),\r\n limit: this.config.options.textLimit || 4,\r\n limitType: 'lines',\r\n limitToRange: Utils.Bools.getBool(this.config.options.limitToRange, false),\r\n manifestDisplayOrder: this.config.options.manifestDisplayOrder,\r\n manifestExclude: this.config.options.manifestExclude,\r\n range: this._getCurrentRange(),\r\n rtlLanguageCodes: this.config.options.rtlLanguageCodes,\r\n sanitizer: function (html) {\r\n return Utils_1.UVUtils.sanitize(html);\r\n },\r\n showAllLanguages: this.config.options.showAllLanguages\r\n };\r\n };\r\n MoreInfoRightPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$main.height(this.$element.height() - this.$top.height() - this.$main.verticalMargins());\r\n };\r\n return MoreInfoRightPanel;\r\n }(RightPanel_1.RightPanel));\r\n exports.MoreInfoRightPanel = MoreInfoRightPanel;\r\n});\r\n//# sourceMappingURL=MoreInfoRightPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/SettingsDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\"], function (require, exports, BaseEvents_1, Dialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SettingsDialogue = /** @class */ (function (_super) {\r\n __extends(SettingsDialogue, _super);\r\n function SettingsDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n SettingsDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('settingsDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_SETTINGS_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_SETTINGS_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function () {\r\n _this.open();\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.$title = $('<h1></h1>');\r\n this.$content.append(this.$title);\r\n this.$scroll = $('<div class=\"scroll\"></div>');\r\n this.$content.append(this.$scroll);\r\n this.$version = $('<div class=\"version\"></div>');\r\n this.$content.append(this.$version);\r\n this.$website = $('<div class=\"website\"></div>');\r\n this.$content.append(this.$website);\r\n this.$locale = $('<div class=\"setting locale\"></div>');\r\n this.$scroll.append(this.$locale);\r\n this.$localeLabel = $('<label for=\"locale\">' + this.content.locale + '</label>');\r\n this.$locale.append(this.$localeLabel);\r\n this.$localeDropDown = $('<select id=\"locale\"></select>');\r\n this.$locale.append(this.$localeDropDown);\r\n // initialise ui.\r\n this.$title.text(this.content.title);\r\n this.$website.html(this.content.website);\r\n this.$website.targetBlank();\r\n this._createLocalesMenu();\r\n this.$element.hide();\r\n };\r\n SettingsDialogue.prototype.getSettings = function () {\r\n return this.extension.getSettings();\r\n };\r\n SettingsDialogue.prototype.updateSettings = function (settings) {\r\n this.extension.updateSettings(settings);\r\n this.component.publish(BaseEvents_1.BaseEvents.UPDATE_SETTINGS, settings);\r\n };\r\n SettingsDialogue.prototype.open = function () {\r\n _super.prototype.open.call(this);\r\n //$.getJSON(this.extension.data.root + \"/info.json\", (pjson: any) => {\r\n this.$version.text(\"v3.1.4\"); // update this on version\r\n //});\r\n };\r\n SettingsDialogue.prototype._createLocalesMenu = function () {\r\n var _this = this;\r\n var locales = this.extension.data.locales;\r\n if (locales && locales.length > 1) {\r\n for (var i = 0; i < locales.length; i++) {\r\n var locale = locales[i];\r\n this.$localeDropDown.append('<option value=\"' + locale.name + '\">' + locale.label + '</option>');\r\n }\r\n this.$localeDropDown.val(locales[0].name);\r\n }\r\n else {\r\n this.$locale.hide();\r\n }\r\n this.$localeDropDown.change(function () {\r\n _this.extension.changeLocale(_this.$localeDropDown.val());\r\n });\r\n };\r\n SettingsDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return SettingsDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.SettingsDialogue = SettingsDialogue;\r\n});\r\n//# sourceMappingURL=SettingsDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-av-extension/SettingsDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/SettingsDialogue\"], function (require, exports, SettingsDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SettingsDialogue = /** @class */ (function (_super) {\r\n __extends(SettingsDialogue, _super);\r\n function SettingsDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n SettingsDialogue.prototype.create = function () {\r\n this.setConfig('settingsDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n return SettingsDialogue;\r\n }(SettingsDialogue_1.SettingsDialogue));\r\n exports.SettingsDialogue = SettingsDialogue;\r\n});\r\n//# sourceMappingURL=SettingsDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/ShareDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\"], function (require, exports, BaseEvents_1, Dialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ShareDialogue = /** @class */ (function (_super) {\r\n __extends(ShareDialogue, _super);\r\n function ShareDialogue($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this.aspectRatio = .75;\r\n _this.isEmbedViewVisible = false;\r\n _this.isShareViewVisible = false;\r\n _this.maxWidth = 8000;\r\n _this.maxHeight = _this.maxWidth * _this.aspectRatio;\r\n _this.minWidth = 200;\r\n _this.minHeight = _this.minWidth * _this.aspectRatio;\r\n _this.shareManifests = false;\r\n return _this;\r\n }\r\n ShareDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('shareDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_SHARE_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_SHARE_DIALOGUE;\r\n this.shareManifests = this.options.shareManifests || false;\r\n this.component.subscribe(this.openCommand, function (triggerButton) {\r\n _this.open(triggerButton);\r\n if (_this.isShareAvailable()) {\r\n _this.openShareView();\r\n }\r\n else {\r\n _this.openEmbedView();\r\n }\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_EMBED_DIALOGUE, function (triggerButton) {\r\n _this.open(triggerButton);\r\n _this.openEmbedView();\r\n });\r\n this.$tabs = $('<div class=\"tabs\"></div>');\r\n this.$content.append(this.$tabs);\r\n this.$shareButton = $('<a class=\"share tab default\" tabindex=\"0\">' + this.content.share + '</a>');\r\n this.$shareButton.prop('title', this.content.share);\r\n this.$tabs.append(this.$shareButton);\r\n this.$embedButton = $('<a class=\"embed tab\" tabindex=\"0\">' + this.content.embed + '</a>');\r\n this.$embedButton.prop('title', this.content.embed);\r\n this.$tabs.append(this.$embedButton);\r\n this.$tabsContent = $('<div class=\"tabsContent\"></div>');\r\n this.$content.append(this.$tabsContent);\r\n this.$footer = $('<div class=\"footer\"></div>');\r\n this.$content.append(this.$footer);\r\n this.$shareView = $('<div class=\"shareView view\"></div>');\r\n this.$tabsContent.append(this.$shareView);\r\n this.$shareHeader = $('<div class=\"header\"></div>');\r\n this.$shareView.append(this.$shareHeader);\r\n this.$shareLink = $('<a class=\"shareLink\" onclick=\"return false;\"></a>');\r\n this.$shareView.append(this.$shareLink);\r\n this.$shareInput = $(\"<input class=\\\"shareInput\\\" type=\\\"text\\\" readonly=\\\"readonly\\\" aria-label=\\\"\" + this.content.shareUrl + \"\\\"/>\");\r\n this.$shareView.append(this.$shareInput);\r\n this.$shareFrame = $('<iframe class=\"shareFrame\"></iframe>');\r\n this.$shareView.append(this.$shareFrame);\r\n this.$embedView = $('<div class=\"embedView view\"></div>');\r\n this.$tabsContent.append(this.$embedView);\r\n this.$embedHeader = $('<div class=\"header\"></div>');\r\n this.$embedView.append(this.$embedHeader);\r\n // this.$link = $('<a target=\"_blank\"></a>');\r\n // this.$embedView.find('.leftCol').append(this.$link);\r\n // this.$image = $('<img class=\"share\" />');\r\n // this.$embedView.append(this.$image);\r\n this.$code = $(\"<input class=\\\"code\\\" type=\\\"text\\\" readonly=\\\"readonly\\\" aria-label=\\\"\" + this.content.embed + \"\\\"/>\");\r\n this.$embedView.append(this.$code);\r\n this.$customSize = $('<div class=\"customSize\"></div>');\r\n this.$embedView.append(this.$customSize);\r\n this.$size = $('<span class=\"size\">' + this.content.size + '</span>');\r\n this.$customSize.append(this.$size);\r\n this.$customSizeDropDown = $('<select id=\"size\" aria-label=\"' + this.content.size + '\"></select>');\r\n this.$customSize.append(this.$customSizeDropDown);\r\n this.$customSizeDropDown.append('<option value=\"small\" data-width=\"560\" data-height=\"420\">560 x 420</option>');\r\n this.$customSizeDropDown.append('<option value=\"medium\" data-width=\"640\" data-height=\"480\">640 x 480</option>');\r\n this.$customSizeDropDown.append('<option value=\"large\" data-width=\"800\" data-height=\"600\">800 x 600</option>');\r\n this.$customSizeDropDown.append('<option value=\"custom\">' + this.content.customSize + '</option>');\r\n this.$widthInput = $('<input class=\"width\" type=\"text\" maxlength=\"10\" aria-label=\"' + this.content.width + '\"/>');\r\n this.$customSize.append(this.$widthInput);\r\n this.$x = $('<span class=\"x\">x</span>');\r\n this.$customSize.append(this.$x);\r\n this.$heightInput = $('<input class=\"height\" type=\"text\" maxlength=\"10\" aria-label=\"' + this.content.height + '\"/>');\r\n this.$customSize.append(this.$heightInput);\r\n var iiifUrl = this.extension.getIIIFShareUrl(this.shareManifests);\r\n this.$iiifButton = $('<a class=\"imageBtn iiif\" href=\"' + iiifUrl + '\" title=\"' + this.content.iiif + '\" target=\"_blank\"></a>');\r\n this.$footer.append(this.$iiifButton);\r\n this.$termsOfUseButton = $('<a href=\"#\">' + this.extension.data.config.content.termsOfUse + '</a>');\r\n this.$footer.append(this.$termsOfUseButton);\r\n this.$widthInput.on('keydown', function (e) {\r\n return Utils.Numbers.numericalInput(e);\r\n });\r\n this.$heightInput.on('keydown', function (e) {\r\n return Utils.Numbers.numericalInput(e);\r\n });\r\n this.$shareInput.focus(function () {\r\n $(this).select();\r\n });\r\n this.$code.focus(function () {\r\n $(this).select();\r\n });\r\n this.$shareButton.onPressed(function () {\r\n _this.openShareView();\r\n });\r\n this.$embedButton.onPressed(function () {\r\n _this.openEmbedView();\r\n });\r\n this.$customSizeDropDown.change(function () {\r\n _this.update();\r\n });\r\n this.$widthInput.change(function () {\r\n _this.updateHeightRatio();\r\n _this.update();\r\n });\r\n this.$heightInput.change(function () {\r\n _this.updateWidthRatio();\r\n _this.update();\r\n });\r\n this.$termsOfUseButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.SHOW_TERMS_OF_USE);\r\n });\r\n this.$element.hide();\r\n this.update();\r\n };\r\n ShareDialogue.prototype.open = function (triggerButton) {\r\n _super.prototype.open.call(this, triggerButton);\r\n this.update();\r\n };\r\n ShareDialogue.prototype.getShareUrl = function () {\r\n return this.extension.getShareUrl();\r\n };\r\n ShareDialogue.prototype.isShareAvailable = function () {\r\n return !!this.getShareUrl();\r\n };\r\n ShareDialogue.prototype.update = function () {\r\n if (this.isShareAvailable()) {\r\n this.$shareButton.show();\r\n }\r\n else {\r\n this.$shareButton.hide();\r\n }\r\n var $selected = this.getSelectedSize();\r\n if ($selected.val() === 'custom') {\r\n this.$widthInput.show();\r\n this.$x.show();\r\n this.$heightInput.show();\r\n }\r\n else {\r\n this.$widthInput.hide();\r\n this.$x.hide();\r\n this.$heightInput.hide();\r\n this.currentWidth = Number($selected.data('width'));\r\n this.currentHeight = Number($selected.data('height'));\r\n this.$widthInput.val(String(this.currentWidth));\r\n this.$heightInput.val(String(this.currentHeight));\r\n }\r\n this.updateInstructions();\r\n this.updateShareOptions();\r\n this.updateShareFrame();\r\n this.updateTermsOfUseButton();\r\n };\r\n ShareDialogue.prototype.updateShareOptions = function () {\r\n var shareUrl = this.getShareUrl();\r\n if (shareUrl) {\r\n this.$shareInput.val(shareUrl);\r\n this.$shareLink.prop('href', shareUrl);\r\n this.$shareLink.text(shareUrl);\r\n }\r\n if (this.extension.isMobile()) {\r\n this.$shareInput.hide();\r\n this.$shareLink.show();\r\n }\r\n else {\r\n this.$shareInput.show();\r\n this.$shareLink.hide();\r\n }\r\n };\r\n ShareDialogue.prototype.updateInstructions = function () {\r\n if (Utils.Bools.getBool(this.options.instructionsEnabled, false)) {\r\n this.$shareHeader.show();\r\n this.$embedHeader.show();\r\n this.$shareHeader.text(this.content.shareInstructions);\r\n this.$embedHeader.text(this.content.embedInstructions);\r\n }\r\n else {\r\n this.$shareHeader.hide();\r\n this.$embedHeader.hide();\r\n }\r\n };\r\n // updateThumbnail(): void {\r\n // var canvas: Manifesto.ICanvas = this.extension.helper.getCurrentCanvas();\r\n // if (!canvas) return;\r\n // var thumbnail = canvas.getProperty('thumbnail');\r\n // if (!thumbnail || !_.isString(thumbnail)){\r\n // thumbnail = canvas.getCanonicalImageUri(this.extension.data.config.options.bookmarkThumbWidth);\r\n // }\r\n // this.$link.attr('href', thumbnail);\r\n // this.$image.attr('src', thumbnail);\r\n // }\r\n ShareDialogue.prototype.getSelectedSize = function () {\r\n return this.$customSizeDropDown.find(':selected');\r\n };\r\n ShareDialogue.prototype.updateWidthRatio = function () {\r\n this.currentHeight = Number(this.$heightInput.val());\r\n if (this.currentHeight < this.minHeight) {\r\n this.currentHeight = this.minHeight;\r\n this.$heightInput.val(String(this.currentHeight));\r\n }\r\n else if (this.currentHeight > this.maxHeight) {\r\n this.currentHeight = this.maxHeight;\r\n this.$heightInput.val(String(this.currentHeight));\r\n }\r\n this.currentWidth = Math.floor(this.currentHeight / this.aspectRatio);\r\n this.$widthInput.val(String(this.currentWidth));\r\n };\r\n ShareDialogue.prototype.updateHeightRatio = function () {\r\n this.currentWidth = Number(this.$widthInput.val());\r\n if (this.currentWidth < this.minWidth) {\r\n this.currentWidth = this.minWidth;\r\n this.$widthInput.val(String(this.currentWidth));\r\n }\r\n else if (this.currentWidth > this.maxWidth) {\r\n this.currentWidth = this.maxWidth;\r\n this.$widthInput.val(String(this.currentWidth));\r\n }\r\n this.currentHeight = Math.floor(this.currentWidth * this.aspectRatio);\r\n this.$heightInput.val(String(this.currentHeight));\r\n };\r\n ShareDialogue.prototype.updateShareFrame = function () {\r\n var shareUrl = this.extension.helper.getShareServiceUrl();\r\n if (!shareUrl) {\r\n return;\r\n }\r\n if (Utils.Bools.getBool(this.config.options.shareFrameEnabled, true) && shareUrl) {\r\n this.$shareFrame.prop('src', shareUrl);\r\n this.$shareFrame.show();\r\n }\r\n else {\r\n this.$shareFrame.hide();\r\n }\r\n };\r\n ShareDialogue.prototype.updateTermsOfUseButton = function () {\r\n var requiredStatement = this.extension.helper.getRequiredStatement();\r\n if (Utils.Bools.getBool(this.extension.data.config.options.termsOfUseEnabled, false) && requiredStatement && requiredStatement.value) {\r\n this.$termsOfUseButton.show();\r\n }\r\n else {\r\n this.$termsOfUseButton.hide();\r\n }\r\n };\r\n ShareDialogue.prototype.openShareView = function () {\r\n this.isShareViewVisible = true;\r\n this.isEmbedViewVisible = false;\r\n this.$embedView.hide();\r\n this.$shareView.show();\r\n this.$shareButton.addClass('on default');\r\n this.$embedButton.removeClass('on default');\r\n this.resize();\r\n };\r\n ShareDialogue.prototype.openEmbedView = function () {\r\n this.isShareViewVisible = false;\r\n this.isEmbedViewVisible = true;\r\n this.$embedView.show();\r\n this.$shareView.hide();\r\n this.$shareButton.removeClass('on default');\r\n this.$embedButton.addClass('on default');\r\n this.resize();\r\n };\r\n ShareDialogue.prototype.close = function () {\r\n _super.prototype.close.call(this);\r\n };\r\n ShareDialogue.prototype.getViews = function () {\r\n return this.$tabsContent.find('.view');\r\n };\r\n ShareDialogue.prototype.equaliseViewHeights = function () {\r\n this.getViews().equaliseHeight(true);\r\n };\r\n ShareDialogue.prototype.resize = function () {\r\n this.equaliseViewHeights();\r\n this.setDockedPosition();\r\n };\r\n return ShareDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.ShareDialogue = ShareDialogue;\r\n});\r\n//# sourceMappingURL=ShareDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-av-extension/ShareDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/ShareDialogue\"], function (require, exports, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ShareDialogue = /** @class */ (function (_super) {\r\n __extends(ShareDialogue, _super);\r\n function ShareDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n ShareDialogue.prototype.create = function () {\r\n this.setConfig('shareDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n ShareDialogue.prototype.update = function () {\r\n _super.prototype.update.call(this);\r\n this.code = this.extension.getEmbedScript(this.options.embedTemplate, this.currentWidth, this.currentHeight);\r\n this.$code.val(this.code);\r\n };\r\n ShareDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return ShareDialogue;\r\n }(ShareDialogue_1.ShareDialogue));\r\n exports.ShareDialogue = ShareDialogue;\r\n});\r\n//# sourceMappingURL=ShareDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-av-extension/Extension',[\"require\", \"exports\", \"@iiif/vocabulary\", \"../../modules/uv-avcenterpanel-module/AVCenterPanel\", \"../../modules/uv-shared-module/BaseEvents\", \"../../modules/uv-shared-module/BaseExtension\", \"../../modules/uv-contentleftpanel-module/ContentLeftPanel\", \"./DownloadDialogue\", \"../../modules/uv-shared-module/FooterPanel\", \"../../modules/uv-avmobilefooterpanel-module/MobileFooter\", \"../../modules/uv-shared-module/HeaderPanel\", \"../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel\", \"./SettingsDialogue\", \"./ShareDialogue\"], function (require, exports, vocabulary_1, AVCenterPanel_1, BaseEvents_1, BaseExtension_1, ContentLeftPanel_1, DownloadDialogue_1, FooterPanel_1, MobileFooter_1, HeaderPanel_1, MoreInfoRightPanel_1, SettingsDialogue_1, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Extension = /** @class */ (function (_super) {\r\n __extends(Extension, _super);\r\n function Extension() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Extension.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n //requirejs.config({shim: {'uv/lib/hls.min': { deps: ['require'], exports: \"Hls\"}}});\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this.viewCanvas(canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.TREE_NODE_SELECTED, function (node) {\r\n _this.fire(BaseEvents_1.BaseEvents.TREE_NODE_SELECTED, node.data.path);\r\n _this.treeNodeSelected(node);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.THUMB_SELECTED, function (thumb) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, thumb.index);\r\n });\r\n };\r\n Extension.prototype.dependencyLoaded = function (index, dep) {\r\n if (index === this.getDependencyIndex('waveform-data')) {\r\n window.WaveformData = dep;\r\n }\r\n else if (index === this.getDependencyIndex('hls')) {\r\n window.Hls = dep; //https://github.com/mrdoob/three.js/issues/9602\r\n }\r\n };\r\n Extension.prototype.createModules = function () {\r\n _super.prototype.createModules.call(this);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel = new HeaderPanel_1.HeaderPanel(this.shell.$headerPanel);\r\n }\r\n else {\r\n this.shell.$headerPanel.hide();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel = new ContentLeftPanel_1.ContentLeftPanel(this.shell.$leftPanel);\r\n }\r\n else {\r\n this.shell.$leftPanel.hide();\r\n }\r\n this.centerPanel = new AVCenterPanel_1.AVCenterPanel(this.shell.$centerPanel);\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel = new MoreInfoRightPanel_1.MoreInfoRightPanel(this.shell.$rightPanel);\r\n }\r\n else {\r\n this.shell.$rightPanel.hide();\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel = new FooterPanel_1.FooterPanel(this.shell.$footerPanel);\r\n this.mobileFooterPanel = new MobileFooter_1.FooterPanel(this.shell.$mobileFooterPanel);\r\n }\r\n else {\r\n this.shell.$footerPanel.hide();\r\n }\r\n this.$shareDialogue = $('<div class=\"overlay share\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$shareDialogue);\r\n this.shareDialogue = new ShareDialogue_1.ShareDialogue(this.$shareDialogue);\r\n this.$downloadDialogue = $('<div class=\"overlay download\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$downloadDialogue);\r\n this.downloadDialogue = new DownloadDialogue_1.DownloadDialogue(this.$downloadDialogue);\r\n this.$settingsDialogue = $('<div class=\"overlay settings\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$settingsDialogue);\r\n this.settingsDialogue = new SettingsDialogue_1.SettingsDialogue(this.$settingsDialogue);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel.init();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel.init();\r\n }\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel.init();\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel.init();\r\n }\r\n };\r\n Extension.prototype.isLeftPanelEnabled = function () {\r\n var isEnabled = _super.prototype.isLeftPanelEnabled.call(this);\r\n var tree = this.helper.getTree();\r\n if (tree && tree.nodes.length) {\r\n isEnabled = true;\r\n }\r\n return isEnabled;\r\n };\r\n Extension.prototype.render = function () {\r\n _super.prototype.render.call(this);\r\n };\r\n Extension.prototype.getEmbedScript = function (template, width, height) {\r\n var appUri = this.getAppUri();\r\n var iframeSrc = appUri + \"#?manifest=\" + this.helper.manifestUri + \"&c=\" + this.helper.collectionIndex + \"&m=\" + this.helper.manifestIndex + \"&s=\" + this.helper.sequenceIndex + \"&cv=\" + this.helper.canvasIndex + \"&rid=\" + this.helper.rangeId;\r\n return Utils.Strings.format(template, iframeSrc, width.toString(), height.toString());\r\n };\r\n Extension.prototype.treeNodeSelected = function (node) {\r\n var data = node.data;\r\n if (!data.type)\r\n return;\r\n switch (data.type) {\r\n case vocabulary_1.IIIFResourceType.MANIFEST.toString():\r\n // do nothing\r\n break;\r\n case vocabulary_1.IIIFResourceType.COLLECTION.toString():\r\n // do nothing\r\n break;\r\n default:\r\n this.viewRange(data.path);\r\n break;\r\n }\r\n };\r\n Extension.prototype.viewRange = function (path) {\r\n var range = this.helper.getRangeByPath(path);\r\n if (!range)\r\n return;\r\n this.component.publish(BaseEvents_1.BaseEvents.RANGE_CHANGED, range);\r\n // don't update the canvas index, only when thumbs are clicked\r\n // if (range.canvases && range.canvases.length) {\r\n // const canvasId: string = range.canvases[0];\r\n // const canvas: Manifesto.ICanvas | null = this.helper.getCanvasById(canvasId);\r\n // if (canvas) {\r\n // const canvasIndex: number = canvas.index;\r\n // if (canvasIndex !== this.helper.canvasIndex) {\r\n // this.component.publish(BaseEvents.CANVAS_INDEX_CHANGED, [canvasIndex]);\r\n // }\r\n // }\r\n // }\r\n };\r\n return Extension;\r\n }(BaseExtension_1.BaseExtension));\r\n exports.Extension = Extension;\r\n});\r\n//# sourceMappingURL=Extension.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-filelinkcenterpanel-module/FileLinkCenterPanel',[\"require\", \"exports\", \"manifesto.js\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/CenterPanel\", \"../../Utils\"], function (require, exports, manifesto_js_1, BaseEvents_1, CenterPanel_1, Utils_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var FileLinkCenterPanel = /** @class */ (function (_super) {\r\n __extends(FileLinkCenterPanel, _super);\r\n function FileLinkCenterPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n FileLinkCenterPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('fileLinkCenterPanel');\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE, function (resources) {\r\n _this.openMedia(resources);\r\n });\r\n this.$scroll = $('<div class=\"scroll\"></div>');\r\n this.$content.append(this.$scroll);\r\n this.$downloadItems = $('<ol></ol>');\r\n this.$scroll.append(this.$downloadItems);\r\n this.$downloadItemTemplate = $('<li><img/><div class=\"col2\"><a class=\"filename\" target=\"_blank\" download=\"\"></a><span class=\"label\"></span><a class=\"description\" target=\"_blank\" download=\"\"></a></div></li>');\r\n this.title = this.extension.helper.getLabel();\r\n };\r\n FileLinkCenterPanel.prototype.openMedia = function (resources) {\r\n var _this = this;\r\n this.extension.getExternalResources(resources).then(function () {\r\n var canvas = _this.extension.helper.getCurrentCanvas();\r\n var annotations = canvas.getContent();\r\n var $item;\r\n for (var i = 0; i < annotations.length; i++) {\r\n var annotation = annotations[i];\r\n if (!annotation.getBody().length) {\r\n continue;\r\n }\r\n $item = _this.$downloadItemTemplate.clone();\r\n var $fileName = $item.find('.filename');\r\n var $label = $item.find('.label');\r\n var $thumb = $item.find('img');\r\n var $description = $item.find('.description');\r\n var annotationBody = annotation.getBody()[0];\r\n var id = annotationBody.getProperty('id');\r\n if (id) {\r\n $fileName.prop('href', id);\r\n $fileName.text(id.substr(id.lastIndexOf('/') + 1));\r\n }\r\n var label = manifesto_js_1.LanguageMap.getValue(annotationBody.getLabel());\r\n if (label) {\r\n $label.text(Utils_1.UVUtils.sanitize(label));\r\n }\r\n var thumbnail = annotation.getProperty('thumbnail');\r\n if (thumbnail) {\r\n $thumb.prop('src', thumbnail);\r\n }\r\n else {\r\n $thumb.hide();\r\n }\r\n var description = annotationBody.getProperty('description');\r\n if (description) {\r\n $description.text(Utils_1.UVUtils.sanitize(description));\r\n if (id) {\r\n $description.prop('href', id);\r\n }\r\n }\r\n _this.$downloadItems.append($item);\r\n }\r\n });\r\n };\r\n FileLinkCenterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n if (this.title) {\r\n this.$title.text(Utils_1.UVUtils.sanitize(this.title));\r\n }\r\n this.$scroll.height(this.$content.height() - this.$scroll.verticalMargins());\r\n };\r\n return FileLinkCenterPanel;\r\n }(CenterPanel_1.CenterPanel));\r\n exports.FileLinkCenterPanel = FileLinkCenterPanel;\r\n});\r\n//# sourceMappingURL=FileLinkCenterPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/HelpDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\"], function (require, exports, BaseEvents_1, Dialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var HelpDialogue = /** @class */ (function (_super) {\r\n __extends(HelpDialogue, _super);\r\n function HelpDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n HelpDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('helpDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_HELP_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_HELP_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function () {\r\n _this.open();\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.$title = $('<h1></h1>');\r\n this.$content.append(this.$title);\r\n this.$scroll = $('<div class=\"scroll\"></div>');\r\n this.$content.append(this.$scroll);\r\n this.$message = $('<p></p>');\r\n this.$scroll.append(this.$message);\r\n // initialise ui.\r\n this.$title.text(this.content.title);\r\n this.$message.html(this.content.text);\r\n // ensure anchor tags link to _blank.\r\n this.$message.targetBlank();\r\n this.$element.hide();\r\n };\r\n HelpDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return HelpDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.HelpDialogue = HelpDialogue;\r\n});\r\n//# sourceMappingURL=HelpDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-resourcesleftpanel-module/ThumbsView',[\"require\", \"exports\", \"../uv-shared-module/ThumbsView\"], function (require, exports, ThumbsView_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ThumbsView = /** @class */ (function (_super) {\r\n __extends(ThumbsView, _super);\r\n function ThumbsView() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ThumbsView.prototype.create = function () {\r\n this.setConfig('resourcesLeftPanel');\r\n _super.prototype.create.call(this);\r\n };\r\n return ThumbsView;\r\n }(ThumbsView_1.ThumbsView));\r\n exports.ThumbsView = ThumbsView;\r\n});\r\n//# sourceMappingURL=ThumbsView.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-resourcesleftpanel-module/ResourcesLeftPanel',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/LeftPanel\", \"./ThumbsView\", \"manifesto.js\", \"@iiif/vocabulary\"], function (require, exports, BaseEvents_1, LeftPanel_1, ThumbsView_1, manifesto_js_1, vocabulary_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ResourcesLeftPanel = /** @class */ (function (_super) {\r\n __extends(ResourcesLeftPanel, _super);\r\n function ResourcesLeftPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n ResourcesLeftPanel.prototype.create = function () {\r\n this.setConfig('resourcesLeftPanel');\r\n _super.prototype.create.call(this);\r\n this.setTitle(this.content.title);\r\n /*\r\n TODO: make tabs work\r\n this.$tabs = $('<div class=\"tabs\"></div>');\r\n this.$main.append(this.$tabs);\r\n \r\n this.$thumbsButton = $('<a class=\"thumbs tab\">' + this.content.thumbnails + '</a>');\r\n this.$thumbsButton.prop('title', this.content.thumbnails);\r\n this.$tabs.append(this.$thumbsButton);\r\n \r\n this.$resourcesButton = $('<a class=\"resources tab\">' + this.content.resources+ '</a>');\r\n this.$resourcesButton.prop('title', this.content.resources);\r\n this.$tabs.append(this.$resourcesButton);\r\n */\r\n this.$tabsContent = $('<div class=\"tabsContent\"></div>');\r\n this.$main.append(this.$tabsContent);\r\n this.$views = $('<div class=\"views\"></div>');\r\n this.$tabsContent.append(this.$views);\r\n this.$thumbsView = $('<div class=\"thumbsView\"></div>');\r\n this.$views.append(this.$thumbsView);\r\n this.$resourcesView = $('<div class=\"resourcesView\"></div>');\r\n this.$resources = $('<ul></ul>');\r\n this.$resourcesView.append(this.$resources);\r\n this.$views.append(this.$resourcesView);\r\n this.thumbsView = new ThumbsView_1.ThumbsView(this.$thumbsView);\r\n this.dataBind();\r\n };\r\n ResourcesLeftPanel.prototype.dataBind = function () {\r\n this.dataBindThumbsView();\r\n var annotations = this.extension.helper.getCurrentCanvas().getResources();\r\n if (annotations.length === 0) {\r\n this.$resourcesView.hide();\r\n }\r\n for (var i = 0; i < annotations.length; i++) {\r\n var annotation = annotations[i];\r\n var resource = annotation.getResource();\r\n if (resource) {\r\n var label = manifesto_js_1.LanguageMap.getValue(resource.getLabel());\r\n if (label) {\r\n var mime = Utils.Files.simplifyMimeType(resource.getFormat().toString());\r\n var $listItem = $('<li><a href=\"' + resource.id + '\" target=\"_blank\">' + label + ' (' + mime + ')' + '</li>');\r\n this.$resources.append($listItem);\r\n }\r\n }\r\n }\r\n };\r\n ResourcesLeftPanel.prototype.dataBindThumbsView = function () {\r\n if (!this.thumbsView)\r\n return;\r\n var width;\r\n var height;\r\n var viewingDirection = this.extension.helper.getViewingDirection();\r\n if (viewingDirection && (viewingDirection.toString() === vocabulary_1.ViewingDirection.LEFT_TO_RIGHT.toString() || viewingDirection.toString() === vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString())) {\r\n width = this.config.options.twoColThumbWidth;\r\n height = this.config.options.twoColThumbHeight;\r\n }\r\n else {\r\n width = this.config.options.oneColThumbWidth;\r\n height = this.config.options.oneColThumbHeight;\r\n }\r\n if (typeof (width) === \"undefined\") {\r\n width = 100;\r\n }\r\n if (typeof (height) === \"undefined\") {\r\n height = 100;\r\n }\r\n this.thumbsView.thumbs = this.extension.helper.getThumbs(width, height);\r\n // hide thumb selector for single-part manifests\r\n if (this.thumbsView.thumbs.length < 2) {\r\n this.$thumbsView.hide();\r\n }\r\n this.thumbsView.databind();\r\n };\r\n ResourcesLeftPanel.prototype.expandFullStart = function () {\r\n _super.prototype.expandFullStart.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_START);\r\n };\r\n ResourcesLeftPanel.prototype.expandFullFinish = function () {\r\n _super.prototype.expandFullFinish.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_FINISH);\r\n };\r\n ResourcesLeftPanel.prototype.collapseFullStart = function () {\r\n _super.prototype.collapseFullStart.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_START);\r\n };\r\n ResourcesLeftPanel.prototype.collapseFullFinish = function () {\r\n _super.prototype.collapseFullFinish.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_FINISH);\r\n };\r\n ResourcesLeftPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$views.height(this.$main.height());\r\n this.$resources.height(this.$main.height());\r\n };\r\n return ResourcesLeftPanel;\r\n }(LeftPanel_1.LeftPanel));\r\n exports.ResourcesLeftPanel = ResourcesLeftPanel;\r\n});\r\n//# sourceMappingURL=ResourcesLeftPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-default-extension/SettingsDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/SettingsDialogue\"], function (require, exports, SettingsDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SettingsDialogue = /** @class */ (function (_super) {\r\n __extends(SettingsDialogue, _super);\r\n function SettingsDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n SettingsDialogue.prototype.create = function () {\r\n this.setConfig('settingsDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n return SettingsDialogue;\r\n }(SettingsDialogue_1.SettingsDialogue));\r\n exports.SettingsDialogue = SettingsDialogue;\r\n});\r\n//# sourceMappingURL=SettingsDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-default-extension/ShareDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/ShareDialogue\"], function (require, exports, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ShareDialogue = /** @class */ (function (_super) {\r\n __extends(ShareDialogue, _super);\r\n function ShareDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n ShareDialogue.prototype.create = function () {\r\n this.setConfig('shareDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n ShareDialogue.prototype.update = function () {\r\n _super.prototype.update.call(this);\r\n this.code = this.extension.getEmbedScript(this.options.embedTemplate, this.currentWidth, this.currentHeight);\r\n this.$code.val(this.code);\r\n };\r\n ShareDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return ShareDialogue;\r\n }(ShareDialogue_1.ShareDialogue));\r\n exports.ShareDialogue = ShareDialogue;\r\n});\r\n//# sourceMappingURL=ShareDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-default-extension/Extension',[\"require\", \"exports\", \"../../modules/uv-shared-module/BaseEvents\", \"../../modules/uv-shared-module/BaseExtension\", \"../../modules/uv-filelinkcenterpanel-module/FileLinkCenterPanel\", \"../../modules/uv-shared-module/FooterPanel\", \"../../modules/uv-shared-module/HeaderPanel\", \"../../modules/uv-dialogues-module/HelpDialogue\", \"../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel\", \"../../modules/uv-resourcesleftpanel-module/ResourcesLeftPanel\", \"./SettingsDialogue\", \"./ShareDialogue\"], function (require, exports, BaseEvents_1, BaseExtension_1, FileLinkCenterPanel_1, FooterPanel_1, HeaderPanel_1, HelpDialogue_1, MoreInfoRightPanel_1, ResourcesLeftPanel_1, SettingsDialogue_1, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Extension = /** @class */ (function (_super) {\r\n __extends(Extension, _super);\r\n function Extension() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Extension.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n // listen for mediaelement enter/exit fullscreen events.\r\n $(window).bind('enterfullscreen', function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN);\r\n });\r\n $(window).bind('exitfullscreen', function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this.viewCanvas(canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.THUMB_SELECTED, function (canvasIndex) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, canvasIndex);\r\n });\r\n };\r\n Extension.prototype.createModules = function () {\r\n _super.prototype.createModules.call(this);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel = new HeaderPanel_1.HeaderPanel(this.shell.$headerPanel);\r\n }\r\n else {\r\n this.shell.$headerPanel.hide();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel = new ResourcesLeftPanel_1.ResourcesLeftPanel(this.shell.$leftPanel);\r\n }\r\n this.centerPanel = new FileLinkCenterPanel_1.FileLinkCenterPanel(this.shell.$centerPanel);\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel = new MoreInfoRightPanel_1.MoreInfoRightPanel(this.shell.$rightPanel);\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel = new FooterPanel_1.FooterPanel(this.shell.$footerPanel);\r\n }\r\n else {\r\n this.shell.$footerPanel.hide();\r\n }\r\n this.$helpDialogue = $('<div class=\"overlay help\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$helpDialogue);\r\n this.helpDialogue = new HelpDialogue_1.HelpDialogue(this.$helpDialogue);\r\n this.$shareDialogue = $('<div class=\"overlay share\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$shareDialogue);\r\n this.shareDialogue = new ShareDialogue_1.ShareDialogue(this.$shareDialogue);\r\n this.$settingsDialogue = $('<div class=\"overlay settings\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$settingsDialogue);\r\n this.settingsDialogue = new SettingsDialogue_1.SettingsDialogue(this.$settingsDialogue);\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel.init();\r\n }\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel.init();\r\n }\r\n };\r\n Extension.prototype.render = function () {\r\n _super.prototype.render.call(this);\r\n };\r\n Extension.prototype.isLeftPanelEnabled = function () {\r\n return Utils.Bools.getBool(this.data.config.options.leftPanelEnabled, true)\r\n && ((this.helper.isMultiCanvas() || this.helper.isMultiSequence()) || this.helper.hasResources());\r\n };\r\n Extension.prototype.getEmbedScript = function (template, width, height) {\r\n //const configUri: string = this.data.config.uri || '';\r\n //const script: string = String.format(template, this.getSerializedLocales(), configUri, this.helper.iiifResourceUri, this.helper.collectionIndex, this.helper.manifestIndex, this.helper.sequenceIndex, this.helper.canvasIndex, width, height, this.data.embedScriptUri);\r\n var appUri = this.getAppUri();\r\n var iframeSrc = appUri + \"#?manifest=\" + this.helper.manifestUri + \"&c=\" + this.helper.collectionIndex + \"&m=\" + this.helper.manifestIndex + \"&s=\" + this.helper.sequenceIndex + \"&cv=\" + this.helper.canvasIndex;\r\n return Utils.Strings.format(template, iframeSrc, width.toString(), height.toString());\r\n };\r\n return Extension;\r\n }(BaseExtension_1.BaseExtension));\r\n exports.Extension = Extension;\r\n});\r\n//# sourceMappingURL=Extension.js.map\n", "define('extensions/uv-ebook-extension/Events',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Events = /** @class */ (function () {\r\n function Events() {\r\n }\r\n Events.namespace = \"ebookExtension.\";\r\n Events.CFI_FRAGMENT_CHANGED = Events.namespace + \"cfiFragmentChanged\";\r\n Events.ITEM_CLICKED = Events.namespace + \"itemClicked\";\r\n Events.LOADED_NAVIGATION = Events.namespace + \"loadedNavigation\";\r\n Events.RELOCATED = Events.namespace + \"relocated\";\r\n Events.RENDITION_ATTACHED = Events.namespace + \"renditionAttached\";\r\n Events.TOC_READY = Events.namespace + \"tocReady\";\r\n return Events;\r\n }());\r\n exports.Events = Events;\r\n});\r\n//# sourceMappingURL=Events.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-ebookleftpanel-module/EbookLeftPanel',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/LeftPanel\", \"../../extensions/uv-ebook-extension/Events\"], function (require, exports, BaseEvents_1, LeftPanel_1, Events_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var EbookLeftPanel = /** @class */ (function (_super) {\r\n __extends(EbookLeftPanel, _super);\r\n function EbookLeftPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n EbookLeftPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig(\"ebookLeftPanel\");\r\n _super.prototype.create.call(this);\r\n this._$container = $('<div class=\"container\"></div>');\r\n this._ebookTOC = document.createElement(\"uv-ebook-toc\");\r\n this._$ebookTOC = $(this._ebookTOC);\r\n //this._ebookTOC.setAttribute(\"src-tab-enabled\", this.config.options.srcTabEnabled);\r\n this.$main.addClass(\"disabled\");\r\n this.$main.append(this._$container);\r\n this._$container.append(this._$ebookTOC);\r\n this.setTitle(this.content.title);\r\n this.component.subscribe(Events_1.Events.LOADED_NAVIGATION, function (navigation) {\r\n _this.$main.removeClass(\"disabled\");\r\n _this._ebookTOC.toc = navigation.toc;\r\n });\r\n this.component.subscribe(Events_1.Events.RELOCATED, function (location) {\r\n _this._ebookTOC.selected = location.start.href;\r\n });\r\n this._ebookTOC.addEventListener(\"itemClicked\", function (e) {\r\n _this.component.publish(Events_1.Events.ITEM_CLICKED, e.detail);\r\n }, false);\r\n Utils.Async.waitFor(function () {\r\n return (window.customElements !== undefined);\r\n }, function () {\r\n customElements.whenDefined(\"uv-ebook-toc\").then(function () {\r\n _this.component.publish(Events_1.Events.TOC_READY);\r\n });\r\n });\r\n };\r\n EbookLeftPanel.prototype.expandFullStart = function () {\r\n _super.prototype.expandFullStart.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_START);\r\n };\r\n EbookLeftPanel.prototype.expandFullFinish = function () {\r\n _super.prototype.expandFullFinish.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_FINISH);\r\n };\r\n EbookLeftPanel.prototype.collapseFullStart = function () {\r\n _super.prototype.collapseFullStart.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_START);\r\n };\r\n EbookLeftPanel.prototype.collapseFullFinish = function () {\r\n _super.prototype.collapseFullFinish.call(this);\r\n this.component.publish(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_FINISH);\r\n };\r\n EbookLeftPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this._$container.height(this.$main.height() - this._$container.verticalPadding());\r\n };\r\n return EbookLeftPanel;\r\n }(LeftPanel_1.LeftPanel));\r\n exports.EbookLeftPanel = EbookLeftPanel;\r\n});\r\n//# sourceMappingURL=EbookLeftPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-ebook-extension/DownloadDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/DownloadDialogue\"], function (require, exports, DownloadDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var DownloadDialogue = /** @class */ (function (_super) {\r\n __extends(DownloadDialogue, _super);\r\n function DownloadDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n DownloadDialogue.prototype.create = function () {\r\n this.setConfig('downloadDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n DownloadDialogue.prototype.open = function ($triggerButton) {\r\n _super.prototype.open.call(this, $triggerButton);\r\n this.addEntireFileDownloadOptions();\r\n this.updateNoneAvailable();\r\n this.resize();\r\n };\r\n DownloadDialogue.prototype.isDownloadOptionAvailable = function (option) {\r\n return _super.prototype.isDownloadOptionAvailable.call(this, option);\r\n };\r\n return DownloadDialogue;\r\n }(DownloadDialogue_1.DownloadDialogue));\r\n exports.DownloadDialogue = DownloadDialogue;\r\n});\r\n//# sourceMappingURL=DownloadDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-ebookcenterpanel-module/EbookCenterPanel',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/CenterPanel\", \"../../extensions/uv-ebook-extension/Events\", \"../uv-shared-module/Position\"], function (require, exports, BaseEvents_1, CenterPanel_1, Events_1, Position_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var EbookCenterPanel = /** @class */ (function (_super) {\r\n __extends(EbookCenterPanel, _super);\r\n function EbookCenterPanel($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this._ebookReaderReady = false;\r\n _this._state = {};\r\n _this._prevState = {};\r\n _this.attributionPosition = Position_1.Position.BOTTOM_RIGHT;\r\n return _this;\r\n }\r\n EbookCenterPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig(\"ebookCenterPanel\");\r\n _super.prototype.create.call(this);\r\n this._ebookReader = document.createElement(\"uv-ebook-reader\");\r\n this.$content.prepend(this._ebookReader);\r\n this._ebookReader.setAttribute(\"width\", \"100%\");\r\n this._ebookReader.setAttribute(\"height\", \"100%\");\r\n this._ebookReader.addEventListener(\"loadedNavigation\", function (e) {\r\n _this.component.publish(Events_1.Events.LOADED_NAVIGATION, e.detail);\r\n }, false);\r\n this._ebookReader.addEventListener(\"relocated\", function (e) {\r\n _this.component.publish(Events_1.Events.RELOCATED, e.detail);\r\n _this._cfi = e.detail.start.cfi;\r\n _this.component.publish(Events_1.Events.CFI_FRAGMENT_CHANGED, _this._cfi);\r\n }, false);\r\n Utils.Async.waitFor(function () {\r\n return (window.customElements !== undefined);\r\n }, function () {\r\n customElements.whenDefined(\"uv-ebook-reader\").then(function () {\r\n _this._ebookReaderReady = true;\r\n });\r\n });\r\n var that = this;\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE, function (e, resources) {\r\n that.openMedia(resources);\r\n });\r\n this.component.subscribe(Events_1.Events.ITEM_CLICKED, function (href) {\r\n _this._nextState({\r\n cfi: href\r\n });\r\n });\r\n this.component.subscribe(Events_1.Events.CFI_FRAGMENT_CHANGED, function (cfi) {\r\n Utils.Async.waitFor(function () {\r\n return _this._ebookReaderReady;\r\n }, function () {\r\n if (cfi !== _this._cfi) {\r\n _this._nextState({\r\n cfi: cfi\r\n });\r\n }\r\n });\r\n });\r\n };\r\n EbookCenterPanel.prototype.openMedia = function (resources) {\r\n var _this = this;\r\n this.extension.getExternalResources(resources).then(function () {\r\n var canvas = _this.extension.helper.getCurrentCanvas();\r\n var annotations = canvas.getContent();\r\n if (annotations.length) {\r\n var annotation = annotations[0];\r\n var body = annotation.getBody();\r\n if (body.length) {\r\n var media = body[0];\r\n //const format: MediaType | null = media.getFormat();\r\n _this._nextState({\r\n bookPath: media.id\r\n });\r\n }\r\n }\r\n _this.component.publish(BaseEvents_1.BaseEvents.RESIZE);\r\n });\r\n };\r\n EbookCenterPanel.prototype._nextState = function (s) {\r\n var _this = this;\r\n this._state = Object.assign({}, this._state, s);\r\n Utils.Async.waitFor(function () {\r\n return _this._ebookReaderReady;\r\n }, function () {\r\n if (_this._state.bookPath && _this._state.bookPath !== _this._prevState.bookPath) {\r\n _this._ebookReader.load(_this._state.bookPath);\r\n }\r\n if (_this._state.cfi && _this._state.cfi !== _this._prevState.cfi) {\r\n _this._ebookReader.display(_this._state.cfi);\r\n }\r\n _this._prevState = Object.assign({}, _this._state);\r\n });\r\n };\r\n EbookCenterPanel.prototype.resize = function () {\r\n var _this = this;\r\n _super.prototype.resize.call(this);\r\n if (this._ebookReaderReady) {\r\n setTimeout(function () {\r\n _this._ebookReader.resize();\r\n }, 10);\r\n }\r\n };\r\n return EbookCenterPanel;\r\n }(CenterPanel_1.CenterPanel));\r\n exports.EbookCenterPanel = EbookCenterPanel;\r\n});\r\n//# sourceMappingURL=EbookCenterPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-ebookmobilefooterpanel-module/MobileFooter',[\"require\", \"exports\", \"../uv-shared-module/FooterPanel\"], function (require, exports, FooterPanel_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var FooterPanel = /** @class */ (function (_super) {\r\n __extends(FooterPanel, _super);\r\n function FooterPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n FooterPanel.prototype.create = function () {\r\n this.setConfig('mobileFooterPanel');\r\n _super.prototype.create.call(this);\r\n };\r\n FooterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$options.css('left', Math.floor((this.$element.width() / 2) - (this.$options.width() / 2)));\r\n };\r\n return FooterPanel;\r\n }(FooterPanel_1.FooterPanel));\r\n exports.FooterPanel = FooterPanel;\r\n});\r\n//# sourceMappingURL=MobileFooter.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/MoreInfoDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\", \"../../Utils\", \"@iiif/iiif-metadata-component\"], function (require, exports, BaseEvents_1, Dialogue_1, Utils_1, iiif_metadata_component_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var MoreInfoDialogue = /** @class */ (function (_super) {\r\n __extends(MoreInfoDialogue, _super);\r\n function MoreInfoDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n MoreInfoDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('moreInfoDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_MOREINFO_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_MOREINFO_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function (triggerButton) {\r\n _this.open(triggerButton);\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.config.content = this.extension.data.config.modules.moreInfoRightPanel.content;\r\n this.config.options = this.extension.data.config.modules.moreInfoRightPanel.options;\r\n // create ui\r\n this.$title = $('<h1>' + this.config.content.title + '</h1>');\r\n this.$content.append(this.$title);\r\n this.$metadata = $('<div class=\"iiif-metadata-component\"></div>');\r\n this.$content.append(this.$metadata);\r\n this.metadataComponent = new iiif_metadata_component_1.MetadataComponent({\r\n target: this.$metadata[0]\r\n });\r\n // hide\r\n this.$element.hide();\r\n };\r\n MoreInfoDialogue.prototype.open = function (triggerButton) {\r\n _super.prototype.open.call(this, triggerButton);\r\n this.metadataComponent.set(this._getData());\r\n };\r\n MoreInfoDialogue.prototype._getData = function () {\r\n return {\r\n canvasDisplayOrder: this.config.options.canvasDisplayOrder,\r\n canvases: this.extension.getCurrentCanvases(),\r\n canvasExclude: this.config.options.canvasExclude,\r\n canvasLabels: this.extension.getCanvasLabels(this.content.page),\r\n content: this.config.content,\r\n copiedMessageDuration: 2000,\r\n copyToClipboardEnabled: Utils.Bools.getBool(this.config.options.copyToClipboardEnabled, false),\r\n helper: this.extension.helper,\r\n licenseFormatter: null,\r\n limit: this.config.options.textLimit || 4,\r\n limitType: iiif_metadata_component_1.LimitType.LINES,\r\n manifestDisplayOrder: this.config.options.manifestDisplayOrder,\r\n manifestExclude: this.config.options.manifestExclude,\r\n range: this.extension.getCurrentCanvasRange(),\r\n rtlLanguageCodes: this.config.options.rtlLanguageCodes,\r\n sanitizer: function (html) {\r\n return Utils_1.UVUtils.sanitize(html);\r\n },\r\n showAllLanguages: this.config.options.showAllLanguages\r\n };\r\n };\r\n MoreInfoDialogue.prototype.close = function () {\r\n _super.prototype.close.call(this);\r\n };\r\n MoreInfoDialogue.prototype.resize = function () {\r\n this.setDockedPosition();\r\n };\r\n return MoreInfoDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.MoreInfoDialogue = MoreInfoDialogue;\r\n});\r\n//# sourceMappingURL=MoreInfoDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-ebook-extension/SettingsDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/SettingsDialogue\"], function (require, exports, SettingsDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SettingsDialogue = /** @class */ (function (_super) {\r\n __extends(SettingsDialogue, _super);\r\n function SettingsDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n SettingsDialogue.prototype.create = function () {\r\n this.setConfig('settingsDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n return SettingsDialogue;\r\n }(SettingsDialogue_1.SettingsDialogue));\r\n exports.SettingsDialogue = SettingsDialogue;\r\n});\r\n//# sourceMappingURL=SettingsDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-ebook-extension/ShareDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/ShareDialogue\"], function (require, exports, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ShareDialogue = /** @class */ (function (_super) {\r\n __extends(ShareDialogue, _super);\r\n function ShareDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n ShareDialogue.prototype.create = function () {\r\n this.setConfig('shareDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n ShareDialogue.prototype.update = function () {\r\n _super.prototype.update.call(this);\r\n this.code = this.extension.getEmbedScript(this.options.embedTemplate, this.currentWidth, this.currentHeight);\r\n this.$code.val(this.code);\r\n };\r\n ShareDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return ShareDialogue;\r\n }(ShareDialogue_1.ShareDialogue));\r\n exports.ShareDialogue = ShareDialogue;\r\n});\r\n//# sourceMappingURL=ShareDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-ebook-extension/Extension',[\"require\", \"exports\", \"../../modules/uv-shared-module/BaseEvents\", \"../../modules/uv-shared-module/BaseExtension\", \"../../modules/uv-ebookleftpanel-module/EbookLeftPanel\", \"./Events\", \"./DownloadDialogue\", \"../../modules/uv-ebookcenterpanel-module/EbookCenterPanel\", \"../../modules/uv-shared-module/FooterPanel\", \"../../modules/uv-ebookmobilefooterpanel-module/MobileFooter\", \"../../modules/uv-shared-module/HeaderPanel\", \"../../modules/uv-dialogues-module/MoreInfoDialogue\", \"../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel\", \"./SettingsDialogue\", \"./ShareDialogue\"], function (require, exports, BaseEvents_1, BaseExtension_1, EbookLeftPanel_1, Events_1, DownloadDialogue_1, EbookCenterPanel_1, FooterPanel_1, MobileFooter_1, HeaderPanel_1, MoreInfoDialogue_1, MoreInfoRightPanel_1, SettingsDialogue_1, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Extension = /** @class */ (function (_super) {\r\n __extends(Extension, _super);\r\n function Extension() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Extension.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this.viewCanvas(canvasIndex);\r\n });\r\n this.component.subscribe(Events_1.Events.CFI_FRAGMENT_CHANGED, function (cfi) {\r\n _this.cfiFragement = cfi;\r\n _this.fire(Events_1.Events.CFI_FRAGMENT_CHANGED, _this.cfiFragement);\r\n });\r\n };\r\n Extension.prototype.dependencyLoaded = function (_index, _dep) {\r\n };\r\n Extension.prototype.createModules = function () {\r\n _super.prototype.createModules.call(this);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel = new HeaderPanel_1.HeaderPanel(this.shell.$headerPanel);\r\n }\r\n else {\r\n this.shell.$headerPanel.hide();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel = new EbookLeftPanel_1.EbookLeftPanel(this.shell.$leftPanel);\r\n }\r\n else {\r\n this.shell.$leftPanel.hide();\r\n }\r\n this.centerPanel = new EbookCenterPanel_1.EbookCenterPanel(this.shell.$centerPanel);\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel = new MoreInfoRightPanel_1.MoreInfoRightPanel(this.shell.$rightPanel);\r\n }\r\n else {\r\n this.shell.$rightPanel.hide();\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel = new FooterPanel_1.FooterPanel(this.shell.$footerPanel);\r\n this.mobileFooterPanel = new MobileFooter_1.FooterPanel(this.shell.$mobileFooterPanel);\r\n }\r\n else {\r\n this.shell.$footerPanel.hide();\r\n }\r\n this.$moreInfoDialogue = $('<div class=\"overlay moreInfo\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$moreInfoDialogue);\r\n this.moreInfoDialogue = new MoreInfoDialogue_1.MoreInfoDialogue(this.$moreInfoDialogue);\r\n this.$shareDialogue = $('<div class=\"overlay share\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$shareDialogue);\r\n this.shareDialogue = new ShareDialogue_1.ShareDialogue(this.$shareDialogue);\r\n this.$downloadDialogue = $('<div class=\"overlay download\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$downloadDialogue);\r\n this.downloadDialogue = new DownloadDialogue_1.DownloadDialogue(this.$downloadDialogue);\r\n this.$settingsDialogue = $('<div class=\"overlay settings\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$settingsDialogue);\r\n this.settingsDialogue = new SettingsDialogue_1.SettingsDialogue(this.$settingsDialogue);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel.init();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel.init();\r\n }\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel.init();\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel.init();\r\n }\r\n };\r\n Extension.prototype.isLeftPanelEnabled = function () {\r\n return true;\r\n };\r\n Extension.prototype.render = function () {\r\n _super.prototype.render.call(this);\r\n this.checkForCFIParam();\r\n };\r\n Extension.prototype.getEmbedScript = function (template, width, height) {\r\n var appUri = this.getAppUri();\r\n var iframeSrc = appUri + \"#?manifest=\" + this.helper.manifestUri + \"&cfi=\" + this.cfiFragement;\r\n var script = Utils.Strings.format(template, iframeSrc, width.toString(), height.toString());\r\n return script;\r\n };\r\n Extension.prototype.checkForCFIParam = function () {\r\n var cfi = this.data.cfi;\r\n if (cfi) {\r\n this.component.publish(Events_1.Events.CFI_FRAGMENT_CHANGED, cfi);\r\n }\r\n };\r\n return Extension;\r\n }(BaseExtension_1.BaseExtension));\r\n exports.Extension = Extension;\r\n});\r\n//# sourceMappingURL=Extension.js.map\n", "define('modules/uv-shared-module/Bookmark',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Bookmark = /** @class */ (function () {\r\n function Bookmark() {\r\n }\r\n return Bookmark;\r\n }());\r\n exports.Bookmark = Bookmark;\r\n});\r\n//# sourceMappingURL=Bookmark.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-mediaelement-extension/DownloadDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/DownloadDialogue\"], function (require, exports, DownloadDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var DownloadDialogue = /** @class */ (function (_super) {\r\n __extends(DownloadDialogue, _super);\r\n function DownloadDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n DownloadDialogue.prototype.create = function () {\r\n this.setConfig('downloadDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n DownloadDialogue.prototype.open = function (triggerButton) {\r\n _super.prototype.open.call(this, triggerButton);\r\n this.addEntireFileDownloadOptions();\r\n this.updateNoneAvailable();\r\n this.resize();\r\n };\r\n DownloadDialogue.prototype.isDownloadOptionAvailable = function (option) {\r\n return _super.prototype.isDownloadOptionAvailable.call(this, option);\r\n };\r\n return DownloadDialogue;\r\n }(DownloadDialogue_1.DownloadDialogue));\r\n exports.DownloadDialogue = DownloadDialogue;\r\n});\r\n//# sourceMappingURL=DownloadDialogue.js.map\n", "define('extensions/uv-mediaelement-extension/Events',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Events = /** @class */ (function () {\r\n function Events() {\r\n }\r\n Events.namespace = 'mediaelementExtension.';\r\n Events.MEDIA_ENDED = Events.namespace + 'mediaEnded';\r\n Events.MEDIA_PAUSED = Events.namespace + 'mediaPaused';\r\n Events.MEDIA_PLAYED = Events.namespace + 'mediaPlayed';\r\n return Events;\r\n }());\r\n exports.Events = Events;\r\n});\r\n//# sourceMappingURL=Events.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-mediaelementcenterpanel-module/MediaElementCenterPanel',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../../extensions/uv-mediaelement-extension/Events\", \"../uv-shared-module/CenterPanel\", \"../../Utils\"], function (require, exports, BaseEvents_1, Events_1, CenterPanel_1, Utils_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var MediaElementCenterPanel = /** @class */ (function (_super) {\r\n __extends(MediaElementCenterPanel, _super);\r\n function MediaElementCenterPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n MediaElementCenterPanel.prototype.create = function () {\r\n this.setConfig('mediaelementCenterPanel');\r\n _super.prototype.create.call(this);\r\n var that = this;\r\n // events.\r\n // only full screen video\r\n if (this.isVideo()) {\r\n this.component.subscribe(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN, function () {\r\n if (that.component.isFullScreen) {\r\n that.player.enterFullScreen(false);\r\n }\r\n else {\r\n that.player.exitFullScreen(false);\r\n }\r\n });\r\n }\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE, function (resources) {\r\n that.openMedia(resources);\r\n });\r\n this.$container = $('<div class=\"container\"></div>');\r\n this.$content.append(this.$container);\r\n this.title = this.extension.helper.getLabel();\r\n };\r\n MediaElementCenterPanel.prototype.openMedia = function (resources) {\r\n var _this = this;\r\n var that = this;\r\n this.extension.getExternalResources(resources).then(function () {\r\n _this.$container.empty();\r\n var canvas = _this.extension.helper.getCurrentCanvas();\r\n _this.mediaHeight = _this.config.defaultHeight;\r\n _this.mediaWidth = _this.config.defaultWidth;\r\n _this.$container.height(_this.mediaHeight);\r\n _this.$container.width(_this.mediaWidth);\r\n var poster = _this.extension.getPosterImageUri();\r\n var sources = [];\r\n var renderings = canvas.getRenderings();\r\n if (renderings && renderings.length) {\r\n canvas.getRenderings().forEach(function (rendering) {\r\n sources.push({\r\n type: rendering.getFormat().toString(),\r\n src: rendering.id\r\n });\r\n });\r\n }\r\n else {\r\n var formats = _this.extension.getMediaFormats(_this.extension.helper.getCurrentCanvas());\r\n if (formats && formats.length) {\r\n formats.forEach(function (format) {\r\n var type = format.getFormat();\r\n if (type) {\r\n sources.push({\r\n type: type.toString(),\r\n src: format.id\r\n });\r\n }\r\n });\r\n }\r\n }\r\n if (_this.isVideo()) {\r\n _this.$media = $('<video controls=\"controls\" preload=\"none\"></video>');\r\n _this.$container.append(_this.$media);\r\n _this.player = new MediaElementPlayer($('video')[0], {\r\n //pluginPath: this.extension.data.root + 'lib/mediaelement/',\r\n poster: poster,\r\n features: ['playpause', 'current', 'progress', 'volume'],\r\n success: function (mediaElement, originalNode) {\r\n mediaElement.addEventListener('canplay', function () {\r\n that.resize();\r\n });\r\n mediaElement.addEventListener('play', function () {\r\n that.component.publish(Events_1.Events.MEDIA_PLAYED, Math.floor(mediaElement.currentTime));\r\n });\r\n mediaElement.addEventListener('pause', function () {\r\n // mediaelement creates a pause event before the ended event. ignore this.\r\n if (Math.floor(mediaElement.currentTime) != Math.floor(mediaElement.duration)) {\r\n that.component.publish(Events_1.Events.MEDIA_PAUSED, Math.floor(mediaElement.currentTime));\r\n }\r\n });\r\n mediaElement.addEventListener('ended', function () {\r\n that.component.publish(Events_1.Events.MEDIA_ENDED, Math.floor(mediaElement.duration));\r\n });\r\n mediaElement.setSrc(sources);\r\n }\r\n });\r\n }\r\n else {\r\n _this.$media = $('<audio controls=\"controls\" preload=\"none\"></audio>');\r\n _this.$container.append(_this.$media);\r\n _this.player = new MediaElementPlayer($('audio')[0], {\r\n poster: poster,\r\n defaultAudioWidth: 'auto',\r\n defaultAudioHeight: 'auto',\r\n showPosterWhenPaused: true,\r\n showPosterWhenEnded: true,\r\n success: function (mediaElement, originalNode) {\r\n mediaElement.addEventListener('canplay', function () {\r\n that.resize();\r\n });\r\n mediaElement.addEventListener('play', function () {\r\n that.component.publish(Events_1.Events.MEDIA_PLAYED, Math.floor(mediaElement.currentTime));\r\n });\r\n mediaElement.addEventListener('pause', function () {\r\n // mediaelement creates a pause event before the ended event. ignore this.\r\n if (Math.floor(mediaElement.currentTime) != Math.floor(mediaElement.duration)) {\r\n that.component.publish(Events_1.Events.MEDIA_PAUSED, Math.floor(mediaElement.currentTime));\r\n }\r\n });\r\n mediaElement.addEventListener('ended', function () {\r\n that.component.publish(Events_1.Events.MEDIA_ENDED, Math.floor(mediaElement.duration));\r\n });\r\n mediaElement.setSrc(sources);\r\n }\r\n });\r\n }\r\n _this.resize();\r\n });\r\n };\r\n MediaElementCenterPanel.prototype.isVideo = function () {\r\n return this.extension.isVideo();\r\n };\r\n MediaElementCenterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n // if in Firefox < v13 don't resize the media container.\r\n if (window.browserDetect.browser === 'Firefox' && window.browserDetect.version < 13) {\r\n this.$container.width(this.mediaWidth);\r\n this.$container.height(this.mediaHeight);\r\n }\r\n else {\r\n // fit media to available space.\r\n var size = Utils.Dimensions.fitRect(this.mediaWidth, this.mediaHeight, this.$content.width(), this.$content.height());\r\n this.$container.height(size.height);\r\n this.$container.width(size.width);\r\n if (this.player && !this.extension.isFullScreen()) {\r\n this.$media.width(size.width);\r\n this.$media.height(size.height);\r\n }\r\n }\r\n var left = Math.floor((this.$content.width() - this.$container.width()) / 2);\r\n var top = Math.floor((this.$content.height() - this.$container.height()) / 2);\r\n this.$container.css({\r\n 'left': left,\r\n 'top': top\r\n });\r\n if (this.title) {\r\n this.$title.text(Utils_1.UVUtils.sanitize(this.title));\r\n }\r\n if (this.player) {\r\n if (!this.isVideo() || (this.isVideo() && !this.component.isFullScreen)) {\r\n this.player.setPlayerSize();\r\n this.player.setControlsSize();\r\n var $mejs = $('.mejs__container');\r\n $mejs.css({\r\n 'margin-top': (this.$container.height() - $mejs.height()) / 2\r\n });\r\n }\r\n }\r\n };\r\n return MediaElementCenterPanel;\r\n }(CenterPanel_1.CenterPanel));\r\n exports.MediaElementCenterPanel = MediaElementCenterPanel;\r\n});\r\n//# sourceMappingURL=MediaElementCenterPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-mediaelement-extension/SettingsDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/SettingsDialogue\"], function (require, exports, SettingsDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SettingsDialogue = /** @class */ (function (_super) {\r\n __extends(SettingsDialogue, _super);\r\n function SettingsDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n SettingsDialogue.prototype.create = function () {\r\n this.setConfig('settingsDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n return SettingsDialogue;\r\n }(SettingsDialogue_1.SettingsDialogue));\r\n exports.SettingsDialogue = SettingsDialogue;\r\n});\r\n//# sourceMappingURL=SettingsDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-mediaelement-extension/ShareDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/ShareDialogue\"], function (require, exports, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ShareDialogue = /** @class */ (function (_super) {\r\n __extends(ShareDialogue, _super);\r\n function ShareDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n ShareDialogue.prototype.create = function () {\r\n this.setConfig('shareDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n ShareDialogue.prototype.update = function () {\r\n _super.prototype.update.call(this);\r\n this.code = this.extension.getEmbedScript(this.options.embedTemplate, this.currentWidth, this.currentHeight);\r\n this.$code.val(this.code);\r\n };\r\n ShareDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return ShareDialogue;\r\n }(ShareDialogue_1.ShareDialogue));\r\n exports.ShareDialogue = ShareDialogue;\r\n});\r\n//# sourceMappingURL=ShareDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-mediaelement-extension/Extension',[\"require\", \"exports\", \"manifesto.js\", \"../../modules/uv-shared-module/BaseEvents\", \"../../modules/uv-shared-module/BaseExtension\", \"../../modules/uv-shared-module/Bookmark\", \"./DownloadDialogue\", \"./Events\", \"../../modules/uv-shared-module/FooterPanel\", \"../../modules/uv-shared-module/HeaderPanel\", \"../../modules/uv-dialogues-module/HelpDialogue\", \"../../modules/uv-mediaelementcenterpanel-module/MediaElementCenterPanel\", \"../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel\", \"../../modules/uv-resourcesleftpanel-module/ResourcesLeftPanel\", \"./SettingsDialogue\", \"./ShareDialogue\", \"@iiif/vocabulary\"], function (require, exports, Manifesto, BaseEvents_1, BaseExtension_1, Bookmark_1, DownloadDialogue_1, Events_1, FooterPanel_1, HeaderPanel_1, HelpDialogue_1, MediaElementCenterPanel_1, MoreInfoRightPanel_1, ResourcesLeftPanel_1, SettingsDialogue_1, ShareDialogue_1, vocabulary_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Extension = /** @class */ (function (_super) {\r\n __extends(Extension, _super);\r\n function Extension() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Extension.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n // listen for mediaelement enter/exit fullscreen events.\r\n $(window).bind('enterfullscreen', function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN);\r\n });\r\n $(window).bind('exitfullscreen', function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.TOGGLE_FULLSCREEN);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this.viewCanvas(canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.THUMB_SELECTED, function (thumb) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, thumb.index);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_START, function () {\r\n _this.shell.$centerPanel.hide();\r\n _this.shell.$rightPanel.hide();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_FINISH, function () {\r\n _this.shell.$centerPanel.show();\r\n _this.shell.$rightPanel.show();\r\n _this.resize();\r\n });\r\n this.component.subscribe(Events_1.Events.MEDIA_ENDED, function () {\r\n _this.fire(Events_1.Events.MEDIA_ENDED);\r\n });\r\n this.component.subscribe(Events_1.Events.MEDIA_PAUSED, function () {\r\n _this.fire(Events_1.Events.MEDIA_PAUSED);\r\n });\r\n this.component.subscribe(Events_1.Events.MEDIA_PLAYED, function () {\r\n _this.fire(Events_1.Events.MEDIA_PLAYED);\r\n });\r\n };\r\n Extension.prototype.createModules = function () {\r\n _super.prototype.createModules.call(this);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel = new HeaderPanel_1.HeaderPanel(this.shell.$headerPanel);\r\n }\r\n else {\r\n this.shell.$headerPanel.hide();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel = new ResourcesLeftPanel_1.ResourcesLeftPanel(this.shell.$leftPanel);\r\n }\r\n this.centerPanel = new MediaElementCenterPanel_1.MediaElementCenterPanel(this.shell.$centerPanel);\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel = new MoreInfoRightPanel_1.MoreInfoRightPanel(this.shell.$rightPanel);\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel = new FooterPanel_1.FooterPanel(this.shell.$footerPanel);\r\n }\r\n else {\r\n this.shell.$footerPanel.hide();\r\n }\r\n this.$helpDialogue = $('<div class=\"overlay help\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$helpDialogue);\r\n this.helpDialogue = new HelpDialogue_1.HelpDialogue(this.$helpDialogue);\r\n this.$downloadDialogue = $('<div class=\"overlay download\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$downloadDialogue);\r\n this.downloadDialogue = new DownloadDialogue_1.DownloadDialogue(this.$downloadDialogue);\r\n this.$shareDialogue = $('<div class=\"overlay share\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$shareDialogue);\r\n this.shareDialogue = new ShareDialogue_1.ShareDialogue(this.$shareDialogue);\r\n this.$settingsDialogue = $('<div class=\"overlay settings\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$settingsDialogue);\r\n this.settingsDialogue = new SettingsDialogue_1.SettingsDialogue(this.$settingsDialogue);\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel.init();\r\n }\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel.init();\r\n }\r\n };\r\n Extension.prototype.render = function () {\r\n _super.prototype.render.call(this);\r\n };\r\n Extension.prototype.isLeftPanelEnabled = function () {\r\n return Utils.Bools.getBool(this.data.config.options.leftPanelEnabled, true)\r\n && ((this.helper.isMultiCanvas() || this.helper.isMultiSequence()) || this.helper.hasResources());\r\n };\r\n Extension.prototype.bookmark = function () {\r\n _super.prototype.bookmark.call(this);\r\n var canvas = this.extensions.helper.getCurrentCanvas();\r\n var bookmark = new Bookmark_1.Bookmark();\r\n bookmark.index = this.helper.canvasIndex;\r\n bookmark.label = Manifesto.LanguageMap.getValue(canvas.getLabel());\r\n bookmark.thumb = canvas.getProperty('thumbnail');\r\n bookmark.title = this.helper.getLabel();\r\n bookmark.trackingLabel = window.trackingLabel;\r\n if (this.isVideo()) {\r\n bookmark.type = vocabulary_1.ExternalResourceType.MOVING_IMAGE.toString();\r\n }\r\n else {\r\n bookmark.type = vocabulary_1.ExternalResourceType.SOUND.toString();\r\n }\r\n this.fire(BaseEvents_1.BaseEvents.BOOKMARK, bookmark);\r\n };\r\n Extension.prototype.getEmbedScript = function (template, width, height) {\r\n //const configUri: string = this.data.config.uri || '';\r\n //const script: string = String.format(template, this.getSerializedLocales(), configUri, this.helper.iiifResourceUri, this.helper.collectionIndex, this.helper.manifestIndex, this.helper.sequenceIndex, this.helper.canvasIndex, width, height, this.data.embedScriptUri);\r\n var appUri = this.getAppUri();\r\n var iframeSrc = appUri + \"#?manifest=\" + this.helper.manifestUri + \"&c=\" + this.helper.collectionIndex + \"&m=\" + this.helper.manifestIndex + \"&s=\" + this.helper.sequenceIndex + \"&cv=\" + this.helper.canvasIndex;\r\n return Utils.Strings.format(template, iframeSrc, width.toString(), height.toString());\r\n };\r\n // todo: use canvas.getThumbnail()\r\n Extension.prototype.getPosterImageUri = function () {\r\n var canvas = this.helper.getCurrentCanvas();\r\n var annotations = canvas.getContent();\r\n if (annotations && annotations.length) {\r\n return annotations[0].getProperty('thumbnail');\r\n }\r\n else {\r\n return canvas.getProperty('thumbnail');\r\n }\r\n };\r\n Extension.prototype.isVideoFormat = function (type) {\r\n var videoFormats = [vocabulary_1.MediaType.AUDIO_MP4.toString(), vocabulary_1.MediaType.WEBM.toString()];\r\n return videoFormats.indexOf(type) != -1;\r\n };\r\n Extension.prototype.isVideo = function () {\r\n var canvas = this.helper.getCurrentCanvas();\r\n var annotations = canvas.getContent();\r\n if (annotations && annotations.length) {\r\n var formats = this.getMediaFormats(canvas);\r\n for (var i = 0; i < formats.length; i++) {\r\n var format = formats[i];\r\n var type = format.getFormat();\r\n if (type) {\r\n if (this.isVideoFormat(type.toString())) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n else {\r\n // @ts-ignore\r\n var type = canvas.getType();\r\n if (type) {\r\n return type.toString() === vocabulary_1.ExternalResourceType.MOVING_IMAGE.toString();\r\n }\r\n }\r\n throw (new Error(\"Unable to determine media type\"));\r\n };\r\n return Extension;\r\n }(BaseExtension_1.BaseExtension));\r\n exports.Extension = Extension;\r\n});\r\n//# sourceMappingURL=Extension.js.map\n", "define('modules/uv-shared-module/AnnotationResults',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var AnnotationResults = /** @class */ (function () {\r\n function AnnotationResults() {\r\n }\r\n return AnnotationResults;\r\n }());\r\n exports.AnnotationResults = AnnotationResults;\r\n});\r\n//# sourceMappingURL=AnnotationResults.js.map\n", "define('modules/uv-shared-module/Point',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Point = /** @class */ (function () {\r\n function Point(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n return Point;\r\n }());\r\n exports.Point = Point;\r\n});\r\n//# sourceMappingURL=Point.js.map\n", "define('extensions/uv-seadragon-extension/CroppedImageDimensions',[\"require\", \"exports\", \"../../modules/uv-shared-module/Point\"], function (require, exports, Point_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Size = Utils.Size;\r\n var CroppedImageDimensions = /** @class */ (function () {\r\n function CroppedImageDimensions() {\r\n this.region = new Size(0, 0);\r\n this.regionPos = new Point_1.Point(0, 0);\r\n this.size = new Size(0, 0);\r\n }\r\n return CroppedImageDimensions;\r\n }());\r\n exports.CroppedImageDimensions = CroppedImageDimensions;\r\n});\r\n//# sourceMappingURL=CroppedImageDimensions.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-seadragon-extension/DownloadDialogue',[\"require\", \"exports\", \"manifesto.js\", \"../../modules/uv-shared-module/BaseEvents\", \"../../modules/uv-dialogues-module/DownloadDialogue\", \"../../modules/uv-shared-module/DownloadOption\"], function (require, exports, manifesto_js_1, BaseEvents_1, DownloadDialogue_1, DownloadOption_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var DownloadDialogue = /** @class */ (function (_super) {\r\n __extends(DownloadDialogue, _super);\r\n function DownloadDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n DownloadDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('downloadDialogue');\r\n _super.prototype.create.call(this);\r\n // create ui.\r\n this.$settingsButton = $('<a class=\"settings\" href=\"#\">' + this.content.editSettings + '</a>');\r\n this.$pagingNote = $('<div class=\"pagingNote\">' + this.content.pagingNote + ' </div>');\r\n this.$pagingNote.append(this.$settingsButton);\r\n this.$content.append(this.$pagingNote);\r\n this.$imageOptionsContainer = $('<li class=\"group image\"></li>');\r\n this.$downloadOptions.append(this.$imageOptionsContainer);\r\n this.$imageOptions = $('<ul></ul>');\r\n this.$imageOptionsContainer.append(this.$imageOptions);\r\n this.$currentViewAsJpgButton = $('<li class=\"option single\"><input id=\"' + DownloadOption_1.DownloadOption.CURRENT_VIEW + '\" type=\"radio\" name=\"downloadOptions\" tabindex=\"0\" /><label for=\"' + DownloadOption_1.DownloadOption.CURRENT_VIEW + '\"></label></li>');\r\n this.$imageOptions.append(this.$currentViewAsJpgButton);\r\n this.$currentViewAsJpgButton.hide();\r\n this.$wholeImageHighResButton = $('<li class=\"option single\"><input id=\"' + DownloadOption_1.DownloadOption.WHOLE_IMAGE_HIGH_RES + '\" type=\"radio\" name=\"downloadOptions\" tabindex=\"0\" /><label id=\"' + DownloadOption_1.DownloadOption.WHOLE_IMAGE_HIGH_RES + 'label\" for=\"' + DownloadOption_1.DownloadOption.WHOLE_IMAGE_HIGH_RES + '\"></label></li>');\r\n this.$imageOptions.append(this.$wholeImageHighResButton);\r\n this.$wholeImageHighResButton.hide();\r\n this.$wholeImagesHighResButton = $('<li class=\"option multiple\"><input id=\"' + DownloadOption_1.DownloadOption.WHOLE_IMAGES_HIGH_RES + '\" type=\"radio\" name=\"downloadOptions\" tabindex=\"0\" /><label id=\"' + DownloadOption_1.DownloadOption.WHOLE_IMAGES_HIGH_RES + 'label\" for=\"' + DownloadOption_1.DownloadOption.WHOLE_IMAGES_HIGH_RES + '\"></label></li>');\r\n this.$imageOptions.append(this.$wholeImagesHighResButton);\r\n this.$wholeImageHighResButton.hide();\r\n this.$wholeImageLowResAsJpgButton = $('<li class=\"option single\"><input id=\"' + DownloadOption_1.DownloadOption.WHOLE_IMAGE_LOW_RES + '\" type=\"radio\" name=\"downloadOptions\" tabindex=\"0\" /><label for=\"' + DownloadOption_1.DownloadOption.WHOLE_IMAGE_LOW_RES + '\">' + this.content.wholeImageLowResAsJpg + '</label></li>');\r\n this.$imageOptions.append(this.$wholeImageLowResAsJpgButton);\r\n this.$wholeImageLowResAsJpgButton.hide();\r\n this.$canvasOptionsContainer = $('<li class=\"group canvas\"></li>');\r\n this.$downloadOptions.append(this.$canvasOptionsContainer);\r\n this.$canvasOptions = $('<ul></ul>');\r\n this.$canvasOptionsContainer.append(this.$canvasOptions);\r\n this.$manifestOptionsContainer = $('<li class=\"group manifest\"></li>');\r\n this.$downloadOptions.append(this.$manifestOptionsContainer);\r\n this.$manifestOptions = $('<ul></ul>');\r\n this.$manifestOptionsContainer.append(this.$manifestOptions);\r\n this.$selectionButton = $('<li class=\"option\"><input id=\"' + DownloadOption_1.DownloadOption.SELECTION + '\" type=\"radio\" name=\"downloadOptions\" tabindex=\"0\" /><label id=\"' + DownloadOption_1.DownloadOption.SELECTION + 'label\" for=\"' + DownloadOption_1.DownloadOption.SELECTION + '\"></label></li>');\r\n this.$manifestOptions.append(this.$selectionButton);\r\n this.$selectionButton.hide();\r\n this.$downloadButton = $('<a class=\"btn btn-primary\" href=\"#\" tabindex=\"0\">' + this.content.download + '</a>');\r\n this.$buttons.prepend(this.$downloadButton);\r\n this.$explanatoryTextTemplate = $('<span class=\"explanatory\"></span>');\r\n var that = this;\r\n // what happens on download is specific to the extension (except for renderings which need to be moved to the base download dialogue)\r\n // todo: we need to make everything a list of radio button options in the base class, then we can unify everything into a single render method\r\n this.$downloadButton.on('click', function (e) {\r\n e.preventDefault();\r\n var $selectedOption = that.getSelectedOption();\r\n var id = $selectedOption.attr('id');\r\n var label = $selectedOption.attr('title');\r\n var mime = $selectedOption.data('mime');\r\n var type = DownloadOption_1.DownloadOption.UNKNOWN;\r\n var canvas = _this.extension.helper.getCurrentCanvas();\r\n if (_this.renderingUrls[id]) {\r\n if (mime) {\r\n if (mime.toLowerCase().indexOf('pdf') !== -1) {\r\n type = DownloadOption_1.DownloadOption.ENTIRE_DOCUMENT_AS_PDF;\r\n }\r\n else if (mime.toLowerCase().indexOf('txt') !== -1) {\r\n type = DownloadOption_1.DownloadOption.ENTIRE_DOCUMENT_AS_TEXT;\r\n }\r\n }\r\n if (type = DownloadOption_1.DownloadOption.ENTIRE_DOCUMENT_AS_PDF) {\r\n //var printService: Service = this.extension.helper.manifest.getService(manifesto.ServiceProfile.printExtensions());\r\n // if downloading a pdf - if there's a print service, generate an event instead of opening a new window.\r\n // if (printService && this.extension.isOnHomeDomain()){\r\n // this.component.publish(Events.PRINT);\r\n // } else {\r\n window.open(_this.renderingUrls[id]);\r\n //}\r\n }\r\n }\r\n else {\r\n type = id;\r\n switch (type) {\r\n case DownloadOption_1.DownloadOption.CURRENT_VIEW:\r\n var viewer = that.extension.getViewer();\r\n window.open(that.extension.getCroppedImageUri(canvas, viewer));\r\n break;\r\n case DownloadOption_1.DownloadOption.SELECTION:\r\n Utils.Async.waitFor(function () {\r\n return !_this.isActive;\r\n }, function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.SHOW_MULTISELECT_DIALOGUE);\r\n });\r\n break;\r\n case DownloadOption_1.DownloadOption.WHOLE_IMAGE_HIGH_RES:\r\n window.open(_this.getCanvasHighResImageUri(_this.extension.helper.getCurrentCanvas()));\r\n break;\r\n case DownloadOption_1.DownloadOption.WHOLE_IMAGES_HIGH_RES:\r\n var indices = _this.extension.getPagedIndices();\r\n for (var i = 0; i < indices.length; i++) {\r\n window.open(_this.getCanvasHighResImageUri(_this.extension.helper.getCanvasByIndex(indices[i])));\r\n }\r\n break;\r\n case DownloadOption_1.DownloadOption.WHOLE_IMAGE_LOW_RES:\r\n var imageUri = that.extension.getConfinedImageUri(canvas, that.options.confinedImageSize);\r\n if (imageUri) {\r\n window.open(imageUri);\r\n }\r\n break;\r\n }\r\n }\r\n _this.component.publish(BaseEvents_1.BaseEvents.DOWNLOAD, {\r\n \"type\": type,\r\n \"label\": label\r\n });\r\n _this.close();\r\n });\r\n this.$settingsButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.HIDE_DOWNLOAD_DIALOGUE);\r\n _this.component.publish(BaseEvents_1.BaseEvents.SHOW_SETTINGS_DIALOGUE);\r\n });\r\n };\r\n DownloadDialogue.prototype.open = function (triggerButton) {\r\n _super.prototype.open.call(this, triggerButton);\r\n var canvas = this.extension.helper.getCurrentCanvas();\r\n var rotation = this.extension.getViewerRotation();\r\n var hasNormalDimensions = rotation % 180 == 0;\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.CURRENT_VIEW)) {\r\n var $input = this.$currentViewAsJpgButton.find('input');\r\n var $label = this.$currentViewAsJpgButton.find('label');\r\n var label = this.content.currentViewAsJpg;\r\n var viewer = this.extension.getViewer();\r\n var dimensions = this.extension.getCroppedImageDimensions(canvas, viewer);\r\n // dimensions\r\n if (dimensions) {\r\n label = hasNormalDimensions ?\r\n Utils.Strings.format(label, dimensions.size.width.toString(), dimensions.size.height.toString()) :\r\n Utils.Strings.format(label, dimensions.size.height.toString(), dimensions.size.width.toString());\r\n $label.text(label);\r\n $input.prop('title', label);\r\n this.$currentViewAsJpgButton.data('width', dimensions.size.width);\r\n this.$currentViewAsJpgButton.data('height', dimensions.size.height);\r\n this.$currentViewAsJpgButton.show();\r\n }\r\n else {\r\n this.$currentViewAsJpgButton.hide();\r\n }\r\n // explanatory text\r\n if (Utils.Bools.getBool(this.options.optionsExplanatoryTextEnabled, false)) {\r\n var text = this.content.currentViewAsJpgExplanation;\r\n if (text) {\r\n var $span = this.$explanatoryTextTemplate.clone();\r\n $span.text(text);\r\n $label.append($span);\r\n }\r\n }\r\n }\r\n else {\r\n this.$currentViewAsJpgButton.hide();\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.WHOLE_IMAGE_HIGH_RES)) {\r\n var $input = this.$wholeImageHighResButton.find('input');\r\n var $label = this.$wholeImageHighResButton.find('label');\r\n var mime = this.getCanvasMimeType(this.extension.helper.getCurrentCanvas());\r\n if (mime) {\r\n mime = Utils.Files.simplifyMimeType(mime);\r\n }\r\n else {\r\n mime = '?';\r\n }\r\n // dimensions\r\n var size = this.getCanvasComputedDimensions(this.extension.helper.getCurrentCanvas());\r\n if (!size) {\r\n // if there is no image service, allow the image to be downloaded directly.\r\n if (canvas.externalResource && !canvas.externalResource.hasServiceDescriptor()) {\r\n var label = Utils.Strings.format(this.content.wholeImageHighRes, '?', '?', mime);\r\n $label.text(label);\r\n $input.prop('title', label);\r\n this.$wholeImageHighResButton.show();\r\n }\r\n else {\r\n this.$wholeImageHighResButton.hide();\r\n }\r\n }\r\n else {\r\n var label = hasNormalDimensions ?\r\n Utils.Strings.format(this.content.wholeImageHighRes, size.width.toString(), size.height.toString(), mime) :\r\n Utils.Strings.format(this.content.wholeImageHighRes, size.height.toString(), size.width.toString(), mime);\r\n $label.text(label);\r\n $input.prop('title', label);\r\n this.$wholeImageHighResButton.data('width', size.width);\r\n this.$wholeImageHighResButton.data('height', size.height);\r\n this.$wholeImageHighResButton.show();\r\n }\r\n // explanatory text\r\n if (Utils.Bools.getBool(this.options.optionsExplanatoryTextEnabled, false)) {\r\n var text = this.content.wholeImageHighResExplanation;\r\n if (text) {\r\n var $span = this.$explanatoryTextTemplate.clone();\r\n $span.text(text);\r\n $label.append($span);\r\n }\r\n }\r\n }\r\n else {\r\n this.$wholeImageHighResButton.hide();\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.WHOLE_IMAGES_HIGH_RES)) {\r\n var $input = this.$wholeImagesHighResButton.find('input');\r\n var $label = this.$wholeImagesHighResButton.find('label');\r\n var mime = this.getCanvasMimeType(this.extension.helper.getCurrentCanvas());\r\n if (mime) {\r\n mime = Utils.Files.simplifyMimeType(mime);\r\n }\r\n else {\r\n mime = '?';\r\n }\r\n var label = Utils.Strings.format(this.content.wholeImagesHighRes, mime);\r\n $label.text(label);\r\n $input.prop('title', label);\r\n this.$wholeImagesHighResButton.show();\r\n // explanatory text\r\n if (Utils.Bools.getBool(this.options.optionsExplanatoryTextEnabled, false)) {\r\n var text = this.content.wholeImagesHighResExplanation;\r\n if (text) {\r\n var $span = this.$explanatoryTextTemplate.clone();\r\n $span.text(text);\r\n $label.append($span);\r\n }\r\n }\r\n }\r\n else {\r\n this.$wholeImagesHighResButton.hide();\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.WHOLE_IMAGE_LOW_RES)) {\r\n var $input = this.$wholeImageLowResAsJpgButton.find('input');\r\n var $label = this.$wholeImageLowResAsJpgButton.find('label');\r\n var size = this.extension.getConfinedImageDimensions(canvas, this.options.confinedImageSize);\r\n var label = hasNormalDimensions ?\r\n Utils.Strings.format(this.content.wholeImageLowResAsJpg, size.width.toString(), size.height.toString()) :\r\n Utils.Strings.format(this.content.wholeImageLowResAsJpg, size.height.toString(), size.width.toString());\r\n $label.text(label);\r\n $input.prop('title', label);\r\n this.$wholeImageLowResAsJpgButton.data('width', size.width);\r\n this.$wholeImageLowResAsJpgButton.data('height', size.height);\r\n this.$wholeImageLowResAsJpgButton.show();\r\n // explanatory text\r\n if (Utils.Bools.getBool(this.options.optionsExplanatoryTextEnabled, false)) {\r\n var text = this.content.wholeImageLowResAsJpgExplanation;\r\n if (text) {\r\n var $span = this.$explanatoryTextTemplate.clone();\r\n $span.text(text);\r\n $label.append($span);\r\n }\r\n }\r\n }\r\n else {\r\n this.$wholeImageLowResAsJpgButton.hide();\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.SELECTION)) {\r\n var $input = this.$selectionButton.find('input');\r\n var $label = this.$selectionButton.find('label');\r\n $label.text(this.content.downloadSelection);\r\n $input.prop('title', this.content.downloadSelection);\r\n this.$selectionButton.show();\r\n // explanatory text\r\n if (Utils.Bools.getBool(this.options.optionsExplanatoryTextEnabled, false)) {\r\n var text = this.content.selectionExplanation;\r\n if (text) {\r\n var $span = this.$explanatoryTextTemplate.clone();\r\n $span.text(text);\r\n $label.append($span);\r\n }\r\n }\r\n }\r\n else {\r\n this.$selectionButton.hide();\r\n }\r\n this.resetDynamicDownloadOptions();\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.RANGE_RENDERINGS)) {\r\n if (canvas.ranges && canvas.ranges.length) {\r\n for (var i = 0; i < canvas.ranges.length; i++) {\r\n var range = canvas.ranges[i];\r\n var renderingOptions = this.getDownloadOptionsForRenderings(range, this.content.entireFileAsOriginal, DownloadOption_1.DownloadOption.CANVAS_RENDERINGS);\r\n this.addDownloadOptionsForRenderings(renderingOptions);\r\n }\r\n }\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.IMAGE_RENDERINGS)) {\r\n var images = canvas.getImages();\r\n for (var i = 0; i < images.length; i++) {\r\n var renderingOptions = this.getDownloadOptionsForRenderings(images[i].getResource(), this.content.entireFileAsOriginal, DownloadOption_1.DownloadOption.IMAGE_RENDERINGS);\r\n this.addDownloadOptionsForRenderings(renderingOptions);\r\n }\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.CANVAS_RENDERINGS)) {\r\n var renderingOptions = this.getDownloadOptionsForRenderings(canvas, this.content.entireFileAsOriginal, DownloadOption_1.DownloadOption.CANVAS_RENDERINGS);\r\n this.addDownloadOptionsForRenderings(renderingOptions);\r\n }\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.MANIFEST_RENDERINGS)) {\r\n var renderingOptions = this.getDownloadOptionsForRenderings(this.extension.helper.getCurrentSequence(), this.content.entireDocument, DownloadOption_1.DownloadOption.MANIFEST_RENDERINGS);\r\n if (!renderingOptions.length && this.extension.helper.manifest) {\r\n renderingOptions = this.getDownloadOptionsForRenderings(this.extension.helper.manifest, this.content.entireDocument, DownloadOption_1.DownloadOption.MANIFEST_RENDERINGS);\r\n }\r\n this.addDownloadOptionsForRenderings(renderingOptions);\r\n }\r\n // hide the current view option if it's equivalent to whole image.\r\n if (this.isDownloadOptionAvailable(DownloadOption_1.DownloadOption.CURRENT_VIEW)) {\r\n var currentWidth = parseInt(this.$currentViewAsJpgButton.data('width').toString());\r\n var currentHeight = parseInt(this.$currentViewAsJpgButton.data('height').toString());\r\n var wholeWidth = parseInt(this.$wholeImageHighResButton.data('width').toString());\r\n var wholeHeight = parseInt(this.$wholeImageHighResButton.data('height').toString());\r\n var percentageWidth = (currentWidth / wholeWidth) * 100;\r\n var percentageHeight = (currentHeight / wholeHeight) * 100;\r\n var disabledPercentage = this.options.currentViewDisabledPercentage;\r\n // if over disabledPercentage of the size of whole image\r\n if (percentageWidth >= disabledPercentage && percentageHeight >= disabledPercentage) {\r\n this.$currentViewAsJpgButton.hide();\r\n }\r\n else {\r\n this.$currentViewAsJpgButton.show();\r\n }\r\n }\r\n // order by image area\r\n var $options = this.$imageOptions.find('li.single');\r\n $options = $options.sort(function (a, b) {\r\n var aWidth = $(a).data('width');\r\n aWidth ? aWidth = parseInt(aWidth.toString()) : 0;\r\n var aHeight = $(a).data('height');\r\n aHeight ? aHeight = parseInt(aHeight.toString()) : 0;\r\n var bWidth = $(b).data('width');\r\n bWidth ? bWidth = parseInt(bWidth.toString()) : 0;\r\n var bHeight = $(b).data('height');\r\n bHeight ? bHeight = parseInt(bHeight.toString()) : 0;\r\n var aArea = aWidth * aHeight;\r\n var bArea = bWidth * bHeight;\r\n if (aArea < bArea) {\r\n return -1;\r\n }\r\n if (aArea > bArea) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n $options.detach().appendTo(this.$imageOptions);\r\n // hide empty groups\r\n var $groups = this.$downloadOptions.find('li.group');\r\n $groups.each(function (index, group) {\r\n var $group = $(group);\r\n $group.show();\r\n if ($group.find('li.option:hidden').length === $group.find('li.option').length) {\r\n // all options are hidden, hide group.\r\n $group.hide();\r\n }\r\n });\r\n this.$downloadOptions.find('li.group:visible').last().addClass('lastVisible');\r\n if (this.extension.isPagingSettingEnabled() && (this.config.options.downloadPagingNoteEnabled)) {\r\n this.$pagingNote.show();\r\n }\r\n else {\r\n this.$pagingNote.hide();\r\n }\r\n if (!this.$downloadOptions.find('li.option:visible').length) {\r\n this.$noneAvailable.show();\r\n this.$downloadButton.hide();\r\n }\r\n else {\r\n // select first option.\r\n this.$downloadOptions.find('li.option input:visible:first').prop(\"checked\", true);\r\n this.$noneAvailable.hide();\r\n this.$downloadButton.show();\r\n }\r\n this.resize();\r\n };\r\n DownloadDialogue.prototype.addDownloadOptionsForRenderings = function (renderingOptions) {\r\n var _this = this;\r\n renderingOptions.forEach(function (option) {\r\n switch (option.type) {\r\n case DownloadOption_1.DownloadOption.IMAGE_RENDERINGS:\r\n _this.$imageOptions.append(option.button);\r\n break;\r\n case DownloadOption_1.DownloadOption.CANVAS_RENDERINGS:\r\n _this.$canvasOptions.append(option.button);\r\n break;\r\n case DownloadOption_1.DownloadOption.MANIFEST_RENDERINGS:\r\n _this.$manifestOptions.append(option.button);\r\n break;\r\n }\r\n });\r\n };\r\n DownloadDialogue.prototype.getCanvasImageResource = function (canvas) {\r\n var images = canvas.getImages();\r\n if (images[0]) {\r\n return images[0].getResource();\r\n }\r\n return null;\r\n };\r\n DownloadDialogue.prototype.getCanvasHighResImageUri = function (canvas) {\r\n var size = this.getCanvasComputedDimensions(canvas);\r\n if (size) {\r\n var width = size.width;\r\n var uri = canvas.getCanonicalImageUri(width);\r\n if (canvas.externalResource && canvas.externalResource.hasServiceDescriptor()) {\r\n var uri_parts = uri.split('/');\r\n var rotation = this.extension.getViewerRotation();\r\n uri_parts[uri_parts.length - 2] = String(rotation);\r\n uri = uri_parts.join('/');\r\n }\r\n return uri;\r\n }\r\n else if (canvas.externalResource && !canvas.externalResource.hasServiceDescriptor()) {\r\n // if there is no image service, return the dataUri.\r\n return canvas.externalResource.dataUri;\r\n }\r\n return '';\r\n };\r\n DownloadDialogue.prototype.getCanvasMimeType = function (canvas) {\r\n var resource = this.getCanvasImageResource(canvas);\r\n if (resource) {\r\n var format = resource.getFormat();\r\n if (format) {\r\n return format.toString();\r\n }\r\n }\r\n return null;\r\n };\r\n DownloadDialogue.prototype.getCanvasDimensions = function (canvas) {\r\n // externalResource may not have loaded yet\r\n if (canvas.externalResource.data) {\r\n var width = canvas.externalResource.data.width;\r\n var height = canvas.externalResource.data.height;\r\n if (width && height) {\r\n return new manifesto_js_1.Size(width, height);\r\n }\r\n }\r\n return null;\r\n };\r\n DownloadDialogue.prototype.getCanvasComputedDimensions = function (canvas) {\r\n var imageSize = this.getCanvasDimensions(canvas);\r\n var requiredSize = canvas.getMaxDimensions();\r\n if (!imageSize) {\r\n return null;\r\n }\r\n if (!requiredSize) {\r\n return imageSize;\r\n }\r\n if (imageSize.width <= requiredSize.width && imageSize.height <= requiredSize.height) {\r\n return imageSize;\r\n }\r\n var scaleW = requiredSize.width / imageSize.width;\r\n var scaleH = requiredSize.height / imageSize.height;\r\n var scale = Math.min(scaleW, scaleH);\r\n return new manifesto_js_1.Size(Math.floor(imageSize.width * scale), Math.floor(imageSize.height * scale));\r\n };\r\n DownloadDialogue.prototype._isLevel0 = function (profile) {\r\n if (!profile || !profile.length)\r\n return false;\r\n return manifesto_js_1.Utils.isLevel0ImageProfile(profile[0]);\r\n };\r\n DownloadDialogue.prototype.isDownloadOptionAvailable = function (option) {\r\n if (!this.extension.resources) {\r\n return false;\r\n }\r\n var canvas = this.extension.helper.getCurrentCanvas();\r\n // if the external resource doesn't have a service descriptor or is level 0\r\n // only allow wholeImageHighRes\r\n if (!canvas.externalResource.hasServiceDescriptor() || this._isLevel0(canvas.externalResource.data.profile)) {\r\n if (option === DownloadOption_1.DownloadOption.WHOLE_IMAGE_HIGH_RES) {\r\n // if in one-up mode, or in two-up mode with a single page being shown\r\n if (!this.extension.isPagingSettingEnabled() ||\r\n this.extension.isPagingSettingEnabled() && this.extension.resources && this.extension.resources.length === 1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n switch (option) {\r\n case DownloadOption_1.DownloadOption.CURRENT_VIEW:\r\n case DownloadOption_1.DownloadOption.CANVAS_RENDERINGS:\r\n case DownloadOption_1.DownloadOption.IMAGE_RENDERINGS:\r\n case DownloadOption_1.DownloadOption.WHOLE_IMAGE_HIGH_RES:\r\n // if in one-up mode, or in two-up mode with a single page being shown\r\n if (!this.extension.isPagingSettingEnabled() ||\r\n this.extension.isPagingSettingEnabled() && this.extension.resources && this.extension.resources.length === 1) {\r\n var maxDimensions = canvas.getMaxDimensions();\r\n if (maxDimensions) {\r\n if (maxDimensions.width <= this.options.maxImageWidth) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n case DownloadOption_1.DownloadOption.WHOLE_IMAGES_HIGH_RES:\r\n if (this.extension.isPagingSettingEnabled() && this.extension.resources && this.extension.resources.length > 1) {\r\n return true;\r\n }\r\n return false;\r\n case DownloadOption_1.DownloadOption.WHOLE_IMAGE_LOW_RES:\r\n // hide low-res option if hi-res width is smaller than constraint\r\n var size = this.getCanvasComputedDimensions(canvas);\r\n if (!size) {\r\n return false;\r\n }\r\n return (!this.extension.isPagingSettingEnabled() && (size.width > this.options.confinedImageSize));\r\n case DownloadOption_1.DownloadOption.SELECTION:\r\n return this.options.selectionEnabled;\r\n case DownloadOption_1.DownloadOption.RANGE_RENDERINGS:\r\n if (canvas.ranges && canvas.ranges.length) {\r\n var range = canvas.ranges[0];\r\n return range.getRenderings().length > 0;\r\n }\r\n return false;\r\n default:\r\n return _super.prototype.isDownloadOptionAvailable.call(this, option);\r\n }\r\n };\r\n return DownloadDialogue;\r\n }(DownloadDialogue_1.DownloadDialogue));\r\n exports.DownloadDialogue = DownloadDialogue;\r\n});\r\n//# sourceMappingURL=DownloadDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-dialogues-module/ExternalContentDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\"], function (require, exports, BaseEvents_1, Dialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ExternalContentDialogue = /** @class */ (function (_super) {\r\n __extends(ExternalContentDialogue, _super);\r\n function ExternalContentDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n ExternalContentDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('externalContentDialogue');\r\n _super.prototype.create.call(this);\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_EXTERNALCONTENT_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_EXTERNALCONTENT_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function (params) {\r\n _this.open();\r\n _this.$iframe.prop('src', params.uri);\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n });\r\n this.$iframe = $('<iframe></iframe>');\r\n this.$content.append(this.$iframe);\r\n this.$element.hide();\r\n };\r\n ExternalContentDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$iframe.width(this.$content.width());\r\n this.$iframe.height(this.$content.height());\r\n };\r\n return ExternalContentDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.ExternalContentDialogue = ExternalContentDialogue;\r\n});\r\n//# sourceMappingURL=ExternalContentDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-osdmobilefooterpanel-module/MobileFooter',[\"require\", \"exports\", \"../uv-shared-module/FooterPanel\", \"../../extensions/uv-seadragon-extension/Events\"], function (require, exports, FooterPanel_1, Events_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var FooterPanel = /** @class */ (function (_super) {\r\n __extends(FooterPanel, _super);\r\n function FooterPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n FooterPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('mobileFooterPanel');\r\n _super.prototype.create.call(this);\r\n this.$spacer = $('<div class=\"spacer\"></div>');\r\n this.$options.prepend(this.$spacer);\r\n this.$rotateButton = $(\"\\n <button class=\\\"btn imageBtn rotate\\\" title=\\\"\" + this.content.rotateRight + \"\\\">\\n <i class=\\\"uv-icon-rotate\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.rotateRight + \"\\n </button>\\n \");\r\n this.$options.prepend(this.$rotateButton);\r\n this.$zoomOutButton = $(\"\\n <button class=\\\"btn imageBtn zoomOut\\\" title=\\\"\" + this.content.zoomOut + \"\\\">\\n <i class=\\\"uv-icon-zoom-out\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.zoomOut + \"\\n </button>\\n \");\r\n this.$options.prepend(this.$zoomOutButton);\r\n this.$zoomInButton = $(\"\\n <button class=\\\"btn imageBtn zoomIn\\\" title=\\\"\" + this.content.zoomIn + \"\\\">\\n <i class=\\\"uv-icon-zoom-in\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.zoomIn + \"\\n </button>\\n \");\r\n this.$options.prepend(this.$zoomInButton);\r\n this.$zoomInButton.onPressed(function () {\r\n _this.component.publish(Events_1.Events.ZOOM_IN);\r\n });\r\n this.$zoomOutButton.onPressed(function () {\r\n _this.component.publish(Events_1.Events.ZOOM_OUT);\r\n });\r\n this.$rotateButton.onPressed(function () {\r\n _this.component.publish(Events_1.Events.ROTATE);\r\n });\r\n };\r\n FooterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this.$options.css('left', Math.floor((this.$element.width() / 2) - (this.$options.width() / 2)));\r\n };\r\n return FooterPanel;\r\n }(FooterPanel_1.FooterPanel));\r\n exports.FooterPanel = FooterPanel;\r\n});\r\n//# sourceMappingURL=MobileFooter.js.map\n", "define('modules/uv-shared-module/AutoComplete',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var AutoComplete = /** @class */ (function () {\r\n function AutoComplete(element, autoCompleteFunc, parseResultsFunc, onSelect, delay, minChars, positionAbove, allowWords) {\r\n if (delay === void 0) { delay = 300; }\r\n if (minChars === void 0) { minChars = 2; }\r\n if (positionAbove === void 0) { positionAbove = false; }\r\n if (allowWords === void 0) { allowWords = false; }\r\n var _this = this;\r\n this._$element = element;\r\n this._autoCompleteFunc = autoCompleteFunc;\r\n this._delay = delay;\r\n this._minChars = minChars;\r\n this._onSelect = onSelect;\r\n this._parseResultsFunc = parseResultsFunc;\r\n this._positionAbove = positionAbove;\r\n this._allowWords = allowWords;\r\n // create ui.\r\n this._$searchResultsList = $('<ul class=\"autocomplete\"></ul>');\r\n if (this._positionAbove) {\r\n this._$element.parent().prepend(this._$searchResultsList);\r\n }\r\n else {\r\n this._$element.parent().append(this._$searchResultsList);\r\n }\r\n this._$searchResultTemplate = $('<li class=\"result\"><a href=\"#\" tabindex=\"-1\"></a></li>');\r\n // init ui.\r\n // callback after set period.\r\n var typewatch = (function () {\r\n var timer = 0;\r\n return function (cb, ms) {\r\n clearTimeout(timer);\r\n timer = setTimeout(cb, ms);\r\n };\r\n })();\r\n var that = this;\r\n this._$element.on(\"keydown\", function (e) {\r\n var originalEvent = e.originalEvent;\r\n //that._lastKeyDownWasNavigation = that._isNavigationKeyDown(originalEvent);\r\n var charCode = Utils.Keyboard.getCharCode(originalEvent);\r\n var cancelEvent = false;\r\n if (charCode === KeyCodes.KeyDown.LeftArrow) {\r\n cancelEvent = true;\r\n }\r\n else if (charCode === KeyCodes.KeyDown.RightArrow) {\r\n cancelEvent = true;\r\n }\r\n if (cancelEvent) {\r\n originalEvent.cancelBubble = true;\r\n if (originalEvent.stopPropagation)\r\n originalEvent.stopPropagation();\r\n }\r\n });\r\n // auto complete\r\n this._$element.on(\"keyup\", function (e) {\r\n // if pressing enter without a list item selected\r\n if (!that._getSelectedListItem().length && e.keyCode === KeyCodes.KeyDown.Enter) {\r\n that._onSelect(that._getTerms());\r\n return;\r\n }\r\n // If there are search results\r\n if (that._$searchResultsList.is(':visible') && that._results.length) {\r\n if (e.keyCode === KeyCodes.KeyDown.Enter) {\r\n that._searchForItem(that._getSelectedListItem());\r\n }\r\n else if (e.keyCode === KeyCodes.KeyDown.DownArrow) {\r\n that._setSelectedResultIndex(1);\r\n return;\r\n }\r\n else if (e.keyCode === KeyCodes.KeyDown.UpArrow) {\r\n that._setSelectedResultIndex(-1);\r\n return;\r\n }\r\n }\r\n if (e.keyCode !== KeyCodes.KeyDown.Enter) {\r\n // after a delay, show autocomplete list.\r\n typewatch(function () {\r\n var val = that._getTerms();\r\n // if there are more than x chars\r\n // update the autocomplete list.\r\n if (val && val.length > that._minChars && that._searchForWords(val)) {\r\n that._search(val);\r\n }\r\n else {\r\n // otherwise, hide the autocomplete list.\r\n that._clearResults();\r\n that._hideResults();\r\n }\r\n }, that._delay);\r\n }\r\n });\r\n // hide results if clicked outside.\r\n $(document).on('mouseup', function (e) {\r\n if (_this._$searchResultsList.parent().has($(e.target)[0]).length === 0) {\r\n _this._clearResults();\r\n _this._hideResults();\r\n }\r\n });\r\n this._hideResults();\r\n }\r\n AutoComplete.prototype._searchForWords = function (search) {\r\n if (this._allowWords || !search.includes(' ')) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n AutoComplete.prototype._getTerms = function () {\r\n return this._$element.val().trim();\r\n };\r\n AutoComplete.prototype._setSelectedResultIndex = function (direction) {\r\n var nextIndex;\r\n if (direction === 1) {\r\n nextIndex = this._selectedResultIndex + 1;\r\n }\r\n else {\r\n nextIndex = this._selectedResultIndex - 1;\r\n }\r\n var $items = this._$searchResultsList.find('li');\r\n if (nextIndex < 0) {\r\n nextIndex = $items.length - 1;\r\n }\r\n else if (nextIndex > $items.length - 1) {\r\n nextIndex = 0;\r\n }\r\n this._selectedResultIndex = nextIndex;\r\n $items.removeClass('selected');\r\n var $selectedItem = $items.eq(this._selectedResultIndex);\r\n $selectedItem.addClass('selected');\r\n var top = $selectedItem.outerHeight(true) * this._selectedResultIndex;\r\n this._$searchResultsList.scrollTop(top);\r\n };\r\n AutoComplete.prototype._search = function (term) {\r\n this._results = [];\r\n this._clearResults();\r\n this._showResults();\r\n this._$searchResultsList.append('<li class=\"loading\"></li>');\r\n this._updateListPosition();\r\n var that = this;\r\n this._autoCompleteFunc(term, function (results) {\r\n that._listResults(results);\r\n });\r\n };\r\n AutoComplete.prototype._clearResults = function () {\r\n this._$searchResultsList.empty();\r\n };\r\n AutoComplete.prototype._hideResults = function () {\r\n this._$searchResultsList.hide();\r\n };\r\n AutoComplete.prototype._showResults = function () {\r\n this._selectedResultIndex = -1;\r\n this._$searchResultsList.show();\r\n };\r\n AutoComplete.prototype._updateListPosition = function () {\r\n if (this._positionAbove) {\r\n this._$searchResultsList.css({\r\n 'top': this._$searchResultsList.outerHeight(true) * -1\r\n });\r\n }\r\n else {\r\n this._$searchResultsList.css({\r\n 'top': this._$element.outerHeight(true)\r\n });\r\n }\r\n };\r\n AutoComplete.prototype._listResults = function (results) {\r\n // get an array of strings\r\n this._results = this._parseResultsFunc(results);\r\n this._clearResults();\r\n if (!this._results.length) {\r\n // don't do this, because there still may be results for the PHRASE but not the word.\r\n // they won't know until they do the search.\r\n //this.searchResultsList.append('<li>no results</li>');\r\n this._hideResults();\r\n return;\r\n }\r\n for (var i = 0; i < this._results.length; i++) {\r\n var result = this._results[i];\r\n var $resultItem = this._$searchResultTemplate.clone();\r\n var $a = $resultItem.find('a');\r\n $a.text(result);\r\n this._$searchResultsList.append($resultItem);\r\n }\r\n this._updateListPosition();\r\n var that = this;\r\n this._$searchResultsList.find('li').on('click', function (e) {\r\n e.preventDefault();\r\n that._searchForItem($(this));\r\n });\r\n };\r\n AutoComplete.prototype._searchForItem = function ($item) {\r\n var term = $item.find('a').text();\r\n this._$element.val(term);\r\n this._hideResults();\r\n this._onSelect(term);\r\n this._clearResults();\r\n this._hideResults();\r\n };\r\n AutoComplete.prototype._getSelectedListItem = function () {\r\n return this._$searchResultsList.find('li.selected');\r\n };\r\n return AutoComplete;\r\n }());\r\n exports.AutoComplete = AutoComplete;\r\n});\r\n//# sourceMappingURL=AutoComplete.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-searchfooterpanel-module/FooterPanel',[\"require\", \"exports\", \"manifesto.js\", \"../uv-shared-module/AutoComplete\", \"../uv-shared-module/BaseEvents\", \"../../extensions/uv-seadragon-extension/Events\", \"../uv-shared-module/FooterPanel\", \"../../extensions/uv-seadragon-extension/Mode\", \"../../Utils\"], function (require, exports, manifesto_js_1, AutoComplete_1, BaseEvents_1, Events_1, FooterPanel_1, Mode_1, Utils_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var FooterPanel = /** @class */ (function (_super) {\r\n __extends(FooterPanel, _super);\r\n function FooterPanel($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this.placemarkerTouched = false;\r\n return _this;\r\n }\r\n FooterPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('searchFooterPanel');\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function () {\r\n _this.canvasIndexChanged();\r\n _this.setCurrentSearchResultPlacemarker();\r\n _this.updatePrevButton();\r\n _this.updateNextButton();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CLEAR_ANNOTATIONS, function () {\r\n _this.clearSearchResults();\r\n });\r\n // todo: this should be a setting\r\n this.component.subscribe(Events_1.Events.MODE_CHANGED, function () {\r\n _this.settingsChanged();\r\n });\r\n this.component.subscribe(Events_1.Events.SEARCH, function (terms) {\r\n _this.terms = terms;\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATIONS, function (annotationResults) {\r\n _this.displaySearchResults(annotationResults.annotations, annotationResults.terms);\r\n _this.setCurrentSearchResultPlacemarker();\r\n _this.updatePrevButton();\r\n _this.updateNextButton();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATIONS_EMPTY, function () {\r\n _this.hideSearchSpinner();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATION_CHANGED, function () {\r\n _this.updatePrevButton();\r\n _this.updateNextButton();\r\n });\r\n this.$printButton = $(\"\\n <button class=\\\"print btn imageBtn\\\" title=\\\"\" + this.content.print + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon uv-icon-print\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.print + \"\\n </button>\\n \");\r\n this.$options.prepend(this.$printButton);\r\n // search input.\r\n this.$searchContainer = $('<div class=\"search\"></div>');\r\n this.$element.prepend(this.$searchContainer);\r\n this.$searchOptions = $('<div class=\"searchOptions\"></div>');\r\n this.$searchContainer.append(this.$searchOptions);\r\n this.$searchLabel = $('<span class=\"label\">' + this.content.searchWithin + '</span>');\r\n this.$searchOptions.append(this.$searchLabel);\r\n this.$searchTextContainer = $('<div class=\"searchTextContainer\"></div>');\r\n this.$searchOptions.append(this.$searchTextContainer);\r\n this.$searchText = $('<input class=\"searchText\" type=\"text\" maxlength=\"100\" value=\"' + this.content.enterKeyword + '\" aria-label=\"' + this.content.searchWithin + '\"/>');\r\n this.$searchTextContainer.append(this.$searchText);\r\n this.$searchButton = $('<a class=\"imageButton searchButton\" tabindex=\"0\"></a>');\r\n this.$searchTextContainer.append(this.$searchButton);\r\n // search results.\r\n this.$searchPagerContainer = $('<div class=\"searchPager\"></div>');\r\n this.$element.prepend(this.$searchPagerContainer);\r\n this.$searchPagerControls = $('<div class=\"controls\"></div>');\r\n this.$searchPagerContainer.prepend(this.$searchPagerControls);\r\n this.$previousResultButton = $('<a class=\"previousResult\" title=\"' + this.content.previousResult + '\">' + this.content.previousResult + '</a>');\r\n this.$searchPagerControls.append(this.$previousResultButton);\r\n this.$searchResultsInfo = $('<div class=\"searchResultsInfo\"><span class=\"info\"><span class=\"number\">x</span> <span class=\"foundFor\"></span> \\'<span class=\"terms\">y</span>\\'</span></div>');\r\n this.$searchPagerControls.append(this.$searchResultsInfo);\r\n this.$clearSearchResultsButton = $('<a class=\"clearSearch\" title=\"' + this.content.clearSearch + '\">' + this.content.clearSearch + '</a>');\r\n this.$searchResultsInfo.append(this.$clearSearchResultsButton);\r\n this.$nextResultButton = $('<a class=\"nextResult\" title=\"' + this.content.nextResult + '\">' + this.content.nextResult + '</a>');\r\n this.$searchPagerControls.append(this.$nextResultButton);\r\n // placemarker line.\r\n this.$searchResultsContainer = $('<div class=\"searchResults\"></div>');\r\n this.$element.prepend(this.$searchResultsContainer);\r\n this.$line = $('<div class=\"line\"></div>');\r\n this.$searchResultsContainer.append(this.$line);\r\n this.$pagePositionMarker = $('<div class=\"positionPlacemarker\"></div>');\r\n this.$searchResultsContainer.append(this.$pagePositionMarker);\r\n this.$pagePositionLabel = $('<div class=\"label\"></div>');\r\n this.$searchResultsContainer.append(this.$pagePositionLabel);\r\n this.$placemarkerDetails = $('<div class=\"placeMarkerDetails\"></div>');\r\n this.$searchResultsContainer.append(this.$placemarkerDetails);\r\n this.$placemarkerDetailsTop = $('<h1></h1>');\r\n this.$placemarkerDetails.append(this.$placemarkerDetailsTop);\r\n this.$placemarkerDetailsBottom = $('<p></p>');\r\n this.$placemarkerDetails.append(this.$placemarkerDetailsBottom);\r\n // initialise ui.\r\n this.$searchPagerContainer.hide();\r\n this.$placemarkerDetails.hide();\r\n // ui event handlers.\r\n var that = this;\r\n this.$searchButton.on('click', function (e) {\r\n e.preventDefault();\r\n _this.search(_this.$searchText.val());\r\n });\r\n this.$searchText.on('focus', function () {\r\n // clear initial text.\r\n if (_this.$searchText.val() === _this.content.enterKeyword)\r\n _this.$searchText.val('');\r\n });\r\n this.$placemarkerDetails.on('mouseover', function () {\r\n that.component.publish(Events_1.Events.SEARCH_PREVIEW_START, _this.currentPlacemarkerIndex);\r\n });\r\n this.$placemarkerDetails.on('mouseleave', function () {\r\n $(this).hide();\r\n that.component.publish(Events_1.Events.SEARCH_PREVIEW_FINISH);\r\n // reset all placemarkers.\r\n var placemarkers = that.getSearchResultPlacemarkers();\r\n placemarkers.removeClass('hover');\r\n });\r\n this.$placemarkerDetails.on('click', function () {\r\n that.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.currentPlacemarkerIndex);\r\n });\r\n this.$previousResultButton.on('click', function (e) {\r\n e.preventDefault();\r\n if (_this.isPreviousButtonEnabled()) {\r\n that.component.publish(Events_1.Events.PREV_SEARCH_RESULT);\r\n }\r\n });\r\n this.$nextResultButton.on('click', function (e) {\r\n e.preventDefault();\r\n if (_this.isNextButtonEnabled()) {\r\n that.component.publish(Events_1.Events.NEXT_SEARCH_RESULT);\r\n }\r\n });\r\n this.$clearSearchResultsButton.on('click', function (e) {\r\n e.preventDefault();\r\n that.component.publish(BaseEvents_1.BaseEvents.CLEAR_ANNOTATIONS);\r\n });\r\n // hide search options if not enabled/supported.\r\n if (!this.isSearchEnabled()) {\r\n this.$searchContainer.hide();\r\n this.$searchPagerContainer.hide();\r\n this.$searchResultsContainer.hide();\r\n this.$element.addClass('min');\r\n }\r\n if (this.extension.helper.getTotalCanvases() === 1) {\r\n this.$searchResultsContainer.hide();\r\n }\r\n var autocompleteService = this.extension.getAutoCompleteUri();\r\n if (autocompleteService) {\r\n new AutoComplete_1.AutoComplete(this.$searchText, function (terms, cb) {\r\n $.getJSON(Utils.Strings.format(autocompleteService, terms), function (results) {\r\n cb(results);\r\n });\r\n }, function (results) {\r\n return $.map(results.terms, function (result) {\r\n return result.match;\r\n });\r\n }, function (terms) {\r\n _this.search(terms);\r\n }, 300, 2, true, Utils.Bools.getBool(this.options.autocompleteAllowWords, false));\r\n }\r\n else {\r\n this.$searchText.on(\"keyup\", function (e) {\r\n if (e.keyCode === KeyCodes.KeyDown.Enter) {\r\n that.search(that.$searchText.val());\r\n }\r\n });\r\n }\r\n this.$printButton.onPressed(function () {\r\n that.component.publish(Events_1.Events.PRINT);\r\n });\r\n this.updatePrintButton();\r\n var positionMarkerEnabled = Utils.Bools.getBool(this.config.options.positionMarkerEnabled, true);\r\n if (!positionMarkerEnabled) {\r\n this.$pagePositionMarker.hide();\r\n this.$pagePositionLabel.hide();\r\n }\r\n };\r\n FooterPanel.prototype.isSearchEnabled = function () {\r\n return this.extension.isSearchEnabled();\r\n };\r\n FooterPanel.prototype.isZoomToSearchResultEnabled = function () {\r\n return Utils.Bools.getBool(this.extension.data.config.options.zoomToSearchResultEnabled, true);\r\n };\r\n FooterPanel.prototype.isPreviousButtonEnabled = function () {\r\n var currentCanvasIndex = this.extension.helper.canvasIndex;\r\n var firstSearchResultCanvasIndex = this.getFirstSearchResultCanvasIndex();\r\n var currentSearchResultRectIndex = this.getCurrentSearchResultRectIndex();\r\n // if zoom to search result is enabled and there is a highlighted search result.\r\n if (this.isZoomToSearchResultEnabled() && this.extension.currentAnnotationRect) {\r\n if (currentCanvasIndex < firstSearchResultCanvasIndex) {\r\n return false;\r\n }\r\n else if (currentCanvasIndex === firstSearchResultCanvasIndex) {\r\n if (currentSearchResultRectIndex === 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n return (currentCanvasIndex > firstSearchResultCanvasIndex);\r\n };\r\n FooterPanel.prototype.isNextButtonEnabled = function () {\r\n var currentCanvasIndex = this.extension.helper.canvasIndex;\r\n var lastSearchResultCanvasIndex = this.getLastSearchResultCanvasIndex();\r\n var currentSearchResultRectIndex = this.getCurrentSearchResultRectIndex();\r\n // if zoom to search result is enabled and there is a highlighted search result.\r\n if (this.isZoomToSearchResultEnabled() && this.extension.currentAnnotationRect) {\r\n if (currentCanvasIndex > lastSearchResultCanvasIndex) {\r\n return false;\r\n }\r\n else if (currentCanvasIndex === lastSearchResultCanvasIndex) {\r\n if (currentSearchResultRectIndex === this.getLastSearchResultRectIndex()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n return (currentCanvasIndex < lastSearchResultCanvasIndex);\r\n };\r\n FooterPanel.prototype.getSearchResults = function () {\r\n return this.extension.annotations;\r\n };\r\n FooterPanel.prototype.getCurrentSearchResultRectIndex = function () {\r\n return this.extension.getCurrentAnnotationRectIndex();\r\n };\r\n FooterPanel.prototype.getFirstSearchResultCanvasIndex = function () {\r\n var searchResults = this.getSearchResults();\r\n if (!searchResults)\r\n return -1;\r\n var firstSearchResultCanvasIndex = searchResults[0].canvasIndex;\r\n return firstSearchResultCanvasIndex;\r\n };\r\n FooterPanel.prototype.getLastSearchResultCanvasIndex = function () {\r\n var searchResults = this.getSearchResults();\r\n if (!searchResults)\r\n return -1;\r\n var lastSearchResultCanvasIndex = searchResults[searchResults.length - 1].canvasIndex;\r\n return lastSearchResultCanvasIndex;\r\n };\r\n FooterPanel.prototype.getLastSearchResultRectIndex = function () {\r\n return this.extension.getLastAnnotationRectIndex();\r\n };\r\n FooterPanel.prototype.updateNextButton = function () {\r\n var searchResults = this.getSearchResults();\r\n if (searchResults && searchResults.length) {\r\n if (this.isNextButtonEnabled()) {\r\n this.$nextResultButton.removeClass('disabled');\r\n }\r\n else {\r\n this.$nextResultButton.addClass('disabled');\r\n }\r\n }\r\n };\r\n FooterPanel.prototype.updatePrevButton = function () {\r\n var searchResults = this.getSearchResults();\r\n if (searchResults && searchResults.length) {\r\n if (this.isPreviousButtonEnabled()) {\r\n this.$previousResultButton.removeClass('disabled');\r\n }\r\n else {\r\n this.$previousResultButton.addClass('disabled');\r\n }\r\n }\r\n };\r\n FooterPanel.prototype.updatePrintButton = function () {\r\n var configEnabled = Utils.Bools.getBool(this.options.printEnabled, false);\r\n //var printService: Service = this.extension.helper.manifest.getService(manifesto.ServiceProfile.printExtensions());\r\n //if (configEnabled && printService && this.extension.isOnHomeDomain()){\r\n if (configEnabled) {\r\n this.$printButton.show();\r\n }\r\n else {\r\n this.$printButton.hide();\r\n }\r\n };\r\n FooterPanel.prototype.search = function (terms) {\r\n var _this = this;\r\n this.terms = terms;\r\n if (this.terms === '' || this.terms === this.content.enterKeyword) {\r\n this.extension.showMessage(this.extension.data.config.modules.genericDialogue.content.emptyValue, function () {\r\n _this.$searchText.focus();\r\n });\r\n return;\r\n }\r\n // blur search field\r\n this.$searchText.blur();\r\n this.showSearchSpinner();\r\n this.component.publish(Events_1.Events.SEARCH, this.terms);\r\n };\r\n FooterPanel.prototype.getSearchResultPlacemarkers = function () {\r\n return this.$searchResultsContainer.find('.searchResultPlacemarker');\r\n };\r\n FooterPanel.prototype.setCurrentSearchResultPlacemarker = function () {\r\n var placemarkers = this.getSearchResultPlacemarkers();\r\n placemarkers.parent().find('.current').removeClass('current');\r\n var $current = $('.searchResultPlacemarker[data-index=\"' + this.extension.helper.canvasIndex + '\"]');\r\n $current.addClass('current');\r\n };\r\n FooterPanel.prototype.positionSearchResultPlacemarkers = function () {\r\n var searchResults = this.getSearchResults();\r\n if (!searchResults || !searchResults.length)\r\n return;\r\n // clear all existing placemarkers\r\n var placemarkers = this.getSearchResultPlacemarkers();\r\n placemarkers.remove();\r\n var pageWidth = this.getPageLineRatio();\r\n var lineTop = this.$line.position().top;\r\n var lineLeft = this.$line.position().left;\r\n var that = this;\r\n // for each page with a result, place a marker along the line.\r\n for (var i = 0; i < searchResults.length; i++) {\r\n var result = searchResults[i];\r\n var distance = result.canvasIndex * pageWidth;\r\n var $placemarker = $('<div class=\"searchResultPlacemarker\" data-index=\"' + result.canvasIndex + '\"></div>');\r\n $placemarker[0].ontouchstart = function (e) { that.onPlacemarkerTouchStart.call(this, that); };\r\n $placemarker.click(function (e) { that.onPlacemarkerClick.call(this, that); });\r\n $placemarker.mouseenter(function (e) { that.onPlacemarkerMouseEnter.call(this, that); });\r\n $placemarker.mouseleave(function (e) { that.onPlacemarkerMouseLeave.call(this, e, that); });\r\n this.$searchResultsContainer.append($placemarker);\r\n var top_1 = lineTop - $placemarker.height();\r\n var left = lineLeft + distance - ($placemarker.width() / 2);\r\n $placemarker.css({\r\n top: top_1,\r\n left: left\r\n });\r\n }\r\n };\r\n FooterPanel.prototype.onPlacemarkerTouchStart = function (that) {\r\n that.placemarkerTouched = true;\r\n //const $placemarker: JQuery = $(this);\r\n //const index: number = parseInt($placemarker.attr('data-index'));\r\n //this.component.publish(Events.VIEW_PAGE, [index]);\r\n };\r\n FooterPanel.prototype.onPlacemarkerClick = function (that) {\r\n if (that.placemarkerTouched)\r\n return;\r\n that.placemarkerTouched = false;\r\n //const $placemarker: JQuery = $(this);\r\n //const index: number = parseInt($placemarker.attr('data-index'));\r\n //this.component.publish(Events.VIEW_PAGE, [index]);\r\n };\r\n FooterPanel.prototype.onPlacemarkerMouseEnter = function (that) {\r\n if (that.placemarkerTouched)\r\n return;\r\n var $placemarker = $(this);\r\n $placemarker.addClass('hover');\r\n var canvasIndex = parseInt($placemarker.attr('data-index'));\r\n that.component.publish(Events_1.Events.SEARCH_PREVIEW_START, canvasIndex);\r\n var $placemarkers = that.getSearchResultPlacemarkers();\r\n var elemIndex = $placemarkers.index($placemarker[0]);\r\n that.currentPlacemarkerIndex = canvasIndex;\r\n that.$placemarkerDetails.show();\r\n var title = \"{0} {1}\";\r\n if (that.isPageModeEnabled()) {\r\n var canvas = that.extension.helper.getCanvasByIndex(canvasIndex);\r\n var label = manifesto_js_1.LanguageMap.getValue(canvas.getLabel());\r\n if (!label && that.extension.helper.manifest) {\r\n label = that.extension.helper.manifest.options.defaultLabel;\r\n }\r\n title = Utils.Strings.format(title, that.content.pageCaps, label);\r\n }\r\n else {\r\n title = Utils.Strings.format(title, that.content.imageCaps, String(canvasIndex + 1));\r\n }\r\n that.$placemarkerDetailsTop.html(title);\r\n var searchResults = that.getSearchResults();\r\n if (searchResults) {\r\n var result = searchResults[elemIndex];\r\n var terms = \"\";\r\n if (that.terms) {\r\n terms = Utils.Strings.ellipsis(that.terms, that.options.elideDetailsTermsCount);\r\n }\r\n var instanceFoundText = that.content.instanceFound;\r\n var instancesFoundText = that.content.instancesFound;\r\n var text = '';\r\n if (result.rects.length === 1) {\r\n text = Utils.Strings.format(instanceFoundText, terms);\r\n that.$placemarkerDetailsBottom.html(text);\r\n }\r\n else {\r\n text = Utils.Strings.format(instancesFoundText, String(result.rects.length), terms);\r\n that.$placemarkerDetailsBottom.html(text);\r\n }\r\n }\r\n var pos = $placemarker.position();\r\n var top = pos.top - that.$placemarkerDetails.height();\r\n var left = pos.left;\r\n if (left < that.$placemarkerDetails.width() / 2) {\r\n left = 0 - ($placemarker.width() / 2);\r\n }\r\n else if (left > that.$line.width() - (that.$placemarkerDetails.width() / 2)) {\r\n left = that.$line.width() - that.$placemarkerDetails.width() + ($placemarker.width() / 2);\r\n }\r\n else {\r\n left -= (that.$placemarkerDetails.width() / 2);\r\n }\r\n that.$placemarkerDetails.css({\r\n top: top,\r\n left: left\r\n });\r\n };\r\n FooterPanel.prototype.onPlacemarkerMouseLeave = function (e, that) {\r\n that.component.publish(Events_1.Events.SEARCH_PREVIEW_FINISH);\r\n var $placemarker = $(this);\r\n var newElement = e.toElement || e.relatedTarget;\r\n var isChild = $(newElement).closest(that.$placemarkerDetails).length;\r\n if (newElement != that.$placemarkerDetails.get(0) && isChild === 0) {\r\n that.$placemarkerDetails.hide();\r\n $placemarker.removeClass('hover');\r\n }\r\n };\r\n FooterPanel.prototype.setPageMarkerPosition = function () {\r\n if (this.extension.helper.canvasIndex === null)\r\n return;\r\n // position placemarker showing current page.\r\n var pageLineRatio = this.getPageLineRatio();\r\n var lineTop = this.$line.position().top;\r\n var lineLeft = this.$line.position().left;\r\n var position = this.extension.helper.canvasIndex * pageLineRatio;\r\n var top = lineTop;\r\n var left = lineLeft + position;\r\n this.$pagePositionMarker.css({\r\n top: top,\r\n left: left\r\n });\r\n // if the remaining distance to the right is less than the width of the label\r\n // shift it to the left.\r\n var lineWidth = this.$line.width();\r\n if (left + this.$pagePositionLabel.outerWidth(true) > lineWidth) {\r\n left -= this.$pagePositionLabel.outerWidth(true);\r\n this.$pagePositionLabel.removeClass('right');\r\n this.$pagePositionLabel.addClass('left');\r\n }\r\n else {\r\n this.$pagePositionLabel.removeClass('left');\r\n this.$pagePositionLabel.addClass('right');\r\n }\r\n this.$pagePositionLabel.css({\r\n top: top,\r\n left: left\r\n });\r\n };\r\n FooterPanel.prototype.clearSearchResults = function () {\r\n if (!this.isSearchEnabled()) {\r\n return;\r\n }\r\n // clear all existing placemarkers\r\n var $placemarkers = this.getSearchResultPlacemarkers();\r\n $placemarkers.remove();\r\n // clear search input field.\r\n this.$searchText.val(this.content.enterKeyword);\r\n // hide pager.\r\n this.$searchContainer.show();\r\n this.$searchPagerContainer.hide();\r\n // set focus to search box.\r\n this.$searchText.focus();\r\n };\r\n FooterPanel.prototype.getPageLineRatio = function () {\r\n var lineWidth = this.$line.width();\r\n // find page/width ratio by dividing the line width by the number of pages in the book.\r\n if (this.extension.helper.getTotalCanvases() === 1)\r\n return 0;\r\n return lineWidth / (this.extension.helper.getTotalCanvases() - 1);\r\n };\r\n FooterPanel.prototype.canvasIndexChanged = function () {\r\n this.setPageMarkerPosition();\r\n this.setPlacemarkerLabel();\r\n };\r\n FooterPanel.prototype.settingsChanged = function () {\r\n this.setPlacemarkerLabel();\r\n };\r\n FooterPanel.prototype.setPlacemarkerLabel = function () {\r\n var displaying = this.content.displaying;\r\n var index = this.extension.helper.canvasIndex;\r\n if (this.isPageModeEnabled()) {\r\n var canvas = this.extension.helper.getCanvasByIndex(index);\r\n var label = manifesto_js_1.LanguageMap.getValue(canvas.getLabel());\r\n if (!label) {\r\n label = this.content.defaultLabel;\r\n }\r\n var lastCanvasOrderLabel = this.extension.helper.getLastCanvasLabel(true);\r\n if (lastCanvasOrderLabel) {\r\n this.$pagePositionLabel.html(Utils.Strings.format(displaying, this.content.page, Utils_1.UVUtils.sanitize(label), Utils_1.UVUtils.sanitize(lastCanvasOrderLabel)));\r\n }\r\n }\r\n else {\r\n this.$pagePositionLabel.html(Utils.Strings.format(displaying, this.content.image, String(index + 1), this.extension.helper.getTotalCanvases().toString()));\r\n }\r\n };\r\n FooterPanel.prototype.isPageModeEnabled = function () {\r\n return this.config.options.pageModeEnabled && this.extension.getMode().toString() === Mode_1.Mode.page.toString() && !Utils.Bools.getBool(this.config.options.forceImageMode, false);\r\n };\r\n FooterPanel.prototype.showSearchSpinner = function () {\r\n this.$searchText.addClass('searching');\r\n };\r\n FooterPanel.prototype.hideSearchSpinner = function () {\r\n this.$searchText.removeClass('searching');\r\n };\r\n FooterPanel.prototype.displaySearchResults = function (results, terms) {\r\n if (!this.isSearchEnabled()) {\r\n return;\r\n }\r\n this.hideSearchSpinner();\r\n this.positionSearchResultPlacemarkers();\r\n // show pager.\r\n this.$searchContainer.hide();\r\n this.$searchPagerControls.css({\r\n 'left': 0\r\n });\r\n var $info = this.$searchResultsInfo.find('.info');\r\n var $number = $info.find('.number');\r\n var $foundFor = $info.find('.foundFor');\r\n var $terms = $info.find('.terms');\r\n if (terms) {\r\n $info.show();\r\n $number.text(this.extension.getTotalAnnotationRects());\r\n if (results.length === 1) {\r\n $foundFor.html(this.content.resultFoundFor);\r\n }\r\n else {\r\n $foundFor.html(this.content.resultsFoundFor);\r\n }\r\n $terms.html(Utils.Strings.ellipsis(terms, this.options.elideResultsTermsCount));\r\n $terms.prop('title', terms);\r\n }\r\n else {\r\n $info.hide();\r\n }\r\n this.$searchPagerContainer.show();\r\n this.resize();\r\n };\r\n FooterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n var searchResults = this.getSearchResults();\r\n if (searchResults && searchResults.length) {\r\n this.positionSearchResultPlacemarkers();\r\n }\r\n this.setPageMarkerPosition();\r\n this.$searchPagerContainer.width(this.$element.width());\r\n var center = this.$element.width() / 2;\r\n // position search pager controls.\r\n this.$searchPagerControls.css({\r\n 'left': center - (this.$searchPagerControls.width() / 2)\r\n });\r\n // position search input.\r\n this.$searchOptions.css({\r\n 'left': center - (this.$searchOptions.outerWidth() / 2)\r\n });\r\n };\r\n return FooterPanel;\r\n }(FooterPanel_1.FooterPanel));\r\n exports.FooterPanel = FooterPanel;\r\n});\r\n//# sourceMappingURL=FooterPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-multiselectdialogue-module/MultiSelectDialogue',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/Dialogue\", \"../../extensions/uv-seadragon-extension/Mode\", \"@iiif/iiif-gallery-component\"], function (require, exports, BaseEvents_1, Dialogue_1, Mode_1, iiif_gallery_component_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var MultiSelectDialogue = /** @class */ (function (_super) {\r\n __extends(MultiSelectDialogue, _super);\r\n function MultiSelectDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n MultiSelectDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('multiSelectDialogue');\r\n _super.prototype.create.call(this);\r\n var that = this;\r\n this.openCommand = BaseEvents_1.BaseEvents.SHOW_MULTISELECT_DIALOGUE;\r\n this.closeCommand = BaseEvents_1.BaseEvents.HIDE_MULTISELECT_DIALOGUE;\r\n this.component.subscribe(this.openCommand, function () {\r\n _this.open();\r\n var multiSelectState = _this.extension.helper.getMultiSelectState();\r\n multiSelectState.setEnabled(true);\r\n _this.galleryComponent.set(_this.data);\r\n });\r\n this.component.subscribe(this.closeCommand, function () {\r\n _this.close();\r\n var multiSelectState = _this.extension.helper.getMultiSelectState();\r\n multiSelectState.setEnabled(false);\r\n });\r\n this.$title = $('<h1></h1>');\r\n this.$content.append(this.$title);\r\n this.$title.text(this.content.title);\r\n this.$gallery = $('<div class=\"iiif-gallery-component\"></div>');\r\n this.$content.append(this.$gallery);\r\n this.data = {\r\n helper: this.extension.helper,\r\n chunkedResizingThreshold: this.config.options.galleryThumbChunkedResizingThreshold,\r\n content: this.config.content,\r\n debug: false,\r\n imageFadeInDuration: 300,\r\n initialZoom: 4,\r\n minLabelWidth: 20,\r\n pageModeEnabled: this.isPageModeEnabled(),\r\n searchResults: [],\r\n scrollStopDuration: 100,\r\n sizingEnabled: true,\r\n thumbHeight: this.config.options.galleryThumbHeight,\r\n thumbLoadPadding: this.config.options.galleryThumbLoadPadding,\r\n thumbWidth: this.config.options.galleryThumbWidth,\r\n viewingDirection: this.extension.helper.getViewingDirection()\r\n };\r\n this.galleryComponent = new iiif_gallery_component_1.GalleryComponent({\r\n target: this.$gallery[0]\r\n });\r\n var $selectButton = this.$gallery.find('a.select');\r\n $selectButton.addClass('btn btn-primary');\r\n this.galleryComponent.on('multiSelectionMade', function (ids) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.MULTISELECTION_MADE, ids);\r\n that.close();\r\n }, false);\r\n this.$element.hide();\r\n };\r\n MultiSelectDialogue.prototype.isPageModeEnabled = function () {\r\n return Utils.Bools.getBool(this.config.options.pageModeEnabled, true) && this.extension.getMode().toString() === Mode_1.Mode.page.toString();\r\n };\r\n MultiSelectDialogue.prototype.open = function () {\r\n _super.prototype.open.call(this);\r\n };\r\n MultiSelectDialogue.prototype.close = function () {\r\n _super.prototype.close.call(this);\r\n };\r\n MultiSelectDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n var $main = this.$gallery.find('.main');\r\n var $header = this.$gallery.find('.header');\r\n $main.height(this.$content.height() - this.$title.outerHeight() - this.$title.verticalMargins() - $header.height());\r\n };\r\n return MultiSelectDialogue;\r\n }(Dialogue_1.Dialogue));\r\n exports.MultiSelectDialogue = MultiSelectDialogue;\r\n});\r\n//# sourceMappingURL=MultiSelectDialogue.js.map\n", "define('extensions/uv-seadragon-extension/MultiSelectionArgs',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var MultiSelectionArgs = /** @class */ (function () {\r\n function MultiSelectionArgs() {\r\n }\r\n return MultiSelectionArgs;\r\n }());\r\n exports.MultiSelectionArgs = MultiSelectionArgs;\r\n});\r\n//# sourceMappingURL=MultiSelectionArgs.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-pagingheaderpanel-module/PagingHeaderPanel',[\"require\", \"exports\", \"../uv-shared-module/AutoComplete\", \"../uv-shared-module/BaseEvents\", \"../../extensions/uv-seadragon-extension/Events\", \"../uv-shared-module/HeaderPanel\", \"../../extensions/uv-seadragon-extension/Mode\", \"../../Utils\", \"@iiif/vocabulary\", \"manifesto.js\"], function (require, exports, AutoComplete_1, BaseEvents_1, Events_1, HeaderPanel_1, Mode_1, Utils_1, vocabulary_1, manifesto_js_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var PagingHeaderPanel = /** @class */ (function (_super) {\r\n __extends(PagingHeaderPanel, _super);\r\n function PagingHeaderPanel($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this.firstButtonEnabled = false;\r\n _this.lastButtonEnabled = false;\r\n _this.nextButtonEnabled = false;\r\n _this.prevButtonEnabled = false;\r\n return _this;\r\n }\r\n PagingHeaderPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('pagingHeaderPanel');\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this.canvasIndexChanged(canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SETTINGS_CHANGED, function () {\r\n _this.modeChanged();\r\n _this.updatePagingToggle();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGE_FAILED, function () {\r\n _this.setSearchFieldValue(_this.extension.helper.canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_START, function () {\r\n _this.openGallery();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_START, function () {\r\n _this.closeGallery();\r\n });\r\n this.$prevOptions = $('<div class=\"prevOptions\"></div>');\r\n this.$centerOptions.append(this.$prevOptions);\r\n this.$firstButton = $(\"\\n <button class=\\\"btn imageBtn first\\\" tabindex=\\\"0\\\" title=\\\"\" + this.content.first + \"\\\">\\n <i class=\\\"uv-icon-first\\\" aria-hidden=\\\"true\\\"></i><span>\" + this.content.first + \"</span>\\n </button>\\n \");\r\n this.$prevOptions.append(this.$firstButton);\r\n this.$prevButton = $(\"\\n <button class=\\\"btn imageBtn prev\\\" tabindex=\\\"0\\\" title=\\\"\" + this.content.previous + \"\\\">\\n <i class=\\\"uv-icon-prev\\\" aria-hidden=\\\"true\\\"></i><span>\" + this.content.previous + \"</span>\\n </button>\\n \");\r\n this.$prevOptions.append(this.$prevButton);\r\n this.$modeOptions = $('<div class=\"mode\"></div>');\r\n this.$centerOptions.append(this.$modeOptions);\r\n this.$imageModeLabel = $('<label for=\"image\">' + this.content.image + '</label>');\r\n this.$modeOptions.append(this.$imageModeLabel);\r\n this.$imageModeOption = $('<input type=\"radio\" id=\"image\" name=\"mode\" tabindex=\"0\"/>');\r\n this.$modeOptions.append(this.$imageModeOption);\r\n this.$pageModeLabel = $('<label for=\"page\"></label>');\r\n this.$modeOptions.append(this.$pageModeLabel);\r\n this.$pageModeOption = $('<input type=\"radio\" id=\"page\" name=\"mode\" tabindex=\"0\"/>');\r\n this.$modeOptions.append(this.$pageModeOption);\r\n this.$search = $('<div class=\"search\"></div>');\r\n this.$centerOptions.append(this.$search);\r\n this.$searchText = $('<input class=\"searchText\" maxlength=\"50\" type=\"text\" tabindex=\"0\" aria-label=\"' + this.content.pageSearchLabel + '\"/>');\r\n this.$search.append(this.$searchText);\r\n if (Utils.Bools.getBool(this.options.autoCompleteBoxEnabled, true)) {\r\n this.$searchText.hide();\r\n this.$autoCompleteBox = $('<input class=\"autocompleteText\" type=\"text\" maxlength=\"100\" aria-label=\"' + this.content.pageSearchLabel + '\"/>');\r\n this.$search.append(this.$autoCompleteBox);\r\n new AutoComplete_1.AutoComplete(this.$autoCompleteBox, function (term, cb) {\r\n var results = [];\r\n var canvases = _this.extension.helper.getCanvases();\r\n // if in page mode, get canvases by label.\r\n if (_this.isPageModeEnabled()) {\r\n for (var i = 0; i < canvases.length; i++) {\r\n var canvas = canvases[i];\r\n var label = manifesto_js_1.LanguageMap.getValue(canvas.getLabel());\r\n if (label && label.startsWith(term)) {\r\n results.push(label);\r\n }\r\n }\r\n }\r\n else {\r\n // get canvas by index\r\n for (var i = 0; i < canvases.length; i++) {\r\n var canvas = canvases[i];\r\n if (canvas.index.toString().startsWith(term)) {\r\n results.push(canvas.index.toString());\r\n }\r\n }\r\n }\r\n cb(results);\r\n }, function (results) {\r\n return results;\r\n }, function (terms) {\r\n _this.search(terms);\r\n }, 300, 0, Utils.Bools.getBool(this.options.autocompleteAllowWords, false));\r\n }\r\n else if (Utils.Bools.getBool(this.options.imageSelectionBoxEnabled, true)) {\r\n this.$selectionBoxOptions = $('<div class=\"image-selectionbox-options\"></div>');\r\n this.$centerOptions.append(this.$selectionBoxOptions);\r\n this.$imageSelectionBox = $('<select class=\"image-selectionbox\" name=\"image-select\" tabindex=\"0\" ></select>');\r\n this.$selectionBoxOptions.append(this.$imageSelectionBox);\r\n for (var imageIndex = 0; imageIndex < this.extension.helper.getTotalCanvases(); imageIndex++) {\r\n var canvas = this.extension.helper.getCanvasByIndex(imageIndex);\r\n var label = Utils_1.UVUtils.sanitize(manifesto_js_1.LanguageMap.getValue(canvas.getLabel(), this.extension.helper.options.locale));\r\n this.$imageSelectionBox.append('<option value=' + (imageIndex) + '>' + label + '</option>');\r\n }\r\n this.$imageSelectionBox.change(function () {\r\n var imageIndex = parseInt(_this.$imageSelectionBox.val());\r\n _this.component.publish(Events_1.Events.IMAGE_SEARCH, imageIndex);\r\n });\r\n }\r\n this.$total = $('<span class=\"total\"></span>');\r\n this.$search.append(this.$total);\r\n this.$searchButton = $(\"<a class=\\\"go btn btn-primary\\\" title=\\\"\" + this.content.go + \"\\\" tabindex=\\\"0\\\">\" + this.content.go + \"</a>\");\r\n this.$search.append(this.$searchButton);\r\n this.$nextOptions = $('<div class=\"nextOptions\"></div>');\r\n this.$centerOptions.append(this.$nextOptions);\r\n this.$nextButton = $(\"\\n <button class=\\\"btn imageBtn next\\\" tabindex=\\\"0\\\" title=\\\"\" + this.content.next + \"\\\">\\n <i class=\\\"uv-icon-next\\\" aria-hidden=\\\"true\\\"></i><span>\" + this.content.next + \"</span>\\n </button>\\n \");\r\n this.$nextOptions.append(this.$nextButton);\r\n this.$lastButton = $(\"\\n <button class=\\\"btn imageBtn last\\\" tabindex=\\\"0\\\" title=\\\"\" + this.content.last + \"\\\">\\n <i class=\\\"uv-icon-last\\\" aria-hidden=\\\"true\\\"></i><span>\" + this.content.last + \"</span>\\n </button>\\n \");\r\n this.$nextOptions.append(this.$lastButton);\r\n if (this.isPageModeEnabled()) {\r\n this.$pageModeOption.attr('checked', 'checked');\r\n this.$pageModeOption.removeAttr('disabled');\r\n this.$pageModeLabel.removeClass('disabled');\r\n }\r\n else {\r\n this.$imageModeOption.attr('checked', 'checked');\r\n // disable page mode option.\r\n this.$pageModeOption.attr('disabled', 'disabled');\r\n this.$pageModeLabel.addClass('disabled');\r\n }\r\n if (this.extension.helper.getManifestType().toString() === manifesto_js_1.ManifestType.MANUSCRIPT.toString()) {\r\n this.$pageModeLabel.text(this.content.folio);\r\n }\r\n else {\r\n this.$pageModeLabel.text(this.content.page);\r\n }\r\n this.$galleryButton = $(\"\\n <button class=\\\"btn imageBtn gallery\\\" title=\\\"\" + this.content.gallery + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon-gallery\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.gallery + \"\\n </button>\\n \");\r\n this.$rightOptions.prepend(this.$galleryButton);\r\n this.$pagingToggleButtons = $('<div class=\"pagingToggleButtons\"></div>');\r\n this.$rightOptions.prepend(this.$pagingToggleButtons);\r\n this.$oneUpButton = $(\"\\n <button class=\\\"btn imageBtn one-up\\\" title=\\\"\" + this.content.oneUp + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon-one-up\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.oneUp + \"\\n </button>\");\r\n this.$pagingToggleButtons.append(this.$oneUpButton);\r\n this.$twoUpButton = $(\"\\n <button class=\\\"btn imageBtn two-up\\\" title=\\\"\" + this.content.twoUp + \"\\\" tabindex=\\\"0\\\">\\n <i class=\\\"uv-icon-two-up\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.twoUp + \"\\n </button>\\n \");\r\n this.$pagingToggleButtons.append(this.$twoUpButton);\r\n this.updatePagingToggle();\r\n this.updateGalleryButton();\r\n this.$oneUpButton.onPressed(function () {\r\n var enabled = false;\r\n _this.updateSettings({ pagingEnabled: enabled });\r\n _this.component.publish(Events_1.Events.PAGING_TOGGLED, enabled);\r\n });\r\n this.$twoUpButton.onPressed(function () {\r\n var enabled = true;\r\n _this.updateSettings({ pagingEnabled: enabled });\r\n _this.component.publish(Events_1.Events.PAGING_TOGGLED, enabled);\r\n });\r\n this.$galleryButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.TOGGLE_EXPAND_LEFT_PANEL);\r\n });\r\n this.setNavigationTitles();\r\n this.setTotal();\r\n var viewingDirection = this.extension.helper.getViewingDirection() || vocabulary_1.ViewingDirection.LEFT_TO_RIGHT;\r\n // check if the book has more than one page, otherwise hide prev/next options.\r\n if (this.extension.helper.getTotalCanvases() === 1) {\r\n this.$centerOptions.hide();\r\n }\r\n // ui event handlers.\r\n this.$firstButton.onPressed(function () {\r\n switch (viewingDirection.toString()) {\r\n case vocabulary_1.ViewingDirection.LEFT_TO_RIGHT.toString():\r\n case vocabulary_1.ViewingDirection.TOP_TO_BOTTOM.toString():\r\n case vocabulary_1.ViewingDirection.BOTTOM_TO_TOP.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.FIRST);\r\n break;\r\n case vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.LAST);\r\n break;\r\n }\r\n });\r\n this.$prevButton.onPressed(function () {\r\n switch (viewingDirection.toString()) {\r\n case vocabulary_1.ViewingDirection.LEFT_TO_RIGHT.toString():\r\n case vocabulary_1.ViewingDirection.BOTTOM_TO_TOP.toString():\r\n case vocabulary_1.ViewingDirection.TOP_TO_BOTTOM.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.PREV);\r\n break;\r\n case vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.NEXT);\r\n break;\r\n }\r\n });\r\n this.$nextButton.onPressed(function () {\r\n switch (viewingDirection.toString()) {\r\n case vocabulary_1.ViewingDirection.LEFT_TO_RIGHT.toString():\r\n case vocabulary_1.ViewingDirection.BOTTOM_TO_TOP.toString():\r\n case vocabulary_1.ViewingDirection.TOP_TO_BOTTOM.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.NEXT);\r\n break;\r\n case vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.PREV);\r\n break;\r\n }\r\n });\r\n this.$lastButton.onPressed(function () {\r\n switch (viewingDirection.toString()) {\r\n case vocabulary_1.ViewingDirection.LEFT_TO_RIGHT.toString():\r\n case vocabulary_1.ViewingDirection.TOP_TO_BOTTOM.toString():\r\n case vocabulary_1.ViewingDirection.BOTTOM_TO_TOP.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.LAST);\r\n break;\r\n case vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.FIRST);\r\n break;\r\n }\r\n });\r\n // If page mode is disabled, we don't need to show radio buttons since\r\n // there is only one option:\r\n if (!this.config.options.pageModeEnabled) {\r\n this.$imageModeOption.hide();\r\n this.$pageModeLabel.hide();\r\n this.$pageModeOption.hide();\r\n }\r\n else {\r\n // Only activate click actions for mode buttons when controls are\r\n // visible, since otherwise, clicking on the \"Image\" label can\r\n // trigger unexpected/undesired side effects.\r\n this.$imageModeOption.on('click', function (e) {\r\n _this.component.publish(Events_1.Events.MODE_CHANGED, Mode_1.Mode.image.toString());\r\n });\r\n this.$pageModeOption.on('click', function (e) {\r\n _this.component.publish(Events_1.Events.MODE_CHANGED, Mode_1.Mode.page.toString());\r\n });\r\n }\r\n this.$searchText.onEnter(function () {\r\n _this.$searchText.blur();\r\n _this.search(_this.$searchText.val());\r\n });\r\n this.$searchText.click(function () {\r\n $(this).select();\r\n });\r\n this.$searchButton.onPressed(function () {\r\n if (_this.options.autoCompleteBoxEnabled) {\r\n _this.search(_this.$autoCompleteBox.val());\r\n }\r\n else {\r\n _this.search(_this.$searchText.val());\r\n }\r\n });\r\n if (this.options.modeOptionsEnabled === false) {\r\n this.$modeOptions.hide();\r\n this.$centerOptions.addClass('modeOptionsDisabled');\r\n }\r\n // Search is shown as default\r\n if (this.options.imageSelectionBoxEnabled === true && this.options.autoCompleteBoxEnabled !== true) {\r\n this.$search.hide();\r\n }\r\n if (this.options.helpEnabled === false) {\r\n this.$helpButton.hide();\r\n }\r\n // todo: discuss on community call\r\n // Get visible element in centerOptions with greatest tabIndex\r\n // var $elementWithGreatestTabIndex: JQuery = this.$centerOptions.getVisibleElementWithGreatestTabIndex();\r\n // // cycle focus back to start.\r\n // if ($elementWithGreatestTabIndex) {\r\n // $elementWithGreatestTabIndex.blur(() => {\r\n // if (this.extension.tabbing && !this.extension.shifted) {\r\n // this.$nextButton.focus();\r\n // }\r\n // });\r\n // }\r\n // this.$nextButton.blur(() => {\r\n // if (this.extension.tabbing && this.extension.shifted) {\r\n // setTimeout(() => {\r\n // $elementWithGreatestTabIndex.focus();\r\n // }, 100);\r\n // }\r\n // });\r\n if (!Utils.Bools.getBool(this.options.pagingToggleEnabled, true)) {\r\n this.$pagingToggleButtons.hide();\r\n }\r\n };\r\n PagingHeaderPanel.prototype.openGallery = function () {\r\n this.$oneUpButton.removeClass('on');\r\n this.$twoUpButton.removeClass('on');\r\n this.$galleryButton.addClass('on');\r\n };\r\n PagingHeaderPanel.prototype.closeGallery = function () {\r\n this.updatePagingToggle();\r\n this.$galleryButton.removeClass('on');\r\n };\r\n PagingHeaderPanel.prototype.isPageModeEnabled = function () {\r\n return this.config.options.pageModeEnabled && this.extension.getMode().toString() === Mode_1.Mode.page.toString();\r\n };\r\n PagingHeaderPanel.prototype.setNavigationTitles = function () {\r\n if (this.isPageModeEnabled()) {\r\n if (this.extension.helper.isRightToLeft()) {\r\n this.$firstButton.prop('title', this.content.lastPage);\r\n this.$firstButton.find('span').text(this.content.lastPage);\r\n this.$prevButton.prop('title', this.content.nextPage);\r\n this.$prevButton.find('span').text(this.content.nextPage);\r\n this.$nextButton.prop('title', this.content.previousPage);\r\n this.$nextButton.find('span').text(this.content.previousPage);\r\n this.$lastButton.prop('title', this.content.firstPage);\r\n this.$lastButton.find('span').text(this.content.firstPage);\r\n }\r\n else {\r\n this.$firstButton.prop('title', this.content.firstPage);\r\n this.$firstButton.find('span').text(this.content.firstPage);\r\n this.$prevButton.prop('title', this.content.previousPage);\r\n this.$prevButton.find('span').text(this.content.previousPage);\r\n this.$nextButton.prop('title', this.content.nextPage);\r\n this.$nextButton.find('span').text(this.content.nextPage);\r\n this.$lastButton.prop('title', this.content.lastPage);\r\n this.$lastButton.find('span').text(this.content.lastPage);\r\n }\r\n }\r\n else {\r\n if (this.extension.helper.isRightToLeft()) {\r\n this.$firstButton.prop('title', this.content.lastImage);\r\n this.$firstButton.find('span').text(this.content.lastPage);\r\n this.$prevButton.prop('title', this.content.nextImage);\r\n this.$prevButton.find('span').text(this.content.nextImage);\r\n this.$nextButton.prop('title', this.content.previousImage);\r\n this.$nextButton.find('span').text(this.content.previousImage);\r\n this.$lastButton.prop('title', this.content.firstImage);\r\n this.$lastButton.find('span').text(this.content.firstImage);\r\n }\r\n else {\r\n this.$firstButton.prop('title', this.content.firstImage);\r\n this.$firstButton.find('span').text(this.content.firstImage);\r\n this.$prevButton.prop('title', this.content.previousImage);\r\n this.$prevButton.find('span').text(this.content.previousImage);\r\n this.$nextButton.prop('title', this.content.nextImage);\r\n this.$nextButton.find('span').text(this.content.nextImage);\r\n this.$lastButton.prop('title', this.content.lastImage);\r\n this.$lastButton.find('span').text(this.content.lastImage);\r\n }\r\n }\r\n };\r\n PagingHeaderPanel.prototype.updatePagingToggle = function () {\r\n if (!this.pagingToggleIsVisible()) {\r\n this.$pagingToggleButtons.hide();\r\n return;\r\n }\r\n if (this.extension.isPagingSettingEnabled()) {\r\n this.$oneUpButton.removeClass('on');\r\n this.$twoUpButton.addClass('on');\r\n }\r\n else {\r\n this.$twoUpButton.removeClass('on');\r\n this.$oneUpButton.addClass('on');\r\n }\r\n };\r\n PagingHeaderPanel.prototype.pagingToggleIsVisible = function () {\r\n return Utils.Bools.getBool(this.options.pagingToggleEnabled, true) && this.extension.helper.isPagingAvailable();\r\n };\r\n PagingHeaderPanel.prototype.updateGalleryButton = function () {\r\n if (!this.galleryIsVisible()) {\r\n this.$galleryButton.hide();\r\n }\r\n };\r\n PagingHeaderPanel.prototype.galleryIsVisible = function () {\r\n return Utils.Bools.getBool(this.options.galleryButtonEnabled, true) && this.extension.isLeftPanelEnabled();\r\n };\r\n PagingHeaderPanel.prototype.setTotal = function () {\r\n var of = this.content.of;\r\n if (this.isPageModeEnabled()) {\r\n this.$total.html(Utils.Strings.format(of, this.extension.helper.getLastCanvasLabel(true)));\r\n }\r\n else {\r\n this.$total.html(Utils.Strings.format(of, this.extension.helper.getTotalCanvases().toString()));\r\n }\r\n };\r\n PagingHeaderPanel.prototype.setSearchFieldValue = function (index) {\r\n var canvas = this.extension.helper.getCanvasByIndex(index);\r\n var value = null;\r\n if (this.isPageModeEnabled()) {\r\n var orderLabel = manifesto_js_1.LanguageMap.getValue(canvas.getLabel());\r\n if (orderLabel === \"-\") {\r\n value = \"\";\r\n }\r\n else {\r\n value = orderLabel;\r\n }\r\n }\r\n else {\r\n index += 1;\r\n value = index.toString();\r\n }\r\n if (this.options.autoCompleteBoxEnabled) {\r\n this.$autoCompleteBox.val(value);\r\n }\r\n else {\r\n this.$searchText.val(value);\r\n }\r\n };\r\n PagingHeaderPanel.prototype.search = function (value) {\r\n if (!value) {\r\n this.extension.showMessage(this.content.emptyValue);\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGE_FAILED);\r\n return;\r\n }\r\n if (this.isPageModeEnabled()) {\r\n this.component.publish(Events_1.Events.PAGE_SEARCH, value);\r\n }\r\n else {\r\n var index = void 0;\r\n if (this.options.autoCompleteBoxEnabled) {\r\n index = parseInt(this.$autoCompleteBox.val(), 10);\r\n }\r\n else {\r\n index = parseInt(this.$searchText.val(), 10);\r\n }\r\n index -= 1;\r\n if (isNaN(index)) {\r\n this.extension.showMessage(this.extension.data.config.modules.genericDialogue.content.invalidNumber);\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGE_FAILED);\r\n return;\r\n }\r\n var asset = this.extension.helper.getCanvasByIndex(index);\r\n if (!asset) {\r\n this.extension.showMessage(this.extension.data.config.modules.genericDialogue.content.pageNotFound);\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGE_FAILED);\r\n return;\r\n }\r\n this.component.publish(Events_1.Events.IMAGE_SEARCH, index);\r\n }\r\n };\r\n PagingHeaderPanel.prototype.canvasIndexChanged = function (index) {\r\n this.setSearchFieldValue(index);\r\n if (this.options.imageSelectionBoxEnabled === true && this.options.autoCompleteBoxEnabled !== true) {\r\n this.$imageSelectionBox.val(index);\r\n }\r\n var viewingDirection = this.extension.helper.getViewingDirection() || vocabulary_1.ViewingDirection.LEFT_TO_RIGHT;\r\n if (viewingDirection.toString() === vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString()) {\r\n if (this.extension.helper.isFirstCanvas()) {\r\n this.disableLastButton();\r\n this.disableNextButton();\r\n }\r\n else {\r\n this.enableLastButton();\r\n this.enableNextButton();\r\n }\r\n if (this.extension.helper.isLastCanvas()) {\r\n this.disableFirstButton();\r\n this.disablePrevButton();\r\n }\r\n else {\r\n this.enableFirstButton();\r\n this.enablePrevButton();\r\n }\r\n }\r\n else {\r\n if (this.extension.helper.isFirstCanvas()) {\r\n this.disableFirstButton();\r\n this.disablePrevButton();\r\n }\r\n else {\r\n this.enableFirstButton();\r\n this.enablePrevButton();\r\n }\r\n if (this.extension.helper.isLastCanvas()) {\r\n this.disableLastButton();\r\n this.disableNextButton();\r\n }\r\n else {\r\n this.enableLastButton();\r\n this.enableNextButton();\r\n }\r\n }\r\n };\r\n PagingHeaderPanel.prototype.disableFirstButton = function () {\r\n this.firstButtonEnabled = false;\r\n this.$firstButton.disable();\r\n };\r\n PagingHeaderPanel.prototype.enableFirstButton = function () {\r\n this.firstButtonEnabled = true;\r\n this.$firstButton.enable();\r\n };\r\n PagingHeaderPanel.prototype.disableLastButton = function () {\r\n this.lastButtonEnabled = false;\r\n this.$lastButton.disable();\r\n };\r\n PagingHeaderPanel.prototype.enableLastButton = function () {\r\n this.lastButtonEnabled = true;\r\n this.$lastButton.enable();\r\n };\r\n PagingHeaderPanel.prototype.disablePrevButton = function () {\r\n this.prevButtonEnabled = false;\r\n this.$prevButton.disable();\r\n };\r\n PagingHeaderPanel.prototype.enablePrevButton = function () {\r\n this.prevButtonEnabled = true;\r\n this.$prevButton.enable();\r\n };\r\n PagingHeaderPanel.prototype.disableNextButton = function () {\r\n this.nextButtonEnabled = false;\r\n this.$nextButton.disable();\r\n };\r\n PagingHeaderPanel.prototype.enableNextButton = function () {\r\n this.nextButtonEnabled = true;\r\n this.$nextButton.enable();\r\n };\r\n PagingHeaderPanel.prototype.modeChanged = function () {\r\n this.setSearchFieldValue(this.extension.helper.canvasIndex);\r\n this.setNavigationTitles();\r\n this.setTotal();\r\n };\r\n PagingHeaderPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n // hide toggle buttons below minimum width\r\n if (this.extension.width() < this.extension.data.config.options.minWidthBreakPoint) {\r\n if (this.pagingToggleIsVisible())\r\n this.$pagingToggleButtons.hide();\r\n if (this.galleryIsVisible())\r\n this.$galleryButton.hide();\r\n }\r\n else {\r\n if (this.pagingToggleIsVisible())\r\n this.$pagingToggleButtons.show();\r\n if (this.galleryIsVisible())\r\n this.$galleryButton.show();\r\n }\r\n };\r\n return PagingHeaderPanel;\r\n }(HeaderPanel_1.HeaderPanel));\r\n exports.PagingHeaderPanel = PagingHeaderPanel;\r\n});\r\n//# sourceMappingURL=PagingHeaderPanel.js.map\n", "define('extensions/uv-seadragon-extension/Bounds',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Bounds = /** @class */ (function () {\r\n function Bounds(x, y, w, h) {\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.h = h;\r\n }\r\n Bounds.prototype.toString = function () {\r\n return this.x + \",\" + this.y + \",\" + this.w + \",\" + this.h;\r\n };\r\n Bounds.fromString = function (bounds) {\r\n var boundsArr = bounds.split(',');\r\n return new Bounds(Number(boundsArr[0]), Number(boundsArr[1]), Number(boundsArr[2]), Number(boundsArr[3]));\r\n };\r\n return Bounds;\r\n }());\r\n exports.Bounds = Bounds;\r\n});\r\n//# sourceMappingURL=Bounds.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-seadragoncenterpanel-module/SeadragonCenterPanel',[\"require\", \"exports\", \"@iiif/vocabulary\", \"../uv-shared-module/BaseEvents\", \"../../extensions/uv-seadragon-extension/Bounds\", \"../uv-shared-module/CenterPanel\", \"../../extensions/uv-seadragon-extension/Events\", \"../../Utils\"], function (require, exports, vocabulary_1, BaseEvents_1, Bounds_1, CenterPanel_1, Events_1, Utils_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SeadragonCenterPanel = /** @class */ (function (_super) {\r\n __extends(SeadragonCenterPanel, _super);\r\n function SeadragonCenterPanel($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this.controlsVisible = false;\r\n _this.isCreated = false;\r\n _this.isFirstLoad = true;\r\n _this.navigatedFromSearch = false;\r\n _this.nextButtonEnabled = false;\r\n _this.prevButtonEnabled = false;\r\n return _this;\r\n }\r\n SeadragonCenterPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('seadragonCenterPanel');\r\n _super.prototype.create.call(this);\r\n this.viewerId = \"osd\" + new Date().getTime();\r\n this.$viewer = $('<div id=\"' + this.viewerId + '\" class=\"viewer\"></div>');\r\n this.$content.prepend(this.$viewer);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATIONS, function (args) {\r\n _this.overlayAnnotations();\r\n _this.zoomToInitialAnnotation();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SETTINGS_CHANGED, function (args) {\r\n _this.viewer.gestureSettingsMouse.clickToZoom = args.clickToZoomEnabled;\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE, function (resources) {\r\n _this.whenResized(function () {\r\n if (!_this.isCreated)\r\n _this.createUI();\r\n _this.openMedia(resources);\r\n });\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CLEAR_ANNOTATIONS, function () {\r\n _this.whenCreated(function () {\r\n _this.extension.currentAnnotationRect = null;\r\n _this.clearAnnotations();\r\n });\r\n });\r\n this.component.subscribe(Events_1.Events.NEXT_SEARCH_RESULT, function () {\r\n _this.whenCreated(function () {\r\n _this.nextAnnotation();\r\n });\r\n });\r\n this.component.subscribe(Events_1.Events.PREV_SEARCH_RESULT, function () {\r\n _this.whenCreated(function () {\r\n _this.prevAnnotation();\r\n });\r\n });\r\n this.component.subscribe(Events_1.Events.ZOOM_IN, function () {\r\n _this.whenCreated(function () {\r\n _this.zoomIn();\r\n });\r\n });\r\n this.component.subscribe(Events_1.Events.ZOOM_OUT, function () {\r\n _this.whenCreated(function () {\r\n _this.zoomOut();\r\n });\r\n });\r\n this.component.subscribe(Events_1.Events.ROTATE, function () {\r\n _this.whenCreated(function () {\r\n _this.rotateRight();\r\n });\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.METRIC_CHANGED, function () {\r\n _this.whenCreated(function () {\r\n _this.updateResponsiveView();\r\n });\r\n });\r\n };\r\n SeadragonCenterPanel.prototype.whenCreated = function (cb) {\r\n var _this = this;\r\n Utils.Async.waitFor(function () {\r\n return _this.isCreated;\r\n }, cb);\r\n };\r\n SeadragonCenterPanel.prototype.zoomIn = function () {\r\n this.viewer.viewport.zoomTo(this.viewer.viewport.getZoom(true) * 2);\r\n };\r\n SeadragonCenterPanel.prototype.zoomOut = function () {\r\n this.viewer.viewport.zoomTo(this.viewer.viewport.getZoom(true) * 0.5);\r\n };\r\n SeadragonCenterPanel.prototype.rotateRight = function () {\r\n this.viewer.viewport.setRotation(this.viewer.viewport.getRotation() + 90);\r\n };\r\n SeadragonCenterPanel.prototype.updateResponsiveView = function () {\r\n this.setNavigatorVisible();\r\n if (!this.extension.isDesktopMetric()) {\r\n this.viewer.autoHideControls = false;\r\n this.$viewportNavButtons.hide();\r\n }\r\n else {\r\n this.viewer.autoHideControls = true;\r\n this.$viewportNavButtons.show();\r\n }\r\n };\r\n SeadragonCenterPanel.prototype.createUI = function () {\r\n var _this = this;\r\n this.$spinner = $('<div class=\"spinner\"></div>');\r\n this.$content.append(this.$spinner);\r\n // add to window object for testing automation purposes.\r\n //window.openSeadragonViewer\r\n // removed as causing issues for multiple UVs on page\r\n this.viewer = OpenSeadragon({\r\n id: this.viewerId,\r\n ajaxWithCredentials: false,\r\n showNavigationControl: true,\r\n showNavigator: true,\r\n showRotationControl: true,\r\n showHomeControl: Utils.Bools.getBool(this.config.options.showHomeControl, false),\r\n showFullPageControl: false,\r\n defaultZoomLevel: this.config.options.defaultZoomLevel || 0,\r\n maxZoomPixelRatio: this.config.options.maxZoomPixelRatio || 2,\r\n controlsFadeDelay: this.config.options.controlsFadeDelay || 250,\r\n controlsFadeLength: this.config.options.controlsFadeLength || 250,\r\n navigatorPosition: this.config.options.navigatorPosition || \"BOTTOM_RIGHT\",\r\n animationTime: this.config.options.animationTime || 1.2,\r\n visibilityRatio: this.config.options.visibilityRatio || 0.5,\r\n constrainDuringPan: Utils.Bools.getBool(this.config.options.constrainDuringPan, false),\r\n immediateRender: Utils.Bools.getBool(this.config.options.immediateRender, false),\r\n blendTime: this.config.options.blendTime || 0,\r\n autoHideControls: Utils.Bools.getBool(this.config.options.autoHideControls, true),\r\n prefixUrl: this.extension.data.root + '/img/',\r\n gestureSettingsMouse: {\r\n clickToZoom: Utils.Bools.getBool(this.extension.data.config.options.clickToZoomEnabled, true)\r\n },\r\n navImages: {\r\n zoomIn: {\r\n REST: 'pixel.gif',\r\n GROUP: 'pixel.gif',\r\n HOVER: 'pixel.gif',\r\n DOWN: 'pixel.gif'\r\n },\r\n zoomOut: {\r\n REST: 'pixel.gif',\r\n GROUP: 'pixel.gif',\r\n HOVER: 'pixel.gif',\r\n DOWN: 'pixel.gif'\r\n },\r\n home: {\r\n REST: 'pixel.gif',\r\n GROUP: 'pixel.gif',\r\n HOVER: 'pixel.gif',\r\n DOWN: 'pixel.gif'\r\n },\r\n rotateright: {\r\n REST: 'pixel.gif',\r\n GROUP: 'pixel.gif',\r\n HOVER: 'pixel.gif',\r\n DOWN: 'pixel.gif'\r\n },\r\n rotateleft: {\r\n REST: 'pixel.gif',\r\n GROUP: 'pixel.gif',\r\n HOVER: 'pixel.gif',\r\n DOWN: 'pixel.gif'\r\n },\r\n next: {\r\n REST: 'pixel.gif',\r\n GROUP: 'pixel.gif',\r\n HOVER: 'pixel.gif',\r\n DOWN: 'pixel.gif'\r\n },\r\n previous: {\r\n REST: 'pixel.gif',\r\n GROUP: 'pixel.gif',\r\n HOVER: 'pixel.gif',\r\n DOWN: 'pixel.gif'\r\n }\r\n }\r\n });\r\n this.$zoomInButton = this.$viewer.find('div[title=\"Zoom in\"]');\r\n this.$zoomInButton.attr('tabindex', 0);\r\n this.$zoomInButton.prop('title', this.content.zoomIn);\r\n this.$zoomInButton.addClass('zoomIn viewportNavButton');\r\n this.$zoomOutButton = this.$viewer.find('div[title=\"Zoom out\"]');\r\n this.$zoomOutButton.attr('tabindex', 0);\r\n this.$zoomOutButton.prop('title', this.content.zoomOut);\r\n this.$zoomOutButton.addClass('zoomOut viewportNavButton');\r\n this.$goHomeButton = this.$viewer.find('div[title=\"Go home\"]');\r\n this.$goHomeButton.attr('tabindex', 0);\r\n this.$goHomeButton.prop('title', this.content.goHome);\r\n this.$goHomeButton.addClass('goHome viewportNavButton');\r\n this.$rotateButton = this.$viewer.find('div[title=\"Rotate right\"]');\r\n this.$rotateButton.attr('tabindex', 0);\r\n this.$rotateButton.prop('title', this.content.rotateRight);\r\n this.$rotateButton.addClass('rotate viewportNavButton');\r\n this.$viewportNavButtonsContainer = this.$viewer.find('.openseadragon-container > div:not(.openseadragon-canvas):first');\r\n this.$viewportNavButtons = this.$viewportNavButtonsContainer.find('.viewportNavButton');\r\n this.$canvas = $(this.viewer.canvas);\r\n // disable right click on canvas\r\n this.$canvas.on('contextmenu', function () { return false; });\r\n this.$navigator = this.$viewer.find(\".navigator\");\r\n this.setNavigatorVisible();\r\n // events\r\n this.$element.on('mousemove', function () {\r\n if (_this.controlsVisible)\r\n return;\r\n _this.controlsVisible = true;\r\n _this.viewer.setControlsEnabled(true);\r\n });\r\n this.$element.on('mouseleave', function () {\r\n if (!_this.controlsVisible)\r\n return;\r\n _this.controlsVisible = false;\r\n _this.viewer.setControlsEnabled(false);\r\n });\r\n // when mouse move stopped\r\n this.$element.on('mousemove', function () {\r\n // if over element, hide controls.\r\n // When over prev/next buttons keep controls enabled\r\n if (_this.$prevButton.ismouseover()) {\r\n return;\r\n }\r\n if (_this.$nextButton.ismouseover()) {\r\n return;\r\n }\r\n if (!_this.$viewer.find('.navigator').ismouseover()) {\r\n if (!_this.controlsVisible)\r\n return;\r\n _this.controlsVisible = false;\r\n _this.viewer.setControlsEnabled(false);\r\n }\r\n }, this.config.options.controlsFadeAfterInactive);\r\n this.viewer.addHandler('tile-drawn', function () {\r\n _this.$spinner.hide();\r\n });\r\n //this.viewer.addHandler(\"open-failed\", () => {\r\n //});\r\n this.viewer.addHandler('resize', function (viewer) {\r\n _this.component.publish(Events_1.Events.SEADRAGON_RESIZE, viewer);\r\n _this.viewerResize(viewer);\r\n });\r\n this.viewer.addHandler('animation-start', function (viewer) {\r\n _this.component.publish(Events_1.Events.SEADRAGON_ANIMATION_START, viewer);\r\n });\r\n this.viewer.addHandler('animation', function (viewer) {\r\n _this.component.publish(Events_1.Events.SEADRAGON_ANIMATION, viewer);\r\n });\r\n this.viewer.addHandler('animation-finish', function (viewer) {\r\n _this.currentBounds = _this.getViewportBounds();\r\n _this.updateVisibleAnnotationRects();\r\n _this.component.publish(Events_1.Events.SEADRAGON_ANIMATION_FINISH, viewer);\r\n });\r\n this.viewer.addHandler('rotate', function (args) {\r\n _this.component.publish(Events_1.Events.SEADRAGON_ROTATION, args.degrees);\r\n });\r\n this.title = this.extension.helper.getLabel();\r\n this.createNavigationButtons();\r\n this.hidePrevButton();\r\n this.hideNextButton();\r\n this.isCreated = true;\r\n this.resize();\r\n };\r\n SeadragonCenterPanel.prototype.createNavigationButtons = function () {\r\n var _this = this;\r\n var viewingDirection = this.extension.helper.getViewingDirection() || vocabulary_1.ViewingDirection.LEFT_TO_RIGHT;\r\n this.$prevButton = $('<div class=\"paging btn prev\" tabindex=\"0\"></div>');\r\n if (this.extension.helper.isRightToLeft()) {\r\n this.$prevButton.prop('title', this.content.next);\r\n }\r\n else {\r\n this.$prevButton.prop('title', this.content.previous);\r\n }\r\n this.$nextButton = $('<div class=\"paging btn next\" tabindex=\"0\"></div>');\r\n if (this.extension.helper.isRightToLeft()) {\r\n this.$nextButton.prop('title', this.content.previous);\r\n }\r\n else {\r\n this.$nextButton.prop('title', this.content.next);\r\n }\r\n this.viewer.addControl(this.$prevButton[0], { anchor: OpenSeadragon.ControlAnchor.TOP_LEFT });\r\n this.viewer.addControl(this.$nextButton[0], { anchor: OpenSeadragon.ControlAnchor.TOP_RIGHT });\r\n switch (viewingDirection.toString()) {\r\n case vocabulary_1.ViewingDirection.BOTTOM_TO_TOP.toString():\r\n case vocabulary_1.ViewingDirection.TOP_TO_BOTTOM.toString():\r\n this.$prevButton.addClass('vertical');\r\n this.$nextButton.addClass('vertical');\r\n ;\r\n break;\r\n }\r\n var that = this;\r\n this.$prevButton.onPressed(function (e) {\r\n e.preventDefault();\r\n OpenSeadragon.cancelEvent(e);\r\n if (!that.prevButtonEnabled)\r\n return;\r\n switch (viewingDirection.toString()) {\r\n case vocabulary_1.ViewingDirection.LEFT_TO_RIGHT.toString():\r\n case vocabulary_1.ViewingDirection.BOTTOM_TO_TOP.toString():\r\n case vocabulary_1.ViewingDirection.TOP_TO_BOTTOM.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.PREV);\r\n break;\r\n case vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.NEXT);\r\n break;\r\n }\r\n });\r\n this.$nextButton.onPressed(function (e) {\r\n e.preventDefault();\r\n OpenSeadragon.cancelEvent(e);\r\n if (!that.nextButtonEnabled)\r\n return;\r\n switch (viewingDirection.toString()) {\r\n case vocabulary_1.ViewingDirection.LEFT_TO_RIGHT.toString():\r\n case vocabulary_1.ViewingDirection.BOTTOM_TO_TOP.toString():\r\n case vocabulary_1.ViewingDirection.TOP_TO_BOTTOM.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.NEXT);\r\n break;\r\n case vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString():\r\n _this.component.publish(BaseEvents_1.BaseEvents.PREV);\r\n break;\r\n }\r\n });\r\n // When Prev/Next buttons are focused, make sure the controls are enabled\r\n this.$prevButton.on('focus', function () {\r\n if (_this.controlsVisible)\r\n return;\r\n _this.controlsVisible = true;\r\n _this.viewer.setControlsEnabled(true);\r\n });\r\n this.$nextButton.on('focus', function () {\r\n if (_this.controlsVisible)\r\n return;\r\n _this.controlsVisible = true;\r\n _this.viewer.setControlsEnabled(true);\r\n });\r\n };\r\n SeadragonCenterPanel.prototype.openMedia = function (resources) {\r\n var _this = this;\r\n this.$spinner.show();\r\n this.items = [];\r\n this.extension.getExternalResources(resources).then(function (resources) {\r\n _this.viewer.close();\r\n resources = _this.getPagePositions(resources);\r\n for (var i = 0; i < resources.length; i++) {\r\n var data = resources[i];\r\n var tileSource = void 0;\r\n if (data.hasServiceDescriptor) {\r\n tileSource = data;\r\n }\r\n else {\r\n tileSource = {\r\n type: 'image',\r\n url: data.id,\r\n buildPyramid: false\r\n };\r\n }\r\n _this.viewer.addTiledImage({\r\n tileSource: tileSource,\r\n x: data.x,\r\n y: data.y,\r\n width: data.width,\r\n success: function (item) {\r\n _this.items.push(item);\r\n if (_this.items.length === resources.length) {\r\n _this.openPagesHandler();\r\n }\r\n _this.resize();\r\n }\r\n });\r\n }\r\n });\r\n };\r\n SeadragonCenterPanel.prototype.getPagePositions = function (resources) {\r\n var leftPage;\r\n var rightPage;\r\n var topPage;\r\n var bottomPage;\r\n var page;\r\n var nextPage;\r\n // if there's more than one image, determine alignment strategy\r\n if (resources.length > 1) {\r\n if (resources.length === 2) {\r\n // recto verso\r\n if (this.extension.helper.isVerticallyAligned()) {\r\n // vertical alignment\r\n topPage = resources[0];\r\n topPage.y = 0;\r\n bottomPage = resources[1];\r\n bottomPage.y = topPage.height + this.config.options.pageGap;\r\n }\r\n else {\r\n // horizontal alignment\r\n leftPage = resources[0];\r\n leftPage.x = 0;\r\n rightPage = resources[1];\r\n rightPage.x = leftPage.width + this.config.options.pageGap;\r\n }\r\n }\r\n else {\r\n // scroll\r\n if (this.extension.helper.isVerticallyAligned()) {\r\n // vertical alignment\r\n if (this.extension.helper.isTopToBottom()) {\r\n // top to bottom\r\n for (var i = 0; i < resources.length - 1; i++) {\r\n page = resources[i];\r\n nextPage = resources[i + 1];\r\n nextPage.y = (page.y || 0) + page.height;\r\n ;\r\n }\r\n }\r\n else {\r\n // bottom to top\r\n for (var i = resources.length; i > 0; i--) {\r\n page = resources[i];\r\n nextPage = resources[i - 1];\r\n nextPage.y = (page.y || 0) - page.height;\r\n }\r\n }\r\n }\r\n else {\r\n // horizontal alignment\r\n if (this.extension.helper.isLeftToRight()) {\r\n // left to right\r\n for (var i = 0; i < resources.length - 1; i++) {\r\n page = resources[i];\r\n nextPage = resources[i + 1];\r\n nextPage.x = (page.x || 0) + page.width;\r\n }\r\n }\r\n else {\r\n // right to left\r\n for (var i = resources.length - 1; i > 0; i--) {\r\n page = resources[i];\r\n nextPage = resources[i - 1];\r\n nextPage.x = (page.x || 0) - page.width;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return resources;\r\n };\r\n SeadragonCenterPanel.prototype.openPagesHandler = function () {\r\n this.component.publish(Events_1.Events.SEADRAGON_OPEN);\r\n if (this.extension.helper.isMultiCanvas() && !this.extension.helper.isContinuous()) {\r\n this.showPrevButton();\r\n this.showNextButton();\r\n $('.navigator').addClass('extraMargin');\r\n var viewingDirection = this.extension.helper.getViewingDirection() || vocabulary_1.ViewingDirection.LEFT_TO_RIGHT;\r\n if (viewingDirection.toString() === vocabulary_1.ViewingDirection.RIGHT_TO_LEFT.toString()) {\r\n if (this.extension.helper.isFirstCanvas()) {\r\n this.disableNextButton();\r\n }\r\n else {\r\n this.enableNextButton();\r\n }\r\n if (this.extension.helper.isLastCanvas()) {\r\n this.disablePrevButton();\r\n }\r\n else {\r\n this.enablePrevButton();\r\n }\r\n }\r\n else {\r\n if (this.extension.helper.isFirstCanvas()) {\r\n this.disablePrevButton();\r\n }\r\n else {\r\n this.enablePrevButton();\r\n }\r\n if (this.extension.helper.isLastCanvas()) {\r\n this.disableNextButton();\r\n }\r\n else {\r\n this.enableNextButton();\r\n }\r\n }\r\n }\r\n this.setNavigatorVisible();\r\n this.overlayAnnotations();\r\n this.updateBounds();\r\n // this only happens if prev/next search result were clicked and caused a reload\r\n if (this.navigatedFromSearch) {\r\n this.navigatedFromSearch = false;\r\n this.zoomToInitialAnnotation();\r\n }\r\n this.isFirstLoad = false;\r\n };\r\n SeadragonCenterPanel.prototype.zoomToInitialAnnotation = function () {\r\n var annotationRect = this.getInitialAnnotationRect();\r\n this.extension.previousAnnotationRect = null;\r\n this.extension.currentAnnotationRect = null;\r\n if (annotationRect && this.isZoomToSearchResultEnabled()) {\r\n this.zoomToAnnotation(annotationRect);\r\n }\r\n };\r\n SeadragonCenterPanel.prototype.overlayAnnotations = function () {\r\n var annotations = this.getAnnotationsForCurrentImages();\r\n for (var i = 0; i < annotations.length; i++) {\r\n var annotation = annotations[i];\r\n var overlayRects = this.getAnnotationOverlayRects(annotation);\r\n for (var k = 0; k < overlayRects.length; k++) {\r\n var overlayRect = overlayRects[k];\r\n var div = document.createElement('div');\r\n div.id = 'searchResult-' + overlayRect.canvasIndex + '-' + overlayRect.resultIndex;\r\n div.className = 'searchOverlay';\r\n div.title = Utils_1.UVUtils.sanitize(overlayRect.chars);\r\n this.viewer.addOverlay(div, overlayRect);\r\n }\r\n }\r\n };\r\n SeadragonCenterPanel.prototype.updateBounds = function () {\r\n var settings = this.extension.getSettings();\r\n // if this is the first load and there are initial bounds, fit to those.\r\n if (this.isFirstLoad) {\r\n this.initialRotation = this.extension.data.rotation;\r\n if (this.initialRotation) {\r\n this.viewer.viewport.setRotation(parseInt(this.initialRotation));\r\n }\r\n this.initialBounds = this.extension.data.xywh;\r\n if (this.initialBounds) {\r\n this.initialBounds = Bounds_1.Bounds.fromString(this.initialBounds);\r\n this.currentBounds = this.initialBounds;\r\n this.fitToBounds(this.currentBounds);\r\n }\r\n }\r\n else if (settings.preserveViewport) {\r\n this.fitToBounds(this.currentBounds);\r\n }\r\n else {\r\n this.goHome();\r\n }\r\n };\r\n SeadragonCenterPanel.prototype.goHome = function () {\r\n this.viewer.viewport.goHome(true);\r\n };\r\n SeadragonCenterPanel.prototype.disablePrevButton = function () {\r\n this.prevButtonEnabled = false;\r\n this.$prevButton.addClass('disabled');\r\n };\r\n SeadragonCenterPanel.prototype.enablePrevButton = function () {\r\n this.prevButtonEnabled = true;\r\n this.$prevButton.removeClass('disabled');\r\n };\r\n SeadragonCenterPanel.prototype.hidePrevButton = function () {\r\n this.disablePrevButton();\r\n this.$prevButton.hide();\r\n };\r\n SeadragonCenterPanel.prototype.showPrevButton = function () {\r\n this.enablePrevButton();\r\n this.$prevButton.show();\r\n };\r\n SeadragonCenterPanel.prototype.disableNextButton = function () {\r\n this.nextButtonEnabled = false;\r\n this.$nextButton.addClass('disabled');\r\n };\r\n SeadragonCenterPanel.prototype.enableNextButton = function () {\r\n this.nextButtonEnabled = true;\r\n this.$nextButton.removeClass('disabled');\r\n };\r\n SeadragonCenterPanel.prototype.hideNextButton = function () {\r\n this.disableNextButton();\r\n this.$nextButton.hide();\r\n };\r\n SeadragonCenterPanel.prototype.showNextButton = function () {\r\n this.enableNextButton();\r\n this.$nextButton.show();\r\n };\r\n SeadragonCenterPanel.prototype.fitToBounds = function (bounds, immediate) {\r\n if (immediate === void 0) { immediate = true; }\r\n var rect = new OpenSeadragon.Rect();\r\n rect.x = Number(bounds.x);\r\n rect.y = Number(bounds.y);\r\n rect.width = Number(bounds.w);\r\n rect.height = Number(bounds.h);\r\n this.viewer.viewport.fitBoundsWithConstraints(rect, immediate);\r\n };\r\n SeadragonCenterPanel.prototype.getCroppedImageBounds = function () {\r\n if (!this.viewer || !this.viewer.viewport)\r\n return null;\r\n var canvas = this.extension.helper.getCurrentCanvas();\r\n var dimensions = this.extension.getCroppedImageDimensions(canvas, this.viewer);\r\n if (dimensions) {\r\n var bounds = new Bounds_1.Bounds(dimensions.regionPos.x, dimensions.regionPos.y, dimensions.region.width, dimensions.region.height);\r\n return bounds.toString();\r\n }\r\n return null;\r\n };\r\n SeadragonCenterPanel.prototype.getViewportBounds = function () {\r\n if (!this.viewer || !this.viewer.viewport)\r\n return null;\r\n var b = this.viewer.viewport.getBounds(true);\r\n return new Bounds_1.Bounds(Math.floor(b.x), Math.floor(b.y), Math.floor(b.width), Math.floor(b.height));\r\n };\r\n SeadragonCenterPanel.prototype.viewerResize = function (viewer) {\r\n if (!viewer.viewport)\r\n return;\r\n var center = viewer.viewport.getCenter(true);\r\n if (!center)\r\n return;\r\n // postpone pan for a millisecond - fixes iPad image stretching/squashing issue.\r\n setTimeout(function () {\r\n viewer.viewport.panTo(center, true);\r\n }, 1);\r\n };\r\n SeadragonCenterPanel.prototype.clearAnnotations = function () {\r\n this.$canvas.find('.searchOverlay').hide();\r\n };\r\n SeadragonCenterPanel.prototype.getAnnotationsForCurrentImages = function () {\r\n var annotationsForCurrentImages = [];\r\n var annotations = this.extension.annotations;\r\n if (!annotations || !annotations.length)\r\n return annotationsForCurrentImages;\r\n var indices = this.extension.getPagedIndices();\r\n for (var i = 0; i < indices.length; i++) {\r\n var canvasIndex = indices[i];\r\n for (var j = 0; j < annotations.length; j++) {\r\n if (annotations[j].canvasIndex === canvasIndex) {\r\n annotationsForCurrentImages.push(annotations[j]);\r\n break;\r\n }\r\n }\r\n }\r\n return annotationsForCurrentImages;\r\n };\r\n SeadragonCenterPanel.prototype.getAnnotationRectsForCurrentImages = function () {\r\n var annotations = this.getAnnotationsForCurrentImages();\r\n return annotations.en().selectMany(function (x) { return x.rects; }).toArray();\r\n };\r\n SeadragonCenterPanel.prototype.updateVisibleAnnotationRects = function () {\r\n // after animating, loop through all search result rects and flag their visibility based on whether they are inside the current viewport.\r\n var annotationRects = this.getAnnotationRectsForCurrentImages();\r\n for (var i = 0; i < annotationRects.length; i++) {\r\n var rect = annotationRects[i];\r\n var viewportBounds = this.viewer.viewport.getBounds();\r\n rect.isVisible = Utils.Dimensions.hitRect(viewportBounds.x, viewportBounds.y, viewportBounds.width, viewportBounds.height, rect.viewportX, rect.viewportY);\r\n }\r\n };\r\n SeadragonCenterPanel.prototype.getAnnotationRectIndex = function (annotationRect) {\r\n var annotationRects = this.getAnnotationRectsForCurrentImages();\r\n return annotationRects.indexOf(annotationRect);\r\n };\r\n SeadragonCenterPanel.prototype.isZoomToSearchResultEnabled = function () {\r\n return Utils.Bools.getBool(this.extension.data.config.options.zoomToSearchResultEnabled, true);\r\n };\r\n SeadragonCenterPanel.prototype.prevAnnotation = function () {\r\n var annotationRects = this.getAnnotationRectsForCurrentImages();\r\n var currentAnnotationRect = this.extension.currentAnnotationRect;\r\n var currentAnnotationRectIndex = currentAnnotationRect ? this.getAnnotationRectIndex(currentAnnotationRect) : annotationRects.length;\r\n //const currentAnnotationRectIndex: number = this.getAnnotationRectIndex(<AnnotationRect>currentAnnotationRect);\r\n var foundRect = null;\r\n // if there's no currentAnnotationRect selected, index is the total available annotation rects for the current images.\r\n // minusing 1 makes the index the last of the available rects for the current images.\r\n for (var i = currentAnnotationRectIndex - 1; i >= 0; i--) {\r\n var rect = annotationRects[i];\r\n // this was removed as users found it confusing.\r\n // find the prev visible or non-visible rect.\r\n //if (rect.isVisible) {\r\n // continue;\r\n //} else {\r\n foundRect = rect;\r\n break;\r\n //}\r\n }\r\n if (foundRect && this.isZoomToSearchResultEnabled()) {\r\n // if the rect's canvasIndex is less than the current canvasIndex\r\n if (foundRect.canvasIndex < this.extension.helper.canvasIndex) {\r\n this.extension.currentAnnotationRect = foundRect;\r\n this.navigatedFromSearch = true;\r\n this.component.publish(BaseEvents_1.BaseEvents.ANNOTATION_CANVAS_CHANGED, foundRect);\r\n }\r\n else {\r\n this.zoomToAnnotation(foundRect);\r\n }\r\n }\r\n else {\r\n this.navigatedFromSearch = true;\r\n this.component.publish(Events_1.Events.PREV_IMAGES_SEARCH_RESULT_UNAVAILABLE);\r\n }\r\n };\r\n SeadragonCenterPanel.prototype.nextAnnotation = function () {\r\n var annotationRects = this.getAnnotationRectsForCurrentImages();\r\n var currentAnnotationRect = this.extension.currentAnnotationRect;\r\n var currentAnnotationRectIndex = currentAnnotationRect ? this.getAnnotationRectIndex(currentAnnotationRect) : -1;\r\n var foundRect = null;\r\n // if there's no currentAnnotationRect selected, index is -1.\r\n // adding 1 makes the index 0 of available rects for the current images.\r\n for (var i = currentAnnotationRectIndex + 1; i < annotationRects.length; i++) {\r\n var rect = annotationRects[i];\r\n // this was removed as users found it confusing.\r\n // find the next visible or non-visible rect.\r\n //if (rect.isVisible) {\r\n // continue;\r\n //} else {\r\n foundRect = rect;\r\n break;\r\n //}\r\n }\r\n if (foundRect && this.isZoomToSearchResultEnabled()) {\r\n // if the rect's canvasIndex is greater than the current canvasIndex\r\n if (foundRect.canvasIndex > this.extension.helper.canvasIndex) {\r\n this.extension.currentAnnotationRect = foundRect;\r\n this.navigatedFromSearch = true;\r\n this.component.publish(BaseEvents_1.BaseEvents.ANNOTATION_CANVAS_CHANGED, [foundRect]);\r\n }\r\n else {\r\n this.zoomToAnnotation(foundRect);\r\n }\r\n }\r\n else {\r\n this.navigatedFromSearch = true;\r\n this.component.publish(Events_1.Events.NEXT_IMAGES_SEARCH_RESULT_UNAVAILABLE);\r\n }\r\n };\r\n SeadragonCenterPanel.prototype.getAnnotationRectByIndex = function (index) {\r\n var annotationRects = this.getAnnotationRectsForCurrentImages();\r\n if (!annotationRects.length)\r\n return null;\r\n return annotationRects[index];\r\n };\r\n SeadragonCenterPanel.prototype.getInitialAnnotationRect = function () {\r\n var _this = this;\r\n var annotationRects = this.getAnnotationRectsForCurrentImages();\r\n if (!annotationRects.length)\r\n return null;\r\n // if we've got this far it means that a reload has happened\r\n // check if the lastCanvasIndex is greater or less than the current canvasIndex\r\n // if greater than, select the last annotation on the current page\r\n // if less than, select the first annotation on the current page\r\n // otherwise default to the first annotation\r\n var previousAnnotationRect = this.extension.previousAnnotationRect;\r\n if (!previousAnnotationRect) {\r\n if (this.extension.lastCanvasIndex > this.extension.helper.canvasIndex) {\r\n return annotationRects.en().where(function (x) { return x.canvasIndex === _this.extension.helper.canvasIndex; }).last();\r\n }\r\n }\r\n return annotationRects.en().where(function (x) { return x.canvasIndex === _this.extension.helper.canvasIndex; }).first();\r\n };\r\n SeadragonCenterPanel.prototype.zoomToAnnotation = function (annotationRect) {\r\n this.extension.previousAnnotationRect = this.extension.currentAnnotationRect || annotationRect;\r\n this.extension.currentAnnotationRect = annotationRect;\r\n // if zoomToBoundsEnabled, zoom to the annotation's bounds.\r\n // otherwise, pan into view preserving the current zoom level.\r\n if (Utils.Bools.getBool(this.extension.data.config.options.zoomToBoundsEnabled, false)) {\r\n this.fitToBounds(new Bounds_1.Bounds(annotationRect.viewportX, annotationRect.viewportY, annotationRect.width, annotationRect.height), false);\r\n }\r\n else {\r\n var x = annotationRect.viewportX - ((this.currentBounds.w * 0.5) - annotationRect.width * 0.5);\r\n var y = annotationRect.viewportY - ((this.currentBounds.h * 0.5) - annotationRect.height * 0.5);\r\n var w = this.currentBounds.w;\r\n var h = this.currentBounds.h;\r\n var bounds = new Bounds_1.Bounds(x, y, w, h);\r\n this.fitToBounds(bounds);\r\n }\r\n this.highlightAnnotationRect(annotationRect);\r\n this.component.publish(BaseEvents_1.BaseEvents.ANNOTATION_CHANGED);\r\n };\r\n SeadragonCenterPanel.prototype.highlightAnnotationRect = function (annotationRect) {\r\n var $rect = $('#searchResult-' + annotationRect.canvasIndex + '-' + annotationRect.index);\r\n $rect.addClass('current');\r\n $('.searchOverlay').not($rect).removeClass('current');\r\n };\r\n SeadragonCenterPanel.prototype.getAnnotationOverlayRects = function (annotationGroup) {\r\n var newRects = [];\r\n if (!this.extension.resources) {\r\n return newRects;\r\n }\r\n var resource = this.extension.resources.en().where(function (x) { return x.index === annotationGroup.canvasIndex; }).first();\r\n var index = this.extension.resources.indexOf(resource);\r\n var offsetX = 0;\r\n if (index > 0) {\r\n offsetX = this.extension.resources[index - 1].width;\r\n }\r\n for (var i = 0; i < annotationGroup.rects.length; i++) {\r\n var searchRect = annotationGroup.rects[i];\r\n var x = (searchRect.x + offsetX) + ((index > 0) ? this.config.options.pageGap : 0);\r\n var y = searchRect.y;\r\n var w = searchRect.width;\r\n var h = searchRect.height;\r\n var rect = new OpenSeadragon.Rect(x, y, w, h);\r\n searchRect.viewportX = x;\r\n searchRect.viewportY = y;\r\n rect.canvasIndex = searchRect.canvasIndex;\r\n rect.resultIndex = searchRect.index;\r\n rect.chars = searchRect.chars;\r\n newRects.push(rect);\r\n }\r\n return newRects;\r\n };\r\n SeadragonCenterPanel.prototype.resize = function () {\r\n var _this = this;\r\n _super.prototype.resize.call(this);\r\n this.$viewer.height(this.$content.height() - this.$viewer.verticalMargins());\r\n this.$viewer.width(this.$content.width() - this.$viewer.horizontalMargins());\r\n if (!this.isCreated)\r\n return;\r\n if (this.title) {\r\n this.$title.text(Utils_1.UVUtils.sanitize(this.title));\r\n }\r\n this.$spinner.css('top', (this.$content.height() / 2) - (this.$spinner.height() / 2));\r\n this.$spinner.css('left', (this.$content.width() / 2) - (this.$spinner.width() / 2));\r\n var viewingDirection = this.extension.helper.getViewingDirection() || vocabulary_1.ViewingDirection.LEFT_TO_RIGHT;\r\n if (this.extension.helper.isMultiCanvas() && this.$prevButton && this.$nextButton) {\r\n var verticalButtonPos = Math.floor(this.$content.width() / 2);\r\n switch (viewingDirection.toString()) {\r\n case vocabulary_1.ViewingDirection.BOTTOM_TO_TOP.toString():\r\n this.$prevButton.addClass('down');\r\n this.$nextButton.addClass('up');\r\n this.$prevButton.css('left', verticalButtonPos - (this.$prevButton.outerWidth() / 2));\r\n this.$prevButton.css('top', (this.$content.height() - this.$prevButton.height()));\r\n this.$nextButton.css('left', (verticalButtonPos * -1) - (this.$nextButton.outerWidth() / 2));\r\n break;\r\n case vocabulary_1.ViewingDirection.TOP_TO_BOTTOM.toString():\r\n this.$prevButton.css('left', verticalButtonPos - (this.$prevButton.outerWidth() / 2));\r\n this.$nextButton.css('left', (verticalButtonPos * -1) - (this.$nextButton.outerWidth() / 2));\r\n this.$nextButton.css('top', (this.$content.height() - this.$nextButton.height()));\r\n break;\r\n default:\r\n this.$prevButton.css('top', (this.$content.height() - this.$prevButton.height()) / 2);\r\n this.$nextButton.css('top', (this.$content.height() - this.$nextButton.height()) / 2);\r\n break;\r\n }\r\n }\r\n // stretch navigator, allowing time for OSD to resize\r\n setTimeout(function () {\r\n if (_this.extension.helper.isContinuous()) {\r\n if (_this.extension.helper.isHorizontallyAligned()) {\r\n var width = _this.$viewer.width() - _this.$viewer.rightMargin();\r\n _this.$navigator.width(width);\r\n }\r\n else {\r\n _this.$navigator.height(_this.$viewer.height());\r\n }\r\n }\r\n }, 100);\r\n };\r\n SeadragonCenterPanel.prototype.setFocus = function () {\r\n if (!this.$canvas.is(\":focus\")) {\r\n if (this.extension.data.config.options.allowStealFocus) {\r\n this.$canvas.focus();\r\n }\r\n }\r\n };\r\n SeadragonCenterPanel.prototype.setNavigatorVisible = function () {\r\n var navigatorEnabled = Utils.Bools.getBool(this.extension.getSettings().navigatorEnabled, true) && this.extension.isDesktopMetric();\r\n this.viewer.navigator.setVisible(navigatorEnabled);\r\n if (navigatorEnabled) {\r\n this.$navigator.show();\r\n }\r\n else {\r\n this.$navigator.hide();\r\n }\r\n };\r\n return SeadragonCenterPanel;\r\n }(CenterPanel_1.CenterPanel));\r\n exports.SeadragonCenterPanel = SeadragonCenterPanel;\r\n});\r\n//# sourceMappingURL=SeadragonCenterPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-seadragon-extension/SettingsDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/SettingsDialogue\"], function (require, exports, SettingsDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SettingsDialogue = /** @class */ (function (_super) {\r\n __extends(SettingsDialogue, _super);\r\n function SettingsDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n SettingsDialogue.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('settingsDialogue');\r\n _super.prototype.create.call(this);\r\n this.$navigatorEnabled = $('<div class=\"setting navigatorEnabled\"></div>');\r\n this.$scroll.append(this.$navigatorEnabled);\r\n // todo: use .checkboxButton jquery extension\r\n this.$navigatorEnabledCheckbox = $('<input id=\"navigatorEnabled\" type=\"checkbox\" tabindex=\"0\" />');\r\n this.$navigatorEnabled.append(this.$navigatorEnabledCheckbox);\r\n this.$navigatorEnabledLabel = $('<label for=\"navigatorEnabled\">' + this.content.navigatorEnabled + '</label>');\r\n this.$navigatorEnabled.append(this.$navigatorEnabledLabel);\r\n this.$pagingEnabled = $('<div class=\"setting pagingEnabled\"></div>');\r\n this.$scroll.append(this.$pagingEnabled);\r\n this.$pagingEnabledCheckbox = $('<input id=\"pagingEnabled\" type=\"checkbox\" tabindex=\"0\" />');\r\n this.$pagingEnabled.append(this.$pagingEnabledCheckbox);\r\n this.$pagingEnabledLabel = $('<label for=\"pagingEnabled\">' + this.content.pagingEnabled + '</label>');\r\n this.$pagingEnabled.append(this.$pagingEnabledLabel);\r\n this.$clickToZoomEnabled = $('<div class=\"setting clickToZoom\"></div>');\r\n this.$scroll.append(this.$clickToZoomEnabled);\r\n this.$clickToZoomEnabledCheckbox = $('<input id=\"clickToZoomEnabled\" type=\"checkbox\" />');\r\n this.$clickToZoomEnabled.append(this.$clickToZoomEnabledCheckbox);\r\n this.$clickToZoomEnabledLabel = $('<label for=\"clickToZoomEnabled\">' + this.content.clickToZoomEnabled + '</label>');\r\n this.$clickToZoomEnabled.append(this.$clickToZoomEnabledLabel);\r\n this.$preserveViewport = $('<div class=\"setting preserveViewport\"></div>');\r\n this.$scroll.append(this.$preserveViewport);\r\n this.$preserveViewportCheckbox = $('<input id=\"preserveViewport\" type=\"checkbox\" tabindex=\"0\" />');\r\n this.$preserveViewport.append(this.$preserveViewportCheckbox);\r\n this.$preserveViewportLabel = $('<label for=\"preserveViewport\">' + this.content.preserveViewport + '</label>');\r\n this.$preserveViewport.append(this.$preserveViewportLabel);\r\n this.$navigatorEnabledCheckbox.change(function () {\r\n var settings = {};\r\n if (_this.$navigatorEnabledCheckbox.is(\":checked\")) {\r\n settings.navigatorEnabled = true;\r\n }\r\n else {\r\n settings.navigatorEnabled = false;\r\n }\r\n _this.updateSettings(settings);\r\n });\r\n this.$clickToZoomEnabledCheckbox.change(function () {\r\n var settings = {};\r\n if (_this.$clickToZoomEnabledCheckbox.is(\":checked\")) {\r\n settings.clickToZoomEnabled = true;\r\n }\r\n else {\r\n settings.clickToZoomEnabled = false;\r\n }\r\n _this.updateSettings(settings);\r\n });\r\n this.$pagingEnabledCheckbox.change(function () {\r\n var settings = {};\r\n if (_this.$pagingEnabledCheckbox.is(\":checked\")) {\r\n settings.pagingEnabled = true;\r\n }\r\n else {\r\n settings.pagingEnabled = false;\r\n }\r\n _this.updateSettings(settings);\r\n });\r\n this.$preserveViewportCheckbox.change(function () {\r\n var settings = {};\r\n if (_this.$preserveViewportCheckbox.is(\":checked\")) {\r\n settings.preserveViewport = true;\r\n }\r\n else {\r\n settings.preserveViewport = false;\r\n }\r\n _this.updateSettings(settings);\r\n });\r\n };\r\n SettingsDialogue.prototype.open = function () {\r\n _super.prototype.open.call(this);\r\n var settings = this.getSettings();\r\n if (settings.navigatorEnabled) {\r\n this.$navigatorEnabledCheckbox.prop(\"checked\", true);\r\n }\r\n else {\r\n this.$navigatorEnabledCheckbox.removeAttr(\"checked\");\r\n }\r\n if (settings.clickToZoomEnabled) {\r\n this.$clickToZoomEnabledCheckbox.prop(\"checked\", true);\r\n }\r\n else {\r\n this.$clickToZoomEnabledCheckbox.removeAttr(\"checked\");\r\n }\r\n if (!this.extension.helper.isPagingAvailable()) {\r\n this.$pagingEnabled.hide();\r\n }\r\n else {\r\n if (settings.pagingEnabled) {\r\n this.$pagingEnabledCheckbox.prop(\"checked\", true);\r\n }\r\n else {\r\n this.$pagingEnabledCheckbox.removeAttr(\"checked\");\r\n }\r\n }\r\n if (settings.preserveViewport) {\r\n this.$preserveViewportCheckbox.prop(\"checked\", true);\r\n }\r\n else {\r\n this.$preserveViewportCheckbox.removeAttr(\"checked\");\r\n }\r\n };\r\n return SettingsDialogue;\r\n }(SettingsDialogue_1.SettingsDialogue));\r\n exports.SettingsDialogue = SettingsDialogue;\r\n});\r\n//# sourceMappingURL=SettingsDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-seadragon-extension/ShareDialogue',[\"require\", \"exports\", \"./Events\", \"../../modules/uv-dialogues-module/ShareDialogue\"], function (require, exports, Events_1, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ShareDialogue = /** @class */ (function (_super) {\r\n __extends(ShareDialogue, _super);\r\n function ShareDialogue($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this.component.subscribe(Events_1.Events.SEADRAGON_OPEN, function () {\r\n _this.update();\r\n });\r\n _this.component.subscribe(Events_1.Events.SEADRAGON_ANIMATION_FINISH, function () {\r\n _this.update();\r\n });\r\n return _this;\r\n }\r\n ShareDialogue.prototype.create = function () {\r\n this.setConfig('shareDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n ShareDialogue.prototype.update = function () {\r\n _super.prototype.update.call(this);\r\n var xywh = this.extension.getViewportBounds();\r\n var rotation = this.extension.getViewerRotation();\r\n this.code = this.extension.getEmbedScript(this.options.embedTemplate, this.currentWidth, this.currentHeight, xywh, rotation);\r\n this.$code.val(this.code);\r\n };\r\n ShareDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return ShareDialogue;\r\n }(ShareDialogue_1.ShareDialogue));\r\n exports.ShareDialogue = ShareDialogue;\r\n});\r\n//# sourceMappingURL=ShareDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-seadragon-extension/Extension',[\"require\", \"exports\", \"manifesto.js\", \"@iiif/manifold\", \"../../modules/uv-shared-module/AnnotationResults\", \"../../modules/uv-shared-module/BaseEvents\", \"../../modules/uv-shared-module/BaseExtension\", \"../../modules/uv-shared-module/Bookmark\", \"../../modules/uv-contentleftpanel-module/ContentLeftPanel\", \"./CroppedImageDimensions\", \"./DownloadDialogue\", \"./Events\", \"../../modules/uv-dialogues-module/ExternalContentDialogue\", \"../../modules/uv-osdmobilefooterpanel-module/MobileFooter\", \"../../modules/uv-searchfooterpanel-module/FooterPanel\", \"../../modules/uv-dialogues-module/HelpDialogue\", \"./Mode\", \"../../modules/uv-dialogues-module/MoreInfoDialogue\", \"../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel\", \"../../modules/uv-multiselectdialogue-module/MultiSelectDialogue\", \"./MultiSelectionArgs\", \"../../modules/uv-pagingheaderpanel-module/PagingHeaderPanel\", \"../../modules/uv-shared-module/Point\", \"../../modules/uv-seadragoncenterpanel-module/SeadragonCenterPanel\", \"./SettingsDialogue\", \"./ShareDialogue\", \"@iiif/vocabulary\"], function (require, exports, manifesto_js_1, manifold_1, AnnotationResults_1, BaseEvents_1, BaseExtension_1, Bookmark_1, ContentLeftPanel_1, CroppedImageDimensions_1, DownloadDialogue_1, Events_1, ExternalContentDialogue_1, MobileFooter_1, FooterPanel_1, HelpDialogue_1, Mode_1, MoreInfoDialogue_1, MoreInfoRightPanel_1, MultiSelectDialogue_1, MultiSelectionArgs_1, PagingHeaderPanel_1, Point_1, SeadragonCenterPanel_1, SettingsDialogue_1, ShareDialogue_1, vocabulary_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Extension = /** @class */ (function (_super) {\r\n __extends(Extension, _super);\r\n function Extension() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.annotations = [];\r\n _this.currentRotation = 0;\r\n _this.isAnnotating = false;\r\n return _this;\r\n }\r\n Extension.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.METRIC_CHANGED, function () {\r\n if (!_this.isDesktopMetric()) {\r\n var settings = {};\r\n settings.pagingEnabled = false;\r\n _this.updateSettings(settings);\r\n _this.component.publish(BaseEvents_1.BaseEvents.UPDATE_SETTINGS);\r\n _this.shell.$rightPanel.hide();\r\n }\r\n else {\r\n _this.shell.$rightPanel.show();\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this.previousAnnotationRect = null;\r\n _this.currentAnnotationRect = null;\r\n _this.viewPage(canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CLEAR_ANNOTATIONS, function () {\r\n _this.clearAnnotations();\r\n _this.component.publish(BaseEvents_1.BaseEvents.ANNOTATIONS_CLEARED);\r\n _this.fire(BaseEvents_1.BaseEvents.CLEAR_ANNOTATIONS);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.DOWN_ARROW, function () {\r\n if (!_this.useArrowKeysToNavigate()) {\r\n _this.centerPanel.setFocus();\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.END, function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.helper.getLastPageIndex());\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.FIRST, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.FIRST);\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.helper.getFirstPageIndex());\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.GALLERY_DECREASE_SIZE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.GALLERY_DECREASE_SIZE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.GALLERY_INCREASE_SIZE, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.GALLERY_INCREASE_SIZE);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.GALLERY_THUMB_SELECTED, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.GALLERY_THUMB_SELECTED);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HOME, function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.helper.getFirstPageIndex());\r\n });\r\n this.component.subscribe(Events_1.Events.IMAGE_SEARCH, function (index) {\r\n _this.fire(Events_1.Events.IMAGE_SEARCH, index);\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, index);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LAST, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.LAST);\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.helper.getLastPageIndex());\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFT_ARROW, function () {\r\n if (_this.useArrowKeysToNavigate()) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.getPrevPageIndex());\r\n }\r\n else {\r\n _this.centerPanel.setFocus();\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_START, function () {\r\n if (_this.isDesktopMetric()) {\r\n _this.shell.$rightPanel.show();\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_FINISH, function () {\r\n _this.shell.$centerPanel.show();\r\n _this.resize();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_START, function () {\r\n _this.shell.$centerPanel.hide();\r\n _this.shell.$rightPanel.hide();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.MINUS, function () {\r\n _this.centerPanel.setFocus();\r\n });\r\n this.component.subscribe(Events_1.Events.MODE_CHANGED, function (mode) {\r\n _this.fire(Events_1.Events.MODE_CHANGED, mode);\r\n _this.mode = new Mode_1.Mode(mode);\r\n var settings = _this.getSettings();\r\n _this.component.publish(BaseEvents_1.BaseEvents.SETTINGS_CHANGED, settings);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.MULTISELECTION_MADE, function (ids) {\r\n var args = new MultiSelectionArgs_1.MultiSelectionArgs();\r\n args.manifestUri = _this.helper.manifestUri;\r\n args.allCanvases = ids.length === _this.helper.getCanvases().length;\r\n args.canvases = ids;\r\n args.format = _this.data.config.options.multiSelectionMimeType;\r\n args.sequence = _this.helper.getCurrentSequence().id;\r\n _this.fire(BaseEvents_1.BaseEvents.MULTISELECTION_MADE, args);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.NEXT, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.NEXT);\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.getNextPageIndex());\r\n });\r\n this.component.subscribe(Events_1.Events.NEXT_SEARCH_RESULT, function () {\r\n _this.fire(Events_1.Events.NEXT_SEARCH_RESULT);\r\n });\r\n this.component.subscribe(Events_1.Events.NEXT_IMAGES_SEARCH_RESULT_UNAVAILABLE, function () {\r\n _this.fire(Events_1.Events.NEXT_IMAGES_SEARCH_RESULT_UNAVAILABLE);\r\n _this.nextSearchResult();\r\n });\r\n this.component.subscribe(Events_1.Events.PREV_IMAGES_SEARCH_RESULT_UNAVAILABLE, function () {\r\n _this.fire(Events_1.Events.PREV_IMAGES_SEARCH_RESULT_UNAVAILABLE);\r\n _this.prevSearchResult();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_THUMBS_VIEW, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.OPEN_THUMBS_VIEW);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_TREE_VIEW, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.OPEN_TREE_VIEW);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.PAGE_DOWN, function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.getNextPageIndex());\r\n });\r\n this.component.subscribe(Events_1.Events.PAGE_SEARCH, function (value) {\r\n _this.fire(Events_1.Events.PAGE_SEARCH, value);\r\n _this.viewLabel(value);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.PAGE_UP, function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.getPrevPageIndex());\r\n });\r\n this.component.subscribe(Events_1.Events.PAGING_TOGGLED, function (obj) {\r\n _this.fire(Events_1.Events.PAGING_TOGGLED, obj);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.PLUS, function () {\r\n _this.centerPanel.setFocus();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.PREV, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.PREV);\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.getPrevPageIndex());\r\n });\r\n this.component.subscribe(Events_1.Events.PREV_SEARCH_RESULT, function () {\r\n _this.fire(Events_1.Events.PREV_SEARCH_RESULT);\r\n });\r\n this.component.subscribe(Events_1.Events.PRINT, function () {\r\n _this.print();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RELOAD, function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CLEAR_ANNOTATIONS);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.RIGHT_ARROW, function () {\r\n if (_this.useArrowKeysToNavigate()) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.getNextPageIndex());\r\n }\r\n else {\r\n _this.centerPanel.setFocus();\r\n }\r\n });\r\n this.component.subscribe(Events_1.Events.SEADRAGON_ANIMATION, function () {\r\n _this.fire(Events_1.Events.SEADRAGON_ANIMATION);\r\n });\r\n this.component.subscribe(Events_1.Events.SEADRAGON_ANIMATION_FINISH, function (viewer) {\r\n var bounds = _this.centerPanel.getViewportBounds();\r\n if (_this.centerPanel && bounds) {\r\n _this.component.publish(Events_1.Events.XYWH_CHANGED, bounds.toString());\r\n _this.data.xywh = bounds.toString();\r\n _this.fire(Events_1.Events.XYWH_CHANGED, _this.data.xywh);\r\n }\r\n var canvas = _this.helper.getCurrentCanvas();\r\n _this.fire(Events_1.Events.CURRENT_VIEW_URI, {\r\n cropUri: _this.getCroppedImageUri(canvas, _this.getViewer()),\r\n fullUri: _this.getConfinedImageUri(canvas, canvas.getWidth())\r\n });\r\n });\r\n this.component.subscribe(Events_1.Events.SEADRAGON_ANIMATION_START, function () {\r\n _this.fire(Events_1.Events.SEADRAGON_ANIMATION_START);\r\n });\r\n this.component.subscribe(Events_1.Events.SEADRAGON_OPEN, function () {\r\n if (!_this.useArrowKeysToNavigate()) {\r\n _this.centerPanel.setFocus();\r\n }\r\n _this.fire(Events_1.Events.SEADRAGON_OPEN);\r\n });\r\n this.component.subscribe(Events_1.Events.SEADRAGON_RESIZE, function () {\r\n _this.fire(Events_1.Events.SEADRAGON_RESIZE);\r\n });\r\n this.component.subscribe(Events_1.Events.SEADRAGON_ROTATION, function (rotation) {\r\n _this.data.rotation = rotation;\r\n _this.fire(Events_1.Events.SEADRAGON_ROTATION, _this.data.rotation);\r\n _this.currentRotation = rotation;\r\n });\r\n this.component.subscribe(Events_1.Events.SEARCH, function (terms) {\r\n _this.fire(Events_1.Events.SEARCH, terms);\r\n _this.search(terms);\r\n });\r\n this.component.subscribe(Events_1.Events.SEARCH_PREVIEW_FINISH, function () {\r\n _this.fire(Events_1.Events.SEARCH_PREVIEW_FINISH);\r\n });\r\n this.component.subscribe(Events_1.Events.SEARCH_PREVIEW_START, function () {\r\n _this.fire(Events_1.Events.SEARCH_PREVIEW_START);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATIONS, function (obj) {\r\n _this.fire(BaseEvents_1.BaseEvents.ANNOTATIONS, obj);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATION_CANVAS_CHANGED, function (rect) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, rect.canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.ANNOTATIONS_EMPTY, function () {\r\n _this.fire(BaseEvents_1.BaseEvents.ANNOTATIONS_EMPTY);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.THUMB_SELECTED, function (thumb) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, thumb.index);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.TREE_NODE_SELECTED, function (node) {\r\n _this.fire(BaseEvents_1.BaseEvents.TREE_NODE_SELECTED, node.data.path);\r\n _this.treeNodeSelected(node);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.UP_ARROW, function () {\r\n if (!_this.useArrowKeysToNavigate()) {\r\n _this.centerPanel.setFocus();\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.UPDATE_SETTINGS, function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, _this.helper.canvasIndex);\r\n var settings = _this.getSettings();\r\n _this.component.publish(BaseEvents_1.BaseEvents.SETTINGS_CHANGED, settings);\r\n });\r\n // this.component.subscribe(Events.VIEW_PAGE, (e: any, index: number) => {\r\n // this.fire(Events.VIEW_PAGE, index);\r\n // this.component.publish(BaseEvents.CANVAS_INDEX_CHANGED, [index]);\r\n // });\r\n };\r\n Extension.prototype.createModules = function () {\r\n _super.prototype.createModules.call(this);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel = new PagingHeaderPanel_1.PagingHeaderPanel(this.shell.$headerPanel);\r\n }\r\n else {\r\n this.shell.$headerPanel.hide();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel = new ContentLeftPanel_1.ContentLeftPanel(this.shell.$leftPanel);\r\n }\r\n else {\r\n this.shell.$leftPanel.hide();\r\n }\r\n this.centerPanel = new SeadragonCenterPanel_1.SeadragonCenterPanel(this.shell.$centerPanel);\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel = new MoreInfoRightPanel_1.MoreInfoRightPanel(this.shell.$rightPanel);\r\n }\r\n else {\r\n this.shell.$rightPanel.hide();\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel = new FooterPanel_1.FooterPanel(this.shell.$footerPanel);\r\n this.mobileFooterPanel = new MobileFooter_1.FooterPanel(this.shell.$mobileFooterPanel);\r\n }\r\n else {\r\n this.shell.$footerPanel.hide();\r\n }\r\n this.$helpDialogue = $('<div class=\"overlay help\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$helpDialogue);\r\n this.helpDialogue = new HelpDialogue_1.HelpDialogue(this.$helpDialogue);\r\n this.$moreInfoDialogue = $('<div class=\"overlay moreInfo\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$moreInfoDialogue);\r\n this.moreInfoDialogue = new MoreInfoDialogue_1.MoreInfoDialogue(this.$moreInfoDialogue);\r\n this.$multiSelectDialogue = $('<div class=\"overlay multiSelect\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$multiSelectDialogue);\r\n this.multiSelectDialogue = new MultiSelectDialogue_1.MultiSelectDialogue(this.$multiSelectDialogue);\r\n this.$shareDialogue = $('<div class=\"overlay share\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$shareDialogue);\r\n this.shareDialogue = new ShareDialogue_1.ShareDialogue(this.$shareDialogue);\r\n this.$downloadDialogue = $('<div class=\"overlay download\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$downloadDialogue);\r\n this.downloadDialogue = new DownloadDialogue_1.DownloadDialogue(this.$downloadDialogue);\r\n this.$settingsDialogue = $('<div class=\"overlay settings\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$settingsDialogue);\r\n this.settingsDialogue = new SettingsDialogue_1.SettingsDialogue(this.$settingsDialogue);\r\n this.$externalContentDialogue = $('<div class=\"overlay externalContent\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$externalContentDialogue);\r\n this.externalContentDialogue = new ExternalContentDialogue_1.ExternalContentDialogue(this.$externalContentDialogue);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel.init();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel.init();\r\n }\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel.init();\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel.init();\r\n }\r\n };\r\n Extension.prototype.render = function () {\r\n _super.prototype.render.call(this);\r\n //Utils.Async.waitFor(() => {\r\n // return this.centerPanel && this.centerPanel.isCreated;\r\n //}, () => {\r\n this.checkForAnnotations();\r\n this.checkForSearchParam();\r\n this.checkForRotationParam();\r\n //});\r\n };\r\n Extension.prototype.checkForAnnotations = function () {\r\n if (this.data.annotations) {\r\n var annotations = this.parseAnnotationList(this.data.annotations);\r\n this.component.publish(BaseEvents_1.BaseEvents.CLEAR_ANNOTATIONS);\r\n this.annotate(annotations);\r\n }\r\n };\r\n Extension.prototype.annotate = function (annotations, terms) {\r\n this.annotations = annotations;\r\n // sort the annotations by canvasIndex\r\n this.annotations = annotations.sort(function (a, b) {\r\n return a.canvasIndex - b.canvasIndex;\r\n });\r\n var annotationResults = new AnnotationResults_1.AnnotationResults();\r\n annotationResults.terms = terms;\r\n annotationResults.annotations = this.annotations;\r\n this.component.publish(BaseEvents_1.BaseEvents.ANNOTATIONS, annotationResults);\r\n // reload current index as it may contain annotations.\r\n //this.component.publish(BaseEvents.CANVAS_INDEX_CHANGED, [this.helper.canvasIndex]);\r\n };\r\n Extension.prototype.checkForSearchParam = function () {\r\n // if a highlight param is set, use it to search.\r\n var highlight = this.data.highlight;\r\n if (highlight) {\r\n highlight.replace(/\\+/g, \" \").replace(/\"/g, \"\");\r\n this.component.publish(Events_1.Events.SEARCH, highlight);\r\n }\r\n };\r\n Extension.prototype.checkForRotationParam = function () {\r\n // if a rotation value is passed, set rotation\r\n var rotation = this.data.rotation;\r\n if (rotation) {\r\n this.component.publish(Events_1.Events.SEADRAGON_ROTATION, rotation);\r\n }\r\n };\r\n Extension.prototype.viewPage = function (canvasIndex) {\r\n // if it's an invalid canvas index.\r\n if (canvasIndex === -1)\r\n return;\r\n var isReload = false;\r\n if (canvasIndex === this.helper.canvasIndex) {\r\n isReload = true;\r\n }\r\n if (this.helper.isCanvasIndexOutOfRange(canvasIndex)) {\r\n this.showMessage(this.data.config.content.canvasIndexOutOfRange);\r\n canvasIndex = 0;\r\n }\r\n if (this.isPagingSettingEnabled() && !isReload) {\r\n var indices = this.getPagedIndices(canvasIndex);\r\n // if the page is already displayed, only advance canvasIndex.\r\n if (indices.includes(this.helper.canvasIndex)) {\r\n this.viewCanvas(canvasIndex);\r\n return;\r\n }\r\n }\r\n this.viewCanvas(canvasIndex);\r\n };\r\n Extension.prototype.getViewer = function () {\r\n return this.centerPanel.viewer;\r\n };\r\n Extension.prototype.getMode = function () {\r\n if (this.mode)\r\n return this.mode;\r\n var manifestType = this.helper.getManifestType();\r\n if (!manifestType) {\r\n return Mode_1.Mode.image;\r\n }\r\n switch (manifestType.toString()) {\r\n case manifesto_js_1.ManifestType.MONOGRAPH.toString():\r\n return Mode_1.Mode.page;\r\n case manifesto_js_1.ManifestType.MANUSCRIPT.toString():\r\n return Mode_1.Mode.page;\r\n default:\r\n return Mode_1.Mode.image;\r\n }\r\n };\r\n Extension.prototype.getViewportBounds = function () {\r\n if (!this.centerPanel)\r\n return null;\r\n var bounds = this.centerPanel.getViewportBounds();\r\n if (bounds) {\r\n return bounds.toString();\r\n }\r\n return null;\r\n };\r\n Extension.prototype.getViewerRotation = function () {\r\n if (!this.centerPanel)\r\n return null;\r\n return this.currentRotation;\r\n };\r\n Extension.prototype.viewRange = function (path) {\r\n //this.currentRangePath = path;\r\n var range = this.helper.getRangeByPath(path);\r\n if (!range)\r\n return;\r\n var canvasId = range.getCanvasIds()[0];\r\n var index = this.helper.getCanvasIndexById(canvasId);\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, index);\r\n };\r\n Extension.prototype.viewLabel = function (label) {\r\n if (!label) {\r\n this.showMessage(this.data.config.modules.genericDialogue.content.emptyValue);\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGE_FAILED);\r\n return;\r\n }\r\n var index = this.helper.getCanvasIndexByLabel(label);\r\n if (index != -1) {\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, index);\r\n }\r\n else {\r\n this.showMessage(this.data.config.modules.genericDialogue.content.pageNotFound);\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGE_FAILED);\r\n }\r\n };\r\n Extension.prototype.treeNodeSelected = function (node) {\r\n var data = node.data;\r\n if (!data.type)\r\n return;\r\n switch (data.type) {\r\n case vocabulary_1.IIIFResourceType.MANIFEST.toString():\r\n this.viewManifest(data);\r\n break;\r\n case vocabulary_1.IIIFResourceType.COLLECTION.toString():\r\n // note: this won't get called as the tree component now has branchNodesSelectable = false\r\n // useful to keep around for reference\r\n this.viewCollection(data);\r\n break;\r\n default:\r\n this.viewRange(data.path);\r\n break;\r\n }\r\n };\r\n Extension.prototype.clearAnnotations = function () {\r\n this.annotations = null;\r\n // reload current index as it may contain results.\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, this.helper.canvasIndex);\r\n };\r\n Extension.prototype.prevSearchResult = function () {\r\n var foundResult;\r\n if (!this.annotations)\r\n return;\r\n // get the first result with a canvasIndex less than the current index.\r\n for (var i = this.annotations.length - 1; i >= 0; i--) {\r\n var result = this.annotations[i];\r\n if (result.canvasIndex <= this.getPrevPageIndex()) {\r\n foundResult = result;\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, foundResult.canvasIndex);\r\n break;\r\n }\r\n }\r\n };\r\n Extension.prototype.nextSearchResult = function () {\r\n if (!this.annotations)\r\n return;\r\n // get the first result with an index greater than the current index.\r\n for (var i = 0; i < this.annotations.length; i++) {\r\n var result = this.annotations[i];\r\n if (result && result.canvasIndex >= this.getNextPageIndex()) {\r\n this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, result.canvasIndex);\r\n break;\r\n }\r\n }\r\n };\r\n Extension.prototype.bookmark = function () {\r\n _super.prototype.bookmark.call(this);\r\n var canvas = this.helper.getCurrentCanvas();\r\n var bookmark = new Bookmark_1.Bookmark();\r\n bookmark.index = this.helper.canvasIndex;\r\n bookmark.label = manifesto_js_1.LanguageMap.getValue(canvas.getLabel());\r\n bookmark.path = this.getCroppedImageUri(canvas, this.getViewer());\r\n bookmark.thumb = canvas.getCanonicalImageUri(this.data.config.options.bookmarkThumbWidth);\r\n bookmark.title = this.helper.getLabel();\r\n bookmark.trackingLabel = window.trackingLabel;\r\n bookmark.type = vocabulary_1.ExternalResourceType.IMAGE.toString();\r\n this.fire(BaseEvents_1.BaseEvents.BOOKMARK, bookmark);\r\n };\r\n Extension.prototype.print = function () {\r\n // var args: MultiSelectionArgs = new MultiSelectionArgs();\r\n // args.manifestUri = this.helper.iiifResourceUri;\r\n // args.allCanvases = true;\r\n // args.format = this.data.config.options.printMimeType;\r\n // args.sequence = this.helper.getCurrentSequence().id;\r\n window.print();\r\n this.fire(Events_1.Events.PRINT);\r\n };\r\n Extension.prototype.getCroppedImageDimensions = function (canvas, viewer) {\r\n if (!viewer)\r\n return null;\r\n if (!viewer.viewport)\r\n return null;\r\n if (!canvas.getHeight() || !canvas.getWidth()) {\r\n return null;\r\n }\r\n var bounds = viewer.viewport.getBounds(true);\r\n var dimensions = new CroppedImageDimensions_1.CroppedImageDimensions();\r\n var width = Math.floor(bounds.width);\r\n var height = Math.floor(bounds.height);\r\n var x = Math.floor(bounds.x);\r\n var y = Math.floor(bounds.y);\r\n // constrain to image bounds\r\n if (x + width > canvas.getWidth()) {\r\n width = canvas.getWidth() - x;\r\n }\r\n else if (x < 0) {\r\n width = width + x;\r\n }\r\n if (x < 0) {\r\n x = 0;\r\n }\r\n if (y + height > canvas.getHeight()) {\r\n height = canvas.getHeight() - y;\r\n }\r\n else if (y < 0) {\r\n height = height + y;\r\n }\r\n if (y < 0) {\r\n y = 0;\r\n }\r\n width = Math.min(width, canvas.getWidth());\r\n height = Math.min(height, canvas.getHeight());\r\n var regionWidth = width;\r\n var regionHeight = height;\r\n var maxDimensions = canvas.getMaxDimensions();\r\n if (maxDimensions) {\r\n if (width > maxDimensions.width) {\r\n var newWidth = maxDimensions.width;\r\n height = Math.round(newWidth * (height / width));\r\n width = newWidth;\r\n }\r\n if (height > maxDimensions.height) {\r\n var newHeight = maxDimensions.height;\r\n width = Math.round((width / height) * newHeight);\r\n height = newHeight;\r\n }\r\n }\r\n dimensions.region = new manifesto_js_1.Size(regionWidth, regionHeight);\r\n dimensions.regionPos = new Point_1.Point(x, y);\r\n dimensions.size = new manifesto_js_1.Size(width, height);\r\n return dimensions;\r\n };\r\n // keep this around for reference\r\n // getOnScreenCroppedImageDimensions(canvas: Canvas, viewer: any): CroppedImageDimensions {\r\n // if (!viewer) return null;\r\n // if (!viewer.viewport) return null;\r\n // if (!canvas.getHeight() || !canvas.getWidth()){\r\n // return null;\r\n // }\r\n // var bounds = viewer.viewport.getBounds(true);\r\n // var containerSize = viewer.viewport.getContainerSize();\r\n // var zoom = viewer.viewport.getZoom(true);\r\n // var top = Math.max(0, bounds.y);\r\n // var left = Math.max(0, bounds.x);\r\n // // change top to be normalised value proportional to height of image, not width (as per OSD).\r\n // top = 1 / (canvas.getHeight() / parseInt(String(canvas.getWidth() * top)));\r\n // // get on-screen pixel sizes.\r\n // var viewportWidthPx = containerSize.x;\r\n // var viewportHeightPx = containerSize.y;\r\n // var imageWidthPx = parseInt(String(viewportWidthPx * zoom));\r\n // var ratio = canvas.getWidth() / imageWidthPx;\r\n // var imageHeightPx = parseInt(String(canvas.getHeight() / ratio));\r\n // var viewportLeftPx = parseInt(String(left * imageWidthPx));\r\n // var viewportTopPx = parseInt(String(top * imageHeightPx));\r\n // var rect1Left = 0;\r\n // var rect1Right = imageWidthPx;\r\n // var rect1Top = 0;\r\n // var rect1Bottom = imageHeightPx;\r\n // var rect2Left = viewportLeftPx;\r\n // var rect2Right = viewportLeftPx + viewportWidthPx;\r\n // var rect2Top = viewportTopPx;\r\n // var rect2Bottom = viewportTopPx + viewportHeightPx;\r\n // var sizeWidth = Math.max(0, Math.min(rect1Right, rect2Right) - Math.max(rect1Left, rect2Left));\r\n // var sizeHeight = Math.max(0, Math.min(rect1Bottom, rect2Bottom) - Math.max(rect1Top, rect2Top));\r\n // // get original image pixel sizes.\r\n // var ratio2 = canvas.getWidth() / imageWidthPx;\r\n // var regionWidth = parseInt(String(sizeWidth * ratio2));\r\n // var regionHeight = parseInt(String(sizeHeight * ratio2));\r\n // var regionTop = parseInt(String(canvas.getHeight() * top));\r\n // var regionLeft = parseInt(String(canvas.getWidth() * left));\r\n // if (regionTop < 0) regionTop = 0;\r\n // if (regionLeft < 0) regionLeft = 0;\r\n // var dimensions: CroppedImageDimensions = new CroppedImageDimensions();\r\n // dimensions.region = new Size(regionWidth, regionHeight);\r\n // dimensions.regionPos = new Point(regionLeft, regionTop);\r\n // dimensions.size = new Size(sizeWidth, sizeHeight);\r\n // return dimensions;\r\n // }\r\n Extension.prototype.getCroppedImageUri = function (canvas, viewer) {\r\n if (!viewer)\r\n return null;\r\n if (!viewer.viewport)\r\n return null;\r\n var dimensions = this.getCroppedImageDimensions(canvas, viewer);\r\n if (!dimensions) {\r\n return null;\r\n }\r\n // construct uri\r\n // {baseuri}/{id}/{region}/{size}/{rotation}/{quality}.jpg\r\n var baseUri = this.getImageBaseUri(canvas);\r\n var id = this.getImageId(canvas);\r\n if (!id) {\r\n return null;\r\n }\r\n var region = dimensions.regionPos.x + \",\" + dimensions.regionPos.y + \",\" + dimensions.region.width + \",\" + dimensions.region.height;\r\n var size = dimensions.size.width + ',' + dimensions.size.height;\r\n var rotation = this.getViewerRotation();\r\n var quality = 'default';\r\n return baseUri + \"/\" + id + \"/\" + region + \"/\" + size + \"/\" + rotation + \"/\" + quality + \".jpg\";\r\n };\r\n Extension.prototype.getConfinedImageDimensions = function (canvas, width) {\r\n var dimensions = new manifesto_js_1.Size(0, 0);\r\n dimensions.width = width;\r\n var normWidth = Utils.Maths.normalise(width, 0, canvas.getWidth());\r\n dimensions.height = Math.floor(canvas.getHeight() * normWidth);\r\n return dimensions;\r\n };\r\n Extension.prototype.getConfinedImageUri = function (canvas, width) {\r\n var baseUri = this.getImageBaseUri(canvas);\r\n // {baseuri}/{id}/{region}/{size}/{rotation}/{quality}.jpg\r\n var id = this.getImageId(canvas);\r\n if (!id) {\r\n return null;\r\n }\r\n var region = 'full';\r\n var dimensions = this.getConfinedImageDimensions(canvas, width);\r\n var size = dimensions.width + ',' + dimensions.height;\r\n var rotation = this.getViewerRotation();\r\n var quality = 'default';\r\n return baseUri + \"/\" + id + \"/\" + region + \"/\" + size + \"/\" + rotation + \"/\" + quality + \".jpg\";\r\n };\r\n Extension.prototype.getImageId = function (canvas) {\r\n if (canvas.externalResource) {\r\n var id = canvas.externalResource.data['@id'];\r\n if (id) {\r\n return id.substr(id.lastIndexOf(\"/\") + 1);\r\n }\r\n }\r\n return null;\r\n };\r\n Extension.prototype.getImageBaseUri = function (canvas) {\r\n var uri = this.getInfoUri(canvas);\r\n // First trim off info.json, then trim off ID....\r\n uri = uri.substr(0, uri.lastIndexOf(\"/\"));\r\n return uri.substr(0, uri.lastIndexOf(\"/\"));\r\n };\r\n Extension.prototype.getInfoUri = function (canvas) {\r\n var infoUri = null;\r\n var images = canvas.getImages();\r\n if (images && images.length) {\r\n var firstImage = images[0];\r\n var resource = firstImage.getResource();\r\n var services = resource.getServices();\r\n for (var i = 0; i < services.length; i++) {\r\n var service = services[i];\r\n var id = service.id;\r\n if (!id.endsWith('/')) {\r\n id += '/';\r\n }\r\n if (manifesto_js_1.Utils.isImageProfile(service.getProfile())) {\r\n infoUri = id + 'info.json';\r\n }\r\n }\r\n }\r\n if (!infoUri) {\r\n // todo: use compiler flag (when available)\r\n infoUri = 'lib/imageunavailable.json';\r\n }\r\n return infoUri;\r\n };\r\n Extension.prototype.getEmbedScript = function (template, width, height, zoom, rotation) {\r\n var config = this.data.config.uri || '';\r\n var locales = this.getSerializedLocales();\r\n var appUri = this.getAppUri();\r\n var iframeSrc = appUri + \"#?manifest=\" + this.helper.manifestUri + \"&c=\" + this.helper.collectionIndex + \"&m=\" + this.helper.manifestIndex + \"&s=\" + this.helper.sequenceIndex + \"&cv=\" + this.helper.canvasIndex + \"&config=\" + config + \"&locales=\" + locales + \"&xywh=\" + zoom + \"&r=\" + rotation;\r\n var script = Utils.Strings.format(template, iframeSrc, width.toString(), height.toString());\r\n return script;\r\n };\r\n Extension.prototype.getPrevPageIndex = function (canvasIndex) {\r\n if (canvasIndex === void 0) { canvasIndex = this.helper.canvasIndex; }\r\n var index;\r\n if (this.isPagingSettingEnabled()) {\r\n var indices = this.getPagedIndices(canvasIndex);\r\n if (this.helper.isRightToLeft()) {\r\n index = indices[indices.length - 1] - 1;\r\n }\r\n else {\r\n index = indices[0] - 1;\r\n }\r\n }\r\n else {\r\n index = canvasIndex - 1;\r\n }\r\n return index;\r\n };\r\n Extension.prototype.isSearchEnabled = function () {\r\n if (!Utils.Bools.getBool(this.data.config.options.searchWithinEnabled, false)) {\r\n return false;\r\n }\r\n if (!this.helper.getSearchService()) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n Extension.prototype.isPagingSettingEnabled = function () {\r\n if (this.helper.isPagingAvailable()) {\r\n return this.getSettings().pagingEnabled;\r\n }\r\n return false;\r\n };\r\n Extension.prototype.getNextPageIndex = function (canvasIndex) {\r\n if (canvasIndex === void 0) { canvasIndex = this.helper.canvasIndex; }\r\n var index;\r\n if (this.isPagingSettingEnabled()) {\r\n var indices = this.getPagedIndices(canvasIndex);\r\n if (this.helper.isRightToLeft()) {\r\n index = indices[0] + 1;\r\n }\r\n else {\r\n index = indices[indices.length - 1] + 1;\r\n }\r\n }\r\n else {\r\n index = canvasIndex + 1;\r\n }\r\n if (index > this.helper.getTotalCanvases() - 1) {\r\n return -1;\r\n }\r\n return index;\r\n };\r\n Extension.prototype.getAutoCompleteService = function () {\r\n var service = this.helper.getSearchService();\r\n if (!service)\r\n return null;\r\n return service.getService(vocabulary_1.ServiceProfile.SEARCH_1_AUTO_COMPLETE) || service.getService(vocabulary_1.ServiceProfile.SEARCH_0_AUTO_COMPLETE);\r\n };\r\n Extension.prototype.getAutoCompleteUri = function () {\r\n var service = this.getAutoCompleteService();\r\n if (!service)\r\n return null;\r\n return service.id + '?q={0}';\r\n };\r\n Extension.prototype.getSearchServiceUri = function () {\r\n var service = this.helper.getSearchService();\r\n if (!service)\r\n return null;\r\n var uri = service.id;\r\n uri = uri + \"?q={0}\";\r\n return uri;\r\n };\r\n Extension.prototype.search = function (terms) {\r\n var _this = this;\r\n if (this.isAnnotating)\r\n return;\r\n this.isAnnotating = true;\r\n // clear search results\r\n this.annotations = [];\r\n var that = this;\r\n // searching\r\n var searchUri = this.getSearchServiceUri();\r\n if (!searchUri)\r\n return;\r\n searchUri = Utils.Strings.format(searchUri, encodeURIComponent(terms));\r\n this.getSearchResults(searchUri, terms, this.annotations, function (annotations) {\r\n that.isAnnotating = false;\r\n if (annotations.length) {\r\n that.annotate(annotations, terms);\r\n }\r\n else {\r\n that.showMessage(that.data.config.modules.genericDialogue.content.noMatches, function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.ANNOTATIONS_EMPTY);\r\n });\r\n }\r\n });\r\n };\r\n Extension.prototype.getSearchResults = function (searchUri, terms, searchResults, cb) {\r\n var _this = this;\r\n $.getJSON(searchUri, function (results) {\r\n if (results.resources && results.resources.length) {\r\n searchResults = searchResults.concat(_this.parseAnnotationList(results));\r\n }\r\n if (results.next) {\r\n _this.getSearchResults(results.next, terms, searchResults, cb);\r\n }\r\n else {\r\n cb(searchResults);\r\n }\r\n });\r\n };\r\n Extension.prototype.parseAnnotationList = function (annotations) {\r\n var parsed = [];\r\n var _loop_1 = function (i) {\r\n var resource = annotations.resources[i];\r\n var canvasIndex = this_1.helper.getCanvasIndexById(resource.on.match(/(.*)#/)[1]);\r\n var annotationGroup = new manifold_1.AnnotationGroup(resource, canvasIndex);\r\n var match = parsed.en().where(function (x) { return x.canvasIndex === annotationGroup.canvasIndex; }).first();\r\n // if there's already an annotation for the canvas index, add a rect to it, otherwise create a new AnnotationGroup\r\n if (match) {\r\n match.addRect(resource);\r\n }\r\n else {\r\n parsed.push(annotationGroup);\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0; i < annotations.resources.length; i++) {\r\n _loop_1(i);\r\n }\r\n // sort by canvasIndex\r\n parsed.sort(function (a, b) {\r\n return a.canvasIndex - b.canvasIndex;\r\n });\r\n return parsed;\r\n };\r\n Extension.prototype.getAnnotationRects = function () {\r\n if (this.annotations) {\r\n return this.annotations.en().selectMany(function (x) { return x.rects; }).toArray();\r\n }\r\n return [];\r\n };\r\n Extension.prototype.getCurrentAnnotationRectIndex = function () {\r\n var annotationRects = this.getAnnotationRects();\r\n if (this.currentAnnotationRect) {\r\n return annotationRects.indexOf(this.currentAnnotationRect);\r\n }\r\n return -1;\r\n };\r\n Extension.prototype.getTotalAnnotationRects = function () {\r\n var annotationRects = this.getAnnotationRects();\r\n return annotationRects.length;\r\n };\r\n Extension.prototype.isFirstAnnotationRect = function () {\r\n return this.getCurrentAnnotationRectIndex() === 0;\r\n };\r\n Extension.prototype.getLastAnnotationRectIndex = function () {\r\n return this.getTotalAnnotationRects() - 1;\r\n };\r\n Extension.prototype.getPagedIndices = function (canvasIndex) {\r\n if (canvasIndex === void 0) { canvasIndex = this.helper.canvasIndex; }\r\n var indices = [];\r\n // if it's a continuous manifest, get all resources.\r\n if (this.helper.isContinuous()) {\r\n indices = $.map(this.helper.getCanvases(), function (c, index) {\r\n return index;\r\n });\r\n }\r\n else {\r\n if (!this.isPagingSettingEnabled()) {\r\n indices.push(this.helper.canvasIndex);\r\n }\r\n else {\r\n if (this.helper.isFirstCanvas(canvasIndex) || (this.helper.isLastCanvas(canvasIndex) && this.helper.isTotalCanvasesEven())) {\r\n indices = [canvasIndex];\r\n }\r\n else if (canvasIndex % 2) {\r\n indices = [canvasIndex, canvasIndex + 1];\r\n }\r\n else {\r\n indices = [canvasIndex - 1, canvasIndex];\r\n }\r\n if (this.helper.isRightToLeft()) {\r\n indices = indices.reverse();\r\n }\r\n }\r\n }\r\n return indices;\r\n };\r\n return Extension;\r\n }(BaseExtension_1.BaseExtension));\r\n exports.Extension = Extension;\r\n});\r\n//# sourceMappingURL=Extension.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-pdf-extension/DownloadDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/DownloadDialogue\"], function (require, exports, DownloadDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var DownloadDialogue = /** @class */ (function (_super) {\r\n __extends(DownloadDialogue, _super);\r\n function DownloadDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n DownloadDialogue.prototype.create = function () {\r\n this.setConfig('downloadDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n DownloadDialogue.prototype.open = function (triggerButton) {\r\n _super.prototype.open.call(this, triggerButton);\r\n this.addEntireFileDownloadOptions();\r\n if (!this.$downloadOptions.find('li:visible').length) {\r\n this.$noneAvailable.show();\r\n }\r\n else {\r\n // select first option.\r\n this.$noneAvailable.hide();\r\n }\r\n this.resize();\r\n };\r\n DownloadDialogue.prototype.isDownloadOptionAvailable = function (option) {\r\n return _super.prototype.isDownloadOptionAvailable.call(this, option);\r\n };\r\n return DownloadDialogue;\r\n }(DownloadDialogue_1.DownloadDialogue));\r\n exports.DownloadDialogue = DownloadDialogue;\r\n});\r\n//# sourceMappingURL=DownloadDialogue.js.map\n", "define('extensions/uv-pdf-extension/Events',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Events = /** @class */ (function () {\r\n function Events() {\r\n }\r\n Events.namespace = 'pdfExtension.';\r\n Events.PDF_LOADED = Events.namespace + 'pdfLoaded';\r\n Events.PAGE_INDEX_CHANGED = Events.namespace + 'pageIndexChanged';\r\n Events.SEARCH = Events.namespace + 'search';\r\n return Events;\r\n }());\r\n exports.Events = Events;\r\n});\r\n//# sourceMappingURL=Events.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-pdfcenterpanel-module/PDFCenterPanel',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/CenterPanel\", \"../../extensions/uv-pdf-extension/Events\"], function (require, exports, BaseEvents_1, CenterPanel_1, Events_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var PDFCenterPanel = /** @class */ (function (_super) {\r\n __extends(PDFCenterPanel, _super);\r\n function PDFCenterPanel($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this._maxScale = 5;\r\n _this._minScale = 0.7;\r\n _this._nextButtonEnabled = false;\r\n _this._pageIndex = 1;\r\n _this._pageIndexPending = null;\r\n _this._pageRendering = false;\r\n _this._pdfDoc = null;\r\n _this._prevButtonEnabled = false;\r\n _this._scale = 0.7;\r\n return _this;\r\n }\r\n PDFCenterPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('pdfCenterPanel');\r\n _super.prototype.create.call(this);\r\n this._$pdfContainer = $('<div class=\"pdfContainer\"></div>');\r\n this._$canvas = $('<canvas></canvas>');\r\n this._$spinner = $('<div class=\"spinner\"></div>');\r\n this._canvas = this._$canvas[0];\r\n this._ctx = this._canvas.getContext('2d');\r\n this._$prevButton = $('<div class=\"btn prev\" tabindex=\"0\"></div>');\r\n this._$nextButton = $('<div class=\"btn next\" tabindex=\"0\"></div>');\r\n this._$zoomInButton = $('<div class=\"btn zoomIn\" tabindex=\"0\"></div>');\r\n this._$zoomOutButton = $('<div class=\"btn zoomOut\" tabindex=\"0\"></div>');\r\n // Only attach PDF controls if we're using PDF.js; they have no meaning in\r\n // PDFObject. However, we still create the objects above so that references\r\n // to them do not cause errors (simpler than putting usePdfJs checks all over):\r\n if (Utils.Bools.getBool(this.extension.data.config.options.usePdfJs, false)) {\r\n this.$content.append(this._$spinner);\r\n this.$content.append(this._$prevButton);\r\n this.$content.append(this._$nextButton);\r\n this.$content.append(this._$zoomInButton);\r\n this.$content.append(this._$zoomOutButton);\r\n }\r\n this._$pdfContainer.append(this._$canvas);\r\n this.$content.prepend(this._$pdfContainer);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE, function (resources) {\r\n _this.openMedia(resources);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.FIRST, function () {\r\n if (!_this._pdfDoc) {\r\n return;\r\n }\r\n _this._pageIndex = 1;\r\n _this._queueRenderPage(_this._pageIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.PREV, function () {\r\n if (!_this._pdfDoc) {\r\n return;\r\n }\r\n if (_this._pageIndex <= 1) {\r\n return;\r\n }\r\n _this._pageIndex--;\r\n _this._queueRenderPage(_this._pageIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.NEXT, function () {\r\n if (!_this._pdfDoc) {\r\n return;\r\n }\r\n if (_this._pageIndex >= _this._pdfDoc.numPages) {\r\n return;\r\n }\r\n _this._pageIndex++;\r\n _this._queueRenderPage(_this._pageIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LAST, function () {\r\n if (!_this._pdfDoc) {\r\n return;\r\n }\r\n _this._pageIndex = _this._pdfDoc.numPages;\r\n _this._queueRenderPage(_this._pageIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function () {\r\n if (!_this._pdfDoc) {\r\n return;\r\n }\r\n _this._pageIndex = 1;\r\n _this._queueRenderPage(_this._pageIndex);\r\n });\r\n this.component.subscribe(Events_1.Events.SEARCH, function (pageIndex) {\r\n if (!_this._pdfDoc) {\r\n return;\r\n }\r\n if (pageIndex < 1 || pageIndex > _this._pdfDoc.numPages) {\r\n return;\r\n }\r\n _this._pageIndex = pageIndex;\r\n _this._queueRenderPage(_this._pageIndex);\r\n });\r\n this._$prevButton.onPressed(function (e) {\r\n e.preventDefault();\r\n if (!_this._prevButtonEnabled)\r\n return;\r\n _this.component.publish(BaseEvents_1.BaseEvents.PREV);\r\n });\r\n this.disablePrevButton();\r\n this._$nextButton.onPressed(function (e) {\r\n e.preventDefault();\r\n if (!_this._nextButtonEnabled)\r\n return;\r\n _this.component.publish(BaseEvents_1.BaseEvents.NEXT);\r\n });\r\n this.disableNextButton();\r\n this._$zoomInButton.onPressed(function (e) {\r\n e.preventDefault();\r\n var newScale = _this._scale + 0.5;\r\n if (newScale < _this._maxScale) {\r\n _this._scale = newScale;\r\n }\r\n else {\r\n _this._scale = _this._maxScale;\r\n }\r\n _this._render(_this._pageIndex);\r\n });\r\n this._$zoomOutButton.onPressed(function (e) {\r\n e.preventDefault();\r\n var newScale = _this._scale - 0.5;\r\n if (newScale > _this._minScale) {\r\n _this._scale = newScale;\r\n }\r\n else {\r\n _this._scale = _this._minScale;\r\n }\r\n _this._render(_this._pageIndex);\r\n });\r\n };\r\n PDFCenterPanel.prototype.disablePrevButton = function () {\r\n this._prevButtonEnabled = false;\r\n this._$prevButton.addClass('disabled');\r\n };\r\n PDFCenterPanel.prototype.enablePrevButton = function () {\r\n this._prevButtonEnabled = true;\r\n this._$prevButton.removeClass('disabled');\r\n };\r\n PDFCenterPanel.prototype.hidePrevButton = function () {\r\n this.disablePrevButton();\r\n this._$prevButton.hide();\r\n };\r\n PDFCenterPanel.prototype.showPrevButton = function () {\r\n this.enablePrevButton();\r\n this._$prevButton.show();\r\n };\r\n PDFCenterPanel.prototype.disableNextButton = function () {\r\n this._nextButtonEnabled = false;\r\n this._$nextButton.addClass('disabled');\r\n };\r\n PDFCenterPanel.prototype.enableNextButton = function () {\r\n this._nextButtonEnabled = true;\r\n this._$nextButton.removeClass('disabled');\r\n };\r\n PDFCenterPanel.prototype.hideNextButton = function () {\r\n this.disableNextButton();\r\n this._$nextButton.hide();\r\n };\r\n PDFCenterPanel.prototype.showNextButton = function () {\r\n this.enableNextButton();\r\n this._$nextButton.show();\r\n };\r\n PDFCenterPanel.prototype.openMedia = function (resources) {\r\n var _this = this;\r\n this._$spinner.show();\r\n this.extension.getExternalResources(resources).then(function () {\r\n var mediaUri = null;\r\n var canvas = _this.extension.helper.getCurrentCanvas();\r\n var formats = _this.extension.getMediaFormats(canvas);\r\n var pdfUri = canvas.id;\r\n if (formats && formats.length) {\r\n mediaUri = formats[0].id;\r\n }\r\n else {\r\n mediaUri = canvas.id;\r\n }\r\n if (!Utils.Bools.getBool(_this.extension.data.config.options.usePdfJs, false)) {\r\n window.PDFObject.embed(pdfUri, '.pdfContainer', { id: \"PDF\" });\r\n }\r\n else {\r\n PDFJS.disableWorker = true;\r\n var parameter = {\r\n url: mediaUri,\r\n withCredentials: canvas.externalResource.isAccessControlled()\r\n };\r\n PDFJS.getDocument(parameter).then(function (pdfDoc) {\r\n _this._pdfDoc = pdfDoc;\r\n _this._render(_this._pageIndex);\r\n _this.component.publish(Events_1.Events.PDF_LOADED, pdfDoc);\r\n _this._$spinner.hide();\r\n });\r\n }\r\n });\r\n };\r\n PDFCenterPanel.prototype._render = function (num) {\r\n var _this = this;\r\n if (!Utils.Bools.getBool(this.extension.data.config.options.usePdfJs, false)) {\r\n return;\r\n }\r\n this._pageRendering = true;\r\n this._$zoomOutButton.enable();\r\n this._$zoomInButton.enable();\r\n //disable zoom if not possible\r\n var lowScale = this._scale - 0.5;\r\n var highScale = this._scale + 0.5;\r\n if (lowScale < this._minScale) {\r\n this._$zoomOutButton.disable();\r\n }\r\n if (highScale > this._maxScale) {\r\n this._$zoomInButton.disable();\r\n }\r\n //this._pdfDoc.getPage(num).then((page: any) => {\r\n this._pdfDoc.getPage(num).then(function (page) {\r\n if (_this._renderTask) {\r\n _this._renderTask.cancel();\r\n }\r\n // how to fit to the available space\r\n // const height: number = this.$content.height();\r\n // this._canvas.height = height;\r\n // this._viewport = page.getViewport(this._canvas.height / page.getViewport(1.0).height);\r\n // const width: number = this._viewport.width;\r\n // this._canvas.width = width;\r\n // this._$canvas.css({\r\n // left: (this.$content.width() / 2) - (width / 2)\r\n // });\r\n // scale viewport\r\n _this._viewport = page.getViewport(_this._scale);\r\n _this._canvas.height = _this._viewport.height;\r\n _this._canvas.width = _this._viewport.width;\r\n // get divisible number between canvas height and content height\r\n var divisible_amount = _this._canvas.height / _this.$content.height();\r\n // create a variable for the new canvas height.\r\n // (canvas height divided by our divisible_amount) multiply by the viewport scale\r\n var canvas_height = (_this._canvas.height / divisible_amount) * _this._viewport.scale;\r\n // if canvas height is smaller than our content height\r\n // use the content hight instead\r\n if (canvas_height < _this.$content.height()) {\r\n canvas_height = _this.$content.height();\r\n }\r\n // set the canvas height with CSS\r\n _this._$canvas.css({\r\n height: canvas_height\r\n });\r\n // Render PDF page into canvas context\r\n var renderContext = {\r\n canvasContext: _this._ctx,\r\n viewport: _this._viewport\r\n };\r\n _this._renderTask = page.render(renderContext);\r\n // Wait for rendering to finish\r\n _this._renderTask.promise.then(function () {\r\n _this.component.publish(Events_1.Events.PAGE_INDEX_CHANGED, _this._pageIndex);\r\n _this._pageRendering = false;\r\n if (_this._pageIndexPending !== null) {\r\n // New page rendering is pending\r\n _this._render(_this._pageIndexPending);\r\n _this._pageIndexPending = null;\r\n }\r\n if (_this._pageIndex === 1) {\r\n _this.disablePrevButton();\r\n }\r\n else {\r\n _this.enablePrevButton();\r\n }\r\n if (_this._pageIndex === _this._pdfDoc.numPages) {\r\n _this.disableNextButton();\r\n }\r\n else {\r\n _this.enableNextButton();\r\n }\r\n }).catch(function (err) {\r\n //console.log(err);\r\n });\r\n });\r\n };\r\n PDFCenterPanel.prototype._queueRenderPage = function (num) {\r\n if (this._pageRendering) {\r\n this._pageIndexPending = num;\r\n }\r\n else {\r\n this._render(num);\r\n }\r\n };\r\n PDFCenterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n this._$pdfContainer.width(this.$content.width());\r\n this._$pdfContainer.height(this.$content.height());\r\n this._$spinner.css('top', (this.$content.height() / 2) - (this._$spinner.height() / 2));\r\n this._$spinner.css('left', (this.$content.width() / 2) - (this._$spinner.width() / 2));\r\n this._$prevButton.css({\r\n top: (this.$content.height() - this._$prevButton.height()) / 2,\r\n left: this._$prevButton.horizontalMargins()\r\n });\r\n this._$nextButton.css({\r\n top: (this.$content.height() - this._$nextButton.height()) / 2,\r\n left: this.$content.width() - (this._$nextButton.width() + this._$nextButton.horizontalMargins())\r\n });\r\n if (!this._viewport) {\r\n return;\r\n }\r\n this._render(this._pageIndex);\r\n };\r\n return PDFCenterPanel;\r\n }(CenterPanel_1.CenterPanel));\r\n exports.PDFCenterPanel = PDFCenterPanel;\r\n});\r\n//# sourceMappingURL=PDFCenterPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-pdfheaderpanel-module/PDFHeaderPanel',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../../extensions/uv-pdf-extension/Events\", \"../uv-shared-module/HeaderPanel\"], function (require, exports, BaseEvents_1, Events_1, HeaderPanel_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var PDFHeaderPanel = /** @class */ (function (_super) {\r\n __extends(PDFHeaderPanel, _super);\r\n function PDFHeaderPanel($element) {\r\n var _this = _super.call(this, $element) || this;\r\n _this.firstButtonEnabled = false;\r\n _this.lastButtonEnabled = false;\r\n _this.nextButtonEnabled = false;\r\n _this.prevButtonEnabled = false;\r\n _this._pageIndex = 0;\r\n _this._pdfDoc = null;\r\n return _this;\r\n }\r\n PDFHeaderPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('pdfHeaderPanel');\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(Events_1.Events.PAGE_INDEX_CHANGED, function (pageIndex) {\r\n _this._pageIndex = pageIndex;\r\n _this.render();\r\n });\r\n this.component.subscribe(Events_1.Events.PDF_LOADED, function (pdfDoc) {\r\n _this._pdfDoc = pdfDoc;\r\n });\r\n this.$prevOptions = $('<div class=\"prevOptions\"></div>');\r\n this.$centerOptions.append(this.$prevOptions);\r\n this.$firstButton = $(\"\\n <button class=\\\"btn imageBtn first\\\" tabindex=\\\"0\\\" title=\\\"\" + this.content.first + \"\\\">\\n <i class=\\\"uv-icon-first\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.first + \"\\n </button>\\n \");\r\n this.$prevOptions.append(this.$firstButton);\r\n this.$firstButton.disable();\r\n this.$prevButton = $(\"\\n <button class=\\\"btn imageBtn prev\\\" tabindex=\\\"0\\\" title=\\\"\" + this.content.previous + \"\\\">\\n <i class=\\\"uv-icon-prev\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.previous + \"\\n </button>\\n \");\r\n this.$prevOptions.append(this.$prevButton);\r\n this.$prevButton.disable();\r\n this.$search = $('<div class=\"search\"></div>');\r\n this.$centerOptions.append(this.$search);\r\n this.$searchText = $('<input class=\"searchText\" maxlength=\"50\" type=\"text\" tabindex=\"0\" aria-label=\"' + this.content.pageSearchLabel + '\"/>');\r\n this.$search.append(this.$searchText);\r\n this.$total = $('<span class=\"total\"></span>');\r\n this.$search.append(this.$total);\r\n this.$searchButton = $('<a class=\"go btn btn-primary\" tabindex=\"0\">' + this.content.go + '</a>');\r\n this.$search.append(this.$searchButton);\r\n this.$searchButton.disable();\r\n this.$nextOptions = $('<div class=\"nextOptions\"></div>');\r\n this.$centerOptions.append(this.$nextOptions);\r\n this.$nextButton = $(\"\\n <button class=\\\"btn imageBtn next\\\" tabindex=\\\"0\\\" title=\\\"\" + this.content.next + \"\\\">\\n <i class=\\\"uv-icon-next\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.next + \"\\n </button>\\n \");\r\n this.$nextOptions.append(this.$nextButton);\r\n this.$nextButton.disable();\r\n this.$lastButton = $(\"\\n <button class=\\\"btn imageBtn last\\\" tabindex=\\\"0\\\" title=\\\"\" + this.content.last + \"\\\">\\n <i class=\\\"uv-icon-last\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.last + \"\\n </button>\\n \");\r\n this.$nextOptions.append(this.$lastButton);\r\n this.$lastButton.disable();\r\n // ui event handlers.\r\n this.$firstButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.FIRST);\r\n });\r\n this.$prevButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.PREV);\r\n });\r\n this.$nextButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.NEXT);\r\n });\r\n this.$lastButton.onPressed(function () {\r\n _this.component.publish(BaseEvents_1.BaseEvents.LAST);\r\n });\r\n this.$searchText.onEnter(function () {\r\n _this.$searchText.blur();\r\n _this.search(_this.$searchText.val());\r\n });\r\n this.$searchText.click(function () {\r\n $(this).select();\r\n });\r\n this.$searchButton.onPressed(function () {\r\n _this.search(_this.$searchText.val());\r\n });\r\n };\r\n PDFHeaderPanel.prototype.render = function () {\r\n // check if the book has more than one page, otherwise hide prev/next options.\r\n if (this._pdfDoc.numPages === 1) {\r\n this.$centerOptions.hide();\r\n }\r\n else {\r\n this.$centerOptions.show();\r\n }\r\n this.$searchText.val(this._pageIndex);\r\n var of = this.content.of;\r\n this.$total.html(Utils.Strings.format(of, this._pdfDoc.numPages.toString()));\r\n this.$searchButton.enable();\r\n if (this._pageIndex === 1) {\r\n this.$firstButton.disable();\r\n this.$prevButton.disable();\r\n }\r\n else {\r\n this.$firstButton.enable();\r\n this.$prevButton.enable();\r\n }\r\n if (this._pageIndex === this._pdfDoc.numPages) {\r\n this.$lastButton.disable();\r\n this.$nextButton.disable();\r\n }\r\n else {\r\n this.$lastButton.enable();\r\n this.$nextButton.enable();\r\n }\r\n };\r\n PDFHeaderPanel.prototype.search = function (value) {\r\n if (!value) {\r\n this.extension.showMessage(this.content.emptyValue);\r\n return;\r\n }\r\n var index = parseInt(this.$searchText.val(), 10);\r\n if (isNaN(index)) {\r\n this.extension.showMessage(this.extension.data.config.modules.genericDialogue.content.invalidNumber);\r\n return;\r\n }\r\n this.component.publish(Events_1.Events.SEARCH, index);\r\n };\r\n PDFHeaderPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return PDFHeaderPanel;\r\n }(HeaderPanel_1.HeaderPanel));\r\n exports.PDFHeaderPanel = PDFHeaderPanel;\r\n});\r\n//# sourceMappingURL=PDFHeaderPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-pdf-extension/SettingsDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/SettingsDialogue\"], function (require, exports, SettingsDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SettingsDialogue = /** @class */ (function (_super) {\r\n __extends(SettingsDialogue, _super);\r\n function SettingsDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n SettingsDialogue.prototype.create = function () {\r\n this.setConfig('settingsDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n return SettingsDialogue;\r\n }(SettingsDialogue_1.SettingsDialogue));\r\n exports.SettingsDialogue = SettingsDialogue;\r\n});\r\n//# sourceMappingURL=SettingsDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-pdf-extension/ShareDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/ShareDialogue\"], function (require, exports, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ShareDialogue = /** @class */ (function (_super) {\r\n __extends(ShareDialogue, _super);\r\n function ShareDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n ShareDialogue.prototype.create = function () {\r\n this.setConfig('shareDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n ShareDialogue.prototype.update = function () {\r\n _super.prototype.update.call(this);\r\n this.code = this.extension.getEmbedScript(this.options.embedTemplate, this.currentWidth, this.currentHeight);\r\n this.$code.val(this.code);\r\n };\r\n ShareDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return ShareDialogue;\r\n }(ShareDialogue_1.ShareDialogue));\r\n exports.ShareDialogue = ShareDialogue;\r\n});\r\n//# sourceMappingURL=ShareDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-pdf-extension/Extension',[\"require\", \"exports\", \"@iiif/vocabulary\", \"manifesto.js\", \"../../modules/uv-shared-module/BaseEvents\", \"../../modules/uv-shared-module/BaseExtension\", \"../../modules/uv-shared-module/Bookmark\", \"./DownloadDialogue\", \"../../modules/uv-shared-module/FooterPanel\", \"../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel\", \"../../modules/uv-pdfcenterpanel-module/PDFCenterPanel\", \"../../modules/uv-pdfheaderpanel-module/PDFHeaderPanel\", \"../../modules/uv-resourcesleftpanel-module/ResourcesLeftPanel\", \"./SettingsDialogue\", \"./ShareDialogue\"], function (require, exports, vocabulary_1, manifesto_js_1, BaseEvents_1, BaseExtension_1, Bookmark_1, DownloadDialogue_1, FooterPanel_1, MoreInfoRightPanel_1, PDFCenterPanel_1, PDFHeaderPanel_1, ResourcesLeftPanel_1, SettingsDialogue_1, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Extension = /** @class */ (function (_super) {\r\n __extends(Extension, _super);\r\n function Extension() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Extension.prototype.create = function () {\r\n var _this = this;\r\n requirejs.config({ paths: { 'pdfjs-dist/build/pdf.combined': this.data.root + '/lib/' + 'pdf.combined' } });\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this.viewCanvas(canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.THUMB_SELECTED, function (thumb) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, thumb.index);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_EXPAND_FULL_START, function () {\r\n _this.shell.$centerPanel.hide();\r\n _this.shell.$rightPanel.hide();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.LEFTPANEL_COLLAPSE_FULL_FINISH, function () {\r\n _this.shell.$centerPanel.show();\r\n _this.shell.$rightPanel.show();\r\n _this.resize();\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.SHOW_OVERLAY, function () {\r\n if (_this.IsOldIE()) {\r\n _this.centerPanel.$element.hide();\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.HIDE_OVERLAY, function () {\r\n if (_this.IsOldIE()) {\r\n _this.centerPanel.$element.show();\r\n }\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.EXIT_FULLSCREEN, function () {\r\n setTimeout(function () {\r\n _this.resize();\r\n }, 10); // allow time to exit full screen, then resize\r\n });\r\n };\r\n Extension.prototype.render = function () {\r\n _super.prototype.render.call(this);\r\n };\r\n Extension.prototype.IsOldIE = function () {\r\n var browser = window.browserDetect.browser;\r\n var version = window.browserDetect.version;\r\n if (browser === 'Explorer' && version <= 9)\r\n return true;\r\n return false;\r\n };\r\n Extension.prototype.isHeaderPanelEnabled = function () {\r\n return _super.prototype.isHeaderPanelEnabled.call(this) && Utils.Bools.getBool(this.data.config.options.usePdfJs, true);\r\n };\r\n Extension.prototype.createModules = function () {\r\n _super.prototype.createModules.call(this);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel = new PDFHeaderPanel_1.PDFHeaderPanel(this.shell.$headerPanel);\r\n }\r\n else {\r\n this.shell.$headerPanel.hide();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel = new ResourcesLeftPanel_1.ResourcesLeftPanel(this.shell.$leftPanel);\r\n }\r\n this.centerPanel = new PDFCenterPanel_1.PDFCenterPanel(this.shell.$centerPanel);\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel = new MoreInfoRightPanel_1.MoreInfoRightPanel(this.shell.$rightPanel);\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel = new FooterPanel_1.FooterPanel(this.shell.$footerPanel);\r\n }\r\n else {\r\n this.shell.$footerPanel.hide();\r\n }\r\n this.$downloadDialogue = $('<div class=\"overlay download\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$downloadDialogue);\r\n this.downloadDialogue = new DownloadDialogue_1.DownloadDialogue(this.$downloadDialogue);\r\n this.$shareDialogue = $('<div class=\"overlay share\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$shareDialogue);\r\n this.shareDialogue = new ShareDialogue_1.ShareDialogue(this.$shareDialogue);\r\n this.$settingsDialogue = $('<div class=\"overlay settings\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$settingsDialogue);\r\n this.settingsDialogue = new SettingsDialogue_1.SettingsDialogue(this.$settingsDialogue);\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel.init();\r\n }\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel.init();\r\n }\r\n };\r\n Extension.prototype.bookmark = function () {\r\n _super.prototype.bookmark.call(this);\r\n var canvas = this.helper.getCurrentCanvas();\r\n var bookmark = new Bookmark_1.Bookmark();\r\n bookmark.index = this.helper.canvasIndex;\r\n bookmark.label = manifesto_js_1.LanguageMap.getValue(canvas.getLabel());\r\n bookmark.thumb = canvas.getProperty('thumbnail');\r\n bookmark.title = this.helper.getLabel();\r\n bookmark.trackingLabel = window.trackingLabel;\r\n bookmark.type = vocabulary_1.ExternalResourceType.DOCUMENT.toString();\r\n this.fire(BaseEvents_1.BaseEvents.BOOKMARK, bookmark);\r\n };\r\n Extension.prototype.dependencyLoaded = function (index, dep) {\r\n if (index === 0) {\r\n window.PDFObject = dep;\r\n }\r\n };\r\n Extension.prototype.getEmbedScript = function (template, width, height) {\r\n //const configUri = this.data.config.uri || '';\r\n //const script = String.format(template, this.getSerializedLocales(), configUri, this.helper.iiifResourceUri, this.helper.collectionIndex, this.helper.manifestIndex, this.helper.sequenceIndex, this.helper.canvasIndex, width, height, this.data.embedScriptUri);\r\n var appUri = this.getAppUri();\r\n var iframeSrc = appUri + \"#?manifest=\" + this.helper.manifestUri + \"&c=\" + this.helper.collectionIndex + \"&m=\" + this.helper.manifestIndex + \"&s=\" + this.helper.sequenceIndex + \"&cv=\" + this.helper.canvasIndex;\r\n var script = Utils.Strings.format(template, iframeSrc, width.toString(), height.toString());\r\n return script;\r\n };\r\n return Extension;\r\n }(BaseExtension_1.BaseExtension));\r\n exports.Extension = Extension;\r\n});\r\n//# sourceMappingURL=Extension.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-virtex-extension/DownloadDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/DownloadDialogue\"], function (require, exports, DownloadDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var DownloadDialogue = /** @class */ (function (_super) {\r\n __extends(DownloadDialogue, _super);\r\n function DownloadDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n DownloadDialogue.prototype.create = function () {\r\n this.setConfig('downloadDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n DownloadDialogue.prototype.open = function (triggerButton) {\r\n _super.prototype.open.call(this, triggerButton);\r\n this.addEntireFileDownloadOptions();\r\n this.updateNoneAvailable();\r\n this.resize();\r\n };\r\n DownloadDialogue.prototype.isDownloadOptionAvailable = function (option) {\r\n return _super.prototype.isDownloadOptionAvailable.call(this, option);\r\n };\r\n return DownloadDialogue;\r\n }(DownloadDialogue_1.DownloadDialogue));\r\n exports.DownloadDialogue = DownloadDialogue;\r\n});\r\n//# sourceMappingURL=DownloadDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-virtex-extension/SettingsDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/SettingsDialogue\"], function (require, exports, SettingsDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var SettingsDialogue = /** @class */ (function (_super) {\r\n __extends(SettingsDialogue, _super);\r\n function SettingsDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n SettingsDialogue.prototype.create = function () {\r\n this.setConfig('settingsDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n return SettingsDialogue;\r\n }(SettingsDialogue_1.SettingsDialogue));\r\n exports.SettingsDialogue = SettingsDialogue;\r\n});\r\n//# sourceMappingURL=SettingsDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-virtex-extension/ShareDialogue',[\"require\", \"exports\", \"../../modules/uv-dialogues-module/ShareDialogue\"], function (require, exports, ShareDialogue_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var ShareDialogue = /** @class */ (function (_super) {\r\n __extends(ShareDialogue, _super);\r\n function ShareDialogue($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n ShareDialogue.prototype.create = function () {\r\n this.setConfig('shareDialogue');\r\n _super.prototype.create.call(this);\r\n };\r\n ShareDialogue.prototype.update = function () {\r\n _super.prototype.update.call(this);\r\n this.code = this.extension.getEmbedScript(this.options.embedTemplate, this.currentWidth, this.currentHeight);\r\n this.$code.val(this.code);\r\n };\r\n ShareDialogue.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n };\r\n return ShareDialogue;\r\n }(ShareDialogue_1.ShareDialogue));\r\n exports.ShareDialogue = ShareDialogue;\r\n});\r\n//# sourceMappingURL=ShareDialogue.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('modules/uv-virtexcenterpanel-module/VirtexCenterPanel',[\"require\", \"exports\", \"../uv-shared-module/BaseEvents\", \"../uv-shared-module/CenterPanel\", \"../../Utils\"], function (require, exports, BaseEvents_1, CenterPanel_1, Utils_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var VirtexCenterPanel = /** @class */ (function (_super) {\r\n __extends(VirtexCenterPanel, _super);\r\n function VirtexCenterPanel($element) {\r\n return _super.call(this, $element) || this;\r\n }\r\n VirtexCenterPanel.prototype.create = function () {\r\n var _this = this;\r\n this.setConfig('virtexCenterPanel');\r\n _super.prototype.create.call(this);\r\n var that = this;\r\n this.component.subscribe(BaseEvents_1.BaseEvents.OPEN_EXTERNAL_RESOURCE, function (resources) {\r\n that.openMedia(resources);\r\n });\r\n this.$navigation = $('<div class=\"navigation\"></div>');\r\n this.$content.prepend(this.$navigation);\r\n this.$zoomInButton = $(\"\\n <button class=\\\"btn imageBtn zoomIn\\\" title=\\\"\" + this.content.zoomIn + \"\\\">\\n <i class=\\\"uv-icon-zoom-in\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.zoomIn + \"\\n </button>\\n \");\r\n this.$navigation.append(this.$zoomInButton);\r\n this.$zoomOutButton = $(\"\\n <button class=\\\"btn imageBtn zoomOut\\\" title=\\\"\" + this.content.zoomOut + \"\\\">\\n <i class=\\\"uv-icon-zoom-out\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.zoomOut + \"\\n </button>\\n \");\r\n this.$navigation.append(this.$zoomOutButton);\r\n this.$vrButton = $(\"\\n <button class=\\\"btn imageBtn vr\\\" title=\\\"\" + this.content.vr + \"\\\">\\n <i class=\\\"uv-icon-vr\\\" aria-hidden=\\\"true\\\"></i>\" + this.content.vr + \"\\n </button>\\n \");\r\n this.$navigation.append(this.$vrButton);\r\n this.$viewport = $('<div class=\"virtex\"></div>');\r\n this.$content.prepend(this.$viewport);\r\n this.title = this.extension.helper.getLabel();\r\n this.$zoomInButton.on('click', function (e) {\r\n e.preventDefault();\r\n if (_this.viewport) {\r\n _this.viewport.zoomIn();\r\n }\r\n });\r\n this.$zoomOutButton.on('click', function (e) {\r\n e.preventDefault();\r\n if (_this.viewport) {\r\n _this.viewport.zoomOut();\r\n }\r\n });\r\n this.$vrButton.on('click', function (e) {\r\n e.preventDefault();\r\n if (_this.viewport) {\r\n _this.viewport.toggleVR();\r\n }\r\n });\r\n if (!this._isVREnabled()) {\r\n this.$vrButton.hide();\r\n }\r\n };\r\n VirtexCenterPanel.prototype.openMedia = function (resources) {\r\n var _this = this;\r\n this.extension.getExternalResources(resources).then(function () {\r\n _this.$viewport.empty();\r\n var mediaUri = null;\r\n var canvas = _this.extension.helper.getCurrentCanvas();\r\n var formats = _this.extension.getMediaFormats(canvas);\r\n var resourceType = null;\r\n // default to threejs format.\r\n var fileType = new Virtex.FileType(\"application/vnd.threejs+json\");\r\n if (formats && formats.length) {\r\n mediaUri = formats[0].id;\r\n resourceType = formats[0].getFormat();\r\n }\r\n else {\r\n mediaUri = canvas.id;\r\n }\r\n if (resourceType) {\r\n fileType = new Virtex.FileType(resourceType.toString());\r\n }\r\n var isAndroid = navigator.userAgent.toLowerCase().indexOf(\"android\") > -1;\r\n _this.viewport = new Virtex.Viewport({\r\n target: _this.$viewport[0],\r\n data: {\r\n antialias: !isAndroid,\r\n file: mediaUri,\r\n fullscreenEnabled: false,\r\n type: fileType,\r\n showStats: _this.options.showStats\r\n }\r\n });\r\n if (_this.viewport) {\r\n _this.viewport.on('vravailable', function () {\r\n _this.$vrButton.show();\r\n }, false);\r\n _this.viewport.on('vrunavailable', function () {\r\n _this.$vrButton.hide();\r\n }, false);\r\n }\r\n _this.resize();\r\n });\r\n };\r\n VirtexCenterPanel.prototype._isVREnabled = function () {\r\n return (Utils.Bools.getBool(this.config.options.vrEnabled, false) && WEBVR.isAvailable());\r\n };\r\n VirtexCenterPanel.prototype.resize = function () {\r\n _super.prototype.resize.call(this);\r\n if (this.title) {\r\n this.$title.text(Utils_1.UVUtils.sanitize(this.title));\r\n }\r\n this.$viewport.width(this.$content.width());\r\n this.$viewport.height(this.$content.height());\r\n if (this.viewport) {\r\n this.viewport.resize();\r\n }\r\n };\r\n return VirtexCenterPanel;\r\n }(CenterPanel_1.CenterPanel));\r\n exports.VirtexCenterPanel = VirtexCenterPanel;\r\n});\r\n//# sourceMappingURL=VirtexCenterPanel.js.map\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('extensions/uv-virtex-extension/Extension',[\"require\", \"exports\", \"manifesto.js\", \"@iiif/vocabulary\", \"../../modules/uv-shared-module/BaseEvents\", \"../../modules/uv-shared-module/BaseExtension\", \"../../modules/uv-shared-module/Bookmark\", \"../../modules/uv-contentleftpanel-module/ContentLeftPanel\", \"./DownloadDialogue\", \"../../modules/uv-shared-module/FooterPanel\", \"../../modules/uv-shared-module/HeaderPanel\", \"../../modules/uv-moreinforightpanel-module/MoreInfoRightPanel\", \"./SettingsDialogue\", \"./ShareDialogue\", \"../../modules/uv-virtexcenterpanel-module/VirtexCenterPanel\"], function (require, exports, manifesto_js_1, vocabulary_1, BaseEvents_1, BaseExtension_1, Bookmark_1, ContentLeftPanel_1, DownloadDialogue_1, FooterPanel_1, HeaderPanel_1, MoreInfoRightPanel_1, SettingsDialogue_1, ShareDialogue_1, VirtexCenterPanel_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var Extension = /** @class */ (function (_super) {\r\n __extends(Extension, _super);\r\n function Extension() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Extension.prototype.create = function () {\r\n var _this = this;\r\n _super.prototype.create.call(this);\r\n this.component.subscribe(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, function (canvasIndex) {\r\n _this.viewCanvas(canvasIndex);\r\n });\r\n this.component.subscribe(BaseEvents_1.BaseEvents.THUMB_SELECTED, function (canvasIndex) {\r\n _this.component.publish(BaseEvents_1.BaseEvents.CANVAS_INDEX_CHANGED, canvasIndex);\r\n });\r\n };\r\n Extension.prototype.createModules = function () {\r\n _super.prototype.createModules.call(this);\r\n if (this.isHeaderPanelEnabled()) {\r\n this.headerPanel = new HeaderPanel_1.HeaderPanel(this.shell.$headerPanel);\r\n }\r\n else {\r\n this.shell.$headerPanel.hide();\r\n }\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel = new ContentLeftPanel_1.ContentLeftPanel(this.shell.$leftPanel);\r\n }\r\n this.centerPanel = new VirtexCenterPanel_1.VirtexCenterPanel(this.shell.$centerPanel);\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel = new MoreInfoRightPanel_1.MoreInfoRightPanel(this.shell.$rightPanel);\r\n }\r\n if (this.isFooterPanelEnabled()) {\r\n this.footerPanel = new FooterPanel_1.FooterPanel(this.shell.$footerPanel);\r\n }\r\n else {\r\n this.shell.$footerPanel.hide();\r\n }\r\n this.$downloadDialogue = $('<div class=\"overlay download\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$downloadDialogue);\r\n this.downloadDialogue = new DownloadDialogue_1.DownloadDialogue(this.$downloadDialogue);\r\n this.$shareDialogue = $('<div class=\"overlay share\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$shareDialogue);\r\n this.shareDialogue = new ShareDialogue_1.ShareDialogue(this.$shareDialogue);\r\n this.$settingsDialogue = $('<div class=\"overlay settings\" aria-hidden=\"true\"></div>');\r\n this.shell.$overlays.append(this.$settingsDialogue);\r\n this.settingsDialogue = new SettingsDialogue_1.SettingsDialogue(this.$settingsDialogue);\r\n if (this.isLeftPanelEnabled()) {\r\n this.leftPanel.init();\r\n }\r\n else {\r\n this.shell.$leftPanel.hide();\r\n }\r\n if (this.isRightPanelEnabled()) {\r\n this.rightPanel.init();\r\n }\r\n else {\r\n this.shell.$rightPanel.hide();\r\n }\r\n };\r\n Extension.prototype.render = function () {\r\n _super.prototype.render.call(this);\r\n };\r\n Extension.prototype.dependencyLoaded = function (index, dep) {\r\n if (index === 0) {\r\n window.THREE = dep; //https://github.com/mrdoob/three.js/issues/9602\r\n }\r\n };\r\n Extension.prototype.isLeftPanelEnabled = function () {\r\n return Utils.Bools.getBool(this.data.config.options.leftPanelEnabled, true)\r\n && (this.helper.isMultiCanvas() || this.helper.isMultiSequence());\r\n };\r\n Extension.prototype.bookmark = function () {\r\n _super.prototype.bookmark.call(this);\r\n var canvas = this.helper.getCurrentCanvas();\r\n var bookmark = new Bookmark_1.Bookmark();\r\n bookmark.index = this.helper.canvasIndex;\r\n bookmark.label = manifesto_js_1.LanguageMap.getValue(canvas.getLabel());\r\n bookmark.thumb = canvas.getProperty('thumbnail');\r\n bookmark.title = this.helper.getLabel();\r\n bookmark.trackingLabel = window.trackingLabel;\r\n bookmark.type = vocabulary_1.ExternalResourceType.PHYSICAL_OBJECT.toString();\r\n this.fire(BaseEvents_1.BaseEvents.BOOKMARK, bookmark);\r\n };\r\n Extension.prototype.getEmbedScript = function (template, width, height) {\r\n //const configUri: string = this.data.config.uri || '';\r\n //const script: string = String.format(template, this.getSerializedLocales(), configUri, this.helper.iiifResourceUri, this.helper.collectionIndex, this.helper.manifestIndex, this.helper.sequenceIndex, this.helper.canvasIndex, width, height, this.data.embedScriptUri);\r\n var appUri = this.getAppUri();\r\n var iframeSrc = appUri + \"#?manifest=\" + this.helper.manifestUri + \"&c=\" + this.helper.collectionIndex + \"&m=\" + this.helper.manifestIndex + \"&s=\" + this.helper.sequenceIndex + \"&cv=\" + this.helper.canvasIndex;\r\n return Utils.Strings.format(template, iframeSrc, width.toString(), height.toString());\r\n };\r\n return Extension;\r\n }(BaseExtension_1.BaseExtension));\r\n exports.Extension = Extension;\r\n});\r\n//# sourceMappingURL=Extension.js.map\n", "define('PubSub',[\"require\", \"exports\"], function (require, exports) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var PubSub = /** @class */ (function () {\r\n function PubSub() {\r\n this.events = {};\r\n }\r\n PubSub.prototype.publish = function (name, args) {\r\n var _this = this;\r\n var handlers = this.events[name];\r\n if (handlers === undefined)\r\n return;\r\n handlers.forEach(function (handler) {\r\n handler.call(_this, args);\r\n });\r\n };\r\n PubSub.prototype.subscribe = function (name, handler) {\r\n var handlers = this.events[name];\r\n if (handlers === undefined) {\r\n handlers = this.events[name] = [];\r\n }\r\n handlers.push(handler);\r\n };\r\n PubSub.prototype.unsubscribe = function (name, handler) {\r\n var handlers = this.events[name];\r\n if (handlers === undefined)\r\n return;\r\n var handlerIdx = handlers.indexOf(handler);\r\n handlers.splice(handlerIdx);\r\n };\r\n PubSub.prototype.dispose = function () {\r\n this.events = {};\r\n };\r\n return PubSub;\r\n }());\r\n exports.PubSub = PubSub;\r\n});\r\n//# sourceMappingURL=PubSub.js.map\n", "if (!Element.prototype.scrollIntoViewIfNeeded) {\r\n Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) {\r\n centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;\r\n var parent = this.parentNode, parentComputedStyle = window.getComputedStyle(parent, undefined), parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue(\"border-top-width\")), parentBorderLeftWidth = parseInt(parentComputedStyle.getPropertyValue(\"border-left-width\")), overTop = this.offsetTop - parent.offsetTop < parent.scrollTop, overBottom = this.offsetTop -\r\n parent.offsetTop +\r\n this.clientHeight -\r\n parentBorderTopWidth >\r\n parent.scrollTop + parent.clientHeight, overLeft = this.offsetLeft - parent.offsetLeft < parent.scrollLeft, overRight = this.offsetLeft -\r\n parent.offsetLeft +\r\n this.clientWidth -\r\n parentBorderLeftWidth >\r\n parent.scrollLeft + parent.clientWidth, alignWithTop = overTop && !overBottom;\r\n if ((overTop || overBottom) && centerIfNeeded) {\r\n parent.scrollTop =\r\n this.offsetTop -\r\n parent.offsetTop -\r\n parent.clientHeight / 2 -\r\n parentBorderTopWidth +\r\n this.clientHeight / 2;\r\n }\r\n if ((overLeft || overRight) && centerIfNeeded) {\r\n parent.scrollLeft =\r\n this.offsetLeft -\r\n parent.offsetLeft -\r\n parent.clientWidth / 2 -\r\n parentBorderLeftWidth +\r\n this.clientWidth / 2;\r\n }\r\n if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) {\r\n this.scrollIntoView(alignWithTop);\r\n }\r\n };\r\n}\r\n//# sourceMappingURL=Polyfills.js.map\ndefine(\"Polyfills\", function(){});\n\n", "var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\ndefine('UVComponent',[\"require\", \"exports\", \"@iiif/manifold\", \"@iiif/vocabulary\", \"./modules/uv-shared-module/BaseEvents\", \"./extensions/uv-av-extension/Extension\", \"./extensions/uv-default-extension/Extension\", \"./extensions/uv-ebook-extension/Extension\", \"./extensions/uv-mediaelement-extension/Extension\", \"./extensions/uv-seadragon-extension/Extension\", \"./extensions/uv-pdf-extension/Extension\", \"./extensions/uv-virtex-extension/Extension\", \"./Utils\", \"./PubSub\", \"./Polyfills\"], function (require, exports, manifold_1, vocabulary_1, BaseEvents_1, Extension_1, Extension_2, Extension_3, Extension_4, Extension_5, Extension_6, Extension_7, Utils_1, PubSub_1) {\r\n \"use strict\";\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n var UVComponent = /** @class */ (function (_super) {\r\n __extends(UVComponent, _super);\r\n function UVComponent(options) {\r\n var _this = _super.call(this, options) || this;\r\n _this.isFullScreen = false;\r\n _this._pubsub = new PubSub_1.PubSub();\r\n _this._init();\r\n _this._resize();\r\n return _this;\r\n }\r\n UVComponent.prototype._init = function () {\r\n var success = _super.prototype._init.call(this);\r\n if (!success) {\r\n console.error(\"UV failed to initialise\");\r\n }\r\n this._extensions = {};\r\n this._extensions[vocabulary_1.IIIFResourceType.CANVAS.toString()] = {\r\n type: Extension_5.Extension,\r\n name: 'uv-seadragon-extension'\r\n };\r\n this._extensions[vocabulary_1.ExternalResourceType.IMAGE.toString()] = {\r\n type: Extension_5.Extension,\r\n name: 'uv-seadragon-extension'\r\n };\r\n this._extensions[vocabulary_1.ExternalResourceType.MOVING_IMAGE.toString()] = {\r\n type: Extension_4.Extension,\r\n name: 'uv-mediaelement-extension'\r\n };\r\n this._extensions[vocabulary_1.ExternalResourceType.PHYSICAL_OBJECT.toString()] = {\r\n type: Extension_7.Extension,\r\n name: 'uv-virtex-extension'\r\n };\r\n this._extensions[\"Model\"] = {\r\n type: Extension_7.Extension,\r\n name: 'uv-virtex-extension'\r\n };\r\n this._extensions[vocabulary_1.ExternalResourceType.SOUND.toString()] = {\r\n type: Extension_4.Extension,\r\n name: 'uv-mediaelement-extension'\r\n };\r\n this._extensions[vocabulary_1.RenderingFormat.PDF.toString()] = {\r\n type: Extension_6.Extension,\r\n name: 'uv-pdf-extension'\r\n };\r\n // presentation 3\r\n this._extensions[vocabulary_1.MediaType.JPG.toString()] = {\r\n type: Extension_5.Extension,\r\n name: 'uv-seadragon-extension'\r\n };\r\n this._extensions[vocabulary_1.MediaType.PDF.toString()] = {\r\n type: Extension_6.Extension,\r\n name: 'uv-pdf-extension'\r\n };\r\n this._extensions[vocabulary_1.MediaType.VIDEO_MP4.toString()] = {\r\n type: Extension_1.Extension,\r\n name: 'uv-av-extension'\r\n };\r\n this._extensions[vocabulary_1.MediaType.WEBM.toString()] = {\r\n type: Extension_1.Extension,\r\n name: 'uv-av-extension'\r\n };\r\n this._extensions[vocabulary_1.MediaType.THREEJS.toString()] = {\r\n type: Extension_7.Extension,\r\n name: 'uv-virtex-extension'\r\n };\r\n this._extensions['model/gltf+json'] = {\r\n type: Extension_7.Extension,\r\n name: 'uv-virtex-extension'\r\n };\r\n this._extensions['model/gltf+json'] = {\r\n type: Extension_7.Extension,\r\n name: 'uv-virtex-extension'\r\n };\r\n this._extensions['model/gltf-binary'] = {\r\n type: Extension_7.Extension,\r\n name: 'uv-virtex-extension'\r\n };\r\n this._extensions['av'] = {\r\n type: Extension_1.Extension,\r\n name: 'uv-av-extension'\r\n };\r\n this._extensions['video'] = {\r\n type: Extension_1.Extension,\r\n name: 'uv-av-extension'\r\n };\r\n this._extensions['audio/mp3'] = {\r\n type: Extension_1.Extension,\r\n name: 'uv-av-extension'\r\n };\r\n this._extensions['audio/mp4'] = {\r\n type: Extension_1.Extension,\r\n name: 'uv-av-extension'\r\n };\r\n this._extensions['application/vnd.apple.mpegurl'] = {\r\n type: Extension_1.Extension,\r\n name: 'uv-av-extension'\r\n };\r\n this._extensions['application/dash+xml'] = {\r\n type: Extension_1.Extension,\r\n name: 'uv-av-extension'\r\n };\r\n this._extensions['application/epub+zip'] = {\r\n type: Extension_3.Extension,\r\n name: 'uv-ebook-extension'\r\n };\r\n this._extensions['application/oebps-package+xml'] = {\r\n type: Extension_3.Extension,\r\n name: 'uv-ebook-extension'\r\n };\r\n this._extensions['default'] = {\r\n type: Extension_2.Extension,\r\n name: 'uv-default-extension'\r\n };\r\n this.set(this.options.data);\r\n return success;\r\n };\r\n UVComponent.prototype.data = function () {\r\n return {\r\n annotations: undefined,\r\n root: \"./uv\",\r\n canvasIndex: 0,\r\n collectionIndex: undefined,\r\n config: undefined,\r\n configUri: undefined,\r\n embedded: false,\r\n iiifResourceUri: '',\r\n isLightbox: false,\r\n isReload: false,\r\n limitLocales: false,\r\n locales: [\r\n {\r\n name: 'en-GB'\r\n }\r\n ],\r\n manifestIndex: 0,\r\n rangeId: undefined,\r\n rotation: 0,\r\n sequenceIndex: 0,\r\n xywh: ''\r\n };\r\n };\r\n UVComponent.prototype.set = function (data) {\r\n // if this is the first set\r\n if (!this.extension) {\r\n if (!data.iiifResourceUri) {\r\n this._error(\"iiifResourceUri is required.\");\r\n return;\r\n }\r\n // remove '/' from root\r\n if (data.root && data.root.endsWith('/')) {\r\n data.root = data.root.substring(0, data.root.length - 1);\r\n }\r\n this._reload(data);\r\n }\r\n else {\r\n // changing any of these data properties forces the UV to reload.\r\n if (Utils_1.UVUtils.propertiesChanged(data, this.extension.data, ['collectionIndex', 'manifestIndex', 'config', 'configUri', 'domain', 'embedDomain', 'embedScriptUri', 'iiifResourceUri', 'isHomeDomain', 'isLightbox', 'isOnlyInstance', 'isReload', 'locales', 'root'])) {\r\n this.extension.data = Object.assign({}, this.extension.data, data);\r\n this._reload(this.extension.data);\r\n }\r\n else {\r\n // no need to reload, just update.\r\n this.extension.data = Object.assign({}, this.extension.data, data);\r\n this.extension.render();\r\n }\r\n }\r\n };\r\n UVComponent.prototype.get = function (key) {\r\n if (this.extension) {\r\n return this.extension.data[key];\r\n }\r\n };\r\n UVComponent.prototype.publish = function (event, args) {\r\n this._pubsub.publish(event, args);\r\n };\r\n UVComponent.prototype.subscribe = function (event, cb) {\r\n this._pubsub.subscribe(event, cb);\r\n };\r\n UVComponent.prototype._reload = function (data) {\r\n var _this = this;\r\n this._pubsub.dispose(); // remove any existing event listeners\r\n this.subscribe(BaseEvents_1.BaseEvents.RELOAD, function (data) {\r\n _this.fire(BaseEvents_1.BaseEvents.RELOAD, data);\r\n });\r\n var $elem = $(this.options.target);\r\n // empty the containing element\r\n $elem.empty();\r\n // add loading class\r\n $elem.addClass('loading');\r\n jQuery.support.cors = true;\r\n var that = this;\r\n manifold_1.loadManifest({\r\n manifestUri: data.iiifResourceUri,\r\n collectionIndex: data.collectionIndex,\r\n manifestIndex: data.manifestIndex || 0,\r\n sequenceIndex: data.sequenceIndex || 0,\r\n canvasIndex: data.canvasIndex || 0,\r\n rangeId: data.rangeId,\r\n locale: (data.locales) ? data.locales[0].name : undefined\r\n }).then(function (helper) {\r\n var trackingLabel = helper.getTrackingLabel();\r\n if (trackingLabel) {\r\n trackingLabel += ', URI: ' + (window.location !== window.parent.location) ? document.referrer : document.location;\r\n window.trackingLabel = trackingLabel;\r\n }\r\n var sequence;\r\n if (data.sequenceIndex !== undefined) {\r\n sequence = helper.getSequenceByIndex(data.sequenceIndex);\r\n if (!sequence) {\r\n that._error(\"Sequence \" + data.sequenceIndex + \" not found.\");\r\n return;\r\n }\r\n }\r\n var canvas;\r\n if (data.canvasIndex !== undefined) {\r\n canvas = helper.getCanvasByIndex(data.canvasIndex);\r\n }\r\n if (!canvas) {\r\n that._error(\"Canvas \" + data.canvasIndex + \" not found.\");\r\n return;\r\n }\r\n var extension = undefined;\r\n // if the canvas has a duration, use the uv-av-extension\r\n // const duration: number | null = canvas.getDuration();\r\n // if (typeof(duration) !== 'undefined') {\r\n // extension = that._extensions[\"av\"];\r\n // } else {\r\n // canvasType will always be \"canvas\" in IIIF presentation 3.0\r\n // to determine the correct extension to use, we need to inspect canvas.content.items[0].format\r\n // which is an iana media type: http://www.iana.org/assignments/media-types/media-types.xhtml\r\n var content = canvas.getContent();\r\n if (content.length) {\r\n var annotation = content[0];\r\n var body = annotation.getBody();\r\n if (body && body.length) {\r\n var format = body[0].getFormat();\r\n if (format) {\r\n extension = that._extensions[format.toString()];\r\n if (!extension) {\r\n // try type\r\n // @ts-ignore\r\n var type = body[0].getType();\r\n if (type) {\r\n extension = that._extensions[type.toString()];\r\n }\r\n }\r\n }\r\n else {\r\n // @ts-ignore\r\n var type = body[0].getType();\r\n if (type) {\r\n extension = that._extensions[type.toString()];\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // @ts-ignore\r\n var canvasType = canvas.getType();\r\n if (canvasType) {\r\n // try using canvasType\r\n extension = that._extensions[canvasType.toString()];\r\n }\r\n // if there isn't an extension for the canvasType, try the format\r\n if (!extension) {\r\n var format = canvas.getProperty('format');\r\n extension = that._extensions[format];\r\n }\r\n }\r\n //}\r\n // if there still isn't a matching extension, use the default extension.\r\n if (!extension) {\r\n extension = that._extensions['default'];\r\n }\r\n that._configure(data, extension, function (config) {\r\n data.config = config;\r\n that._injectCss(data, extension, function () {\r\n that._createExtension(extension, data, helper);\r\n });\r\n });\r\n }).catch(function () {\r\n that._error('Failed to load manifest.');\r\n });\r\n };\r\n UVComponent.prototype._isCORSEnabled = function () {\r\n return Modernizr.cors;\r\n };\r\n UVComponent.prototype._error = function (message) {\r\n this.fire(BaseEvents_1.BaseEvents.ERROR, message);\r\n };\r\n UVComponent.prototype._configure = function (data, extension, cb) {\r\n var _this = this;\r\n this._getConfigExtension(data, extension, function (configExtension) {\r\n if (data.locales) {\r\n var configPath = data.root + '/lib/' + extension.name + '.' + data.locales[0].name + '.config.json';\r\n $.getJSON(configPath, function (config) {\r\n _this._extendConfig(data, extension, config, configExtension, cb);\r\n });\r\n }\r\n });\r\n };\r\n UVComponent.prototype._extendConfig = function (data, extension, config, configExtension, cb) {\r\n config.name = extension.name;\r\n // if configUri has been set, extend the existing config object.\r\n if (configExtension) {\r\n // save a reference to the config extension uri.\r\n config.uri = data.configUri;\r\n $.extend(true, config, configExtension);\r\n //$.extend(true, config, configExtension, data.config);\r\n }\r\n cb(config);\r\n };\r\n UVComponent.prototype._getConfigExtension = function (data, extension, cb) {\r\n if (!data.locales) {\r\n return;\r\n }\r\n var sessionConfig = sessionStorage.getItem(extension.name + '.' + data.locales[0].name);\r\n var configUri = data.configUri;\r\n if (sessionConfig) {\r\n cb(JSON.parse(sessionConfig));\r\n }\r\n else if (configUri) {\r\n if (this._isCORSEnabled()) {\r\n $.getJSON(configUri, function (configExtension) {\r\n cb(configExtension);\r\n });\r\n }\r\n else {\r\n // use jsonp\r\n var settings = {\r\n url: configUri,\r\n type: 'GET',\r\n dataType: 'jsonp',\r\n jsonp: 'callback',\r\n jsonpCallback: 'configExtensionCallback'\r\n };\r\n $.ajax(settings);\r\n window.configExtensionCallback = function (configExtension) {\r\n cb(configExtension);\r\n };\r\n }\r\n }\r\n else {\r\n cb(null);\r\n }\r\n };\r\n UVComponent.prototype._injectCss = function (data, extension, cb) {\r\n if (!data.locales) {\r\n return;\r\n }\r\n var cssPath = data.root + '/themes/' + data.config.options.theme + '/css/' + extension.name + '/theme.css';\r\n var locale = data.locales[0].name;\r\n var themeName = extension.name.toLowerCase() + '-theme-' + locale.toLowerCase();\r\n var $existingCSS = $('#' + themeName.toLowerCase());\r\n if (!$existingCSS.length) {\r\n $('head').append('<link rel=\"stylesheet\" id=\"' + themeName + '\" href=\"' + cssPath.toLowerCase() + '\" />');\r\n cb();\r\n }\r\n else {\r\n cb();\r\n }\r\n };\r\n UVComponent.prototype._createExtension = function (extension, data, helper) {\r\n this.extension = new extension.type();\r\n if (this.extension) {\r\n this.extension.component = this;\r\n this.extension.data = data;\r\n this.extension.helper = helper;\r\n this.extension.name = extension.name;\r\n this.extension.create();\r\n }\r\n };\r\n UVComponent.prototype.exitFullScreen = function () {\r\n if (this.extension) {\r\n this.extension.exitFullScreen();\r\n }\r\n };\r\n UVComponent.prototype.resize = function () {\r\n if (this.extension) {\r\n this.extension.resize();\r\n }\r\n };\r\n return UVComponent;\r\n }(_Components.BaseComponent));\r\n exports.default = UVComponent;\r\n});\r\n//# sourceMappingURL=UVComponent.js.map\n", "if (typeof jQuery === \"function\") {\r\n // @ts-ignore\r\n define('jquery', [], function () {\r\n return jQuery;\r\n });\r\n}\r\n// IE CustomEvent Polyfill\r\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\r\n(function () {\r\n if (typeof window.CustomEvent === \"function\")\r\n return false;\r\n function CustomEvent(event, params) {\r\n params = params || { bubbles: false, cancelable: false, detail: undefined };\r\n var evt = document.createEvent('CustomEvent');\r\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\r\n return evt;\r\n }\r\n CustomEvent.prototype = window.Event.prototype;\r\n window.CustomEvent = CustomEvent;\r\n return;\r\n})();\r\n// @ts-ignore\r\ndefine('@iiif/manifold', ['require', '../lib/manifold.js', 'manifold'], function (require, m) {\r\n var manifold = require('manifold');\r\n // @ts-ignore\r\n window.Manifold = manifold;\r\n return manifold;\r\n});\r\n// @ts-ignore\r\ndefine('manifesto.js', ['require', './lib/manifesto.js', 'manifesto'], function (require, m) {\r\n var manifesto = require('manifesto');\r\n // @ts-ignore\r\n window.Manifesto = manifesto;\r\n // @ts-ignore\r\n window.manifesto = manifesto;\r\n return manifesto;\r\n});\r\n// @ts-ignore\r\ndefine('@iiif/vocabulary', ['require', '../lib/vocabulary.js', 'vocabulary'], function (require, m) {\r\n return require('vocabulary');\r\n});\r\n// @ts-ignore\r\ndefine('@iiif/iiif-metadata-component', ['require', '../lib/IIIFMetadataComponent.js', 'IIIFMetadataComponent'], function (require, m) {\r\n return require('IIIFMetadataComponent');\r\n});\r\n// @ts-ignore\r\ndefine('@iiif/iiif-gallery-component', ['require', '../lib/GalleryComponent.js'], function (require, m) {\r\n return m;\r\n});\r\n// @ts-ignore\r\ndefine('@iiif/iiif-av-component', ['require', '../lib/IIIFAVComponent.js', 'IIIFAVComponent'], function (require, m) {\r\n return require('IIIFAVComponent');\r\n});\r\n// bundled into dist/uv.js\r\n// - things in src/lib that are generic to all extensions\r\n// - bundled data providers\r\n// - UVComponent\r\n// @ts-ignore\r\nrequirejs([\r\n './lib/base64.min.js',\r\n './lib/browserdetect.js',\r\n './lib/detectmobilebrowser.js',\r\n './lib/jquery.xdomainrequest.js',\r\n './lib/modernizr.js',\r\n './lib/ex.es3.min.js',\r\n './lib/BaseComponent.js',\r\n './lib/KeyCodes.js',\r\n './lib/HTTPStatusCode.js',\r\n './lib/jquery-plugins.js',\r\n './lib/ba-tiny-pubsub.js',\r\n 'manifesto.js',\r\n '@iiif/manifold',\r\n './lib/Utils.js',\r\n './lib/xss.min.js',\r\n './lib/fetch.umd.js',\r\n 'URLDataProvider',\r\n 'UVComponent',\r\n // Extra dependencies.\r\n '@iiif/iiif-metadata-component',\r\n '@iiif/iiif-gallery-component',\r\n '@iiif/vocabulary',\r\n '@iiif/iiif-av-component'\r\n], function (base64, browserdetect, detectmobilebrowser, xdomainrequest, modernizr, sanitize, exjs, basecomponent, keycodes, httpstatuscodes, jqueryplugins, pubsub, manifesto, manifold, utils, fetch, URLDataProvider, UVComponent) {\r\n window.UV = UVComponent.default;\r\n window.UV.URLDataProvider = URLDataProvider.default;\r\n window.dispatchEvent(new CustomEvent('uvLoaded', {}));\r\n});\r\n//# sourceMappingURL=app.js.map\ndefine(\"app\", function(){});\n\n" ] }