New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

manifesto.js

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

manifesto.js - npm Package Compare versions

Comparing version

to
0.2.0

2

dist/manifesto.bundle.d.ts

@@ -1,2 +0,2 @@

// manifesto.js v0.1.26 https://github.com/universalviewer/manifesto
// manifesto.js v0.2.0 https://github.com/universalviewer/manifesto
declare module exjs {

@@ -3,0 +3,0 @@ var version: string;

@@ -1,2 +0,2 @@

// manifesto.js v0.1.26 https://github.com/universalviewer/manifesto
// manifesto.js v0.2.0 https://github.com/universalviewer/manifesto
declare module Manifesto {

@@ -3,0 +3,0 @@ class StringValue {

@@ -1,3 +0,3 @@

// manifesto.js v0.1.26 https://github.com/universalviewer/manifesto
// manifesto.js v0.2.0 https://github.com/universalviewer/manifesto
var Manifesto;!function(Manifesto){var StringValue=function(){function StringValue(value){this.value="",value&&(this.value=value.toLowerCase())}return StringValue.prototype.toString=function(){return this.value},StringValue}();Manifesto.StringValue=StringValue}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var AnnotationMotivation=function(_super){function AnnotationMotivation(){_super.apply(this,arguments)}return __extends(AnnotationMotivation,_super),AnnotationMotivation.prototype.bookmarking=function(){return new AnnotationMotivation(AnnotationMotivation.BOOKMARKING.toString())},AnnotationMotivation.prototype.classifying=function(){return new AnnotationMotivation(AnnotationMotivation.CLASSIFYING.toString())},AnnotationMotivation.prototype.commenting=function(){return new AnnotationMotivation(AnnotationMotivation.COMMENTING.toString())},AnnotationMotivation.prototype.describing=function(){return new AnnotationMotivation(AnnotationMotivation.DESCRIBING.toString())},AnnotationMotivation.prototype.editing=function(){return new AnnotationMotivation(AnnotationMotivation.EDITING.toString())},AnnotationMotivation.prototype.highlighting=function(){return new AnnotationMotivation(AnnotationMotivation.HIGHLIGHTING.toString())},AnnotationMotivation.prototype.identifying=function(){return new AnnotationMotivation(AnnotationMotivation.IDENTIFYING.toString())},AnnotationMotivation.prototype.linking=function(){return new AnnotationMotivation(AnnotationMotivation.LINKING.toString())},AnnotationMotivation.prototype.moderating=function(){return new AnnotationMotivation(AnnotationMotivation.MODERATING.toString())},AnnotationMotivation.prototype.painting=function(){return new AnnotationMotivation(AnnotationMotivation.PAINTING.toString())},AnnotationMotivation.prototype.questioning=function(){return new AnnotationMotivation(AnnotationMotivation.QUESTIONING.toString())},AnnotationMotivation.prototype.replying=function(){return new AnnotationMotivation(AnnotationMotivation.REPLYING.toString())},AnnotationMotivation.prototype.tagging=function(){return new AnnotationMotivation(AnnotationMotivation.TAGGING.toString())},AnnotationMotivation.prototype.transcribing=function(){return new AnnotationMotivation(AnnotationMotivation.TRANSCRIBING.toString())},AnnotationMotivation.BOOKMARKING=new AnnotationMotivation("oa:bookmarking"),AnnotationMotivation.CLASSIFYING=new AnnotationMotivation("oa:classifying"),AnnotationMotivation.COMMENTING=new AnnotationMotivation("oa:commenting"),AnnotationMotivation.DESCRIBING=new AnnotationMotivation("oa:describing"),AnnotationMotivation.EDITING=new AnnotationMotivation("oa:editing"),AnnotationMotivation.HIGHLIGHTING=new AnnotationMotivation("oa:highlighting"),AnnotationMotivation.IDENTIFYING=new AnnotationMotivation("oa:identifying"),AnnotationMotivation.LINKING=new AnnotationMotivation("oa:linking"),AnnotationMotivation.MODERATING=new AnnotationMotivation("oa:moderating"),AnnotationMotivation.PAINTING=new AnnotationMotivation("sc:painting"),AnnotationMotivation.QUESTIONING=new AnnotationMotivation("oa:questioning"),AnnotationMotivation.REPLYING=new AnnotationMotivation("oa:replying"),AnnotationMotivation.TAGGING=new AnnotationMotivation("oa:tagging"),AnnotationMotivation.TRANSCRIBING=new AnnotationMotivation("oad:transcribing"),AnnotationMotivation}(Manifesto.StringValue);Manifesto.AnnotationMotivation=AnnotationMotivation}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var ElementType=function(_super){function ElementType(){_super.apply(this,arguments)}return __extends(ElementType,_super),ElementType.prototype.canvas=function(){return new ElementType(ElementType.CANVAS.toString())},ElementType.prototype.document=function(){return new ElementType(ElementType.DOCUMENT.toString())},ElementType.prototype.image=function(){return new ElementType(ElementType.IMAGE.toString())},ElementType.prototype.movingimage=function(){return new ElementType(ElementType.MOVINGIMAGE.toString())},ElementType.prototype.physicalobject=function(){return new ElementType(ElementType.PHYSICALOBJECT.toString())},ElementType.prototype.sound=function(){return new ElementType(ElementType.SOUND.toString())},ElementType.CANVAS=new ElementType("sc:canvas"),ElementType.DOCUMENT=new ElementType("foaf:document"),ElementType.IMAGE=new ElementType("dcTypes:image"),ElementType.MOVINGIMAGE=new ElementType("dctypes:movingimage"),ElementType.PHYSICALOBJECT=new ElementType("dctypes:physicalobject"),ElementType.SOUND=new ElementType("dctypes:sound"),ElementType}(Manifesto.StringValue);Manifesto.ElementType=ElementType}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var IIIFResourceType=function(_super){function IIIFResourceType(){_super.apply(this,arguments)}return __extends(IIIFResourceType,_super),IIIFResourceType.prototype.manifest=function(){return new IIIFResourceType(IIIFResourceType.MANIFEST.toString())},IIIFResourceType.prototype.collection=function(){return new IIIFResourceType(IIIFResourceType.COLLECTION.toString())},IIIFResourceType.MANIFEST=new IIIFResourceType("sc:manifest"),IIIFResourceType.COLLECTION=new IIIFResourceType("sc:collection"),IIIFResourceType}(Manifesto.StringValue);Manifesto.IIIFResourceType=IIIFResourceType}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var ManifestType=function(_super){function ManifestType(){_super.apply(this,arguments)}return __extends(ManifestType,_super),ManifestType.prototype.empty=function(){return new ManifestType(ManifestType.EMPTY.toString())},ManifestType.prototype.manuscript=function(){return new ManifestType(ManifestType.MANUSCRIPT.toString())},ManifestType.prototype.monograph=function(){return new ManifestType(ManifestType.MONOGRAPH.toString())},ManifestType.EMPTY=new ManifestType(""),ManifestType.MANUSCRIPT=new ManifestType("manuscript"),ManifestType.MONOGRAPH=new ManifestType("monograph"),ManifestType}(Manifesto.StringValue);Manifesto.ManifestType=ManifestType}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var RenderingFormat=function(_super){function RenderingFormat(){_super.apply(this,arguments)}return __extends(RenderingFormat,_super),RenderingFormat.prototype.pdf=function(){return new RenderingFormat(RenderingFormat.PDF.toString())},RenderingFormat.prototype.doc=function(){return new RenderingFormat(RenderingFormat.DOC.toString())},RenderingFormat.prototype.docx=function(){return new RenderingFormat(RenderingFormat.DOCX.toString())},RenderingFormat.PDF=new RenderingFormat("application/pdf"),RenderingFormat.DOC=new RenderingFormat("application/msword"),RenderingFormat.DOCX=new RenderingFormat("application/vnd.openxmlformats-officedocument.wordprocessingml.document"),RenderingFormat}(Manifesto.StringValue);Manifesto.RenderingFormat=RenderingFormat}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var ResourceFormat=function(_super){function ResourceFormat(){_super.apply(this,arguments)}return __extends(ResourceFormat,_super),ResourceFormat.prototype.jpgimage=function(){return new ResourceFormat(ResourceFormat.JPGIMAGE.toString())},ResourceFormat.prototype.pdf=function(){return new ResourceFormat(ResourceFormat.PDF.toString())},ResourceFormat.JPGIMAGE=new ResourceFormat("image/jpeg"),ResourceFormat.PDF=new ResourceFormat("application/pdf"),ResourceFormat}(Manifesto.StringValue);Manifesto.ResourceFormat=ResourceFormat}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var ResourceType=function(_super){function ResourceType(){_super.apply(this,arguments)}return __extends(ResourceType,_super),ResourceType.prototype.image=function(){return new ResourceType(ResourceType.IMAGE.toString())},ResourceType.IMAGE=new ResourceType("dctypes:image"),ResourceType}(Manifesto.StringValue);Manifesto.ResourceType=ResourceType}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var ServiceProfile=function(_super){function ServiceProfile(){_super.apply(this,arguments)}return __extends(ServiceProfile,_super),ServiceProfile.prototype.autoComplete=function(){return new ServiceProfile(ServiceProfile.AUTOCOMPLETE.toString())},ServiceProfile.prototype.iiif1ImageLevel1=function(){return new ServiceProfile(ServiceProfile.IIIF1IMAGELEVEL1.toString())},ServiceProfile.prototype.iiif1ImageLevel2=function(){return new ServiceProfile(ServiceProfile.IIIF1IMAGELEVEL2.toString())},ServiceProfile.prototype.iiif2ImageLevel1=function(){return new ServiceProfile(ServiceProfile.IIIF2IMAGELEVEL1.toString())},ServiceProfile.prototype.iiif2ImageLevel2=function(){return new ServiceProfile(ServiceProfile.IIIF2IMAGELEVEL2.toString())},ServiceProfile.prototype.ixif=function(){return new ServiceProfile(ServiceProfile.IXIF.toString())},ServiceProfile.prototype.login=function(){return new ServiceProfile(ServiceProfile.LOGIN.toString())},ServiceProfile.prototype.clickThrough=function(){return new ServiceProfile(ServiceProfile.CLICKTHROUGH.toString())},ServiceProfile.prototype.restricted=function(){return new ServiceProfile(ServiceProfile.RESTRICTED.toString())},ServiceProfile.prototype.logout=function(){return new ServiceProfile(ServiceProfile.LOGOUT.toString())},ServiceProfile.prototype.otherManifestations=function(){return new ServiceProfile(ServiceProfile.OTHERMANIFESTATIONS.toString())},ServiceProfile.prototype.searchWithin=function(){return new ServiceProfile(ServiceProfile.SEARCHWITHIN.toString())},ServiceProfile.prototype.stanfordIIIFImageCompliance1=function(){return new ServiceProfile(ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE1.toString())},ServiceProfile.prototype.stanfordIIIFImageCompliance2=function(){return new ServiceProfile(ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE2.toString())},ServiceProfile.prototype.stanfordIIIFImageConformance1=function(){return new ServiceProfile(ServiceProfile.STANFORDIIIFIMAGECONFORMANCE1.toString())},ServiceProfile.prototype.stanfordIIIFImageConformance2=function(){return new ServiceProfile(ServiceProfile.STANFORDIIIFIMAGECONFORMANCE2.toString())},ServiceProfile.prototype.stanfordIIIF1ImageCompliance1=function(){return new ServiceProfile(ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE1.toString())},ServiceProfile.prototype.stanfordIIIF1ImageCompliance2=function(){return new ServiceProfile(ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE2.toString())},ServiceProfile.prototype.stanfordIIIF1ImageConformance1=function(){return new ServiceProfile(ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE1.toString())},ServiceProfile.prototype.stanfordIIIF1ImageConformance2=function(){return new ServiceProfile(ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE2.toString())},ServiceProfile.prototype.token=function(){return new ServiceProfile(ServiceProfile.TOKEN.toString())},ServiceProfile.prototype.trackingExtensions=function(){return new ServiceProfile(ServiceProfile.TRACKINGEXTENSIONS.toString())},ServiceProfile.prototype.uiExtensions=function(){return new ServiceProfile(ServiceProfile.UIEXTENSIONS.toString())},ServiceProfile.AUTOCOMPLETE=new ServiceProfile("http://iiif.io/api/search/0/autocomplete"),ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE0=new ServiceProfile("http://library.stanford.edu/iiif/image-api/compliance.html#level0"),ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE1=new ServiceProfile("http://library.stanford.edu/iiif/image-api/compliance.html#level1"),ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE2=new ServiceProfile("http://library.stanford.edu/iiif/image-api/compliance.html#level2"),ServiceProfile.STANFORDIIIFIMAGECONFORMANCE0=new ServiceProfile("http://library.stanford.edu/iiif/image-api/conformance.html#level0"),ServiceProfile.STANFORDIIIFIMAGECONFORMANCE1=new ServiceProfile("http://library.stanford.edu/iiif/image-api/conformance.html#level1"),ServiceProfile.STANFORDIIIFIMAGECONFORMANCE2=new ServiceProfile("http://library.stanford.edu/iiif/image-api/conformance.html#level2"),ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE0=new ServiceProfile("http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0"),ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE1=new ServiceProfile("http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1"),ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE2=new ServiceProfile("http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2"),ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE0=new ServiceProfile("http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0"),ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE1=new ServiceProfile("http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1"),ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE2=new ServiceProfile("http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2"),ServiceProfile.IIIF1IMAGELEVEL0=new ServiceProfile("http://iiif.io/api/image/1/level0.json"),ServiceProfile.IIIF1IMAGELEVEL0PROFILE=new ServiceProfile("http://iiif.io/api/image/1/profiles/level0.json"),ServiceProfile.IIIF1IMAGELEVEL1=new ServiceProfile("http://iiif.io/api/image/1/level1.json"),ServiceProfile.IIIF1IMAGELEVEL1PROFILE=new ServiceProfile("http://iiif.io/api/image/1/profiles/level1.json"),ServiceProfile.IIIF1IMAGELEVEL2=new ServiceProfile("http://iiif.io/api/image/1/level2.json"),ServiceProfile.IIIF1IMAGELEVEL2PROFILE=new ServiceProfile("http://iiif.io/api/image/1/profiles/level2.json"),ServiceProfile.IIIF2IMAGELEVEL0=new ServiceProfile("http://iiif.io/api/image/2/level0.json"),ServiceProfile.IIIF2IMAGELEVEL0PROFILE=new ServiceProfile("http://iiif.io/api/image/2/profiles/level0.json"),ServiceProfile.IIIF2IMAGELEVEL1=new ServiceProfile("http://iiif.io/api/image/2/level1.json"),ServiceProfile.IIIF2IMAGELEVEL1PROFILE=new ServiceProfile("http://iiif.io/api/image/2/profiles/level1.json"),ServiceProfile.IIIF2IMAGELEVEL2=new ServiceProfile("http://iiif.io/api/image/2/level2.json"),ServiceProfile.IIIF2IMAGELEVEL2PROFILE=new ServiceProfile("http://iiif.io/api/image/2/profiles/level2.json"),ServiceProfile.IXIF=new ServiceProfile("http://wellcomelibrary.org/ld/ixif/0/alpha.json"),ServiceProfile.LOGIN=new ServiceProfile("http://iiif.io/api/auth/0/login"),ServiceProfile.CLICKTHROUGH=new ServiceProfile("http://iiif.io/api/auth/0/login/clickthrough"),ServiceProfile.RESTRICTED=new ServiceProfile("http://iiif.io/api/auth/0/login/restricted"),ServiceProfile.LOGOUT=new ServiceProfile("http://iiif.io/api/auth/0/logout"),ServiceProfile.OTHERMANIFESTATIONS=new ServiceProfile("http://iiif.io/api/otherManifestations.json"),ServiceProfile.SEARCHWITHIN=new ServiceProfile("http://iiif.io/api/search/0/search"),ServiceProfile.TOKEN=new ServiceProfile("http://iiif.io/api/auth/0/token"),ServiceProfile.TRACKINGEXTENSIONS=new ServiceProfile("http://universalviewer.io/tracking-extensions-profile"),ServiceProfile.UIEXTENSIONS=new ServiceProfile("http://universalviewer.io/ui-extensions-profile"),ServiceProfile}(Manifesto.StringValue);Manifesto.ServiceProfile=ServiceProfile}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var ViewingDirection=function(_super){function ViewingDirection(){_super.apply(this,arguments)}return __extends(ViewingDirection,_super),ViewingDirection.prototype.leftToRight=function(){return new ViewingDirection(ViewingDirection.LEFTTORIGHT.toString())},ViewingDirection.prototype.rightToLeft=function(){return new ViewingDirection(ViewingDirection.RIGHTTOLEFT.toString())},ViewingDirection.prototype.topToBottom=function(){return new ViewingDirection(ViewingDirection.TOPTOBOTTOM.toString())},ViewingDirection.prototype.bottomToTop=function(){return new ViewingDirection(ViewingDirection.BOTTOMTOTOP.toString())},ViewingDirection.LEFTTORIGHT=new ViewingDirection("left-to-right"),ViewingDirection.RIGHTTOLEFT=new ViewingDirection("right-to-left"),ViewingDirection.TOPTOBOTTOM=new ViewingDirection("top-to-bottom"),ViewingDirection.BOTTOMTOTOP=new ViewingDirection("bottom-to-top"),ViewingDirection}(Manifesto.StringValue);Manifesto.ViewingDirection=ViewingDirection}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var ViewingHint=function(_super){function ViewingHint(){_super.apply(this,arguments)}return __extends(ViewingHint,_super),ViewingHint.prototype.continuous=function(){return new ViewingHint(ViewingHint.CONTINUOUS.toString())},ViewingHint.prototype.empty=function(){return new ViewingHint(ViewingHint.EMPTY.toString())},ViewingHint.prototype.individuals=function(){return new ViewingHint(ViewingHint.INDIVIDUALS.toString())},ViewingHint.prototype.nonPaged=function(){return new ViewingHint(ViewingHint.NONPAGED.toString())},ViewingHint.prototype.paged=function(){return new ViewingHint(ViewingHint.PAGED.toString())},ViewingHint.prototype.top=function(){return new ViewingHint(ViewingHint.TOP.toString())},ViewingHint.CONTINUOUS=new ViewingHint("continuous"),ViewingHint.EMPTY=new ViewingHint(""),ViewingHint.INDIVIDUALS=new ViewingHint("individuals"),ViewingHint.NONPAGED=new ViewingHint("non-paged"),ViewingHint.PAGED=new ViewingHint("paged"),ViewingHint.TOP=new ViewingHint("top"),ViewingHint}(Manifesto.StringValue);Manifesto.ViewingHint=ViewingHint}(Manifesto||(Manifesto={}));var Manifesto;!function(Manifesto){var JSONLDResource=function(){function JSONLDResource(jsonld){this.__jsonld=jsonld,this.context=this.getProperty("@context"),this.id=this.getProperty("@id")}return JSONLDResource.prototype.getProperty=function(name){return this.__jsonld[name]},JSONLDResource}();Manifesto.JSONLDResource=JSONLDResource}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var ManifestResource=function(_super){function ManifestResource(jsonld,options){_super.call(this,jsonld),this.options=options}return __extends(ManifestResource,_super),ManifestResource.prototype.getLabel=function(){return Manifesto.Utils.getLocalisedValue(this.getProperty("label"),this.options.locale)},ManifestResource.prototype.getMetadata=function(){var metadata=this.getProperty("metadata");if(!metadata)return[];for(var i=0;i<metadata.length;i++){var item=metadata[i];item.label=Manifesto.Utils.getLocalisedValue(item.label,this.options.locale),item.value=Manifesto.Utils.getLocalisedValue(item.value,this.options.locale)}return metadata},ManifestResource.prototype.getRendering=function(format){var renderings=this.getRenderings();"string"!=typeof format&&(format=format.toString());for(var i=0;i<renderings.length;i++){var rendering=renderings[i];if(rendering.getFormat().toString()===format)return rendering}return null},ManifestResource.prototype.getRenderings=function(){var rendering;rendering=this.__jsonld?this.__jsonld.rendering:this.rendering;var renderings=[];if(!rendering)return renderings;_isArray(rendering)||(rendering=[rendering]);for(var i=0;i<rendering.length;i++){var r=rendering[i];renderings.push(new Manifesto.Rendering(r,this.options))}return renderings},ManifestResource.prototype.getService=function(profile){return Manifesto.Utils.getService(this,profile)},ManifestResource.prototype.getServices=function(){return Manifesto.Utils.getServices(this)},ManifestResource}(Manifesto.JSONLDResource);Manifesto.ManifestResource=ManifestResource}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var Element=function(_super){function Element(jsonld,options){_super.call(this,jsonld,options)}return __extends(Element,_super),Element.prototype.getResources=function(){var resources=[];if(!this.__jsonld.resources)return resources;for(var i=0;i<this.__jsonld.resources.length;i++){var a=this.__jsonld.resources[i],annotation=new Manifesto.Annotation(a,this.options);resources.push(annotation)}return resources},Element.prototype.getType=function(){return new Manifesto.ElementType(this.getProperty("@type"))},Element}(Manifesto.ManifestResource);Manifesto.Element=Element}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},_endsWith=require("lodash.endswith"),_last=require("lodash.last"),Manifesto;!function(Manifesto){var Canvas=function(_super){function Canvas(jsonld,options){_super.call(this,jsonld,options)}return __extends(Canvas,_super),Canvas.prototype.getCanonicalImageUri=function(w){var id,size,region="full",rotation=0,quality="default",width=w;if(this.externalResource&&this.externalResource.data)id=this.externalResource.data["@id"],width||(width=this.externalResource.data.width),(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)&&(quality="native");else{var images=this.getImages();if(images&&images.length){var firstImage=images[0],resource=firstImage.getResource(),services=resource.getServices();if(width||(width=resource.getWidth()),services.length){var service=services[0];id=service.id,quality=Manifesto.Utils.getImageQuality(service.getProfile())}}if(!id)return"undefined"==typeof this.__jsonld.thumbnail?null:this.__jsonld.thumbnail}size=width+",";var uri=[id,region,size,rotation,quality+".jpg"].join("/");return uri},Canvas.prototype.getImages=function(){var images=[];if(!this.__jsonld.images)return images;for(var i=0;i<this.__jsonld.images.length;i++){var a=this.__jsonld.images[i],annotation=new Manifesto.Annotation(a,this.options);images.push(annotation)}return images},Canvas.prototype.getIndex=function(){return this.getProperty("index")},Canvas.prototype.getWidth=function(){return this.getProperty("width")},Canvas.prototype.getHeight=function(){return this.getProperty("height")},Canvas}(Manifesto.Element);Manifesto.Canvas=Canvas}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},_assign=require("lodash.assign"),Manifesto;!function(Manifesto){var IIIFResource=function(_super){function IIIFResource(jsonld,options){_super.call(this,jsonld,options),this.index=-1,this.isLoaded=!1;var defaultOptions={defaultLabel:"-",locale:"en-GB",resource:this,pessimisticAccessControl:!1};this.options=_assign(defaultOptions,options)}return __extends(IIIFResource,_super),IIIFResource.prototype.generateTreeNodeIds=function(treeNode,index){void 0===index&&(index=0);var id;id=treeNode.parentNode?treeNode.parentNode.id+"-"+index:"0",treeNode.id=id;for(var i=0;i<treeNode.nodes.length;i++){var n=treeNode.nodes[i];this.generateTreeNodeIds(n,i)}},IIIFResource.prototype.getAttribution=function(){return Manifesto.Utils.getLocalisedValue(this.getProperty("attribution"),this.options.locale)},IIIFResource.prototype.getDescription=function(){return Manifesto.Utils.getLocalisedValue(this.getProperty("description"),this.options.locale)},IIIFResource.prototype.getIIIFResourceType=function(){return new Manifesto.IIIFResourceType(this.getProperty("@type"))},IIIFResource.prototype.getLogo=function(){var logo=this.getProperty("logo");return logo?_isString(logo)?logo:logo["@id"]:null},IIIFResource.prototype.getLicense=function(){return Manifesto.Utils.getLocalisedValue(this.getProperty("license"),this.options.locale)},IIIFResource.prototype.getNavDate=function(){return new Date(this.getProperty("navDate"))},IIIFResource.prototype.getRelated=function(){return this.getProperty("related")},IIIFResource.prototype.getSeeAlso=function(){return Manifesto.Utils.getLocalisedValue(this.getProperty("seeAlso"),this.options.locale)},IIIFResource.prototype.getLabel=function(){return Manifesto.Utils.getLocalisedValue(this.getProperty("label"),this.options.locale)},IIIFResource.prototype.getTree=function(){return this.treeRoot=new Manifesto.TreeNode("root"),this.treeRoot.data=this,this.treeRoot},IIIFResource.prototype.load=function(){var that=this;return new Promise(function(resolve,reject){if(that.isLoaded)resolve(that);else{var options=that.options;options.navDate=that.getNavDate(),Manifesto.Utils.loadResource(that.__jsonld["@id"]).then(function(data){that.parentLabel=that.getLabel();var parsed=Manifesto.Deserialiser.parse(data,options);that=_assign(that,parsed),that.index=options.index,resolve(that)})}})},IIIFResource}(Manifesto.ManifestResource);Manifesto.IIIFResource=IIIFResource}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},_isArray=require("lodash.isarray"),_map=require("lodash.map"),Manifesto;!function(Manifesto){var Manifest=function(_super){function Manifest(jsonld,options){if(_super.call(this,jsonld,options),this.index=0,this._ranges=null,this._sequences=null,this.__jsonld.structures&&this.__jsonld.structures.length){var r=this._getRootRange();this._parseRanges(r,"")}}return __extends(Manifest,_super),Manifest.prototype._getRootRange=function(){var range;if(this.__jsonld.structures&&this.__jsonld.structures.length){for(var i=0;i<this.__jsonld.structures.length;i++){var r=this.__jsonld.structures[i];r.viewingHint===Manifesto.ViewingHint.TOP.toString()&&(range=r)}range||(range={},range.ranges=this.__jsonld.structures)}return range},Manifest.prototype._getRangeById=function(id){if(this.__jsonld.structures&&this.__jsonld.structures.length)for(var i=0;i<this.__jsonld.structures.length;i++){var r=this.__jsonld.structures[i];if(r["@id"]===id)return r}return null},Manifest.prototype._parseRanges=function(r,path,parentRange){var range;if(_isString(r)&&(r=this._getRangeById(r)),range=new Manifesto.Range(r,this.options),parentRange?(range.parentRange=parentRange,parentRange.ranges.push(range)):this.rootRange=range,range.path=path,r.ranges)for(var j=0;j<r.ranges.length;j++)this._parseRanges(r.ranges[j],path+"/"+j,range)},Manifest.prototype.getRanges=function(){return null!=this._ranges?this._ranges:(this._ranges=[],this.rootRange&&(this._ranges=this.rootRange.ranges.en().traverseUnique(function(range){return range.ranges}).toArray()),this._ranges)},Manifest.prototype.getRangeById=function(id){for(var ranges=this.getRanges(),i=0;i<ranges.length;i++){var range=ranges[i];if(range.id===id)return range}return null},Manifest.prototype.getRangeByPath=function(path){for(var ranges=this.getRanges(),i=0;i<ranges.length;i++){var range=ranges[i];if(range.path===path)return range}return null},Manifest.prototype.getSequences=function(){if(null!=this._sequences)return this._sequences;this._sequences=[];var children=this.__jsonld.mediaSequences||this.__jsonld.sequences;if(children)for(var i=0;i<children.length;i++){var s=children[i],sequence=new Manifesto.Sequence(s,this.options);this._sequences.push(sequence)}return this._sequences},Manifest.prototype.getSequenceByIndex=function(sequenceIndex){return this.getSequences()[sequenceIndex]},Manifest.prototype.getTotalSequences=function(){return this.getSequences().length},Manifest.prototype.getTree=function(){if(_super.prototype.getTree.call(this),this.treeRoot.data.type=Manifesto.TreeNodeType.MANIFEST.toString(),!this.isLoaded)return this.treeRoot;if(!this.rootRange)return this.treeRoot;if(this.treeRoot.data=this.rootRange,this.rootRange.treeNode=this.treeRoot,this.rootRange.ranges)for(var i=0;i<this.rootRange.ranges.length;i++){var range=this.rootRange.ranges[i],node=new Manifesto.TreeNode;this.treeRoot.addNode(node),this._parseTreeNode(node,range)}return this.generateTreeNodeIds(this.treeRoot),this.treeRoot},Manifest.prototype._parseTreeNode=function(node,range){if(node.label=range.getLabel(),node.data=range,node.data.type=Manifesto.TreeNodeType.RANGE.toString(),range.treeNode=node,range.ranges)for(var i=0;i<range.ranges.length;i++){var childRange=range.ranges[i],childNode=new Manifesto.TreeNode;node.addNode(childNode),this._parseTreeNode(childNode,childRange)}},Manifest.prototype.getManifestType=function(){var service=this.getService(Manifesto.ServiceProfile.UIEXTENSIONS);return service?new Manifesto.ManifestType(service.getProperty("manifestType")):new Manifesto.ManifestType("")},Manifest.prototype.getTrackingLabel=function(){var service=this.getService(Manifesto.ServiceProfile.TRACKINGEXTENSIONS);return service?service.getProperty("trackingLabel"):""},Manifest.prototype.isMultiSequence=function(){return this.getTotalSequences()>1},Manifest.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?new Manifesto.ViewingDirection(this.getProperty("viewingDirection")):Manifesto.ViewingDirection.LEFTTORIGHT},Manifest.prototype.getViewingHint=function(){return this.getProperty("viewingHint")?new Manifesto.ViewingHint(this.getProperty("viewingHint")):Manifesto.ViewingHint.EMPTY},Manifest}(Manifesto.IIIFResource);Manifesto.Manifest=Manifest}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var Collection=function(_super){function Collection(jsonld,options){_super.call(this,jsonld,options),this.collections=[],this.manifests=[],jsonld.__collection=this}return __extends(Collection,_super),Collection.prototype.getCollectionByIndex=function(collectionIndex){var collection=this.collections[collectionIndex];return collection.options.index=collectionIndex,collection.load()},Collection.prototype.getManifestByIndex=function(manifestIndex){var manifest=this.manifests[manifestIndex];return manifest.options.index=manifestIndex,manifest.load()},Collection.prototype.getTotalCollections=function(){return this.collections.length},Collection.prototype.getTotalManifests=function(){return this.manifests.length;
},Collection.prototype.getTree=function(){return _super.prototype.getTree.call(this),this.treeRoot.data.type=Manifesto.TreeNodeType.COLLECTION.toString(),this._parseManifests(this),this._parseCollections(this),this.generateTreeNodeIds(this.treeRoot),this.treeRoot},Collection.prototype._parseManifests=function(parentCollection){if(parentCollection.manifests&&parentCollection.manifests.length)for(var i=0;i<parentCollection.manifests.length;i++){var manifest=parentCollection.manifests[i],tree=manifest.getTree();tree.label=manifest.parentLabel||manifest.getLabel()||"manifest "+(i+1),tree.navDate=manifest.getNavDate(),tree.data.id=manifest.id,tree.data.type=Manifesto.TreeNodeType.MANIFEST.toString(),parentCollection.treeRoot.addNode(tree)}},Collection.prototype._parseCollections=function(parentCollection){if(parentCollection.collections&&parentCollection.collections.length)for(var i=0;i<parentCollection.collections.length;i++){var collection=parentCollection.collections[i],tree=collection.getTree();tree.label=collection.parentLabel||collection.getLabel()||"collection "+(i+1),tree.navDate=collection.getNavDate(),tree.data.id=collection.id,tree.data.type=Manifesto.TreeNodeType.COLLECTION.toString(),parentCollection.treeRoot.addNode(tree),this._parseCollections(collection)}},Collection}(Manifesto.IIIFResource);Manifesto.Collection=Collection}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var Range=function(_super){function Range(jsonld,options){_super.call(this,jsonld,options),this.ranges=[]}return __extends(Range,_super),Range.prototype.getCanvasIds=function(){return this.__jsonld.canvases?this.__jsonld.canvases:[]},Range.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?new Manifesto.ViewingDirection(this.getProperty("viewingDirection")):null},Range.prototype.getViewingHint=function(){return this.getProperty("viewingHint")?new Manifesto.ViewingHint(this.getProperty("viewingHint")):null},Range}(Manifesto.ManifestResource);Manifesto.Range=Range}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var Rendering=function(_super){function Rendering(jsonld,options){_super.call(this,jsonld,options)}return __extends(Rendering,_super),Rendering.prototype.getFormat=function(){return new Manifesto.RenderingFormat(this.getProperty("format"))},Rendering}(Manifesto.ManifestResource);Manifesto.Rendering=Rendering}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},_last=require("lodash.last"),Manifesto;!function(Manifesto){var Sequence=function(_super){function Sequence(jsonld,options){_super.call(this,jsonld,options),this.canvases=null}return __extends(Sequence,_super),Sequence.prototype.getCanvases=function(){if(null!=this.canvases)return this.canvases;this.canvases=[];var children=this.__jsonld.elements||this.__jsonld.canvases;if(children)for(var i=0;i<children.length;i++){var c=children[i],canvas=new Manifesto.Canvas(c,this.options);canvas.index=i,this.canvases.push(canvas)}return this.canvases},Sequence.prototype.getCanvasById=function(id){for(var i=0;i<this.getTotalCanvases();i++){var canvas=this.getCanvasByIndex(i);if(canvas.id===id)return canvas}return null},Sequence.prototype.getCanvasByIndex=function(canvasIndex){return this.getCanvases()[canvasIndex]},Sequence.prototype.getCanvasIndexById=function(id){for(var i=0;i<this.getTotalCanvases();i++){var canvas=this.getCanvasByIndex(i);if(canvas.id===id)return i}return null},Sequence.prototype.getCanvasIndexByLabel=function(label,foliated){label=label.trim(),isNaN(label)||(label=parseInt(label,10).toString(),foliated&&(label+="r"));for(var match,regExp,regStr,labelPart1,labelPart2,doublePageRegExp=/(\d*)\D+(\d*)/,i=0;i<this.getTotalCanvases();i++){var canvas=this.getCanvasByIndex(i);if(canvas.getLabel()===label)return i;if(match=doublePageRegExp.exec(label),match&&(labelPart1=match[1],labelPart2=match[2],labelPart2&&(regStr="^"+labelPart1+"\\D+"+labelPart2+"$",regExp=new RegExp(regStr),regExp.test(canvas.getLabel()))))return i}return-1},Sequence.prototype.getLastCanvasLabel=function(alphanumeric){for(var i=this.getTotalCanvases()-1;i>=0;i--){var canvas=this.getCanvasByIndex(i),label=canvas.getLabel();if(alphanumeric){var regExp=/^[a-zA-Z0-9]*$/;if(regExp.test(label))return label}else if(label)return label}return this.options.defaultLabel},Sequence.prototype.getLastPageIndex=function(){return this.getTotalCanvases()-1},Sequence.prototype.getNextPageIndex=function(canvasIndex,pagingEnabled){var index;if(pagingEnabled){var indices=this.getPagedIndices(canvasIndex);index=this.getViewingDirection().toString()===Manifesto.ViewingDirection.RIGHTTOLEFT.toString()?indices[0]+1:_last(indices)+1}else index=canvasIndex+1;return index>this.getLastPageIndex()?-1:index},Sequence.prototype.getPagedIndices=function(canvasIndex,pagingEnabled){var indices=[];return pagingEnabled?(indices=this.isFirstCanvas(canvasIndex)||this.isLastCanvas(canvasIndex)?[canvasIndex]:canvasIndex%2?[canvasIndex,canvasIndex+1]:[canvasIndex-1,canvasIndex],this.getViewingDirection().toString()===Manifesto.ViewingDirection.RIGHTTOLEFT.toString()&&(indices=indices.reverse())):indices.push(canvasIndex),indices},Sequence.prototype.getPrevPageIndex=function(canvasIndex,pagingEnabled){var index;if(pagingEnabled){var indices=this.getPagedIndices(canvasIndex);index=this.getViewingDirection().toString()===Manifesto.ViewingDirection.RIGHTTOLEFT.toString()?_last(indices)-1:indices[0]-1}else index=canvasIndex-1;return index},Sequence.prototype.getStartCanvasIndex=function(){var startCanvas=this.getStartCanvas();if(startCanvas)for(var i=0;i<this.getTotalCanvases();i++){var canvas=this.getCanvasByIndex(i);if(canvas.id===startCanvas)return i}return 0},Sequence.prototype.getThumbs=function(width,height){for(var thumbs=[],totalCanvases=this.getTotalCanvases(),i=0;i<totalCanvases;i++){var canvas=this.getCanvasByIndex(i);thumbs.push(new Manifesto.Thumb(width,canvas))}return thumbs},Sequence.prototype.getStartCanvas=function(){return this.getProperty("startCanvas")},Sequence.prototype.getTotalCanvases=function(){return this.getCanvases().length},Sequence.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?new Manifesto.ViewingDirection(this.getProperty("viewingDirection")):this.options.resource.getViewingDirection?this.options.resource.getViewingDirection():Manifesto.ViewingDirection.LEFTTORIGHT},Sequence.prototype.getViewingHint=function(){return this.getProperty("viewingHint")?new Manifesto.ViewingHint(this.getProperty("viewingHint")):Manifesto.ViewingHint.EMPTY},Sequence.prototype.isCanvasIndexOutOfRange=function(canvasIndex){return canvasIndex>this.getTotalCanvases()-1},Sequence.prototype.isFirstCanvas=function(canvasIndex){return 0===canvasIndex},Sequence.prototype.isLastCanvas=function(canvasIndex){return canvasIndex===this.getTotalCanvases()-1},Sequence.prototype.isMultiCanvas=function(){return this.getTotalCanvases()>1},Sequence.prototype.isPagingEnabled=function(){return this.getViewingHint().toString()===Manifesto.ViewingHint.PAGED.toString()},Sequence.prototype.isTotalCanvasesEven=function(){return this.getTotalCanvases()%2===0},Sequence}(Manifesto.ManifestResource);Manifesto.Sequence=Sequence}(Manifesto||(Manifesto={}));var _isString=require("lodash.isstring"),Manifesto;!function(Manifesto){var Deserialiser=function(){function Deserialiser(){}return Deserialiser.parse=function(manifest,options){return this.parseJson(JSON.parse(manifest),options)},Deserialiser.parseJson=function(json,options){var resource;switch(options&&options.navDate&&!isNaN(options.navDate.getTime())&&(json.navDate=options.navDate.toString()),json["@type"]){case"sc:Collection":resource=this.parseCollection(json,options);break;case"sc:Manifest":resource=this.parseManifest(json,options);break;default:return null}return resource.isLoaded=!0,resource},Deserialiser.parseCollection=function(json,options){var collection=new Manifesto.Collection(json,options);return options?collection.index=options.index||0:collection.index=0,this.parseCollections(collection,options),this.parseManifests(collection,options),collection},Deserialiser.parseCollections=function(collection,options){var children=collection.__jsonld.collections;if(children)for(var i=0;i<children.length;i++){options&&(options.index=i);var child=this.parseCollection(children[i],options);child.index=i,child.parentCollection=collection,collection.collections.push(child)}},Deserialiser.parseManifest=function(json,options){var manifest=new Manifesto.Manifest(json,options);return manifest},Deserialiser.parseManifests=function(collection,options){var children=collection.__jsonld.manifests;if(children)for(var i=0;i<children.length;i++){var child=this.parseManifest(children[i],options);child.index=i,child.parentCollection=collection,collection.manifests.push(child)}},Deserialiser}();Manifesto.Deserialiser=Deserialiser;var Serialiser=function(){function Serialiser(){}return Serialiser.serialise=function(manifest){return""},Serialiser}();Manifesto.Serialiser=Serialiser}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},_endsWith=require("lodash.endswith"),_isArray=require("lodash.isarray"),Manifesto;!function(Manifesto){var Service=function(_super){function Service(jsonld,options){_super.call(this,jsonld,options)}return __extends(Service,_super),Service.prototype.getProfile=function(){var profile=this.getProperty("profile");return profile||(profile=this.getProperty("dcterms:conformsTo")),_isArray(profile)?new Manifesto.ServiceProfile(profile[0]):new Manifesto.ServiceProfile(profile)},Service.prototype.getDescription=function(){return Manifesto.Utils.getLocalisedValue(this.getProperty("description"),this.options.locale)},Service.prototype.getInfoUri=function(){var infoUri=this.id;return _endsWith(infoUri,"/")||(infoUri+="/"),infoUri+="info.json"},Service}(Manifesto.ManifestResource);Manifesto.Service=Service}(Manifesto||(Manifesto={}));var Manifesto;!function(Manifesto){var Thumb=function(){function Thumb(width,canvas){this.data=canvas,this.index=canvas.index,this.width=width;var heightRatio=canvas.getHeight()/canvas.getWidth();heightRatio?this.height=Math.floor(this.width*heightRatio):this.height=width,this.uri=canvas.getCanonicalImageUri(width),this.label=canvas.getLabel()}return Thumb}();Manifesto.Thumb=Thumb}(Manifesto||(Manifesto={}));var Manifesto;!function(Manifesto){var TreeNode=function(){function TreeNode(label,data){this.label=label,this.data=data||{},this.nodes=[]}return TreeNode.prototype.addNode=function(node){this.nodes.push(node),node.parentNode=this},TreeNode.prototype.isCollection=function(){return this.data.type===Manifesto.TreeNodeType.COLLECTION.toString()},TreeNode.prototype.isManifest=function(){return this.data.type===Manifesto.TreeNodeType.MANIFEST.toString()},TreeNode.prototype.isRange=function(){return this.data.type===Manifesto.TreeNodeType.RANGE.toString()},TreeNode}();Manifesto.TreeNode=TreeNode}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var TreeNodeType=function(_super){function TreeNodeType(){_super.apply(this,arguments)}return __extends(TreeNodeType,_super),TreeNodeType.prototype.collection=function(){return new TreeNodeType(TreeNodeType.COLLECTION.toString())},TreeNodeType.prototype.manifest=function(){return new TreeNodeType(TreeNodeType.MANIFEST.toString())},TreeNodeType.prototype.range=function(){return new TreeNodeType(TreeNodeType.RANGE.toString())},TreeNodeType.COLLECTION=new TreeNodeType("sc:collection"),TreeNodeType.MANIFEST=new TreeNodeType("sc:manifest"),TreeNodeType.RANGE=new TreeNodeType("sc:range"),TreeNodeType}(Manifesto.StringValue);Manifesto.TreeNodeType=TreeNodeType}(Manifesto||(Manifesto={}));var http=require("http"),https=require("https"),url=require("url"),Manifesto;!function(Manifesto){var Utils=function(){function Utils(){}return Utils.getImageQuality=function(profile){var p=profile.toString();return p===Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE1.toString()||p===Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE2.toString()||p===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE1.toString()||p===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE2.toString()||p===Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE1.toString()||p===Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE2.toString()||p===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE1.toString()||p===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE2.toString()||p===Manifesto.ServiceProfile.IIIF1IMAGELEVEL1.toString()||p===Manifesto.ServiceProfile.IIIF1IMAGELEVEL1PROFILE.toString()||p===Manifesto.ServiceProfile.IIIF1IMAGELEVEL2.toString()||p===Manifesto.ServiceProfile.IIIF1IMAGELEVEL2PROFILE.toString()?"native":"default"},Utils.getLocalisedValue=function(resource,locale){if(!_isArray(resource))return resource;for(var i=0;i<resource.length;i++){var value=resource[i],language=value["@language"];if(locale===language)return value["@value"]}for(var match=locale.substr(0,locale.indexOf("-")),i=0;i<resource.length;i++){var value=resource[i],language=value["@language"];if(language===match)return value["@value"]}return null},Utils.loadResource=function(uri){return new Promise(function(resolve,reject){var request,u=url.parse(uri),opts={host:u.hostname,port:u.port,path:u.path,method:"GET",withCredentials:!1};request="https:"===u.protocol?https.request(opts,function(response){var result="";response.on("data",function(chunk){result+=chunk}),response.on("end",function(){resolve(result)})}):http.request(opts,function(response){var result="";response.on("data",function(chunk){result+=chunk}),response.on("end",function(){resolve(result)})}),request.on("error",function(error){reject(error)}),request.end()})},Utils.loadExternalResource=function(resource,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,getStoredAccessToken,handleResourceResponse,options){return new Promise(function(resolve,reject){options&&options.pessimisticAccessControl?resource.getData().then(function(){resource.isAccessControlled()?resource.clickThroughService?resolve(clickThrough(resource)):resource.restrictedService?resolve(restricted(resource)):login(resource).then(function(){getAccessToken(resource,!0).then(function(token){resource.getData(token).then(function(){resolve(handleResourceResponse(resource))})["catch"](function(message){reject(Utils.createInternalServerError(message))})})["catch"](function(message){reject(Utils.createInternalServerError(message))})})["catch"](function(message){reject(Utils.createInternalServerError(message))}):resolve(resource)})["catch"](function(message){reject(Utils.createInternalServerError(message))}):getStoredAccessToken(resource,tokenStorageStrategy).then(function(storedAccessToken){storedAccessToken?resource.getData(storedAccessToken).then(function(){resource.status===HTTPStatusCode.OK?resolve(handleResourceResponse(resource)):Utils.authorize(resource,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,getStoredAccessToken).then(function(){resolve(handleResourceResponse(resource))})["catch"](function(error){reject(resource.restrictedService?Utils.createRestrictedError():Utils.createAuthorizationFailedError())})})["catch"](function(error){reject(Utils.createAuthorizationFailedError())}):Utils.authorize(resource,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,getStoredAccessToken).then(function(){resolve(handleResourceResponse(resource))})["catch"](function(error){reject(Utils.createAuthorizationFailedError())})})["catch"](function(error){reject(Utils.createAuthorizationFailedError())})})},Utils.createError=function(name,message){var error=new Error;return error.message=message,error.name=name,error},Utils.createAuthorizationFailedError=function(){return Utils.createError(manifesto.StatusCodes.AUTHORIZATION_FAILED.toString(),"Authorization failed")},Utils.createRestrictedError=function(){return Utils.createError(manifesto.StatusCodes.RESTRICTED.toString(),"Restricted")},Utils.createInternalServerError=function(message){return Utils.createError(manifesto.StatusCodes.INTERNAL_SERVER_ERROR.toString(),message)},Utils.loadExternalResources=function(resources,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,getStoredAccessToken,handleResourceResponse,options){return new Promise(function(resolve,reject){var promises=_map(resources,function(resource){return Utils.loadExternalResource(resource,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,getStoredAccessToken,handleResourceResponse,options)});Promise.all(promises).then(function(){resolve(resources)})["catch"](function(error){reject(error)})})},Utils.authorize=function(resource,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,getStoredAccessToken){return new Promise(function(resolve,reject){resource.getData().then(function(){resource.isAccessControlled()?getStoredAccessToken(resource,tokenStorageStrategy).then(function(storedAccessToken){storedAccessToken?resource.getData(storedAccessToken).then(function(){resource.status===HTTPStatusCode.OK?resolve(resource):Utils.showAuthInteraction(resource,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,resolve,reject)})["catch"](function(message){reject(Utils.createInternalServerError(message))}):getAccessToken(resource,!1).then(function(accessToken){accessToken?storeAccessToken(resource,accessToken,tokenStorageStrategy).then(function(){resource.getData(accessToken).then(function(){resource.status===HTTPStatusCode.OK?resolve(resource):Utils.showAuthInteraction(resource,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,resolve,reject)})["catch"](function(message){reject(Utils.createInternalServerError(message))})})["catch"](function(message){reject(Utils.createInternalServerError(message))}):Utils.showAuthInteraction(resource,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,resolve,reject)})})["catch"](function(message){reject(Utils.createInternalServerError(message))}):resolve(resource)})})},Utils.showAuthInteraction=function(resource,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,resolve,reject){resource.status!==HTTPStatusCode.MOVED_TEMPORARILY||resource.isResponseHandled?resource.restrictedService?resolve(restricted(resource)):resource.clickThroughService&&!resource.isResponseHandled?clickThrough(resource).then(function(){getAccessToken(resource,!0).then(function(accessToken){storeAccessToken(resource,accessToken,tokenStorageStrategy).then(function(){resource.getData(accessToken).then(function(){resolve(resource)})["catch"](function(message){reject(Utils.createInternalServerError(message))})})["catch"](function(message){reject(Utils.createInternalServerError(message))})})["catch"](function(message){reject(Utils.createInternalServerError(message))})}):login(resource).then(function(){getAccessToken(resource,!0).then(function(accessToken){storeAccessToken(resource,accessToken,tokenStorageStrategy).then(function(){resource.getData(accessToken).then(function(){resolve(resource)})["catch"](function(message){reject(Utils.createInternalServerError(message))})})["catch"](function(message){reject(Utils.createInternalServerError(message))})})["catch"](function(message){reject(Utils.createInternalServerError(message))})}):resolve(resource)},Utils.getService=function(resource,profile){var services=this.getServices(resource);"string"!=typeof profile&&(profile=profile.toString());for(var i=0;i<services.length;i++){var service=services[i];if(service.getProfile().toString()===profile)return service}return null},Utils.getResourceById=function(parentResource,id){return[parentResource.__jsonld].en().traverseUnique(function(x){return Utils.getAllArrays(x)}).first(function(r){return r["@id"]===id})},Utils.getAllArrays=function(obj){var all=[].en();if(!obj)return all;for(var key in obj){var val=obj[key];_isArray(val)&&(all=all.concat(val))}return all},Utils.getServices=function(resource){var service;service=resource.__jsonld?resource.__jsonld.service:resource.service;var services=[];if(!service)return services;_isArray(service)||(service=[service]);for(var i=0;i<service.length;i++){var s=service[i];if(_isString(s)){var r=this.getResourceById(resource.options.resource,s);r&&services.push(new Manifesto.Service(r.__jsonld||r,resource.options))}else services.push(new Manifesto.Service(s,resource.options))}return services},Utils}();Manifesto.Utils=Utils}(Manifesto||(Manifesto={})),global.manifesto=global.Manifesto=module.exports={AnnotationMotivation:new Manifesto.AnnotationMotivation,ElementType:new Manifesto.ElementType,IIIFResourceType:new Manifesto.IIIFResourceType,ManifestType:new Manifesto.ManifestType,RenderingFormat:new Manifesto.RenderingFormat,ResourceFormat:new Manifesto.ResourceFormat,ResourceType:new Manifesto.ResourceType,ServiceProfile:new Manifesto.ServiceProfile,TreeNodeType:new Manifesto.TreeNodeType,ViewingDirection:new Manifesto.ViewingDirection,ViewingHint:new Manifesto.ViewingHint,StatusCodes:{AUTHORIZATION_FAILED:1,FORBIDDEN:2,INTERNAL_SERVER_ERROR:3,RESTRICTED:4},create:function(manifest,options){return Manifesto.Deserialiser.parse(manifest,options)},getService:function(resource,profile){return Manifesto.Utils.getService(resource,profile)},getTreeNode:function(){return new Manifesto.TreeNode},isImageProfile:function(profile){return profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE0.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE1.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE2.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE0.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE1.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE2.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE0.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE1.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE2.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE0.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE1.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE2.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL0.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL0PROFILE.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL1.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL1PROFILE.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL2.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL2PROFILE.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL0.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL0PROFILE.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL1.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL1PROFILE.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL2.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL2PROFILE.toString()},isLevel0ImageProfile:function(profile){return profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE0.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE0.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE0.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE0.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL0.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL0PROFILE.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL0.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL0PROFILE.toString()},isLevel1ImageProfile:function(profile){return profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE1.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE1.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE1.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE1.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL1.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL1PROFILE.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL1.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL1PROFILE.toString()},isLevel2ImageProfile:function(profile){return profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECOMPLIANCE2.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECOMPLIANCE2.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIFIMAGECONFORMANCE2.toString()||profile.toString()===Manifesto.ServiceProfile.STANFORDIIIF1IMAGECONFORMANCE2.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL2.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF1IMAGELEVEL2PROFILE.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL2.toString()||profile.toString()===Manifesto.ServiceProfile.IIIF2IMAGELEVEL2PROFILE.toString()},loadExternalResources:function(resources,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,getStoredAccessToken,handleResourceResponse,options){return Manifesto.Utils.loadExternalResources(resources,tokenStorageStrategy,clickThrough,restricted,login,getAccessToken,storeAccessToken,getStoredAccessToken,handleResourceResponse,options)},loadManifest:function(uri){return Manifesto.Utils.loadResource(uri)}};var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var Annotation=function(_super){function Annotation(jsonld,options){_super.call(this,jsonld,options)}return __extends(Annotation,_super),Annotation.prototype.getMotivation=function(){var motivation=this.getProperty("motivation");return motivation?new Manifesto.AnnotationMotivation(motivation.toLowerCase()):null},Annotation.prototype.getOn=function(){return this.getProperty("on")},Annotation.prototype.getResource=function(){return new Manifesto.Resource(this.getProperty("resource"),this.options)},Annotation}(Manifesto.ManifestResource);Manifesto.Annotation=Annotation}(Manifesto||(Manifesto={}));var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)},Manifesto;!function(Manifesto){var Resource=function(_super){function Resource(jsonld,options){_super.call(this,jsonld,options)}return __extends(Resource,_super),Resource.prototype.getFormat=function(){var format=this.getProperty("format");return format?new Manifesto.ResourceFormat(format.toLowerCase()):null},Resource.prototype.getType=function(){var type=this.getProperty("@type");return type?new Manifesto.ResourceType(type.toLowerCase()):null},Resource.prototype.getWidth=function(){return this.getProperty("width")},Resource.prototype.getHeight=function(){return this.getProperty("height")},Resource.prototype.getMaxWidth=function(){return this.getProperty("maxWidth")},Resource.prototype.getMaxHeight=function(){var maxHeight=this.getProperty("maxHeight");if(!maxHeight)return this.getMaxWidth()},Resource}(Manifesto.ManifestResource);Manifesto.Resource=Resource}(Manifesto||(Manifesto={}));
{
"name": "manifesto.js",
"version": "0.1.27",
"version": "0.2.0",
"description": "IIIF Presentation API utility library for client and server",

@@ -5,0 +5,0 @@ "main": "dist/server/manifesto.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display