diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json new file mode 100644 index 00000000..ffd5f288 --- /dev/null +++ b/.codesandbox/ci.json @@ -0,0 +1,6 @@ +{ + "sandboxes": [ + "vanilla-ts" + ], + "node": "16" +} diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index ef36bdfe..5af39d5e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [ '16', '14' ] + node: [ '16' ] name: Node ${{ matrix.node }} build steps: @@ -24,8 +24,8 @@ jobs: node-version: ${{ matrix.node }} - run: npm ci - run: npm run build - - run: npm run test + # - run: npm run test # @todo these are not working currently. # - run: node pkg-tests/node-load.js # - run: node pkg-tests/node-load.mjs - - run: node pkg-tests/node-umd.js + # - run: node pkg-tests/node-umd.js diff --git a/.gitignore b/.gitignore index a4e7175e..03a95450 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,5 @@ -dist-commonjs -dist-esmodule -dist-umd -dist-var coverage npm-debug.log node_modules +dist debug.log -types \ No newline at end of file diff --git a/.npmignore b/.npmignore index 6f9435ea..4e81ca5b 100644 --- a/.npmignore +++ b/.npmignore @@ -2,4 +2,7 @@ **/tsconfig.json **/webpack.config.js node_modules -src \ No newline at end of file +src +mocha_3d_tests.js +test +pkg-tests diff --git a/README.md b/README.md index 88e04f62..4a6c98fc 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,75 @@ # manifesto -[![Build Status](https://travis-ci.org/IIIF-Commons/manifesto.svg?branch=master)](https://travis-ci.org/IIIF-Commons/manifesto) +Client and server utility library to support draft 3D extensions to to the IIIF Presentation API client and server utility library. -IIIF Presentation API client and server utility library. +Forked from [IIIF-Commons/manifesto](https://github.com/IIIF-Commons/manifesto). - npm install manifesto.js --save +Goal of implementing the [Draft API](https://github.com/IIIF/3d/blob/main/temp-draft-4.md) under development by the [IIIF 3D Technical Study Group](https://github.com/IIIF/3d/). -## Getting Started ### Documentation -https://iiif-commons.github.io/manifesto/ +[Manifesto.js](https://vincentmarchetti.github.io/manifesto/) -### Developer Setup +### Loading through package manager - git clone https://github.com/iiif-commons/manifesto.git - npm install - npm build - npm test +This included in package.json -### Publishing Package + "dependencies": { + "manifesto.js": "IIIF-Commons/manifesto#draft3dapi", + }, + +will install manifesto modules into node_modules. - git checkout master - npm version patch - git add . - git commit -m "Release v1.2.3" - git tag v1.2.3 - git push origin master v1.2.3 +### Demonstration Projects +[Example manifests](https://github.com/IIIF/3d/tree/main/manifests) conforming to the [Draft API](https://github.com/IIIF/3d/blob/main/temp-draft-4.md) . + +[Prototype Viewers](https://github.com/IIIF/3d/issues/28) rendering the example manifests. +- [Three-JS based viewer](https://codesandbox.io/p/github/JulieWinchester/iiif-threejs-demo) +- [X3D/X3DOM based viewer](https://codesandbox.io/p/github/vincentmarchetti/iiif-x3dom-demo/main) +- [Smithsonian Voyager](https://codesandbox.io/p/sandbox/voyager-annotations-demo-forked-l83l6w) + +### ChangeLog + +From start point of the version distributed from [JulieWinchester/manifesto](https://github.com/JulieWinchester/manifesto/tree/3dtsg-dev-dist) + +#### To package.json version 4.3.0-draft3dapi.0.1.0 +distributed from [vincentmarchetti/manifesto#3dtsg-main]() there were these changes: + +1. This test is no longer useful for the Target of an Annotation: + + if ( typeof(target) === "string" ){ + // handle case where target is a Scene + } + + Draft manifest [ 3_lights/direction_light_transform ]( https://github.com/IIIF/3d/blob/main/manifests/3_lights/direction_light_transform_rotate.json ) uses two ways of encoding the value of a target property for an Annotation: with a json string value of the IRI, or with an object with `id` property of the IRI for the Scene. To avoid exponential expansion of if-else code when combined with target property which can also be `SpecificResource` resources, the parsing code was changed so tha the value returned from `getTarget()` is always an object. + + Since the Target property will always be an object referencing a `Scene`, or a `SpecificResource` whose `source` property is a `Scene`, the code for handling either would be + + if (target.isSpecificResource){ + // handle a SpecificResource, with selector property + // and whose source property is the Scene + } + else{ + // handle a Scene directly + } + +2. Annotation.getBody3D() is deprecated. + + The `Annotation.getBody()` from the Presentation 3 code has been extended to support the resources that can be included in a 3d Annotation body property. An important difference is that the `getBody()` function returns an array of objects, while the `getBody3D()` returns a single object. The deprecated function `getBody3D()` should be replaced with `getBody()[0]` + +#### To package.json version 4.3.0-draft3dapi.0.2.0 + +1. Fixed a bug that occurred in determining the 'source' property of a SpecificResource resource that is the "target" property of an Annotation. This bug escaped detection previously because in the 3D case this 'source' property has always been a Scene resource, and the value is not needed for visualization. + +#### To package.json version 4.3.0-draft3dapi.0.3.0 + +1. Added isSpecificResource and isAnnotationBody properties to the SpecificResource and AnnotationBody classes, in response to developer suggestion. (Slack, Apr 24 2024) + +#### To package.json version 4.3.0-draft3dapi.0.4.0 + +1. Implemented Perspective Camera properties in the Camera class. + +#### To package.json version 4.3.0-draft3dapi.0.5.0 + +1. Implement lookAt property of Camera class and of Light class. diff --git a/dist-commonjs/Annotation.d.ts b/dist-commonjs/Annotation.d.ts new file mode 100644 index 00000000..6afc5e98 --- /dev/null +++ b/dist-commonjs/Annotation.d.ts @@ -0,0 +1,56 @@ +import { AnnotationMotivation } from "@iiif/vocabulary/dist-commonjs"; +import { AnnotationBody, IManifestoOptions, ManifestResource, Resource, SpecificResource } from "./internal"; +import { Vector3 } from "threejs-math"; +export declare class Annotation extends ManifestResource { + constructor(jsonld: any, options: IManifestoOptions); + /** + In spite of its name, this method returns an array of objects, each of which + represents a potential body annotations + + @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ } + **/ + getBody(): (AnnotationBody | SpecificResource)[]; + get Body(): (SpecificResource | AnnotationBody)[]; + /** + auxiliary function to getBody; intended to hande an object that has an element items + which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/ + seems to be the use case for this + **/ + private parseBodiesFromItemsList; + /** + auxiliary function to parseBodiesFromItemsList and getBody, this is the last + step on recursively going through collections of bodies. + **/ + private parseSingletonBody; + /** + Developer Note: 8 April 2024 + getBody3D function was developed in the early stages of the 3D API Feb-March 2024 + as alternative to the existing Annotation getBody function, but the signature for + getBody3D was chosen to be a single object instance, not an array. + + At this stage, the merging of the 2D API anf the draft 3D API has been completed, so + 3D applications can use the getBody() function to retrieve the body of an Annotation intended + to target a scene. For compatibily the return value of the function is still an + array. + + 3D clients using getBody are responsible for choosing the appropriate instance from the + returned array. In most cases this will be the sole 0th element. + **/ + getBody3D(): (AnnotationBody | SpecificResource); + getMotivation(): AnnotationMotivation | null; + getOn(): string; + getTarget(): any; + get Target(): any; + getResource(): Resource; + /** + * A 3D point coordinate object for the location of an Annotation + * to satisfy the requirements of the lookAt property of camera and + * spotlight resources, according to the draft v4 API as of April 1 2024 + * + * Is the position of the point for a target which is a SpecificResource with + * a PointSelector + * Otherwise, for example when the annotation target is an entire Scene, the + * location for lookAt is the origin (0,0,0) + **/ + get LookAtLocation(): Vector3; +} diff --git a/dist-commonjs/Annotation.js b/dist-commonjs/Annotation.js new file mode 100644 index 00000000..f7de1f6e --- /dev/null +++ b/dist-commonjs/Annotation.js @@ -0,0 +1,156 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Annotation = void 0; +var internal_1 = require("./internal"); +var threejs_math_1 = require("threejs-math"); +var Annotation = /** @class */ (function (_super) { + __extends(Annotation, _super); + function Annotation(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + /** + In spite of its name, this method returns an array of objects, each of which + represents a potential body annotations + + @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ } + **/ + Annotation.prototype.getBody = function () { + var bodies = []; + var body = this.getProperty("body"); + // the following is intended to handle the following cases for + /// the raw json of the body property of __jsonld + // -- body is an array, each element of which is parsed + // == body is an object with property items, each item is parsed + // -- body is parsed + if (body) { + for (var _i = 0, _a = [].concat(body); _i < _a.length; _i++) { + var bd = _a[_i]; + var items = bd.items; + if (items) + bodies = bodies.concat(this.parseBodiesFromItemsList(items)); + else + bodies.push(this.parseSingletonBody(bd)); + } + } + return bodies; + }; + Object.defineProperty(Annotation.prototype, "Body", { + get: function () { return this.getBody(); }, + enumerable: false, + configurable: true + }); + /** + auxiliary function to getBody; intended to hande an object that has an element items + which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/ + seems to be the use case for this + **/ + Annotation.prototype.parseBodiesFromItemsList = function (rawbodies) { + var retVal = []; + for (var _i = 0, _a = [].concat(rawbodies); _i < _a.length; _i++) { + var bd = _a[_i]; + retVal.push(this.parseSingletonBody(bd)); + } + return retVal; + }; + /** + auxiliary function to parseBodiesFromItemsList and getBody, this is the last + step on recursively going through collections of bodies. + **/ + Annotation.prototype.parseSingletonBody = function (rawbody) { + if (rawbody.type === "SpecificResource") { + return new internal_1.SpecificResource(rawbody, this.options); + } + else { + return internal_1.AnnotationBodyParser.BuildFromJson(rawbody, this.options); + } + }; + /** + Developer Note: 8 April 2024 + getBody3D function was developed in the early stages of the 3D API Feb-March 2024 + as alternative to the existing Annotation getBody function, but the signature for + getBody3D was chosen to be a single object instance, not an array. + + At this stage, the merging of the 2D API anf the draft 3D API has been completed, so + 3D applications can use the getBody() function to retrieve the body of an Annotation intended + to target a scene. For compatibily the return value of the function is still an + array. + + 3D clients using getBody are responsible for choosing the appropriate instance from the + returned array. In most cases this will be the sole 0th element. + **/ + Annotation.prototype.getBody3D = function () { + console.warn("Annotation.getBody3D is deprecated: replace with getBody3D() with getBody()[0]"); + return this.getBody()[0]; + }; + Annotation.prototype.getMotivation = function () { + var motivation = this.getProperty("motivation"); + if (motivation) { + //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation); + return motivation; + } + return null; + }; + // open annotation + Annotation.prototype.getOn = function () { + return this.getProperty("on"); + }; + Annotation.prototype.getTarget = function () { + var rawTarget = this.getPropertyAsObject("target"); + if (rawTarget.isIRI) + return rawTarget; + if (rawTarget.type && rawTarget.type == "SpecificResource") { + return new internal_1.SpecificResource(rawTarget, this.options); + } + else { + throw new Error("unknown target specified"); + } + }; + Object.defineProperty(Annotation.prototype, "Target", { + get: function () { return this.getTarget(); }, + enumerable: false, + configurable: true + }); + Annotation.prototype.getResource = function () { + return new internal_1.Resource(this.getProperty("resource"), this.options); + }; + Object.defineProperty(Annotation.prototype, "LookAtLocation", { + /** + * A 3D point coordinate object for the location of an Annotation + * to satisfy the requirements of the lookAt property of camera and + * spotlight resources, according to the draft v4 API as of April 1 2024 + * + * Is the position of the point for a target which is a SpecificResource with + * a PointSelector + * Otherwise, for example when the annotation target is an entire Scene, the + * location for lookAt is the origin (0,0,0) + **/ + get: function () { + var _a; + var target = this.getTarget(); + if (target.isSpecificResource && ((_a = target.getSelector()) === null || _a === void 0 ? void 0 : _a.isPointSelector)) + return target.getSelector().getLocation(); + else + return new threejs_math_1.Vector3(0.0, 0.0, 0.0); + }, + enumerable: false, + configurable: true + }); + return Annotation; +}(internal_1.ManifestResource)); +exports.Annotation = Annotation; +//# sourceMappingURL=Annotation.js.map \ No newline at end of file diff --git a/dist-commonjs/Annotation.js.map b/dist-commonjs/Annotation.js.map new file mode 100644 index 00000000..9a5a1ab1 --- /dev/null +++ b/dist-commonjs/Annotation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Annotation.js","sourceRoot":"","sources":["../src/Annotation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,uCAOoB;AAEpB,6CAAuC;AAEvC;IAAgC,8BAAgB;IAC9C,oBAAY,MAAW,EAAE,OAA0B;QACjD,OAAA,MAAK,YAAC,M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C,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;IAYD,sBAAI,sCAAc;QAVlB;;;;;;;;;WASG;aACH;;YACE,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,EAAS,CAAC;YAErC,IAAI,MAAM,CAAC,kBAAkB,KAAI,MAAA,MAAM,CAAC,WAAW,EAAE,0CAAE,eAAe,CAAA;gBAClE,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC;;gBAE1C,OAAO,IAAI,sBAAO,CAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC,CAAC;QACtC,CAAC;;;OAAA;IACH,iBAAC;AAAD,CAAC,AA1ID,CAAgC,2BAAgB,GA0I/C;AA1IY,gCAAU"} \ No newline at end of file diff --git a/dist-commonjs/AnnotationBody.d.ts b/dist-commonjs/AnnotationBody.d.ts new file mode 100644 index 00000000..62982da4 --- /dev/null +++ b/dist-commonjs/AnnotationBody.d.ts @@ -0,0 +1,23 @@ +import { ExternalResourceType, MediaType } from "@iiif/vocabulary/dist-commonjs"; +import { IManifestoOptions, ManifestResource } from "./internal"; +/** +With the 3D extensions to the IIIF Presentation API the name of this +class is misleading, but for now is being retained for the sake backward +compatibility with earlier manifesto code and tests. + +The 3D extensions allow that the body property of an annotation can be +a light, camera, or model, or a SpecificResource object wrapping a light, camera, +or model. +**/ +export declare class AnnotationBody extends ManifestResource { + constructor(jsonld?: any, options?: IManifestoOptions); + isAnnotationBody: boolean; + isSpecificResource: boolean; + getFormat(): MediaType | null; + getType(): ExternalResourceType | null; + getWidth(): number; + getHeight(): number; + isModel: boolean; + isLight: boolean; + isCamera: boolean; +} diff --git a/dist-commonjs/AnnotationBody.js b/dist-commonjs/AnnotationBody.js new file mode 100644 index 00000000..77d06508 --- /dev/null +++ b/dist-commonjs/AnnotationBody.js @@ -0,0 +1,77 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnnotationBody = void 0; +var internal_1 = require("./internal"); +/** +With the 3D extensions to the IIIF Presentation API the name of this +class is misleading, but for now is being retained for the sake backward +compatibility with earlier manifesto code and tests. + +The 3D extensions allow that the body property of an annotation can be +a light, camera, or model, or a SpecificResource object wrapping a light, camera, +or model. +**/ +var AnnotationBody = /** @class */ (function (_super) { + __extends(AnnotationBody, _super); + function AnnotationBody(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + /* + property distinguishing instances of SpecificResource from instances of AnnotionBody. + The return type of the Annotation.getBody() method is an array of instances of the + union type ( AnnotationBody | SpecificResource ) + */ + _this.isAnnotationBody = true; + /* + property distinguishing instances of SpecificResource from instances of AnnotionBody. + The return type of the Annotation.getBody() method is an array of instances of the + union type ( AnnotationBody | SpecificResource ) + */ + _this.isSpecificResource = false; + // following class members were added to support 3D and mixed 2D/3D content + // these boolean switches will be appropriately set when the manifest json is parsed + _this.isModel = true; + _this.isLight = false; + _this.isCamera = false; + return _this; + } + // Format, Type, Width, and Height are the body properties supported + // in the code that supports Presentation 3 + AnnotationBody.prototype.getFormat = function () { + var format = this.getProperty("format"); + if (format) { + return internal_1.Utils.getMediaType(format); + } + return null; + }; + AnnotationBody.prototype.getType = function () { + var type = this.getProperty("type"); + if (type) { + return (internal_1.Utils.normaliseType(this.getProperty("type"))); + } + return null; + }; + AnnotationBody.prototype.getWidth = function () { + return this.getProperty("width"); + }; + AnnotationBody.prototype.getHeight = function () { + return this.getProperty("height"); + }; + return AnnotationBody; +}(internal_1.ManifestResource)); +exports.AnnotationBody = AnnotationBody; +//# sourceMappingURL=AnnotationBody.js.map \ No newline at end of file diff --git a/dist-commonjs/AnnotationBody.js.map b/dist-commonjs/AnnotationBody.js.map new file mode 100644 index 00000000..ee688942 --- /dev/null +++ b/dist-commonjs/AnnotationBody.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AnnotationBody.js","sourceRoot":"","sources":["../src/AnnotationBody.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAIA,uCAAwE;AAGxE;;;;;;;;GAQG;AACH;IAAoC,kCAAgB;IAClD,wBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QAIzB;;;;UAIE;QACF,sBAAgB,GAAa,IAAI,CAAC;QAElC;;;;UAIE;QACF,wBAAkB,GAAa,KAAK,CAAC;QAsCrC,2EAA2E;QAC3E,oFAAoF;QAEpF,aAAO,GAAa,IAAI,CAAC;QAEzB,aAAO,GAAa,KAAK,CAAC;QAE1B,cAAQ,GAAa,KAAK,CAAC;;IA5D3B,CAAC;IAkBD,oEAAoE;IACpE,2CAA2C;IAC3C,kCAAS,GAAT;QACE,IAAM,MAAM,GAAW,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAElD,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,gBAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gCAAO,GAAP;QACE,IAAM,IAAI,GAAW,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAE9C,IAAI,IAAI,EAAE,CAAC;YACT,OAA6B,CAC3B,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAC9C,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iCAAQ,GAAR;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,kCAAS,GAAT;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAcH,qBAAC;AAAD,CAAC,AAjED,CAAoC,2BAAgB,GAiEnD;AAjEY,wCAAc"} \ No newline at end of file diff --git a/dist-commonjs/AnnotationBodyParser.d.ts b/dist-commonjs/AnnotationBodyParser.d.ts new file mode 100644 index 00000000..dcde1769 --- /dev/null +++ b/dist-commonjs/AnnotationBodyParser.d.ts @@ -0,0 +1,4 @@ +import { AnnotationBody, IManifestoOptions } from "./internal"; +export declare class AnnotationBodyParser { + static BuildFromJson(jsonld: any, options?: IManifestoOptions): AnnotationBody; +} diff --git a/dist-commonjs/AnnotationBodyParser.js b/dist-commonjs/AnnotationBodyParser.js new file mode 100644 index 00000000..2c7f398d --- /dev/null +++ b/dist-commonjs/AnnotationBodyParser.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnnotationBodyParser = void 0; +var internal_1 = require("./internal"); +var LightTypes = ["AmbientLight", "DirectionalLight", "SpotLight"]; +var CameraTypes = ["PerspectiveCamera", "OrthographicCamera"]; +var DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"]; +var AnnotationBodyParser = /** @class */ (function () { + function AnnotationBodyParser() { + } + AnnotationBodyParser.BuildFromJson = function (jsonld, options) { + if (DisplayedTypes.includes(jsonld.type)) + return new internal_1.AnnotationBody(jsonld, options); + else if (LightTypes.includes(jsonld.type)) + return new internal_1.Light(jsonld, options); + else if (CameraTypes.includes(jsonld.type)) + return new internal_1.Camera(jsonld, options); + else + throw new Error("unimplemented type for AnnotationBody: " + jsonld.type); + }; + return AnnotationBodyParser; +}()); +exports.AnnotationBodyParser = AnnotationBodyParser; +//# sourceMappingURL=AnnotationBodyParser.js.map \ No newline at end of file diff --git a/dist-commonjs/AnnotationBodyParser.js.map b/dist-commonjs/AnnotationBodyParser.js.map new file mode 100644 index 00000000..6799d34b --- /dev/null +++ b/dist-commonjs/AnnotationBodyParser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AnnotationBodyParser.js","sourceRoot":"","sources":["../src/AnnotationBodyParser.ts"],"names":[],"mappings":";;;AAAA,uCAKoB;AAGpB,IAAI,UAAU,GAAY,CAAC,cAAc,EAAG,kBAAkB,EAAE,WAAW,CAAC,CAAC;AAC7E,IAAI,WAAW,GAAY,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;AACvE,IAAI,cAAc,GAAY,CAAC,OAAO,EAAE,UAAU,EAAC,OAAO,EAAC,OAAO,EAAC,OAAO,CAAC,CAAC;AAC5E;IAAA;IAYA,CAAC;IAXU,kCAAa,GAApB,UAAsB,MAAW,EAAG,OAA2B;QAC3D,IAAI,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;YACpC,OAAO,IAAI,yBAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;aAC1C,IAAK,UAAU,CAAC,QAAQ,CAAE,MAAM,CAAC,IAAI,CAAE;YACxC,OAAO,IAAI,gBAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;aACjC,IAAK,WAAW,CAAC,QAAQ,CAAE,MAAM,CAAC,IAAI,CAAE;YACzC,OAAO,IAAI,iBAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;YAEnC,MAAM,IAAI,KAAK,CAAC,yCAAyC,GAAG,MAAM,CAAC,IAAI,CAAE,CAAC;IAElF,CAAC;IACL,2BAAC;AAAD,CAAC,AAZD,IAYC;AAZa,oDAAoB"} \ No newline at end of file diff --git a/dist-commonjs/AnnotationList.d.ts b/dist-commonjs/AnnotationList.d.ts new file mode 100644 index 00000000..7225a12e --- /dev/null +++ b/dist-commonjs/AnnotationList.d.ts @@ -0,0 +1,12 @@ +import { IIIFResourceType } from "@iiif/vocabulary/dist-commonjs"; +import { Annotation, IManifestoOptions, JSONLDResource } from "./internal"; +export declare class AnnotationList extends JSONLDResource { + options: IManifestoOptions; + label: string; + isLoaded: boolean; + constructor(label: any, jsonld?: any, options?: IManifestoOptions); + getIIIFResourceType(): IIIFResourceType; + getLabel(): string; + getResources(): Annotation[]; + load(): Promise; +} diff --git a/dist-commonjs/AnnotationList.js b/dist-commonjs/AnnotationList.js new file mode 100644 index 00000000..c7adb471 --- /dev/null +++ b/dist-commonjs/AnnotationList.js @@ -0,0 +1,65 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnnotationList = void 0; +var internal_1 = require("./internal"); +var AnnotationList = /** @class */ (function (_super) { + __extends(AnnotationList, _super); + function AnnotationList(label, jsonld, options) { + var _this = _super.call(this, jsonld) || this; + _this.label = label; + _this.options = options; + return _this; + } + AnnotationList.prototype.getIIIFResourceType = function () { + return internal_1.Utils.normaliseType(this.getProperty("type")); + }; + AnnotationList.prototype.getLabel = function () { + return this.label; + }; + AnnotationList.prototype.getResources = function () { + var _this = this; + var resources = this.getProperty("resources"); + return resources.map(function (resource) { return new internal_1.Annotation(resource, _this.options); }); + }; + AnnotationList.prototype.load = function () { + var _this = this; + return new Promise(function (resolve, reject) { + if (_this.isLoaded) { + resolve(_this); + } + else { + var id = _this.__jsonld.id; + if (!id) { + id = _this.__jsonld["@id"]; + } + internal_1.Utils.loadManifest(id) + .then(function (data) { + _this.__jsonld = data; + _this.context = _this.getProperty("context"); + _this.id = _this.getProperty("id"); + _this.isLoaded = true; + resolve(_this); + }) + .catch(reject); + } + }); + }; + return AnnotationList; +}(internal_1.JSONLDResource)); +exports.AnnotationList = AnnotationList; +//# sourceMappingURL=AnnotationList.js.map \ No newline at end of file diff --git a/dist-commonjs/AnnotationList.js.map b/dist-commonjs/AnnotationList.js.map new file mode 100644 index 00000000..9bff999b --- /dev/null +++ b/dist-commonjs/AnnotationList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AnnotationList.js","sourceRoot":"","sources":["../src/AnnotationList.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,uCAKoB;AAEpB;IAAoC,kCAAc;IAKhD,wBAAY,KAAK,EAAE,MAAY,EAAE,OAA2B;QAC1D,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QACd,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAI,CAAC,OAAO,GAAsB,OAAO,CAAC;;IAC5C,CAAC;IAED,4CAAmB,GAAnB;QACE,OAAyB,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,iCAAQ,GAAR;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,qCAAY,GAAZ;QAAA,iBAGC;QAFC,IAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChD,OAAO,SAAS,CAAC,GAAG,CAAC,UAAA,QAAQ,IAAI,OAAA,IAAI,qBAAU,CAAC,QAAQ,EAAE,KAAI,CAAC,OAAO,CAAC,EAAtC,CAAsC,CAAC,CAAC;IAC3E,CAAC;IAED,6BAAI,GAAJ;QAAA,iBAsBC;QArBC,OAAO,IAAI,OAAO,CAAiB,UAAC,OAAO,EAAE,MAAM;YACjD,IAAI,KAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,OAAO,CAAC,KAAI,CAAC,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACN,IAAI,EAAE,GAAW,KAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAElC,IAAI,CAAC,EAAE,EAAE,CAAC;oBACR,EAAE,GAAG,KAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAC5B,CAAC;gBAED,gBAAK,CAAC,YAAY,CAAC,EAAE,CAAC;qBACnB,IAAI,CAAC,UAAA,IAAI;oBACR,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACrB,KAAI,CAAC,OAAO,GAAG,KAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;oBAC3C,KAAI,CAAC,EAAE,GAAG,KAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;oBACjC,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACrB,OAAO,CAAC,KAAI,CAAC,CAAC;gBAChB,CAAC,CAAC;qBACD,KAAK,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,qBAAC;AAAD,CAAC,AA/CD,CAAoC,yBAAc,GA+CjD;AA/CY,wCAAc"} \ No newline at end of file diff --git a/dist-commonjs/AnnotationPage.d.ts b/dist-commonjs/AnnotationPage.d.ts new file mode 100644 index 00000000..6b166146 --- /dev/null +++ b/dist-commonjs/AnnotationPage.d.ts @@ -0,0 +1,5 @@ +import { Annotation, IManifestoOptions, ManifestResource } from "./internal"; +export declare class AnnotationPage extends ManifestResource { + constructor(jsonld: any, options: IManifestoOptions); + getItems(): Annotation[]; +} diff --git a/dist-commonjs/AnnotationPage.js b/dist-commonjs/AnnotationPage.js new file mode 100644 index 00000000..fbd19cac --- /dev/null +++ b/dist-commonjs/AnnotationPage.js @@ -0,0 +1,31 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnnotationPage = void 0; +var internal_1 = require("./internal"); +var AnnotationPage = /** @class */ (function (_super) { + __extends(AnnotationPage, _super); + function AnnotationPage(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + AnnotationPage.prototype.getItems = function () { + return this.getProperty("items"); + }; + return AnnotationPage; +}(internal_1.ManifestResource)); +exports.AnnotationPage = AnnotationPage; +//# sourceMappingURL=AnnotationPage.js.map \ No newline at end of file diff --git a/dist-commonjs/AnnotationPage.js.map b/dist-commonjs/AnnotationPage.js.map new file mode 100644 index 00000000..046cb3b9 --- /dev/null +++ b/dist-commonjs/AnnotationPage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AnnotationPage.js","sourceRoot":"","sources":["../src/AnnotationPage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6E;AAE7E;IAAoC,kCAAgB;IAClD,wBAAY,MAAW,EAAE,OAA0B;QACjD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IAED,iCAAQ,GAAR;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IACH,qBAAC;AAAD,CAAC,AARD,CAAoC,2BAAgB,GAQnD;AARY,wCAAc"} \ No newline at end of file diff --git a/dist-commonjs/Camera.d.ts b/dist-commonjs/Camera.d.ts new file mode 100644 index 00000000..0486fc31 --- /dev/null +++ b/dist-commonjs/Camera.d.ts @@ -0,0 +1,21 @@ +import { IManifestoOptions, AnnotationBody, PointSelector } from "./internal"; +export declare class Camera extends AnnotationBody { + constructor(jsonld?: any, options?: IManifestoOptions); + get isPerspectiveCamera(): boolean; + /** + @returns full angular size of perspective viewport in vertical direction. + Angular unit is degrees + **/ + getFieldOfView(): number | undefined; + /** + Full angular size of perspective viewport in vertical direction. + Angular unit is degrees + **/ + get FieldOfView(): number | undefined; + /** + * @return : if not null, is either a PointSelector, or an object + * with an id matching the id of an Annotation instance. + **/ + getLookAt(): object | PointSelector | null; + get LookAt(): object | null; +} diff --git a/dist-commonjs/Camera.js b/dist-commonjs/Camera.js new file mode 100644 index 00000000..03bb4d06 --- /dev/null +++ b/dist-commonjs/Camera.js @@ -0,0 +1,84 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Camera = void 0; +var internal_1 = require("./internal"); +var Camera = /** @class */ (function (_super) { + __extends(Camera, _super); + function Camera(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.isModel = false; + _this.isLight = false; + _this.isCamera = true; + return _this; + } + Object.defineProperty(Camera.prototype, "isPerspectiveCamera", { + get: function () { + return (internal_1.Utils.normaliseType(this.getProperty("type")) === "perspectivecamera"); + }, + enumerable: false, + configurable: true + }); + /** + @returns full angular size of perspective viewport in vertical direction. + Angular unit is degrees + **/ + Camera.prototype.getFieldOfView = function () { + if (this.isPerspectiveCamera) { + var value = this.getProperty("fieldOfView"); + if (value) + return value; + else + return 45.0; + } + else + return undefined; + }; + Object.defineProperty(Camera.prototype, "FieldOfView", { + /** + Full angular size of perspective viewport in vertical direction. + Angular unit is degrees + **/ + get: function () { return this.getFieldOfView(); }, + enumerable: false, + configurable: true + }); + /** + * @return : if not null, is either a PointSelector, or an object + * with an id matching the id of an Annotation instance. + **/ + Camera.prototype.getLookAt = function () { + var rawObj = this.getPropertyAsObject("lookAt"); + var rawType = (rawObj["type"] || rawObj["@type"]); + if (rawType == "Annotation") { + return rawObj; + } + if (rawType == "PointSelector") { + return new internal_1.PointSelector(rawObj); + } + throw new Error('unidentified value of lookAt ${rawType}'); + }; + Object.defineProperty(Camera.prototype, "LookAt", { + get: function () { return this.getLookAt(); }, + enumerable: false, + configurable: true + }); + return Camera; +}(internal_1.AnnotationBody)); +exports.Camera = Camera; +; +//# sourceMappingURL=Camera.js.map \ No newline at end of file diff --git a/dist-commonjs/Camera.js.map b/dist-commonjs/Camera.js.map new file mode 100644 index 00000000..314f6745 --- /dev/null +++ b/dist-commonjs/Camera.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../src/Camera.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAIsC;AAEtC;IAA4B,0BAAc;IACxC,gBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QACvB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,QAAQ,GAAI,IAAI,CAAC;;IACxB,CAAC;IAID,sBAAI,uCAAmB;aAAvB;YACE,OAAO,CAAC,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC;QACjF,CAAC;;;OAAA;IAED;;;OAGG;IACH,+BAAc,GAAd;QAEE,IAAI,IAAI,CAAC,mBAAmB,EAAC,CAAC;YAC1B,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAC5C,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;;gBACnB,OAAO,IAAI,CAAC;QACrB,CAAC;;YACI,OAAO,SAAS,CAAC;IACxB,CAAC;IAKD,sBAAI,+BAAW;QAJf;;;WAGG;aACH,cAAwC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAEtE;;;OAGG;IACH,0BAAS,GAAT;QACE,IAAI,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;QAChD,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,OAAO,IAAI,YAAY,EAAC,CAAC;YACzB,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,IAAI,OAAO,IAAI,eAAe,EAAC,CAAC;YAC5B,OAAO,IAAI,wBAAa,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IACD,sBAAI,0BAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAGzD,aAAC;AAAD,CAAC,AAnDD,CAA4B,yBAAc,GAmDzC;AAnDY,wBAAM;AAmDlB,CAAC"} \ No newline at end of file diff --git a/dist-commonjs/Canvas.d.ts b/dist-commonjs/Canvas.d.ts new file mode 100644 index 00000000..38497209 --- /dev/null +++ b/dist-commonjs/Canvas.d.ts @@ -0,0 +1,31 @@ +import { ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +import { Annotation, AnnotationList, IManifestoOptions, Range, Resource, Size } from "./internal"; +export declare class Canvas extends Resource { + ranges: Range[]; + constructor(jsonld?: any, options?: IManifestoOptions); + getCanonicalImageUri(w?: number): string; + getMaxDimensions(): Size | null; + getContent(): Annotation[]; + getDuration(): number | null; + getImages(): Annotation[]; + getIndex(): number; + getOtherContent(): Promise; + getWidth(): number; + getHeight(): number; + getViewingHint(): ViewingHint | null; + get imageResources(): any; + get resourceAnnotations(): any; + /** + * Returns a given resource Annotation, based on a contained resource or body + * id + */ + resourceAnnotation(id: any): any; + /** + * Returns the fragment placement values if a resourceAnnotation is placed on + * a canvas somewhere besides the full extent + */ + onFragment(id: any): any; + get iiifImageResources(): any; + get imageServiceIds(): any; + get aspectRatio(): number; +} diff --git a/dist-commonjs/Canvas.js b/dist-commonjs/Canvas.js new file mode 100644 index 00000000..213a5785 --- /dev/null +++ b/dist-commonjs/Canvas.js @@ -0,0 +1,351 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Canvas = void 0; +var dist_commonjs_1 = require("@iiif/vocabulary/dist-commonjs"); +var internal_1 = require("./internal"); +// @ts-ignore +var flatten_1 = __importDefault(require("lodash/flatten")); +// @ts-ignore +var flattenDeep_1 = __importDefault(require("lodash/flattenDeep")); +var Canvas = /** @class */ (function (_super) { + __extends(Canvas, _super); + function Canvas(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + // http://iiif.io/api/image/2.1/#canonical-uri-syntax + Canvas.prototype.getCanonicalImageUri = function (w) { + var id = null; + var region = "full"; + var rotation = 0; + var quality = "default"; + var width = w; + var size; + // if an info.json has been loaded + if (this.externalResource && + this.externalResource.data && + this.externalResource.data["@id"]) { + id = this.externalResource.data["@id"]; + if (!width) { + width = this.externalResource.data.width; + } + if (this.externalResource.data["@context"]) { + if (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 { + // info.json hasn't been loaded yet + var images = void 0; + // presentation 2.0 + images = this.getImages(); + if (images && images.length) { + var firstImage = images[0]; + var resource = firstImage.getResource(); + var services = resource.getServices(); + if (!width) { + width = resource.getWidth(); + } + var service = services + ? services.find(function (service) { + return (internal_1.Utils.isImageProfile(service.getProfile()) || + internal_1.Utils.isImageServiceType(service.getIIIFResourceType())); + }) + : null; + if (service) { + id = service.id; + quality = internal_1.Utils.getImageQuality(service.getProfile()); + } + else if (width === resource.getWidth()) { + // if the passed width is the same as the resource width + // i.e. not looking for a thumbnail + // return the full size image. + // used for download options when loading static images. + return resource.id; + } + } + // presentation 3.0 + images = this.getContent(); + if (images && images.length) { + var firstImage = images[0]; + // Developer note: Since Canvas in Presentation 3 doesn't use + // SpecificResource resources in the body, force a cast + var body = firstImage.getBody(); + var anno = body[0]; + var services = anno.getServices(); + if (!width) { + width = anno.getWidth(); + } + var service = services + ? services.find(function (service) { + return internal_1.Utils.isImageServiceType(service.getIIIFResourceType()); + }) + : null; + if (service) { + id = service.id; + quality = internal_1.Utils.getImageQuality(service.getProfile()); + } + else if (width === anno.getWidth()) { + // if the passed width is the same as the resource width + // i.e. not looking for a thumbnail + // return the full size image. + // used for download options when loading static images. + return anno.id; + } + } + // todo: should this be moved to getThumbUri? + if (!id) { + var thumbnail = this.getProperty("thumbnail"); + if (thumbnail) { + if (typeof thumbnail === "string") { + return thumbnail; + } + else { + if (thumbnail["@id"]) { + return thumbnail["@id"]; + } + else if (thumbnail.length) { + return thumbnail[0].id; + } + } + } + } + } + size = width + ","; + // trim off trailing '/' + if (id && id.endsWith("/")) { + id = id.substr(0, id.length - 1); + } + var uri = [id, region, size, rotation, quality + ".jpg"].join("/"); + return uri; + }; + Canvas.prototype.getMaxDimensions = function () { + var maxDimensions = null; + var profile; + if (this.externalResource && + this.externalResource.data && + this.externalResource.data.profile) { + profile = this.externalResource.data.profile; + if (Array.isArray(profile)) { + profile = profile.filter(function (p) { return p["maxWidth" || "maxwidth"]; })[0]; + if (profile) { + maxDimensions = new internal_1.Size(profile.maxWidth, profile.maxHeight ? profile.maxHeight : profile.maxWidth); + } + } + } + return maxDimensions; + }; + // Presentation API 3.0 + Canvas.prototype.getContent = function () { + var content = []; + var items = this.__jsonld.items || this.__jsonld.content; + if (!items) + return content; + // should be contained in an AnnotationPage + var annotationPage = null; + if (items.length) { + annotationPage = new internal_1.AnnotationPage(items[0], this.options); + } + if (!annotationPage) { + return content; + } + var annotations = annotationPage.getItems(); + for (var i = 0; i < annotations.length; i++) { + var a = annotations[i]; + var annotation = new internal_1.Annotation(a, this.options); + content.push(annotation); + } + return content; + }; + Canvas.prototype.getDuration = function () { + return this.getProperty("duration"); + }; + // presentation 2.0 + 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]; + var annotation = new internal_1.Annotation(a, this.options); + images.push(annotation); + } + return images; + }; + Canvas.prototype.getIndex = function () { + return this.getProperty("index"); + }; + Canvas.prototype.getOtherContent = function () { + var _this = this; + var otherContent = Array.isArray(this.getProperty("otherContent")) + ? this.getProperty("otherContent") + : [this.getProperty("otherContent")]; + var canonicalComparison = function (typeA, typeB) { + if (typeof typeA !== "string" || typeof typeB !== "string") { + return false; + } + return typeA.toLowerCase() === typeA.toLowerCase(); + }; + var otherPromises = otherContent + .filter(function (otherContent) { + return otherContent && + canonicalComparison(otherContent["@type"], "sc:AnnotationList"); + }) + .map(function (annotationList, i) { + return new internal_1.AnnotationList(annotationList["label"] || "Annotation list ".concat(i), annotationList, _this.options); + }) + .map(function (annotationList) { return annotationList.load(); }); + return Promise.all(otherPromises); + }; + // Prefer thumbnail service to image service if supplied and if + // the thumbnail service can provide a satisfactory size +/- x pixels. + // this is used to get thumb URIs *before* the info.json has been requested + // and populate thumbnails in a viewer. + // the publisher may also provide pre-computed fixed-size thumbs for better performance. + //getThumbUri(width: number): string { + // + // var uri; + // var images: IAnnotation[] = this.getImages(); + // + // if (images && images.length) { + // var firstImage = images[0]; + // var resource: IResource = firstImage.getResource(); + // var services: IService[] = resource.getServices(); + // + // for (let i = 0; i < services.length; i++) { + // var service: IService = services[i]; + // var id = service.id; + // + // if (!_endsWith(id, '/')) { + // id += '/'; + // } + // + // uri = id + 'full/' + width + ',/0/' + Utils.getImageQuality(service.getProfile()) + '.jpg'; + // } + // } + // + // return uri; + //} + //getType(): CanvasType { + // return new CanvasType(this.getProperty('@type').toLowerCase()); + //} + Canvas.prototype.getWidth = function () { + return this.getProperty("width"); + }; + Canvas.prototype.getHeight = function () { + return this.getProperty("height"); + }; + Canvas.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + Object.defineProperty(Canvas.prototype, "imageResources", { + get: function () { + var _this = this; + var resources = (0, flattenDeep_1.default)([ + this.getImages().map(function (i) { return i.getResource(); }), + this.getContent().map(function (i) { return i.getBody(); }) + ]); + return (0, flatten_1.default)(resources.map(function (resource) { + switch (resource.getProperty("type").toLowerCase()) { + case dist_commonjs_1.ExternalResourceType.CHOICE: + case dist_commonjs_1.ExternalResourceType.OA_CHOICE: + return new Canvas({ + images: (0, flatten_1.default)([ + resource.getProperty("default"), + resource.getProperty("item") + ]).map(function (r) { return ({ resource: r }); }) + }, _this.options) + .getImages() + .map(function (i) { return i.getResource(); }); + default: + return resource; + } + })); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Canvas.prototype, "resourceAnnotations", { + get: function () { + return (0, flattenDeep_1.default)([this.getImages(), this.getContent()]); + }, + enumerable: false, + configurable: true + }); + /** + * Returns a given resource Annotation, based on a contained resource or body + * id + */ + Canvas.prototype.resourceAnnotation = function (id) { + return this.resourceAnnotations.find(function (anno) { + return anno.getResource().id === id || + (0, flatten_1.default)(new Array(anno.getBody())).some(function (body) { return body.id === id; }); + }); + }; + /** + * Returns the fragment placement values if a resourceAnnotation is placed on + * a canvas somewhere besides the full extent + */ + Canvas.prototype.onFragment = function (id) { + var resourceAnnotation = this.resourceAnnotation(id); + if (!resourceAnnotation) + return undefined; + // IIIF v2 + var on = resourceAnnotation.getProperty("on"); + // IIIF v3 + var target = resourceAnnotation.getProperty("target"); + if (!on || !target) { + return undefined; + } + var fragmentMatch = (on || target).match(/xywh=(.*)$/); + if (!fragmentMatch) + return undefined; + return fragmentMatch[1].split(",").map(function (str) { return parseInt(str, 10); }); + }; + Object.defineProperty(Canvas.prototype, "iiifImageResources", { + get: function () { + return this.imageResources.filter(function (r) { return r && r.getServices()[0] && r.getServices()[0].id; }); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Canvas.prototype, "imageServiceIds", { + get: function () { + return this.iiifImageResources.map(function (r) { return r.getServices()[0].id; }); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Canvas.prototype, "aspectRatio", { + get: function () { + return this.getWidth() / this.getHeight(); + }, + enumerable: false, + configurable: true + }); + return Canvas; +}(internal_1.Resource)); +exports.Canvas = Canvas; +//# sourceMappingURL=Canvas.js.map \ No newline at end of file diff --git a/dist-commonjs/Canvas.js.map b/dist-commonjs/Canvas.js.map new file mode 100644 index 00000000..cb0f6991 --- /dev/null +++ b/dist-commonjs/Canvas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,gEAGwC;AACxC,uCAYoB;AACpB,aAAa;AACb,2DAAqC;AACrC,aAAa;AACb,mEAA6C;AAE7C;IAA4B,0BAAQ;IAGlC,gBAAY,MAAY,EAAE,OAA2B;QACnD,OAAA,MAAK,YAAC,MAAM,EAAE,OAA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,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5C,CAAC;;;OAAA;IACH,aAAC;AAAD,CAAC,AAnXD,CAA4B,mBAAQ,GAmXnC;AAnXY,wBAAM"} \ No newline at end of file diff --git a/dist-commonjs/Collection.d.ts b/dist-commonjs/Collection.d.ts new file mode 100644 index 00000000..5db37554 --- /dev/null +++ b/dist-commonjs/Collection.d.ts @@ -0,0 +1,28 @@ +import { Behavior, ViewingDirection, ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +import { IIIFResource, IManifestoOptions, Manifest, TreeNode } from "./internal"; +export declare class Collection extends IIIFResource { + items: IIIFResource[]; + private _collections; + private _manifests; + constructor(jsonld: any, options: IManifestoOptions); + getCollections(): Collection[]; + getManifests(): Manifest[]; + getCollectionByIndex(collectionIndex: number): Promise; + getManifestByIndex(manifestIndex: number): Promise; + getTotalCollections(): number; + getTotalManifests(): number; + getTotalItems(): number; + getViewingDirection(): ViewingDirection; + /** + * Note: this only will return the first behavior as per the manifesto convention + * IIIF v3 supports multiple behaviors + */ + getBehavior(): Behavior | null; + getViewingHint(): ViewingHint | null; + /** + * Get a tree of sub collections and manifests, using each child manifest's first 'top' range. + */ + getDefaultTree(): TreeNode; + private _parseManifests; + private _parseCollections; +} diff --git a/dist-commonjs/Collection.js b/dist-commonjs/Collection.js new file mode 100644 index 00000000..6a5336cd --- /dev/null +++ b/dist-commonjs/Collection.js @@ -0,0 +1,160 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Collection = void 0; +var dist_commonjs_1 = require("@iiif/vocabulary/dist-commonjs"); +var internal_1 = require("./internal"); +var Collection = /** @class */ (function (_super) { + __extends(Collection, _super); + function Collection(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.items = []; + _this._collections = null; + _this._manifests = null; + jsonld.__collection = _this; + return _this; + } + Collection.prototype.getCollections = function () { + if (this._collections) { + return this._collections; + } + return (this._collections = (this.items.filter(function (m) { return m.isCollection(); }))); + }; + Collection.prototype.getManifests = function () { + if (this._manifests) { + return this._manifests; + } + return (this._manifests = (this.items.filter(function (m) { return m.isManifest(); }))); + }; + Collection.prototype.getCollectionByIndex = function (collectionIndex) { + var collections = this.getCollections(); + var collection; + for (var i = 0; i < collections.length; i++) { + var c = collections[i]; + if (c.index === collectionIndex) { + collection = c; + } + } + if (collection) { + collection.options.index = collectionIndex; + // id for collection MUST be dereferenceable + return collection.load(); + } + else { + throw new Error("Collection index not found"); + } + }; + Collection.prototype.getManifestByIndex = function (manifestIndex) { + var manifests = this.getManifests(); + var manifest; + for (var i = 0; i < manifests.length; i++) { + var m = manifests[i]; + if (m.index === manifestIndex) { + manifest = m; + } + } + if (manifest) { + manifest.options.index = manifestIndex; + return manifest.load(); + } + else { + throw new Error("Manifest index not found"); + } + }; + Collection.prototype.getTotalCollections = function () { + return this.getCollections().length; + }; + Collection.prototype.getTotalManifests = function () { + return this.getManifests().length; + }; + Collection.prototype.getTotalItems = function () { + return this.items.length; + }; + Collection.prototype.getViewingDirection = function () { + if (this.getProperty("viewingDirection")) { + return this.getProperty("viewingDirection"); + } + return dist_commonjs_1.ViewingDirection.LEFT_TO_RIGHT; + }; + /** + * Note: this only will return the first behavior as per the manifesto convention + * IIIF v3 supports multiple behaviors + */ + Collection.prototype.getBehavior = function () { + var behavior = this.getProperty("behavior"); + if (Array.isArray(behavior)) { + behavior = behavior[0]; + } + if (behavior) { + return behavior; + } + return null; + }; + Collection.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + /** + * Get a tree of sub collections and manifests, using each child manifest's first 'top' range. + */ + Collection.prototype.getDefaultTree = function () { + _super.prototype.getDefaultTree.call(this); + //console.log("get default tree for ", this.id); + this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION); + this._parseManifests(this); + this._parseCollections(this); + internal_1.Utils.generateTreeNodeIds(this.defaultTree); + return this.defaultTree; + }; + Collection.prototype._parseManifests = function (parentCollection) { + if (parentCollection.getManifests() && + parentCollection.getManifests().length) { + for (var i = 0; i < parentCollection.getManifests().length; i++) { + var manifest = parentCollection.getManifests()[i]; + var tree = manifest.getDefaultTree(); + tree.label = + manifest.parentLabel || + manifest.getLabel().getValue(this.options.locale) || + "manifest " + (i + 1); + tree.navDate = manifest.getNavDate(); + tree.data.id = manifest.id; + tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST); + parentCollection.defaultTree.addNode(tree); + } + } + }; + Collection.prototype._parseCollections = function (parentCollection) { + //console.log("parse collections for ", parentCollection.id); + if (parentCollection.getCollections() && + parentCollection.getCollections().length) { + for (var i = 0; i < parentCollection.getCollections().length; i++) { + var collection = parentCollection.getCollections()[i]; + var tree = collection.getDefaultTree(); + tree.label = + collection.parentLabel || + collection.getLabel().getValue(this.options.locale) || + "collection " + (i + 1); + tree.navDate = collection.getNavDate(); + tree.data.id = collection.id; + tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION); + parentCollection.defaultTree.addNode(tree); + } + } + }; + return Collection; +}(internal_1.IIIFResource)); +exports.Collection = Collection; +//# sourceMappingURL=Collection.js.map \ No newline at end of file diff --git a/dist-commonjs/Collection.js.map b/dist-commonjs/Collection.js.map new file mode 100644 index 00000000..86428f99 --- /dev/null +++ b/dist-commonjs/Collection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../src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B,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC;gBACvC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;gBAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,gBAAK,CAAC,aAAa,CAAC,uBAAY,CAAC,UAAU,CAAC,CAAC;gBAC9D,gBAAgB,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IACH,iBAAC;AAAD,CAAC,AAzKD,CAAgC,uBAAY,GAyK3C;AAzKY,gCAAU"} \ No newline at end of file diff --git a/dist-commonjs/Color.d.ts b/dist-commonjs/Color.d.ts new file mode 100644 index 00000000..7f58cc84 --- /dev/null +++ b/dist-commonjs/Color.d.ts @@ -0,0 +1,36 @@ +/** + * class structure with red, green, blue values in 0-255 range + * Uses the {@link https://www.npmjs.com/package.color-string | color-string } + * library for conversion from and to string representations of color. +**/ +export declare class Color { + /** + * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red + * @returns Color instance. + **/ + static fromCSS(cssTerm: string): Color; + /** + * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red + **/ + constructor(rgbValue: number[]); + /** + * @returns Array of 3 integers in range 0-255 + **/ + value: number[]; + /** + * @return 0 to 255 value of red color component + **/ + get red(): number; + /** + * @return 0 to 255 value of green color component + **/ + get green(): number; + /** + * @return 0 to 255 value of blue color component + **/ + get blue(): number; + /** + * @returns hex string (as for CSS ) representation of r,g,b components + **/ + get CSS(): string; +} diff --git a/dist-commonjs/Color.js b/dist-commonjs/Color.js new file mode 100644 index 00000000..a90c95a6 --- /dev/null +++ b/dist-commonjs/Color.js @@ -0,0 +1,63 @@ +"use strict"; +//import { colorString } from "color-string" +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Color = void 0; +var colorString = require("color-string"); +/** + * class structure with red, green, blue values in 0-255 range + * Uses the {@link https://www.npmjs.com/package.color-string | color-string } + * library for conversion from and to string representations of color. +**/ +var Color = /** @class */ (function () { + /** + * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red + **/ + function Color(rgbValue) { + this.value = rgbValue; + } + /** + * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red + * @returns Color instance. + **/ + Color.fromCSS = function (cssTerm) { + var rv = colorString.get(cssTerm); + if (rv.model !== 'rgb') + throw new Error("unsupported color string: " + cssTerm); + return new Color([rv.value[0], rv.value[1], rv.value[2]]); + }; + Object.defineProperty(Color.prototype, "red", { + /** + * @return 0 to 255 value of red color component + **/ + get: function () { return this.value[0]; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Color.prototype, "green", { + /** + * @return 0 to 255 value of green color component + **/ + get: function () { return this.value[1]; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Color.prototype, "blue", { + /** + * @return 0 to 255 value of blue color component + **/ + get: function () { return this.value[2]; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Color.prototype, "CSS", { + /** + * @returns hex string (as for CSS ) representation of r,g,b components + **/ + get: function () { return colorString.to.hex(this.value); }, + enumerable: false, + configurable: true + }); + return Color; +}()); +exports.Color = Color; +//# sourceMappingURL=Color.js.map \ No newline at end of file diff --git a/dist-commonjs/Color.js.map b/dist-commonjs/Color.js.map new file mode 100644 index 00000000..b77ff926 --- /dev/null +++ b/dist-commonjs/Color.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Color.js","sourceRoot":"","sources":["../src/Color.ts"],"names":[],"mappings":";AAAA,4CAA4C;;;AAE5C,IAAI,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE1C;;;;GAIG;AACH;IAaE;;OAEG;IACH,eAAa,QAAmB;QAC9B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAG;IAC1B,CAAC;IAhBD;;;OAGG;IACI,aAAO,GAAd,UAAgB,OAAgB;QAC1B,IAAI,EAAE,GAAG,WAAW,CAAC,GAAG,CAAE,OAAO,CAAE,CAAC;QACpC,IAAI,EAAE,CAAC,KAAK,KAAK,KAAK;YAClB,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,OAAO,CAAE,CAAC;QAC7D,OAAO,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;IAiBD,sBAAW,sBAAG;QAHd;;WAEG;aACH,cAA0B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;;;OAAA;IAKhD,sBAAW,wBAAK;QAHhB;;WAEG;aACH,cAA2B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;;;OAAA;IAKjD,sBAAW,uBAAI;QAHf;;WAEG;aACH,cAA2B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;;;OAAA;IAKjD,sBAAW,sBAAG;QAHd;;WAEG;aACH,cAA2B,OAAO,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC;;;OAAA;IACpE,YAAC;AAAD,CAAC,AA5CD,IA4CC;AA5CY,sBAAK"} \ No newline at end of file diff --git a/dist-commonjs/Duration.d.ts b/dist-commonjs/Duration.d.ts new file mode 100644 index 00000000..639d0314 --- /dev/null +++ b/dist-commonjs/Duration.d.ts @@ -0,0 +1,6 @@ +export declare class Duration { + start: number; + end: number; + constructor(start: number, end: number); + getLength(): number; +} diff --git a/dist-commonjs/Duration.js b/dist-commonjs/Duration.js new file mode 100644 index 00000000..f5a190fb --- /dev/null +++ b/dist-commonjs/Duration.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Duration = void 0; +var Duration = /** @class */ (function () { + function Duration(start, end) { + this.start = start; + this.end = end; + } + Duration.prototype.getLength = function () { + return this.end - this.start; + }; + return Duration; +}()); +exports.Duration = Duration; +//# sourceMappingURL=Duration.js.map \ No newline at end of file diff --git a/dist-commonjs/Duration.js.map b/dist-commonjs/Duration.js.map new file mode 100644 index 00000000..f96d0879 --- /dev/null +++ b/dist-commonjs/Duration.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Duration.js","sourceRoot":"","sources":["../src/Duration.ts"],"names":[],"mappings":";;;AAAA;IACE,kBAAmB,KAAa,EAAS,GAAW;QAAjC,UAAK,GAAL,KAAK,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAEjD,4BAAS,GAAhB;QACE,OAAO,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC;IAC/B,CAAC;IACH,eAAC;AAAD,CAAC,AAND,IAMC;AANY,4BAAQ"} \ No newline at end of file diff --git a/dist-commonjs/Geometry3d.d.ts b/dist-commonjs/Geometry3d.d.ts new file mode 100644 index 00000000..965aa220 --- /dev/null +++ b/dist-commonjs/Geometry3d.d.ts @@ -0,0 +1,23 @@ +import { Vector3, Euler } from "threejs-math"; +/** +* performs the calculation required for the lookAt +* property of a camera resource. Determines the +* required angles of two rotations, the first about +* the x axis and the second about the y axis, which will +* rotate the default camera direction (0,0,-1) into the +* direction of the input arguments +* +* Result of calculation is returned as a instance of EulerAngle from the +* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The +* three-js library uses body-fixed axes to represent EulerAngles, which reverse +* the ordering of the "relative rotation" algorithm described in the +* draft 3d api. + +* @param direction A vector interpreted as a direction. Client code +* responsible for not passing a 0-length vector, else a + +* +* @returns threejs-math.EulerAngle instance +**/ +export declare function cameraRelativeRotation(direction: Vector3): Euler; +export declare function lightRelativeRotation(direction: Vector3): Euler; diff --git a/dist-commonjs/Geometry3d.js b/dist-commonjs/Geometry3d.js new file mode 100644 index 00000000..21ce2b98 --- /dev/null +++ b/dist-commonjs/Geometry3d.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lightRelativeRotation = exports.cameraRelativeRotation = void 0; +var threejs_math_1 = require("threejs-math"); +// https://ros2jsguy.github.io/threejs-math/index.html +/** +* performs the calculation required for the lookAt +* property of a camera resource. Determines the +* required angles of two rotations, the first about +* the x axis and the second about the y axis, which will +* rotate the default camera direction (0,0,-1) into the +* direction of the input arguments +* +* Result of calculation is returned as a instance of EulerAngle from the +* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The +* three-js library uses body-fixed axes to represent EulerAngles, which reverse +* the ordering of the "relative rotation" algorithm described in the +* draft 3d api. + +* @param direction A vector interpreted as a direction. Client code +* responsible for not passing a 0-length vector, else a + +* +* @returns threejs-math.EulerAngle instance +**/ +function cameraRelativeRotation(direction) { + if (direction.length() == 0.0) + throw new Error("degenerate geometry: cameraRelativeRotation"); + // projDirection is the direction projected onto the xz plane + var projDirection = direction.clone().setComponent(1, 0.0); + var projLength = projDirection.length(); + // handle the edge case, desired viewing direction is either straight up + // or straight down + if (projLength == 0.0) { + if (direction.y > 0.0) { + // looking straight up fro below + return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(+90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ"); + } + else { + return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(-90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ"); + } + } + var yAngleRad = Math.atan2(-projDirection.x, -projDirection.z); + var xAngleRad = Math.atan2(direction.y, projLength); + return new threejs_math_1.Euler(xAngleRad, yAngleRad, 0.0, "YXZ"); +} +exports.cameraRelativeRotation = cameraRelativeRotation; +; +function lightRelativeRotation(direction) { + if (direction.length() == 0.0) + throw new Error("degenerate geometry: cameraRelativeRotation"); + var unit_direction = direction.clone().divideScalar(direction.length()); + // negative y axis is initial direction of DirectionalLight, SpotLight + // in draft 3D API + var ny_axis = new threejs_math_1.Vector3(0.0, -1.0, 0.0); + var quat = new threejs_math_1.Quaternion().setFromUnitVectors(ny_axis, unit_direction); + var tmp = new threejs_math_1.Euler().setFromQuaternion(quat, "ZXY"); + // standard be setting the final intrinsic Y rotation, which is + // along desired direction, to 0 + return new threejs_math_1.Euler(tmp.x, 0.0, tmp.z, "ZXY"); +} +exports.lightRelativeRotation = lightRelativeRotation; +//# sourceMappingURL=Geometry3d.js.map \ No newline at end of file diff --git a/dist-commonjs/Geometry3d.js.map b/dist-commonjs/Geometry3d.js.map new file mode 100644 index 00000000..aa875b85 --- /dev/null +++ b/dist-commonjs/Geometry3d.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Geometry3d.js","sourceRoot":"","sources":["../src/Geometry3d.ts"],"names":[],"mappings":";;;AAAA,6CAAsE;AACtE,sDAAsD;AAGtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,sBAAsB,CAAC,SAAmB;IACtD,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG;QACzB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAEnE,6DAA6D;IAC7D,IAAI,aAAa,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,CAAC,EAAC,GAAG,CAAC,CAAC;IAC1D,IAAI,UAAU,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC;IACxC,wEAAwE;IACxE,mBAAmB;IACnB,IAAI,UAAU,IAAI,GAAG,EACrB,CAAC;QACG,IAAI,SAAS,CAAC,CAAC,GAAG,GAAG,EAAC,CAAC;YACnB,gCAAgC;YAChC,OAAO,IAAI,oBAAK,CAAC,wBAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,wBAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAC,CAAC,EAAC,KAAK,CAAC,CAAC;QACnF,CAAC;aACG,CAAC;YACD,OAAO,IAAI,oBAAK,CAAC,wBAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,wB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null +++ b/dist-commonjs/IAccessToken.d.ts @@ -0,0 +1,7 @@ +export interface IAccessToken { + accessToken: string; + error: string; + errorDescription: string; + expiresIn: number; + tokenType: string; +} diff --git a/dist-commonjs/IAccessToken.js b/dist-commonjs/IAccessToken.js new file mode 100644 index 00000000..a2037557 --- /dev/null +++ b/dist-commonjs/IAccessToken.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IAccessToken.js.map \ No newline at end of file diff --git a/dist-commonjs/IAccessToken.js.map b/dist-commonjs/IAccessToken.js.map new file mode 100644 index 00000000..2bf7cee0 --- /dev/null +++ b/dist-commonjs/IAccessToken.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IAccessToken.js","sourceRoot":"","sources":["../src/IAccessToken.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-commonjs/IExternalImageResourceData.d.ts b/dist-commonjs/IExternalImageResourceData.d.ts new file mode 100644 index 00000000..7ca03189 --- /dev/null +++ b/dist-commonjs/IExternalImageResourceData.d.ts @@ -0,0 +1,5 @@ +import { IExternalResourceData } from "./internal"; +export interface IExternalImageResourceData extends IExternalResourceData { + width: number; + height: number; +} diff --git a/dist-commonjs/IExternalImageResourceData.js b/dist-commonjs/IExternalImageResourceData.js new file mode 100644 index 00000000..11c1ea65 --- /dev/null +++ b/dist-commonjs/IExternalImageResourceData.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IExternalImageResourceData.js.map \ No newline at end of file diff --git a/dist-commonjs/IExternalImageResourceData.js.map b/dist-commonjs/IExternalImageResourceData.js.map new file mode 100644 index 00000000..386fcc2b --- /dev/null +++ b/dist-commonjs/IExternalImageResourceData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IExternalImageResourceData.js","sourceRoot":"","sources":["../src/IExternalImageResourceData.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-commonjs/IExternalResource.d.ts b/dist-commonjs/IExternalResource.d.ts new file mode 100644 index 00000000..e7e62892 --- /dev/null +++ b/dist-commonjs/IExternalResource.d.ts @@ -0,0 +1,24 @@ +import { IAccessToken, IExternalResourceData, IManifestoOptions, Service } from "./internal"; +export interface IExternalResource { + authAPIVersion: number; + authHoldingPage: any; + clickThroughService: Service | null; + data: IExternalResourceData; + dataUri: string | null; + error: any; + externalService: Service | null; + getData(accessToken?: IAccessToken): Promise; + hasServiceDescriptor(): boolean; + height: number; + index: number; + isAccessControlled(): boolean; + isResponseHandled: boolean; + kioskService: Service | null; + loginService: Service | null; + logoutService: Service | null; + options?: IManifestoOptions; + restrictedService: Service | null; + status: number; + tokenService: Service | null; + width: number; +} diff --git a/dist-commonjs/IExternalResource.js b/dist-commonjs/IExternalResource.js new file mode 100644 index 00000000..0e98d7a5 --- /dev/null +++ b/dist-commonjs/IExternalResource.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IExternalResource.js.map \ No newline at end of file diff --git a/dist-commonjs/IExternalResource.js.map b/dist-commonjs/IExternalResource.js.map new file mode 100644 index 00000000..fb86491b --- /dev/null +++ b/dist-commonjs/IExternalResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IExternalResource.js","sourceRoot":"","sources":["../src/IExternalResource.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-commonjs/IExternalResourceData.d.ts b/dist-commonjs/IExternalResourceData.d.ts new file mode 100644 index 00000000..55a6955e --- /dev/null +++ b/dist-commonjs/IExternalResourceData.d.ts @@ -0,0 +1,7 @@ +export interface IExternalResourceData { + contentLocation: string; + hasServiceDescriptor: boolean; + id: string; + index: number; + profile: string | any[]; +} diff --git a/dist-commonjs/IExternalResourceData.js b/dist-commonjs/IExternalResourceData.js new file mode 100644 index 00000000..ee5808dd --- /dev/null +++ b/dist-commonjs/IExternalResourceData.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IExternalResourceData.js.map \ No newline at end of file diff --git a/dist-commonjs/IExternalResourceData.js.map b/dist-commonjs/IExternalResourceData.js.map new file mode 100644 index 00000000..0f3073cd --- /dev/null +++ b/dist-commonjs/IExternalResourceData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IExternalResourceData.js","sourceRoot":"","sources":["../src/IExternalResourceData.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-commonjs/IExternalResourceOptions.d.ts b/dist-commonjs/IExternalResourceOptions.d.ts new file mode 100644 index 00000000..b0c2d334 --- /dev/null +++ b/dist-commonjs/IExternalResourceOptions.d.ts @@ -0,0 +1,3 @@ +export interface IExternalResourceOptions { + authApiVersion: number; +} diff --git a/dist-commonjs/IExternalResourceOptions.js b/dist-commonjs/IExternalResourceOptions.js new file mode 100644 index 00000000..6cf3c02e --- /dev/null +++ b/dist-commonjs/IExternalResourceOptions.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IExternalResourceOptions.js.map \ No newline at end of file diff --git a/dist-commonjs/IExternalResourceOptions.js.map b/dist-commonjs/IExternalResourceOptions.js.map new file mode 100644 index 00000000..28f88ed3 --- /dev/null +++ b/dist-commonjs/IExternalResourceOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IExternalResourceOptions.js","sourceRoot":"","sources":["../src/IExternalResourceOptions.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-commonjs/IIIFResource.d.ts b/dist-commonjs/IIIFResource.d.ts new file mode 100644 index 00000000..1c76ebc3 --- /dev/null +++ b/dist-commonjs/IIIFResource.d.ts @@ -0,0 +1,28 @@ +import { ManifestResource, PropertyValue, LabelValuePair, TreeNode, IManifestoOptions, Collection } from "./internal"; +import { IIIFResourceType } from "@iiif/vocabulary/dist-commonjs"; +export declare class IIIFResource extends ManifestResource { + defaultTree: TreeNode; + index: number; + isLoaded: boolean; + parentCollection: Collection; + parentLabel: string; + constructor(jsonld?: any, options?: IManifestoOptions); + /** + * @deprecated + */ + getAttribution(): PropertyValue; + getDescription(): PropertyValue; + getHomepage(): string | null; + getIIIFResourceType(): IIIFResourceType; + getLogo(): string | null; + getLicense(): string | null; + getNavDate(): Date; + getRelated(): any; + getSeeAlso(): any; + getTrackingLabel(): string; + getDefaultTree(): TreeNode; + getRequiredStatement(): LabelValuePair | null; + isCollection(): boolean; + isManifest(): boolean; + load(): Promise; +} diff --git a/dist-commonjs/IIIFResource.js b/dist-commonjs/IIIFResource.js new file mode 100644 index 00000000..3b3d3215 --- /dev/null +++ b/dist-commonjs/IIIFResource.js @@ -0,0 +1,171 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IIIFResource = void 0; +var internal_1 = require("./internal"); +var dist_commonjs_1 = require("@iiif/vocabulary/dist-commonjs"); +var IIIFResource = /** @class */ (function (_super) { + __extends(IIIFResource, _super); + function IIIFResource(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.index = -1; + _this.isLoaded = false; + var defaultOptions = { + defaultLabel: "-", + locale: "en-GB", + resource: _this, + pessimisticAccessControl: false + }; + _this.options = Object.assign(defaultOptions, options); + return _this; + } + /** + * @deprecated + */ + IIIFResource.prototype.getAttribution = function () { + //console.warn('getAttribution will be deprecated, use getRequiredStatement instead.'); + var attribution = this.getProperty("attribution"); + if (attribution) { + return internal_1.PropertyValue.parse(attribution, this.options.locale); + } + return new internal_1.PropertyValue([], this.options.locale); + }; + IIIFResource.prototype.getDescription = function () { + var description = this.getProperty("description"); + if (description) { + return internal_1.PropertyValue.parse(description, this.options.locale); + } + return new internal_1.PropertyValue([], this.options.locale); + }; + IIIFResource.prototype.getHomepage = function () { + var homepage = this.getProperty("homepage"); + if (!homepage) + return null; + if (typeof homepage == "string") + return homepage; + if (Array.isArray(homepage) && homepage.length) { + homepage = homepage[0]; + } + return homepage["@id"] || homepage.id; + }; + IIIFResource.prototype.getIIIFResourceType = function () { + return internal_1.Utils.normaliseType(this.getProperty("type")); + }; + IIIFResource.prototype.getLogo = function () { + var logo = this.getProperty("logo"); + // Presentation 3. + // The logo is exclusive to the "provider" property, which is of type "Agent". + // In order to fulfil `manifest.getLogo()` we should check + // When P3 is fully supported, the following should work. + // return this.getProvider()?.getLogo(); + if (!logo) { + var provider = this.getProperty("provider"); + if (!provider) { + return null; + } + logo = provider.logo; + } + if (!logo) + return null; + if (typeof logo === "string") + return logo; + if (Array.isArray(logo) && logo.length) { + logo = logo[0]; + } + return logo["@id"] || logo.id; + }; + IIIFResource.prototype.getLicense = function () { + return internal_1.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 this.getProperty("seeAlso"); + }; + IIIFResource.prototype.getTrackingLabel = function () { + var service = (this.getService(dist_commonjs_1.ServiceProfile.TRACKING_EXTENSIONS)); + if (service) { + return service.getProperty("trackingLabel"); + } + return ""; + }; + IIIFResource.prototype.getDefaultTree = function () { + this.defaultTree = new internal_1.TreeNode("root"); + this.defaultTree.data = this; + return this.defaultTree; + }; + IIIFResource.prototype.getRequiredStatement = function () { + var requiredStatement = null; + var _requiredStatement = this.getProperty("requiredStatement"); + if (_requiredStatement) { + requiredStatement = new internal_1.LabelValuePair(this.options.locale); + requiredStatement.parse(_requiredStatement); + } + else { + // fall back to attribution (if it exists) + var attribution = this.getAttribution(); + if (attribution) { + requiredStatement = new internal_1.LabelValuePair(this.options.locale); + requiredStatement.value = attribution; + } + } + return requiredStatement; + }; + IIIFResource.prototype.isCollection = function () { + if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION) { + return true; + } + return false; + }; + IIIFResource.prototype.isManifest = function () { + if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST) { + return true; + } + return false; + }; + IIIFResource.prototype.load = function () { + var that = this; + return new Promise(function (resolve) { + if (that.isLoaded) { + resolve(that); + } + else { + var options_1 = that.options; + options_1.navDate = that.getNavDate(); + var id = that.__jsonld.id; + if (!id) { + id = that.__jsonld["@id"]; + } + internal_1.Utils.loadManifest(id).then(function (data) { + that.parentLabel = that.getLabel().getValue(options_1.locale); + var parsed = internal_1.Deserialiser.parse(data, options_1); + that = Object.assign(that, parsed); + //that.parentCollection = options.resource.parentCollection; + that.index = options_1.index; + resolve(that); + }); + } + }); + }; + return IIIFResource; +}(internal_1.ManifestResource)); +exports.IIIFResource = IIIFResource; +//# sourceMappingURL=IIIFResource.js.map \ No newline at end of file diff --git a/dist-commonjs/IIIFResource.js.map b/dist-commonjs/IIIFResource.js.map new file mode 100644 index 00000000..d1770acc --- /dev/null +++ b/dist-commonjs/IIIFResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IIIFResource.js","sourceRoot":"","sources":["../src/IIIFResource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAUoB;AACpB,gEAGwC;AAExC;IAAkC,gCAAgB;IAOhD,sBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QANlB,WAAK,GAAW,CAAC,CAAC,CAAC;QACnB,cAAQ,GAAY,KAAK,CAAC;QAO/B,IAAM,cAAc,GAAsB;YACxC,YAAY,EAAE,GAAG;YACjB,MAAM,EAAE,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AD,CAAC,AArLD,CAAkC,2BAAgB,GAqLjD;AArLY,oCAAY"} \ No newline at end of file diff --git a/dist-commonjs/IManifestoOptions.d.ts b/dist-commonjs/IManifestoOptions.d.ts new file mode 100644 index 00000000..d09b0f79 --- /dev/null +++ b/dist-commonjs/IManifestoOptions.d.ts @@ -0,0 +1,9 @@ +import { IIIFResource } from "./internal"; +export interface IManifestoOptions { + defaultLabel: string; + index?: number; + locale: string; + navDate?: Date; + pessimisticAccessControl: boolean; + resource: IIIFResource; +} diff --git a/dist-commonjs/IManifestoOptions.js b/dist-commonjs/IManifestoOptions.js new file mode 100644 index 00000000..590b6db9 --- /dev/null +++ b/dist-commonjs/IManifestoOptions.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IManifestoOptions.js.map \ No newline at end of file diff --git a/dist-commonjs/IManifestoOptions.js.map b/dist-commonjs/IManifestoOptions.js.map new file mode 100644 index 00000000..b1a1813c --- /dev/null +++ b/dist-commonjs/IManifestoOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IManifestoOptions.js","sourceRoot":"","sources":["../src/IManifestoOptions.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-commonjs/JSONLDResource.d.ts b/dist-commonjs/JSONLDResource.d.ts new file mode 100644 index 00000000..6520634b --- /dev/null +++ b/dist-commonjs/JSONLDResource.d.ts @@ -0,0 +1,20 @@ +export declare class JSONLDResource { + context: string; + id: string; + __jsonld: any; + constructor(jsonld?: any); + getProperty(name: string): any; + /** + A function that wraps the getProperty function, which client + code can use if it is needed to identify when the json value of + a property is an IRI -- Internationalized Resource Identifier + + If the value of the json value is a bare string, then it will be + wrapped in a json object with the string in the property 'id', + additionally that property will have a property 'isIRI' which will + be true for the literal string case, otherwise false meaning the + returned getProperty should be parsed as before. + + **/ + getPropertyAsObject(name: string): any; +} diff --git a/dist-commonjs/JSONLDResource.js b/dist-commonjs/JSONLDResource.js new file mode 100644 index 00000000..f315c696 --- /dev/null +++ b/dist-commonjs/JSONLDResource.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JSONLDResource = void 0; +var JSONLDResource = /** @class */ (function () { + function JSONLDResource(jsonld) { + this.__jsonld = jsonld; + this.context = this.getProperty("context"); + this.id = this.getProperty("id"); + } + JSONLDResource.prototype.getProperty = function (name) { + var prop = null; + if (this.__jsonld) { + prop = this.__jsonld[name]; + if (!prop) { + // property may have a prepended '@' + prop = this.__jsonld["@" + name]; + } + } + return prop; + }; + /** + A function that wraps the getProperty function, which client + code can use if it is needed to identify when the json value of + a property is an IRI -- Internationalized Resource Identifier + + If the value of the json value is a bare string, then it will be + wrapped in a json object with the string in the property 'id', + additionally that property will have a property 'isIRI' which will + be true for the literal string case, otherwise false meaning the + returned getProperty should be parsed as before. + + **/ + JSONLDResource.prototype.getPropertyAsObject = function (name) { + var prop = this.getProperty(name); + if (prop === null) + return prop; + else if (typeof (prop) === 'string') + return { "id": prop, + "isIRI": true + }; + else if (prop === Object(prop)) + return prop; + else { + throw new Error("cannot resolve prop as object: " + prop); + } + }; + return JSONLDResource; +}()); +exports.JSONLDResource = JSONLDResource; +//# sourceMappingURL=JSONLDResource.js.map \ No newline at end of file diff --git a/dist-commonjs/JSONLDResource.js.map b/dist-commonjs/JSONLDResource.js.map new file mode 100644 index 00000000..35ccc518 --- /dev/null +++ b/dist-commonjs/JSONLDResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"JSONLDResource.js","sourceRoot":"","sources":["../src/JSONLDResource.ts"],"names":[],"mappings":";;;AAAA;IAKE,wBAAY,MAAY;QACtB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,oCAAW,GAAX,UAAY,IAAY;QACtB,IAAI,IAAI,GAAQ,IAAI,CAAC;QAErB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAE3B,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,oCAAoC;gBACpC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAGD;;;;;;;;;;;OAWG;IACH,4CAAmB,GAAnB,UAAoB,IAAY;QAE9B,IAAI,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAElC,IAAK,IAAI,KAAK,IAAI;YACd,OAAO,IAAI,CAAC;aACX,IAAK,OAAM,CAAC,IAAI,CAAC,KAAK,QAAQ;YAC/B,OAAO,EAAE,IAAI,EAAG,IAAI;gBACX,OAAO,EAAG,IAAI;aACf,CAAC;aACR,IAAK,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC;YAC3B,OAAO,IAAI,CAAC;aACZ,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,IAAI,CAAE,CAAC;QAC/D,CAAC;IACH,CAAC;IACH,qBAAC;AAAD,CAAC,AAvDD,IAuDC;AAvDY,wCAAc"} \ No newline at end of file diff --git a/dist-commonjs/LabelValuePair.d.ts b/dist-commonjs/LabelValuePair.d.ts new file mode 100644 index 00000000..85354a6e --- /dev/null +++ b/dist-commonjs/LabelValuePair.d.ts @@ -0,0 +1,14 @@ +import { PropertyValue } from "./internal"; +export declare class LabelValuePair { + label: PropertyValue | null; + value: PropertyValue | null; + defaultLocale: string; + resource: any; + constructor(defaultLocale: string); + parse(resource: any): void; + getLabel(locale?: string | string[]): string | null; + setLabel(value: string): void; + getValue(locale?: string | string[], joinWith?: string): string | null; + getValues(locale?: string | string[]): Array; + setValue(value: string): void; +} diff --git a/dist-commonjs/LabelValuePair.js b/dist-commonjs/LabelValuePair.js new file mode 100644 index 00000000..5d0acc92 --- /dev/null +++ b/dist-commonjs/LabelValuePair.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LabelValuePair = void 0; +var internal_1 = require("./internal"); +var LabelValuePair = /** @class */ (function () { + function LabelValuePair(defaultLocale) { + this.defaultLocale = defaultLocale; + } + LabelValuePair.prototype.parse = function (resource) { + this.resource = resource; + this.label = internal_1.PropertyValue.parse(this.resource.label, this.defaultLocale); + this.value = internal_1.PropertyValue.parse(this.resource.value, this.defaultLocale); + }; + // shortcuts to get/set values based on user or default locale + LabelValuePair.prototype.getLabel = function (locale) { + if (this.label === null) { + return null; + } + if (Array.isArray(locale) && !locale.length) { + locale = undefined; + } + return this.label.getValue(locale || this.defaultLocale); + }; + LabelValuePair.prototype.setLabel = function (value) { + if (this.label === null) { + this.label = new internal_1.PropertyValue([]); + } + this.label.setValue(value, this.defaultLocale); + }; + LabelValuePair.prototype.getValue = function (locale, joinWith) { + if (joinWith === void 0) { joinWith = "
"; } + if (this.value === null) { + return null; + } + if (Array.isArray(locale) && !locale.length) { + locale = undefined; + } + return this.value.getValue(locale || this.defaultLocale, joinWith); + }; + LabelValuePair.prototype.getValues = function (locale) { + if (this.value === null) { + return []; + } + if (Array.isArray(locale) && !locale.length) { + locale = undefined; + } + return this.value.getValues(locale || this.defaultLocale); + }; + LabelValuePair.prototype.setValue = function (value) { + if (this.value === null) { + this.value = new internal_1.PropertyValue([]); + } + this.value.setValue(value, this.defaultLocale); + }; + return LabelValuePair; +}()); +exports.LabelValuePair = LabelValuePair; +//# sourceMappingURL=LabelValuePair.js.map \ No newline at end of file diff --git a/dist-commonjs/LabelValuePair.js.map b/dist-commonjs/LabelValuePair.js.map new file mode 100644 index 00000000..35a5b30e --- /dev/null +++ b/dist-commonjs/LabelValuePair.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LabelValuePair.js","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K,IAAI,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC5C,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACrE,CAAC;IAEM,kCAAS,GAAhB,UAAiB,MAA0B;QACzC,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC5C,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC;IAC5D,CAAC;IAEM,iCAAQ,GAAf,UAAgB,KAAa;QAC3B,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,GAAG,IAAI,wBAAa,CAAC,EAAE,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACjD,CAAC;IACH,qBAAC;AAAD,CAAC,AAhED,IAgEC;AAhEY,wCAAc"} \ No newline at end of file diff --git a/dist-commonjs/Language.d.ts b/dist-commonjs/Language.d.ts new file mode 100644 index 00000000..e8f97ffb --- /dev/null +++ b/dist-commonjs/Language.d.ts @@ -0,0 +1,5 @@ +/** @deprecated Use LocalizedValue instead */ +export default interface Language { + value: string; + locale: string; +} diff --git a/dist-commonjs/Language.js b/dist-commonjs/Language.js new file mode 100644 index 00000000..d099a3c1 --- /dev/null +++ b/dist-commonjs/Language.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Language.js.map \ No newline at end of file diff --git a/dist-commonjs/Language.js.map b/dist-commonjs/Language.js.map new file mode 100644 index 00000000..bc35b163 --- /dev/null +++ b/dist-commonjs/Language.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Language.js","sourceRoot":"","sources":["../src/Language.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-commonjs/LanguageMap.d.ts b/dist-commonjs/LanguageMap.d.ts new file mode 100644 index 00000000..deb11321 --- /dev/null +++ b/dist-commonjs/LanguageMap.d.ts @@ -0,0 +1,8 @@ +import Language from "./Language"; +/** @deprecated Use PropertyValue instead */ +export declare class LanguageMap extends Array { + /** @deprecated Use the `PropertyValue#getValue` instance method instead */ + static getValue(languageCollection: LanguageMap, locale?: string): string | null; + /** @deprecated Use the `PropertyValue#getValues` instance method instead */ + static getValues(languageCollection: LanguageMap, locale?: string): Array; +} diff --git a/dist-commonjs/LanguageMap.js b/dist-commonjs/LanguageMap.js new file mode 100644 index 00000000..d1ebf404 --- /dev/null +++ b/dist-commonjs/LanguageMap.js @@ -0,0 +1,36 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LanguageMap = void 0; +/** @deprecated Use PropertyValue instead */ +var LanguageMap = /** @class */ (function (_super) { + __extends(LanguageMap, _super); + function LanguageMap() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** @deprecated Use the `PropertyValue#getValue` instance method instead */ + LanguageMap.getValue = function (languageCollection, locale) { + return languageCollection.getValue(locale, "
"); + }; + /** @deprecated Use the `PropertyValue#getValues` instance method instead */ + LanguageMap.getValues = function (languageCollection, locale) { + return languageCollection.getValues(locale); + }; + return LanguageMap; +}(Array)); +exports.LanguageMap = LanguageMap; +//# sourceMappingURL=LanguageMap.js.map \ No newline at end of file diff --git a/dist-commonjs/LanguageMap.js.map b/dist-commonjs/LanguageMap.js.map new file mode 100644 index 00000000..867a58c1 --- /dev/null +++ b/dist-commonjs/LanguageMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LanguageMap.js","sourceRoot":"","sources":["../src/LanguageMap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAGA,4CAA4C;AAC5C;IAAiC,+BAAe;IAAhD;;IAgBA,CAAC;IAfC,2EAA2E;IACpE,oBAAQ,GAAf,UACE,kBAA+B,EAC/B,MAAe;QAEf,OAAQ,kBAAoC,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED,4EAA4E;IACrE,qBAAS,GAAhB,UACE,kBAA+B,EAC/B,MAAe;QAEf,OAAQ,kBAAoC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;IACH,kBAAC;AAAD,CAAC,AAhBD,CAAiC,KAAK,GAgBrC;AAhBY,kCAAW"} \ No newline at end of file diff --git a/dist-commonjs/Light.d.ts b/dist-commonjs/Light.d.ts new file mode 100644 index 00000000..b3ccfef6 --- /dev/null +++ b/dist-commonjs/Light.d.ts @@ -0,0 +1,48 @@ +import { IManifestoOptions, AnnotationBody, Color, PointSelector } from "./internal"; +export declare class Light extends AnnotationBody { + constructor(jsonld?: any, options?: IManifestoOptions); + get isAmbientLight(): boolean; + get isDirectionalLight(): boolean; + get isSpotLight(): boolean; + getColor(): Color; + get Color(): Color; + /** + * The implementation of the intensity is based on + * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md } + * and the example 3D manifests + * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights } + * on 24 Mar 2024. The intensity property in the manifest is an object + * with declared type 'Value', a numeric property named 'value' and a + * property named unit . This implementation will only work with a unit == 'relative' + * and it will be assumed that a relative unit value of 1.0 corresponds to the + * brightest light source a rendering engine supports. + * + * This code will implement a default intensity of 1.0 + **/ + getIntensity(): number; + get Intensity(): number; + /** + * As defined in the temp-draft-4.md ( + * https://github.com/IIIF/3d/blob/main/temp-draft-4.md#lights ; 12 May 2024) + * this quantity is the half-angle of the cone of the spotlight. + * + * The inconsistency between this definition of the angle and the definition of + * fieldOfView for PerspectiveCamera (where the property value defines the full angle) has + * already been noted: https://github.com/IIIF/api/issues/2284 + * + * provisional decision is to return undefined in case that this property + * is accessed in a light that is not a spotlight + * + * + * @returns number + + **/ + getAngle(): number | undefined; + get Angle(): number | undefined; + /** + * @return : if not null, is either a PointSelector, or an object + * with an id matching the id of an Annotation instance. + **/ + getLookAt(): object | PointSelector | null; + get LookAt(): object | null; +} diff --git a/dist-commonjs/Light.js b/dist-commonjs/Light.js new file mode 100644 index 00000000..1f594bed --- /dev/null +++ b/dist-commonjs/Light.js @@ -0,0 +1,146 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Light = void 0; +var internal_1 = require("./internal"); +var Light = /** @class */ (function (_super) { + __extends(Light, _super); + function Light(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.isLight = true; + _this.isModel = false; + return _this; + } + Object.defineProperty(Light.prototype, "isAmbientLight", { + get: function () { + return (internal_1.Utils.normaliseType(this.getProperty("type")) === "ambientlight"); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Light.prototype, "isDirectionalLight", { + get: function () { + return (internal_1.Utils.normaliseType(this.getProperty("type")) === "directionallight"); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Light.prototype, "isSpotLight", { + get: function () { + return (internal_1.Utils.normaliseType(this.getProperty("type")) === "spotlight"); + }, + enumerable: false, + configurable: true + }); + Light.prototype.getColor = function () { + var hexColor = this.getProperty("color"); + if (hexColor) + return internal_1.Color.fromCSS(hexColor); + else + return new internal_1.Color([255, 255, 255]); // white light + }; + Object.defineProperty(Light.prototype, "Color", { + get: function () { return this.getColor(); }, + enumerable: false, + configurable: true + }); + /** + * The implementation of the intensity is based on + * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md } + * and the example 3D manifests + * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights } + * on 24 Mar 2024. The intensity property in the manifest is an object + * with declared type 'Value', a numeric property named 'value' and a + * property named unit . This implementation will only work with a unit == 'relative' + * and it will be assumed that a relative unit value of 1.0 corresponds to the + * brightest light source a rendering engine supports. + * + * This code will implement a default intensity of 1.0 + **/ + Light.prototype.getIntensity = function () { + var intObject = this.getProperty("intensity"); + if (intObject) { + try { + if (!(intObject.type === "Value" && intObject.unit === "relative")) + throw new Error(); + return intObject.value; + } + catch (err) { + throw new Error("unable to interpret raw intensity object " + JSON.stringify(intObject)); + } + } + else + return 1.0; + }; + Object.defineProperty(Light.prototype, "Intensity", { + get: function () { return this.getIntensity(); }, + enumerable: false, + configurable: true + }); + /** + * As defined in the temp-draft-4.md ( + * https://github.com/IIIF/3d/blob/main/temp-draft-4.md#lights ; 12 May 2024) + * this quantity is the half-angle of the cone of the spotlight. + * + * The inconsistency between this definition of the angle and the definition of + * fieldOfView for PerspectiveCamera (where the property value defines the full angle) has + * already been noted: https://github.com/IIIF/api/issues/2284 + * + * provisional decision is to return undefined in case that this property + * is accessed in a light that is not a spotlight + * + * + * @returns number + + **/ + Light.prototype.getAngle = function () { + if (this.isSpotLight) { + return Number(this.getProperty("angle")); + } + else { + return undefined; + } + }; + Object.defineProperty(Light.prototype, "Angle", { + get: function () { return this.getAngle(); }, + enumerable: false, + configurable: true + }); + /** + * @return : if not null, is either a PointSelector, or an object + * with an id matching the id of an Annotation instance. + **/ + Light.prototype.getLookAt = function () { + var rawObj = this.getPropertyAsObject("lookAt"); + var rawType = (rawObj["type"] || rawObj["@type"]); + if (rawType == "Annotation") { + return rawObj; + } + if (rawType == "PointSelector") { + return new internal_1.PointSelector(rawObj); + } + throw new Error('unidentified value of lookAt ${rawType}'); + }; + Object.defineProperty(Light.prototype, "LookAt", { + get: function () { return this.getLookAt(); }, + enumerable: false, + configurable: true + }); + return Light; +}(internal_1.AnnotationBody)); +exports.Light = Light; +//# sourceMappingURL=Light.js.map \ No newline at end of file diff --git a/dist-commonjs/Light.js.map b/dist-commonjs/Light.js.map new file mode 100644 index 00000000..b2f23751 --- /dev/null +++ b/dist-commonjs/Light.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Light.js","sourceRoot":"","sources":["../src/Light.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,uCAKsC;AAEtC;IAA2B,yBAAc;IACvC,eAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QACvB,KAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC;;IACvB,CAAC;IAGD,sBAAI,iCAAc;aAAlB;YACE,OAAO,CAAC,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC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AAG,CAAC;IACjB,CAAC;IAED,sBAAI,4BAAS;aAAb,cAA2B,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAExD;;;;;;;;;;;;;;;OAeG;IACH,wBAAQ,GAAR;QACE,IAAI,IAAI,CAAC,WAAW,EAAC,CAAC;YAClB,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAE,CAAC;QAC9C,CAAC;aACG,CAAC;YACD,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;IAED,sBAAI,wBAAK;aAAT,cAAgC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAExD;;;OAGG;IACH,yBAAS,GAAT;QACE,IAAI,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;QAChD,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,OAAO,IAAI,YAAY,EAAC,CAAC;YACzB,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,IAAI,OAAO,IAAI,eAAe,EAAC,CAAC;YAC5B,OAAO,IAAI,wBAAa,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IACD,sBAAI,yBAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAEzD,YAAC;AAAD,CAAC,AAvGD,CAA2B,yBAAc,GAuGxC;AAvGY,sBAAK"} \ No newline at end of file diff --git a/dist-commonjs/Manifest.d.ts b/dist-commonjs/Manifest.d.ts new file mode 100644 index 00000000..5bf20d3f --- /dev/null +++ b/dist-commonjs/Manifest.d.ts @@ -0,0 +1,59 @@ +import { ViewingHint, Behavior, ViewingDirection } from "@iiif/vocabulary/dist-commonjs"; +import { Canvas, IManifestoOptions, IIIFResource, ManifestType, Range, Sequence, TreeNode } from "./internal"; +/** +* @remarks Scenes are conveniently retrieved from a Manifest by iterating through +* Sequence in the Manifest, inner loop the Scenes in each sequence +* @see {@link Sequence } +* +* @example +* var manifest: Manifest; +* function doSomethingWithScene(scene:Scene)... +* ... +* foreach(var seq:Sequence of manifest.getSequences() +* foreach(var scene : Scene of seq.getScenes() +* doSomethingWithScene(scene); +**/ +export declare class Manifest extends IIIFResource { + index: number; + private _allRanges; + items: Sequence[]; + private _topRanges; + constructor(jsonld?: any, options?: IManifestoOptions); + /** @deprecated Use getAccompanyingCanvas instead */ + getPosterCanvas(): Canvas | null; + getAccompanyingCanvas(): Canvas | null; + getBehavior(): Behavior | null; + getDefaultTree(): TreeNode; + private _getTopRanges; + getTopRanges(): Range[]; + private _getRangeById; + private _parseRanges; + getAllRanges(): Range[]; + getRangeById(id: string): Range | null; + getRangeByPath(path: string): Range | null; + /** + * @returns Array of Sequence instances + **/ + getSequences(): Sequence[]; + getSequenceByIndex(sequenceIndex: number): Sequence; + getTotalSequences(): number; + getManifestType(): ManifestType; + isMultiSequence(): boolean; + isPagingEnabled(): boolean; + getViewingDirection(): ViewingDirection | null; + getViewingHint(): ViewingHint | null; + _annotationIdMap: any; + /** + * Developer Note: The concept of the "id map" appear in the + * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map + * This functionality may be available as well in the 'nodeMap' code of the + * digitalbazaar/jsonld library + * + * this very simplified version just returns a mao of id -> Annotation nodes + * in manifest + * + * THe annotationIdMap is a Javascript object whose property names are + * IRI (id values) and property values are instances of the Annotation class + **/ + get annotationIdMap(): Object; +} diff --git a/dist-commonjs/Manifest.js b/dist-commonjs/Manifest.js new file mode 100644 index 00000000..6e0764b4 --- /dev/null +++ b/dist-commonjs/Manifest.js @@ -0,0 +1,315 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Manifest = void 0; +var dist_commonjs_1 = require("@iiif/vocabulary/dist-commonjs"); +var internal_1 = require("./internal"); +/** +* @remarks Scenes are conveniently retrieved from a Manifest by iterating through +* Sequence in the Manifest, inner loop the Scenes in each sequence +* @see {@link Sequence } +* +* @example +* var manifest: Manifest; +* function doSomethingWithScene(scene:Scene)... +* ... +* foreach(var seq:Sequence of manifest.getSequences() +* foreach(var scene : Scene of seq.getScenes() +* doSomethingWithScene(scene); +**/ +var Manifest = /** @class */ (function (_super) { + __extends(Manifest, _super); + function Manifest(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.index = 0; + _this._allRanges = null; + _this.items = []; + _this._topRanges = []; + if (_this.__jsonld.structures && _this.__jsonld.structures.length) { + var topRanges = _this._getTopRanges(); + for (var i = 0; i < topRanges.length; i++) { + var range = topRanges[i]; + _this._parseRanges(range, String(i)); + } + } + // initialization the cached _annotationIdMap to null + // it will be populated if and only if client calls make a request + // to the getter annotationIdMap + _this._annotationIdMap = null; + return _this; + } + /** @deprecated Use getAccompanyingCanvas instead */ + Manifest.prototype.getPosterCanvas = function () { + var posterCanvas = this.getProperty("posterCanvas"); + if (posterCanvas) { + posterCanvas = new internal_1.Canvas(posterCanvas, this.options); + } + return posterCanvas; + }; + Manifest.prototype.getAccompanyingCanvas = function () { + var accompanyingCanvas = this.getProperty("accompanyingCanvas"); + if (accompanyingCanvas) { + accompanyingCanvas = new internal_1.Canvas(accompanyingCanvas, this.options); + } + return accompanyingCanvas; + }; + Manifest.prototype.getBehavior = function () { + var behavior = this.getProperty("behavior"); + if (Array.isArray(behavior)) { + behavior = behavior[0]; + } + if (behavior) { + return behavior; + } + return null; + }; + Manifest.prototype.getDefaultTree = function () { + _super.prototype.getDefaultTree.call(this); + this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST); + if (!this.isLoaded) { + return this.defaultTree; + } + var topRanges = this.getTopRanges(); + // if there are any ranges in the manifest, default to the first 'top' range or generated placeholder + if (topRanges.length) { + topRanges[0].getTree(this.defaultTree); + } + internal_1.Utils.generateTreeNodeIds(this.defaultTree); + return this.defaultTree; + }; + Manifest.prototype._getTopRanges = function () { + var topRanges = []; + if (this.__jsonld.structures && this.__jsonld.structures.length) { + for (var i = 0; i < this.__jsonld.structures.length; i++) { + var json = this.__jsonld.structures[i]; + if (json.viewingHint === dist_commonjs_1.ViewingHint.TOP) { + topRanges.push(json); + } + } + // if no viewingHint="top" range was found, create a default one + if (!topRanges.length) { + var range = {}; + range.ranges = this.__jsonld.structures; + topRanges.push(range); + } + } + return topRanges; + }; + Manifest.prototype.getTopRanges = function () { + return this._topRanges; + }; + 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 || r.id === id) { + return r; + } + } + } + return null; + }; + //private _parseRangeCanvas(json: any, range: Range): void { + // todo: currently this isn't needed + //var canvas: IJSONLDResource = new JSONLDResource(json); + //range.items.push(canvas); + //} + Manifest.prototype._parseRanges = function (r, path, parentRange) { + var range; + var id = null; + if (typeof r === "string") { + id = r; + r = this._getRangeById(id); + } + if (!r) { + console.warn("Range:", id, "does not exist"); + return; + } + range = new internal_1.Range(r, this.options); + range.parentRange = parentRange; + range.path = path; + if (!parentRange) { + this._topRanges.push(range); + } + else { + parentRange.items.push(range); + } + var items = r.items || r.members; + if (items) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + // todo: use an ItemType constant? + if ((item["@type"] && item["@type"].toLowerCase() === "sc:range") || + (item["type"] && item["type"].toLowerCase() === "range")) { + this._parseRanges(item, path + "/" + i, range); + } + else if ((item["@type"] && item["@type"].toLowerCase() === "sc:canvas") || + (item["type"] && item["type"].toLowerCase() === "canvas")) { + // store the ids on the __jsonld object to be used by Range.getCanvasIds() + if (!range.canvases) { + range.canvases = []; + } + var id_1 = item.id || item["@id"]; + range.canvases.push(id_1); + } + } + } + else if (r.ranges) { + for (var i = 0; i < r.ranges.length; i++) { + this._parseRanges(r.ranges[i], path + "/" + i, range); + } + } + }; + Manifest.prototype.getAllRanges = function () { + if (this._allRanges != null) + return this._allRanges; + this._allRanges = []; + var topRanges = this.getTopRanges(); + var _loop_1 = function (i) { + var topRange = topRanges[i]; + if (topRange.id) { + this_1._allRanges.push(topRange); // it might be a placeholder root range + } + var reducer = function (acc, next) { + acc.add(next); + var nextRanges = next.getRanges(); + if (nextRanges.length) { + return nextRanges.reduce(reducer, acc); + } + return acc; + }; + var subRanges = Array.from(topRange.getRanges().reduce(reducer, new Set())); + this_1._allRanges = this_1._allRanges.concat(subRanges); + }; + var this_1 = this; + for (var i = 0; i < topRanges.length; i++) { + _loop_1(i); + } + return this._allRanges; + }; + Manifest.prototype.getRangeById = function (id) { + var ranges = this.getAllRanges(); + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.id === id) { + return range; + } + } + return null; + }; + Manifest.prototype.getRangeByPath = function (path) { + var ranges = this.getAllRanges(); + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.path === path) { + return range; + } + } + return null; + }; + /** + * @returns Array of Sequence instances + **/ + Manifest.prototype.getSequences = function () { + if (this.items.length) { + return this.items; + } + // IxIF mediaSequences overrode sequences, so need to be checked first. + // deprecate this when presentation 3 ships + var items = this.__jsonld.mediaSequences || this.__jsonld.sequences; + if (items) { + for (var i = 0; i < items.length; i++) { + var s = items[i]; + var sequence = new internal_1.Sequence(s, this.options); + this.items.push(sequence); + } + } + else if (this.__jsonld.items) { + var sequence = new internal_1.Sequence(this.__jsonld.items, this.options); + this.items.push(sequence); + } + return this.items; + }; + Manifest.prototype.getSequenceByIndex = function (sequenceIndex) { + return this.getSequences()[sequenceIndex]; + }; + Manifest.prototype.getTotalSequences = function () { + return this.getSequences().length; + }; + Manifest.prototype.getManifestType = function () { + var service = (this.getService(dist_commonjs_1.ServiceProfile.UI_EXTENSIONS)); + if (service) { + return service.getProperty("manifestType"); + } + return internal_1.ManifestType.EMPTY; + }; + Manifest.prototype.isMultiSequence = function () { + return this.getTotalSequences() > 1; + }; + Manifest.prototype.isPagingEnabled = function () { + var viewingHint = this.getViewingHint(); + if (viewingHint) { + return viewingHint === dist_commonjs_1.ViewingHint.PAGED; + } + var behavior = this.getBehavior(); + if (behavior) { + return behavior === dist_commonjs_1.Behavior.PAGED; + } + return false; + }; + Manifest.prototype.getViewingDirection = function () { + return this.getProperty("viewingDirection"); + }; + Manifest.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + Object.defineProperty(Manifest.prototype, "annotationIdMap", { + /** + * Developer Note: The concept of the "id map" appear in the + * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map + * This functionality may be available as well in the 'nodeMap' code of the + * digitalbazaar/jsonld library + * + * this very simplified version just returns a mao of id -> Annotation nodes + * in manifest + * + * THe annotationIdMap is a Javascript object whose property names are + * IRI (id values) and property values are instances of the Annotation class + **/ + get: function () { + if (this._annotationIdMap == null) { + this._annotationIdMap = {}; + for (var _i = 0, _a = this.getSequences(); _i < _a.length; _i++) { + var seq = _a[_i]; + for (var _b = 0, _c = seq.getScenes(); _b < _c.length; _b++) { + var scene = _c[_b]; + for (var _d = 0, _e = scene.getContent(); _d < _e.length; _d++) { + var anno = _e[_d]; + this._annotationIdMap[anno.id] = anno; + } + } + } + } + return this._annotationIdMap; + }, + enumerable: false, + configurable: true + }); + return Manifest; +}(internal_1.IIIFResource)); +exports.Manifest = Manifest; +//# sourceMappingURL=Manifest.js.map \ No newline at end of file diff --git a/dist-commonjs/Manifest.js.map b/dist-commonjs/Manifest.js.map new file mode 100644 index 00000000..47a55247 --- /dev/null +++ b/dist-commonjs/Manifest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Manifest.js","sourceRoot":"","sources":["../src/Manifest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gEAKwC;AACxC,uCAWoB;AAEpB;;;;;;;;;;;;GAYG;AACH;IAA8B,4BAAY;IAMxC,kBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QANlB,WAAK,GAAW,CAAC,CAAC;QACjB,gBAAU,GAAmB,IAAI,CAAC;QACnC,WAAK,GAAe,EAAE,CAAC;QACtB,gBAAU,GAAY,EAAE,CAAC;QAK/B,IAAI,KAAI,CAAC,QAAQ,CAAC,UAAU,IAAI,KAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAChE,IAAM,SAAS,GAAU,KAAI,CAAC,aAAa,EAAE,CAAC;YAE9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC1C,IAAM,KAAK,GAAQ,SAAS,CAAC,CAAC,CAAC,CAAC;gBAChC,KAAI,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,kEAAkE;QAClE,gCAAgC;QAChC,KAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;;IAC/B,CAAC;IAED,oDAAoD;IACpD,kCAAe,GAAf;QACE,IAAI,YAAY,GAAQ,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAEzD,IAAI,YAAY,EAAE,CAAC;YACjB,YAAY,GAAG,IAAI,iBAAM,CAAC,YAAY,EAAE,IAAI,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,CAAC;IAED,iCAAc,GAAd;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IACzC,CAAC;IAgBD,sBAAI,qCAAe;QAZnB;;;;;;;;;;;WAWG;aACH;YACE,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,EAAC,CAAC;gBAE/B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;gBAC3B,KAAiB,UAAmB,EAAnB,KAAA,IAAI,CAAC,YAAY,EAAE,EAAnB,cAAmB,EAAnB,IAAmB;oBAA9B,IAAI,GAAG,SAAA;oBACT,KAAkB,UAAe,EAAf,KAAA,GAAG,CAAC,SAAS,EAAE,EAAf,cAAe,EAAf,IAAe;wBAA5B,IAAI,KAAK,SAAA;wBACV,KAAiB,UAAkB,EAAlB,KAAA,KAAK,CAAC,UAAU,EAAE,EAAlB,cAAkB,EAAlB,IAAkB;4BAA9B,IAAI,IAAI,SAAA;4BACT,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;yBAAA;qBAAA;iBAAA;YAEtD,CAAC;YACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;QAC/B,CAAC;;;OAAA;IACH,eAAC;AAAD,CAAC,AA/UD,CAA8B,uBAAY,GA+UzC;AA/UY,4BAAQ"} \ No newline at end of file diff --git a/dist-commonjs/ManifestResource.d.ts b/dist-commonjs/ManifestResource.d.ts new file mode 100644 index 00000000..85b6d8d4 --- /dev/null +++ b/dist-commonjs/ManifestResource.d.ts @@ -0,0 +1,24 @@ +import { JSONLDResource, Thumbnail, Service, Rendering, LabelValuePair, PropertyValue, IManifestoOptions, IExternalResource } from "./internal"; +import { ServiceProfile, RenderingFormat, IIIFResourceType } from "@iiif/vocabulary/dist-commonjs"; +export declare class ManifestResource extends JSONLDResource { + externalResource: IExternalResource; + options: IManifestoOptions; + constructor(jsonld: any, options?: IManifestoOptions); + getIIIFResourceType(): IIIFResourceType; + getLabel(): PropertyValue; + getDefaultLabel(): string | null; + getMetadata(): LabelValuePair[]; + getRendering(format: RenderingFormat): Rendering | null; + getRenderings(): Rendering[]; + getRequiredStatement(): LabelValuePair | null; + getService(profile: ServiceProfile): Service | null; + getServices(): Service[]; + getThumbnail(): Thumbnail | null; + isAnnotation(): boolean; + isCanvas(): boolean; + isCollection(): boolean; + isManifest(): boolean; + isRange(): boolean; + isScene(): boolean; + isSequence(): boolean; +} diff --git a/dist-commonjs/ManifestResource.js b/dist-commonjs/ManifestResource.js new file mode 100644 index 00000000..fe3b110e --- /dev/null +++ b/dist-commonjs/ManifestResource.js @@ -0,0 +1,138 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ManifestResource = void 0; +var internal_1 = require("./internal"); +var dist_commonjs_1 = require("@iiif/vocabulary/dist-commonjs"); +var ManifestResource = /** @class */ (function (_super) { + __extends(ManifestResource, _super); + function ManifestResource(jsonld, options) { + var _this = _super.call(this, jsonld) || this; + _this.options = options; + return _this; + } + ManifestResource.prototype.getIIIFResourceType = function () { + return internal_1.Utils.normaliseType(this.getProperty("type")); + }; + ManifestResource.prototype.getLabel = function () { + var label = this.getProperty("label"); + if (label) { + return internal_1.PropertyValue.parse(label, this.options.locale); + } + return new internal_1.PropertyValue([], this.options.locale); + }; + ManifestResource.prototype.getDefaultLabel = function () { + return this.getLabel().getValue(this.options.locale); + }; + ManifestResource.prototype.getMetadata = function () { + var _metadata = this.getProperty("metadata"); + var metadata = []; + if (!_metadata) + return metadata; + for (var i = 0; i < _metadata.length; i++) { + var item = _metadata[i]; + var metadataItem = new internal_1.LabelValuePair(this.options.locale); + metadataItem.parse(item); + metadata.push(metadataItem); + } + return metadata; + }; + ManifestResource.prototype.getRendering = function (format) { + var renderings = this.getRenderings(); + for (var i = 0; i < renderings.length; i++) { + var rendering = renderings[i]; + if (rendering.getFormat() === format) { + return rendering; + } + } + return null; + }; + ManifestResource.prototype.getRenderings = function () { + var rendering; + // if passing a manifesto-parsed object, use the __jsonld.rendering property, + // otherwise look for a rendering property + if (this.__jsonld) { + rendering = this.__jsonld.rendering; + } + else { + rendering = this.rendering; + } + var renderings = []; + if (!rendering) + return renderings; + // coerce to array + if (!Array.isArray(rendering)) { + rendering = [rendering]; + } + for (var i = 0; i < rendering.length; i++) { + var r = rendering[i]; + renderings.push(new internal_1.Rendering(r, this.options)); + } + return renderings; + }; + ManifestResource.prototype.getRequiredStatement = function () { + var requiredStatement = null; + var _requiredStatement = this.getProperty("requiredStatement"); + if (_requiredStatement) { + requiredStatement = new internal_1.LabelValuePair(this.options.locale); + requiredStatement.parse(_requiredStatement); + } + return requiredStatement; + }; + ManifestResource.prototype.getService = function (profile) { + return internal_1.Utils.getService(this, profile); + }; + ManifestResource.prototype.getServices = function () { + return internal_1.Utils.getServices(this); + }; + ManifestResource.prototype.getThumbnail = function () { + var thumbnail = this.getProperty("thumbnail"); + if (Array.isArray(thumbnail)) { + thumbnail = thumbnail[0]; + } + if (thumbnail) { + return new internal_1.Thumbnail(thumbnail, this.options); + } + return null; + }; + ManifestResource.prototype.isAnnotation = function () { + return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.ANNOTATION; + }; + ManifestResource.prototype.isCanvas = function () { + return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.CANVAS; + }; + ManifestResource.prototype.isCollection = function () { + return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION; + }; + ManifestResource.prototype.isManifest = function () { + return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST; + }; + ManifestResource.prototype.isRange = function () { + return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.RANGE; + }; + // this different implementation is necessary until such time as the + // SCENE is added to the @iiif/vocabulary package. + ManifestResource.prototype.isScene = function () { + return this.getIIIFResourceType() === internal_1.Utils.normaliseType('Scene'); + }; + ManifestResource.prototype.isSequence = function () { + return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.SEQUENCE; + }; + return ManifestResource; +}(internal_1.JSONLDResource)); +exports.ManifestResource = ManifestResource; +//# sourceMappingURL=ManifestResource.js.map \ No newline at end of file diff --git a/dist-commonjs/ManifestResource.js.map b/dist-commonjs/ManifestResource.js.map new file mode 100644 index 00000000..ce2ef40a --- /dev/null +++ b/dist-commonjs/ManifestResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ManifestResource.js","sourceRoot":"","sources":["../src/ManifestResource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAUoB;AACpB,gEAIwC;AAExC;IAAsC,oCAAc;IAIlD,0BAAY,MAAW,EAAE,OAA2B;QAClD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QACd,KAAI,CAAC,OAAO,GAAsB,OAAO,CAAC;;IAC5C,CAAC;IAED,8CAAmB,GAAnB;QACE,OAAyB,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,mCAAQ,GAAR;QACE,IAAM,KAAK,GAAQ,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,wBAAa,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,IAAI,wBAAa,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,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 --- /dev/null +++ b/dist-commonjs/ManifestType.d.ts @@ -0,0 +1,5 @@ +export declare enum ManifestType { + EMPTY = "", + MANUSCRIPT = "manuscript", + MONOGRAPH = "monograph" +} diff --git a/dist-commonjs/ManifestType.js b/dist-commonjs/ManifestType.js new file mode 100644 index 00000000..d859db96 --- /dev/null +++ b/dist-commonjs/ManifestType.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ManifestType = void 0; +var ManifestType; +(function (ManifestType) { + ManifestType["EMPTY"] = ""; + ManifestType["MANUSCRIPT"] = "manuscript"; + ManifestType["MONOGRAPH"] = "monograph"; +})(ManifestType || (exports.ManifestType = ManifestType = {})); +//# sourceMappingURL=ManifestType.js.map \ No newline at end of file diff --git a/dist-commonjs/ManifestType.js.map b/dist-commonjs/ManifestType.js.map new file mode 100644 index 00000000..96b4e217 --- /dev/null +++ b/dist-commonjs/ManifestType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ManifestType.js","sourceRoot":"","sources":["../src/ManifestType.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,0BAAU,CAAA;IACV,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"} \ No newline at end of file diff --git a/dist-commonjs/PointSelector.d.ts b/dist-commonjs/PointSelector.d.ts new file mode 100644 index 00000000..6da73cf8 --- /dev/null +++ b/dist-commonjs/PointSelector.d.ts @@ -0,0 +1,14 @@ +import { JSONLDResource } from "./internal"; +import { Vector3 } from "threejs-math"; +export declare class PointSelector extends JSONLDResource { + isPointSelector: boolean; + constructor(jsonld: any); + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ + getLocation(): Vector3; + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ + get Location(): Vector3; +} diff --git a/dist-commonjs/PointSelector.js b/dist-commonjs/PointSelector.js new file mode 100644 index 00000000..e4b4d75b --- /dev/null +++ b/dist-commonjs/PointSelector.js @@ -0,0 +1,45 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PointSelector = void 0; +var internal_1 = require("./internal"); +var threejs_math_1 = require("threejs-math"); +var PointSelector = /** @class */ (function (_super) { + __extends(PointSelector, _super); + function PointSelector(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isPointSelector = true; + return _this; + } + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ + PointSelector.prototype.getLocation = function () { + return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z); + }; + Object.defineProperty(PointSelector.prototype, "Location", { + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ + get: function () { return this.getLocation(); }, + enumerable: false, + configurable: true + }); + return PointSelector; +}(internal_1.JSONLDResource)); +exports.PointSelector = PointSelector; +//# sourceMappingURL=PointSelector.js.map \ No newline at end of file diff --git a/dist-commonjs/PointSelector.js.map b/dist-commonjs/PointSelector.js.map new file mode 100644 index 00000000..3c9cd822 --- /dev/null +++ b/dist-commonjs/PointSelector.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PointSelector.js","sourceRoot":"","sources":["../src/PointSelector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAIoB;AAEpB,6CAAuC;AAGvC;IAAmC,iCAAc;IAI/C,uBAAY,MAAW;QACrB,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,qBAAe,GAAa,IAAI,CAAC;;IAIjC,CAAC;IAED;;OAEG;IACH,mCAAW,GAAX;QACE,OAAO,IAAI,sBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC;IACzE,CAAC;IAKD,sBAAI,mCAAQ;QAHZ;;WAEG;aACH,cAA2B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;;;OAAA;IACzD,oBAAC;AAAD,CAAC,AAnBD,CAAmC,yBAAc,GAmBhD;AAnBY,sCAAa"} \ No newline at end of file diff --git a/dist-commonjs/PropertyValue.d.ts b/dist-commonjs/PropertyValue.d.ts new file mode 100644 index 00000000..415e6cea --- /dev/null +++ b/dist-commonjs/PropertyValue.d.ts @@ -0,0 +1,58 @@ +import Language from "./Language"; +/** Utility class to hold one or more values with their associated (optional) locale */ +export declare class LocalizedValue implements Language { + _value: string | string[]; + _locale?: string; + _defaultLocale: string; + /** Parse a localized value from a IIIF v2 property value + * + * @param {string | string[] | object | object[]} rawVal value from IIIF resource + * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value + */ + static parseV2Value(rawVal: any, defaultLocale?: string): LocalizedValue | null; + constructor(value: string | string[], locale?: string, defaultLocale?: string); + /*** @deprecated Use PropertyValue#getValue instead */ + get value(): string; + /*** @deprecated Don't use, only used for backwards compatibility reasons */ + get locale(): string; + addValue(value: string | string[]): void; +} +/*** + * Holds a collection of values and their (optional) languages and allows + * language-based value retrieval as per the algorithm described in + * https://iiif.io/api/presentation/2.1/#language-of-property-values + */ +export declare class PropertyValue extends Array { + _defaultLocale?: string; + static parse(rawVal: any, defaultLocale?: string): PropertyValue; + constructor(values?: LocalizedValue[], defaultLocale?: string); + /*** Try to find the available locale that best fit's the user's preferences. */ + private getSuitableLocale; + /** + * Set the value(s) for a given locale. + * + * If there's an existing locale that matches the given locale, it will be updated. + * + * @param locale Locale to set the value for + * @param value value to set + */ + setValue(value: string | string[], locale?: string): void; + /** + * Get a value in the most suitable locale. + * + * @param {string | string[] | undefined} locales Desired locale, can be a list of + * locales sorted by descending priority. + * @param {string | undefined} joinWith String to join multiple available values by, + * if undefined only the first available value will be returned + * @returns the first value in the most suitable locale or null if none could be found + */ + getValue(locales?: string | string[], joinWith?: string): string | null; + /** + * Get all values available in the most suitable locale. + * + * @param {string | string[]} userLocales Desired locale, can be a list of + * locales sorted by descending priority. + * @returns the values for the most suitable locale, empty if none could be found + */ + getValues(userLocales?: string | string[]): string[]; +} diff --git a/dist-commonjs/PropertyValue.js b/dist-commonjs/PropertyValue.js new file mode 100644 index 00000000..18dfb19d --- /dev/null +++ b/dist-commonjs/PropertyValue.js @@ -0,0 +1,292 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PropertyValue = exports.LocalizedValue = void 0; +var Utils_1 = require("./Utils"); +/** Utility class to hold one or more values with their associated (optional) locale */ +var LocalizedValue = /** @class */ (function () { + function LocalizedValue(value, locale, defaultLocale) { + if (defaultLocale === void 0) { defaultLocale = "none"; } + if (Array.isArray(value) && value.length === 1) { + this._value = value[0]; + } + else { + this._value = value; + } + if (locale === "none" || locale === "@none") { + locale = undefined; + } + this._locale = locale; + this._defaultLocale = defaultLocale; + } + /** Parse a localized value from a IIIF v2 property value + * + * @param {string | string[] | object | object[]} rawVal value from IIIF resource + * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value + */ + LocalizedValue.parseV2Value = function (rawVal, defaultLocale) { + if (typeof rawVal === "string") { + return new LocalizedValue(rawVal, undefined, defaultLocale); + } + else if (rawVal["@value"]) { + return new LocalizedValue(rawVal["@value"], rawVal["@language"], defaultLocale); + } + return null; + }; + Object.defineProperty(LocalizedValue.prototype, "value", { + /*** @deprecated Use PropertyValue#getValue instead */ + get: function () { + if (Array.isArray(this._value)) { + return this._value.join("
"); + } + return this._value; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(LocalizedValue.prototype, "locale", { + /*** @deprecated Don't use, only used for backwards compatibility reasons */ + get: function () { + if (this._locale === undefined) { + return this._defaultLocale; + } + return this._locale; + }, + enumerable: false, + configurable: true + }); + LocalizedValue.prototype.addValue = function (value) { + if (!Array.isArray(this._value)) { + this._value = [this._value]; + } + if (Array.isArray(value)) { + this._value = this._value.concat(value); + } + else { + this._value.push(value); + } + }; + return LocalizedValue; +}()); +exports.LocalizedValue = LocalizedValue; +/*** + * Holds a collection of values and their (optional) languages and allows + * language-based value retrieval as per the algorithm described in + * https://iiif.io/api/presentation/2.1/#language-of-property-values + */ +var PropertyValue = /** @class */ (function (_super) { + __extends(PropertyValue, _super); + function PropertyValue(values, defaultLocale) { + if (values === void 0) { values = []; } + var _this = _super.apply(this, values) || this; + // Needed for ES5 compatibility, see https://stackoverflow.com/a/40967939 + _this.__proto__ = PropertyValue.prototype; + _this._defaultLocale = defaultLocale; + return _this; + } + PropertyValue.parse = function (rawVal, defaultLocale) { + if (!rawVal) { + return new PropertyValue([], defaultLocale); + } + if (Array.isArray(rawVal)) { + // Collection of IIIF v2 property values + var parsed = rawVal + .map(function (v) { return LocalizedValue.parseV2Value(v, defaultLocale); }) + .filter(function (v) { return v !== null; }); + var byLocale = parsed.reduce(function (acc, lv) { + var loc = lv._locale; + if (!loc) { + // Cannot use undefined as an object key + loc = "none"; + } + if (acc[loc]) { + acc[loc].addValue(lv._value); + } + else { + acc[loc] = lv; + } + return acc; + }, {}); + return new PropertyValue(Object.values(byLocale), defaultLocale); + } + else if (typeof rawVal === "string") { + return new PropertyValue([new LocalizedValue(rawVal, undefined, defaultLocale)], defaultLocale); + } + else if (rawVal["@language"]) { + // Single IIIF v2 property value + var parsed = LocalizedValue.parseV2Value(rawVal); + return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale); + } + else if (rawVal["@value"]) { + // Single IIIF v2 property value without language + var parsed = LocalizedValue.parseV2Value(rawVal); + return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale); + } + else { + // IIIF v3 property value + return new PropertyValue(Object.keys(rawVal).map(function (locale) { + var val = rawVal[locale]; + if (!Array.isArray(val)) { + throw new Error("A IIIF v3 localized property value must have an array as the value for a given language."); + } + return new LocalizedValue(val, locale, defaultLocale); + }), defaultLocale); + } + }; + /*** Try to find the available locale that best fit's the user's preferences. */ + PropertyValue.prototype.getSuitableLocale = function (locales) { + // If any of the values have a language associated with them, the client + // must display all of the values associated with the language that best + // matches the language preference. + if (locales.length == 0 && this._defaultLocale) + locales.push(this._defaultLocale); + // create an array of the language codes for all different LocalizedValue instances in this PropertyValue + var allLocales = new Array(); + for (var _i = 0, _a = this; _i < _a.length; _i++) { + var lv = _a[_i]; + if (lv._locale != undefined) + allLocales.push(lv._locale); + } + var _loop_1 = function (userLocale) { + var matchingLocale = allLocales.find(function (l) { return l === userLocale; }); + if (matchingLocale) { + return { value: matchingLocale }; + } + }; + // First, look for a precise match + for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) { + var userLocale = locales_1[_b]; + var state_1 = _loop_1(userLocale); + if (typeof state_1 === "object") + return state_1.value; + } + var _loop_2 = function (userLocale) { + var matchingLocale = allLocales.find(function (l) { return Utils_1.Utils.getInexactLocale(l) === Utils_1.Utils.getInexactLocale(userLocale); }); + if (matchingLocale) { + return { value: matchingLocale }; + } + }; + // Look for an inexact match + for (var _c = 0, locales_2 = locales; _c < locales_2.length; _c++) { + var userLocale = locales_2[_c]; + var state_2 = _loop_2(userLocale); + if (typeof state_2 === "object") + return state_2.value; + } + return undefined; + }; + /** + * Set the value(s) for a given locale. + * + * If there's an existing locale that matches the given locale, it will be updated. + * + * @param locale Locale to set the value for + * @param value value to set + */ + PropertyValue.prototype.setValue = function (value, locale) { + var existing = undefined; + if (!locale) { + existing = this.find(function (lv) { return lv._locale === undefined; }); + } + else { + var bestLocale_1 = this.getSuitableLocale([locale]); + if (bestLocale_1) { + existing = this.find(function (lv) { return lv._locale === bestLocale_1; }); + } + } + if (existing) { + // Mutate existing localized value + existing._value = value; + } + else { + // Create a new localized value + this.push(new LocalizedValue(value, locale, this._defaultLocale)); + } + }; + /** + * Get a value in the most suitable locale. + * + * @param {string | string[] | undefined} locales Desired locale, can be a list of + * locales sorted by descending priority. + * @param {string | undefined} joinWith String to join multiple available values by, + * if undefined only the first available value will be returned + * @returns the first value in the most suitable locale or null if none could be found + */ + PropertyValue.prototype.getValue = function (locales, joinWith) { + var vals = this.getValues(locales); + if (vals.length === 0) { + return null; + } + if (joinWith) { + return vals.join(joinWith); + } + return vals[0]; + }; + /** + * Get all values available in the most suitable locale. + * + * @param {string | string[]} userLocales Desired locale, can be a list of + * locales sorted by descending priority. + * @returns the values for the most suitable locale, empty if none could be found + */ + PropertyValue.prototype.getValues = function (userLocales) { + if (!this.length) { + return []; + } + var locales; + if (!userLocales) { + locales = []; + } + else if (!Array.isArray(userLocales)) { + locales = [userLocales]; + } + else { + locales = userLocales; + } + // If none of the values have a language associated with them, the client + // must display all of the values. + if (this.length === 1 && this[0]._locale === undefined) { + var val = this[0]._value; + return Array.isArray(val) ? val : [val]; + } + // Try to determine the available locale that best fits the user's preferences + var matchingLocale = this.getSuitableLocale(locales); + if (matchingLocale) { + var val = this.find(function (lv) { return lv._locale === matchingLocale; })._value; + return Array.isArray(val) ? val : [val]; + } + // If all of the values have a language associated with them, and none match + // the language preference, the client must select a language and display + // all of the values associated with that language. + var allHaveLang = !this.find(function (lv) { return lv._locale === undefined; }); + if (allHaveLang) { + var val = this[0]._value; + return Array.isArray(val) ? val : [val]; + } + // If some of the values have a language associated with them, but none + // match the language preference, the client must display all of the values + // that do not have a language associated with them. + var lv = this.find(function (lv) { return lv._locale === undefined; }); + if (lv) { + return Array.isArray(lv._value) ? lv._value : [lv._value]; + } + return []; + }; + return PropertyValue; +}(Array)); +exports.PropertyValue = PropertyValue; +//# sourceMappingURL=PropertyValue.js.map \ No newline at end of file diff --git a/dist-commonjs/PropertyValue.js.map b/dist-commonjs/PropertyValue.js.map new file mode 100644 index 00000000..a4d9a751 --- /dev/null +++ b/dist-commonjs/PropertyValue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PropertyValue.js","sourceRoot":"","sources":["../src/PropertyValue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,iCAAgC;AAEhC,uFAAuF;AACvF;IA4BE,wBACE,KAAwB,EACxB,MAAe,EACf,aAA8B;QAA9B,8BAAA,EAAA,sBAA8B;QAE9B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;QACD,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YAC5C,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IApCD;;;;OAIG;IACI,2BAAY,GAAnB,UACE,MAAW,EACX,aAAsB;QAEtB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,SAAS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,CAAC;YAChB,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC3B,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;QAED,uEAAuE;QACvE,2EAA2E;QAC3E,oDAAoD;QACpD,IAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,OAAO,KAAK,SAAS,EAAxB,CAAwB,CAAC,CAAC;QACrD,IAAI,EAAE,EAAE,CAAC;YACP,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAC5D,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,oBAAC;AAAD,CAAC,AA3MD,CAAmC,KAAK,GA2MvC;AA3MY,sCAAa"} \ No newline at end of file diff --git a/dist-commonjs/Range.d.ts b/dist-commonjs/Range.d.ts new file mode 100644 index 00000000..4b14fb6a --- /dev/null +++ b/dist-commonjs/Range.d.ts @@ -0,0 +1,20 @@ +import { Duration, IManifestoOptions, ManifestResource, TreeNode } from "./internal"; +import { Behavior, ViewingDirection, ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +export declare class Range extends ManifestResource { + private _ranges; + canvases: string[] | null; + items: ManifestResource[]; + parentRange: Range | undefined; + path: string; + treeNode: TreeNode; + constructor(jsonld?: any, options?: IManifestoOptions); + getCanvasIds(): string[]; + getDuration(): Duration | undefined; + getRanges(): Range[]; + getBehavior(): Behavior | null; + getViewingDirection(): ViewingDirection | null; + getViewingHint(): ViewingHint | null; + getTree(treeRoot: TreeNode): TreeNode; + spansTime(time: number): boolean; + private _parseTreeNode; +} diff --git a/dist-commonjs/Range.js b/dist-commonjs/Range.js new file mode 100644 index 00000000..10780ace --- /dev/null +++ b/dist-commonjs/Range.js @@ -0,0 +1,201 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Range = void 0; +var internal_1 = require("./internal"); +var dist_commonjs_1 = require("@iiif/vocabulary/dist-commonjs"); +var Range = /** @class */ (function (_super) { + __extends(Range, _super); + function Range(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this._ranges = null; + _this.canvases = null; + _this.items = []; + return _this; + } + Range.prototype.getCanvasIds = function () { + if (this.__jsonld.canvases) { + return this.__jsonld.canvases; + } + else if (this.canvases) { + return this.canvases; + } + return []; + }; + Range.prototype.getDuration = function () { + // For this implementation, we want to catch SOME of the temporal cases - i.e. when there is a t=1,100 + if (this.canvases && this.canvases.length) { + var startTimes = []; + var endTimes = []; + // When we loop through all of the canvases we store the recorded start and end times. + // Then we choose the maximum and minimum values from this. This will give us a more accurate duration for the + // Chosen range. However this is still not perfect and does not cover more complex ranges. These cases are out of + // scope for this change. + for (var _i = 0, _a = this.canvases; _i < _a.length; _i++) { + var canvas = _a[_i]; + if (!canvas) + continue; + var _b = (canvas.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [undefined, canvas]), canvasId = _b[1], start_1 = _b[2], end_1 = _b[3]; + if (canvasId) { + startTimes.push(parseFloat(start_1)); + endTimes.push(parseFloat(end_1)); + } + } + if (startTimes.length && endTimes.length) { + return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes)); + } + } + else { + // get child ranges and calculate the start and end based on them + var childRanges = this.getRanges(); + var startTimes = []; + var endTimes = []; + // Once again, we use a max/min to get the ranges. + for (var _c = 0, childRanges_1 = childRanges; _c < childRanges_1.length; _c++) { + var childRange = childRanges_1[_c]; + var duration = childRange.getDuration(); + if (duration) { + startTimes.push(duration.start); + endTimes.push(duration.end); + } + } + // And return the minimum as the start, and the maximum as the end. + if (startTimes.length && endTimes.length) { + return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes)); + } + } + var start; + var end; + // There are 2 paths for this implementation. Either we have a list of canvases, or a list of ranges + // which may have a list of ranges. + // This is one of the limitations of this implementation. + if (this.canvases && this.canvases.length) { + // When we loop through each of the canvases we are expecting to see a fragment or a link to the whole canvas. + // For example - if we have http://example.org/canvas#t=1,100 it will extract 1 and 100 as the start and end. + for (var i = 0; i < this.canvases.length; i++) { + var canvas = this.canvases[i]; + var temporal = internal_1.Utils.getTemporalComponent(canvas); + if (temporal && temporal.length > 1) { + if (i === 0) { + // Note: Cannot guarantee ranges are sequential (fixed above) + start = Number(temporal[0]); + } + if (i === this.canvases.length - 1) { + end = Number(temporal[1]); // Note: The end of this duration may be targeting a different canvas. + } + } + } + } + else { + // In this second case, where there are nested ranges, we recursively get the duration + // from each of the child ranges (a start and end) and then choose the first and last for the bounds of this range. + var childRanges = this.getRanges(); + for (var i = 0; i < childRanges.length; i++) { + var childRange = childRanges[i]; + var duration = childRange.getDuration(); + if (duration) { + if (i === 0) { + start = duration.start; + } + if (i === childRanges.length - 1) { + end = duration.end; + } + } + } + } + if (start !== undefined && end !== undefined) { + return new internal_1.Duration(start, end); + } + return undefined; + }; + // getCanvases(): ICanvas[] { + // if (this._canvases) { + // return this._canvases; + // } + // return this._canvases = this.items.en().where(m => m.isCanvas()).toArray(); + // } + Range.prototype.getRanges = function () { + if (this._ranges) { + return this._ranges; + } + return (this._ranges = this.items.filter(function (m) { return m.isRange(); })); + }; + Range.prototype.getBehavior = function () { + var behavior = this.getProperty("behavior"); + if (Array.isArray(behavior)) { + behavior = behavior[0]; + } + if (behavior) { + return behavior; + } + return null; + }; + Range.prototype.getViewingDirection = function () { + return this.getProperty("viewingDirection"); + }; + Range.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + Range.prototype.getTree = function (treeRoot) { + treeRoot.data = this; + this.treeNode = treeRoot; + var ranges = this.getRanges(); + if (ranges && ranges.length) { + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + var node = new internal_1.TreeNode(); + treeRoot.addNode(node); + this._parseTreeNode(node, range); + } + } + internal_1.Utils.generateTreeNodeIds(treeRoot); + return treeRoot; + }; + Range.prototype.spansTime = function (time) { + var duration = this.getDuration(); + if (duration) { + if (time >= duration.start && time <= duration.end) { + return true; + } + } + return false; + }; + Range.prototype._parseTreeNode = function (node, range) { + node.label = range.getLabel().getValue(this.options.locale); + node.data = range; + node.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE); + range.treeNode = node; + var ranges = range.getRanges(); + if (ranges && ranges.length) { + for (var i = 0; i < ranges.length; i++) { + var childRange = ranges[i]; + var behavior = childRange.getBehavior(); + if (behavior === dist_commonjs_1.Behavior.NO_NAV) { + continue; + } + else { + var childNode = new internal_1.TreeNode(); + node.addNode(childNode); + this._parseTreeNode(childNode, childRange); + } + } + } + }; + return Range; +}(internal_1.ManifestResource)); +exports.Range = Range; +//# sourceMappingURL=Range.js.map \ No newline at end of file diff --git a/dist-commonjs/Range.js.map b/dist-commonjs/Range.js.map new file mode 100644 index 00000000..b5e84b0d --- /dev/null +++ b/dist-commonjs/Range.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Range.js","sourceRoot":"","sources":["../src/Range.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAOoB;AACpB,gEAIwC;AAExC;IAA2B,yBAAgB;IAQzC,eAAY,MAAY,EAAE,OAA2B;QACnD,YAA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C,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACvC,IAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC7B,IAAM,QAAQ,GAAoB,UAAU,CAAC,WAAW,EAAE,CAAC;gBAE3D,IAAI,QAAQ,KAAK,wBAAQ,CAAC,MAAM,EAAE,CAAC;oBACjC,SAAS;gBACX,CAAC;qBAAM,CAAC;oBACN,IAAM,SAAS,GAAa,IAAI,mBAAQ,EAAE,CAAC;oBAC3C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;oBACxB,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBAC7C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACH,YAAC;AAAD,CAAC,AArND,CAA2B,2BAAgB,GAqN1C;AArNY,sBAAK"} \ No newline at end of file diff --git a/dist-commonjs/Rendering.d.ts b/dist-commonjs/Rendering.d.ts new file mode 100644 index 00000000..59b3fa48 --- /dev/null +++ b/dist-commonjs/Rendering.d.ts @@ -0,0 +1,6 @@ +import { RenderingFormat } from "@iiif/vocabulary/dist-commonjs"; +import { IManifestoOptions, ManifestResource } from "./internal"; +export declare class Rendering extends ManifestResource { + constructor(jsonld?: any, options?: IManifestoOptions); + getFormat(): RenderingFormat; +} diff --git a/dist-commonjs/Rendering.js b/dist-commonjs/Rendering.js new file mode 100644 index 00000000..56e5e21d --- /dev/null +++ b/dist-commonjs/Rendering.js @@ -0,0 +1,31 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Rendering = void 0; +var internal_1 = require("./internal"); +var Rendering = /** @class */ (function (_super) { + __extends(Rendering, _super); + function Rendering(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + Rendering.prototype.getFormat = function () { + return this.getProperty("format"); + }; + return Rendering; +}(internal_1.ManifestResource)); +exports.Rendering = Rendering; +//# sourceMappingURL=Rendering.js.map \ No newline at end of file diff --git a/dist-commonjs/Rendering.js.map b/dist-commonjs/Rendering.js.map new file mode 100644 index 00000000..2db3a9d2 --- /dev/null +++ b/dist-commonjs/Rendering.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Rendering.js","sourceRoot":"","sources":["../src/Rendering.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,uCAAiE;AAEjE;IAA+B,6BAAgB;IAC7C,mBAAY,MAAY,EAAE,OAA2B;QACnD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IAED,6BAAS,GAAT;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IACH,gBAAC;AAAD,CAAC,AARD,CAA+B,2BAAgB,GAQ9C;AARY,8BAAS"} \ No newline at end of file diff --git a/dist-commonjs/Resource.d.ts b/dist-commonjs/Resource.d.ts new file mode 100644 index 00000000..e41ff9a2 --- /dev/null +++ b/dist-commonjs/Resource.d.ts @@ -0,0 +1,13 @@ +import { ExternalResourceType, MediaType } from "@iiif/vocabulary/dist-commonjs"; +import { Annotation, IManifestoOptions, ManifestResource } from "./internal"; +export declare class Resource extends ManifestResource { + index: number; + constructor(jsonld?: any, options?: IManifestoOptions); + getFormat(): MediaType | null; + getResources(): Annotation[]; + getType(): ExternalResourceType | null; + getWidth(): number; + getHeight(): number; + getMaxWidth(): number; + getMaxHeight(): number | null; +} diff --git a/dist-commonjs/Resource.js b/dist-commonjs/Resource.js new file mode 100644 index 00000000..b9a5d95b --- /dev/null +++ b/dist-commonjs/Resource.js @@ -0,0 +1,71 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Resource = void 0; +var internal_1 = require("./internal"); +var Resource = /** @class */ (function (_super) { + __extends(Resource, _super); + function Resource(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + Resource.prototype.getFormat = function () { + var format = this.getProperty("format"); + if (format) { + return format.toLowerCase(); + } + return null; + }; + Resource.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]; + var annotation = new internal_1.Annotation(a, this.options); + resources.push(annotation); + } + return resources; + }; + Resource.prototype.getType = function () { + var type = this.getProperty("type"); + if (type) { + return internal_1.Utils.normaliseType(type); + } + return 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 a maxHeight hasn't been specified, default to maxWidth. + // maxWidth in essence becomes maxEdge + if (!maxHeight) { + return this.getMaxWidth(); + } + return null; + }; + return Resource; +}(internal_1.ManifestResource)); +exports.Resource = Resource; +//# sourceMappingURL=Resource.js.map \ No newline at end of file diff --git a/dist-commonjs/Resource.js.map b/dist-commonjs/Resource.js.map new file mode 100644 index 00000000..dafc1636 --- /dev/null +++ b/dist-commonjs/Resource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Resource.js","sourceRoot":"","sources":["../src/Resource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAIA,uCAKoB;AAEpB;IAA8B,4BAAgB;IAG5C,kBAAY,MAAY,EAAE,OAA2B;QACnD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IAED,4BAAS,GAAT;QACE,IAAM,MAAM,GAAW,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAElD,IAAI,MAAM,EAAE,CAAC;YACX,OAAkB,MAAM,CAAC,WAAW,EAAE,CAAC;QACzC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,+BAAY,GAAZ;QACE,IAAM,SAAS,GAAiB,EAAE,CAAC;QAEnC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS;YAAE,OAAO,SAAS,CAAC;QAE/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxD,IAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACrC,IAAM,UAAU,GAAG,IAAI,qBAAU,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACnD,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7B,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,0BAAO,GAAP;QACE,IAAM,IAAI,GAAW,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAE9C,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAyB,CAAC;QAC3D,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2BAAQ,GAAR;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,4BAAS,GAAT;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,8BAAW,GAAX;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAED,+BAAY,GAAZ;QACE,IAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAEhD,6DAA6D;QAC7D,sCAAsC;QACtC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IACH,eAAC;AAAD,CAAC,AAhED,CAA8B,2BAAgB,GAgE7C;AAhEY,4BAAQ"} \ No newline at end of file diff --git a/dist-commonjs/RotateTransform.d.ts b/dist-commonjs/RotateTransform.d.ts new file mode 100644 index 00000000..d6d62b88 --- /dev/null +++ b/dist-commonjs/RotateTransform.d.ts @@ -0,0 +1,5 @@ +import { Transform } from "./internal"; +export declare class RotateTransform extends Transform { + constructor(jsonld?: any); + getRotation(): object; +} diff --git a/dist-commonjs/RotateTransform.js b/dist-commonjs/RotateTransform.js new file mode 100644 index 00000000..cf7aedec --- /dev/null +++ b/dist-commonjs/RotateTransform.js @@ -0,0 +1,40 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RotateTransform = void 0; +var internal_1 = require("./internal"); +var RotateTransform = /** @class */ (function (_super) { + __extends(RotateTransform, _super); + function RotateTransform(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isRotateTransform = true; + return _this; + } + RotateTransform.prototype.getRotation = function () { + var retVal = {}; + for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) { + var attrib = _a[_i]; + var raw = this.__jsonld[attrib]; + retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0; + } + return retVal; + }; + return RotateTransform; +}(internal_1.Transform)); +exports.RotateTransform = RotateTransform; +; +//# sourceMappingURL=RotateTransform.js.map \ No newline at end of file diff --git a/dist-commonjs/RotateTransform.js.map b/dist-commonjs/RotateTransform.js.map new file mode 100644 index 00000000..2a1f9f9c --- /dev/null +++ b/dist-commonjs/RotateTransform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RotateTransform.js","sourceRoot":"","sources":["../src/RotateTransform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAEoB;AAEpB;IAAqC,mCAAS;IAC1C,yBAAY,MAAY;QACpB,YAAA,MAAK,YAAE,MAAM,CAAE,SAAC;QAChB,KAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;;IAElC,CAAC;IAGD,qCAAW,GAAX;QACI,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAqB,UAAa,EAAb,MAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC,EAAb,cAAa,EAAb,IAAa,EAAC,CAAC;YAA/B,IAAM,MAAM,SAAA;YACb,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAA,CAAC,CAAA,MAAM,CAAC,GAAG,CAAC,CAAA,CAAC,CAAA,GAAG,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEL,sBAAC;AAAD,CAAC,AAjBD,CAAqC,oBAAS,GAiB7C;AAjBY,0CAAe;AAiB3B,CAAC"} \ No newline at end of file diff --git a/dist-commonjs/ScaleTransform.d.ts b/dist-commonjs/ScaleTransform.d.ts new file mode 100644 index 00000000..db2b44b2 --- /dev/null +++ b/dist-commonjs/ScaleTransform.d.ts @@ -0,0 +1,5 @@ +import { Transform } from "./internal"; +export declare class ScaleTransform extends Transform { + constructor(jsonld?: any); + getScale(): object; +} diff --git a/dist-commonjs/ScaleTransform.js b/dist-commonjs/ScaleTransform.js new file mode 100644 index 00000000..383cc6e8 --- /dev/null +++ b/dist-commonjs/ScaleTransform.js @@ -0,0 +1,41 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScaleTransform = void 0; +var internal_1 = require("./internal"); +var ScaleTransform = /** @class */ (function (_super) { + __extends(ScaleTransform, _super); + function ScaleTransform(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isScaleTransform = true; + return _this; + } + ScaleTransform.prototype.getScale = function () { + var retVal = {}; + for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) { + var attrib = _a[_i]; + var raw = this.__jsonld[attrib]; + // note that default scaling is 1.0 + retVal[attrib] = (raw !== undefined) ? Number(raw) : 1.0; + } + return retVal; + }; + return ScaleTransform; +}(internal_1.Transform)); +exports.ScaleTransform = ScaleTransform; +; +//# sourceMappingURL=ScaleTransform.js.map \ No newline at end of file diff --git a/dist-commonjs/ScaleTransform.js.map b/dist-commonjs/ScaleTransform.js.map new file mode 100644 index 00000000..bdbc0f58 --- /dev/null +++ b/dist-commonjs/ScaleTransform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ScaleTransform.js","sourceRoot":"","sources":["../src/ScaleTransform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAEoB;AAEpB;IAAoC,kCAAS;IACzC,wBAAY,MAAY;QACpB,YAAA,MAAK,YAAC,MAAM,CAAE,SAAC;QACf,KAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;;IACjC,CAAC;IAED,iCAAQ,GAAR;QACI,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAqB,UAAa,EAAb,MAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC,EAAb,cAAa,EAAb,IAAa,EAAC,CAAC;YAA/B,IAAM,MAAM,SAAA;YACb,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAEhC,mCAAmC;YACnC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAA,CAAC,CAAA,MAAM,CAAC,GAAG,CAAC,CAAA,CAAC,CAAA,GAAG,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEL,qBAAC;AAAD,CAAC,AAjBD,CAAoC,oBAAS,GAiB5C;AAjBY,wCAAc;AAiB1B,CAAC"} \ No newline at end of file diff --git a/dist-commonjs/Scene.d.ts b/dist-commonjs/Scene.d.ts new file mode 100644 index 00000000..2ffc8f6e --- /dev/null +++ b/dist-commonjs/Scene.d.ts @@ -0,0 +1,8 @@ +import { Annotation, IManifestoOptions, ManifestResource, Color } from "./internal"; +export declare class Scene extends ManifestResource { + constructor(jsonld: any, options: IManifestoOptions); + getContent(): Annotation[]; + get Content(): Annotation[]; + getAnnotationById(searchId: string): Annotation | null; + getBackgroundColor(): Color | null; +} diff --git a/dist-commonjs/Scene.js b/dist-commonjs/Scene.js new file mode 100644 index 00000000..19222a83 --- /dev/null +++ b/dist-commonjs/Scene.js @@ -0,0 +1,81 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Scene = void 0; +var internal_1 = require("./internal"); +var Scene = /** @class */ (function (_super) { + __extends(Scene, _super); + function Scene(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + // Presentation API 3.0 + Scene.prototype.getContent = function () { + var content = []; + var items = this.__jsonld.items || this.__jsonld.content; + if (!items) + return content; + // should be contained in an AnnotationPage + var annotationPage = null; + if (items.length) { + annotationPage = new internal_1.AnnotationPage(items[0], this.options); + } + if (!annotationPage) { + return content; + } + var annotations = annotationPage.getItems(); + for (var i = 0; i < annotations.length; i++) { + var a = annotations[i]; + var annotation = new internal_1.Annotation(a, this.options); + content.push(annotation); + } + ; + return content; + }; + ; + Object.defineProperty(Scene.prototype, "Content", { + // 3D extension + get: function () { return this.getContent(); }, + enumerable: false, + configurable: true + }); + Scene.prototype.getAnnotationById = function (searchId) { + for (var _i = 0, _a = this.Content; _i < _a.length; _i++) { + var anno = _a[_i]; + if (anno.id === searchId) + return anno; + } + return null; + }; + Scene.prototype.getBackgroundColor = function () { + // regular expression intended to match strings like + // "#FF00FF" -- interpreted as three hexadecimal values + // in range 0-255 . Not that the \w escape matches digits, + // upper and lower case latin characters, and underscore + // currently only supports the form for CSS + // https://www.w3.org/wiki/CSS/Properties/color/RGB + // with 6 hexadecimal digits + var bgc = this.getProperty("backgroundColor"); + if (bgc) + return internal_1.Color.fromCSS(bgc); + else + return null; + }; + ; + return Scene; +}(internal_1.ManifestResource)); +exports.Scene = Scene; +//# sourceMappingURL=Scene.js.map \ No newline at end of file diff --git a/dist-commonjs/Scene.js.map b/dist-commonjs/Scene.js.map new file mode 100644 index 00000000..4d6c2483 --- /dev/null +++ b/dist-commonjs/Scene.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Scene.js","sourceRoot":"","sources":["../src/Scene.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,uCAMoB;AAEpB;IAA2B,yBAAgB;IACzC,eAAY,MAAW,EAAE,OAA0B;QACjD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IAGD,uBAAuB;IACvB,0BAAU,GAAV;QACE,IAAM,OAAO,GAAiB,EAAE,CAAC;QAEjC,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QAE3D,IAAI,CAAC,KAAK;YAAE,OAAO,OAAO,CAAC;QAE3B,2CAA2C;QAC3C,IAAI,cAAc,GAA0B,IAAI,CAAC;QAEjD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACjB,cAAc,GAAG,IAAI,yBAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,IAAM,WAAW,GAAiB,cAAc,CAAC,QAAQ,EAAE,CAAC;QAE5D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5C,IAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YACzB,IAAM,UAAU,GAAG,IAAI,qBAAU,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACnD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3B,CAAC;QAAA,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;IAAA,CAAC;IAGF,sBAAI,0BAAO;QADX,eAAe;aACf,cAA+B,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAE1D,iCAAiB,GAAjB,UAAmB,QAAgB;QACjC,KAAiB,UAAY,EAAZ,KAAA,IAAI,CAAC,OAAO,EAAZ,cAAY,EAAZ,IAAY;YAAxB,IAAI,IAAI,SAAA;YACT,IAAI,IAAI,CAAC,EAAE,KAAK,QAAQ;gBAAG,OAAO,IAAI,CAAC;SAAA;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,kCAAkB,GAAlB;QACE,oDAAoD;QACpD,uDAAuD;QACvD,0DAA0D;QAC1D,wDAAwD;QACxD,2CAA2C;QAC3C,mDAAmD;QACnD,4BAA4B;QAE5B,IAAI,GAAG,GAAwB,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QACnE,IAAI,GAAG;YACH,OAAO,gBAAK,CAAC,OAAO,CAAE,GAAa,CAAE,CAAC;;YAEtC,OAAO,IAAI,CAAC;IAClB,CAAC;IAAA,CAAC;IAEJ,YAAC;AAAD,CAAC,AA9DD,CAA2B,2BAAgB,GA8D1C;AA9DY,sBAAK"} \ No newline at end of file diff --git a/dist-commonjs/Sequence.d.ts b/dist-commonjs/Sequence.d.ts new file mode 100644 index 00000000..45c1e0e8 --- /dev/null +++ b/dist-commonjs/Sequence.d.ts @@ -0,0 +1,34 @@ +import { ViewingDirection, ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +import { Canvas, IManifestoOptions, ManifestResource, Scene, Thumb, Thumbnail } from "./internal"; +export declare class Sequence extends ManifestResource { + items: Canvas[]; + private _thumbnails; + constructor(jsonld?: any, options?: IManifestoOptions); + getCanvases(): Canvas[]; + getCanvasById(id: string): Canvas | null; + getCanvasByIndex(canvasIndex: number): any; + getCanvasIndexById(id: string): number | null; + getCanvasIndexByLabel(label: string, foliated?: boolean): number; + getLastCanvasLabel(alphanumeric?: boolean): string; + getLastPageIndex(): number; + getNextPageIndex(canvasIndex: number, pagingEnabled?: boolean): number; + getPagedIndices(canvasIndex: number, pagingEnabled?: boolean): number[]; + getPrevPageIndex(canvasIndex: number, pagingEnabled?: boolean): number; + /** + * @returns Array of Scene instances in the Sequence + **/ + getScenes(): Scene[]; + getStartCanvasIndex(): number; + getThumbs(width: number, height?: number): Thumb[]; + getThumbnails(): Thumbnail[]; + getStartCanvas(): string; + getTotalCanvases(): number; + getViewingDirection(): ViewingDirection | null; + getViewingHint(): ViewingHint | null; + isCanvasIndexOutOfRange(canvasIndex: number): boolean; + isFirstCanvas(canvasIndex: number): boolean; + isLastCanvas(canvasIndex: number): boolean; + isMultiCanvas(): boolean; + isPagingEnabled(): boolean; + isTotalCanvasesEven(): boolean; +} diff --git a/dist-commonjs/Sequence.js b/dist-commonjs/Sequence.js new file mode 100644 index 00000000..46ceff49 --- /dev/null +++ b/dist-commonjs/Sequence.js @@ -0,0 +1,288 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Sequence = void 0; +var dist_commonjs_1 = require("@iiif/vocabulary/dist-commonjs"); +var internal_1 = require("./internal"); +var Sequence = /** @class */ (function (_super) { + __extends(Sequence, _super); + function Sequence(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.items = []; + _this._thumbnails = null; + return _this; + } + Sequence.prototype.getCanvases = function () { + if (this.items.length) { + return this.items; + } + var items = this.__jsonld.canvases || this.__jsonld.elements; + if (items) { + for (var i = 0; i < items.length; i++) { + var c = items[i]; + var canvas = new internal_1.Canvas(c, this.options); + canvas.index = i; + this.items.push(canvas); + } + } + else if (this.__jsonld) { + for (var i = 0; i < this.__jsonld.length; i++) { + var c = this.__jsonld[i]; + var canvas = new internal_1.Canvas(c, this.options); + canvas.index = i; + this.items.push(canvas); + } + } + return this.items; + }; + Sequence.prototype.getCanvasById = function (id) { + for (var i = 0; i < this.getTotalCanvases(); i++) { + var canvas = this.getCanvasByIndex(i); + // normalise canvas id + var canvasId = internal_1.Utils.normaliseUrl(canvas.id); + if (internal_1.Utils.normaliseUrl(id) === canvasId) { + 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(); + if (!isNaN(label)) { + // if the label is numeric + label = parseInt(label, 10).toString(); // trim any preceding zeros. + if (foliated) + label += "r"; // default to recto + } + var doublePageRegExp = /(\d*)\D+(\d*)/; + var match, regExp, regStr, labelPart1, labelPart2; + for (var i = 0; i < this.getTotalCanvases(); i++) { + var canvas = this.getCanvasByIndex(i); + // check if there's a literal match + if (canvas.getLabel().getValue(this.options.locale) === label) { + return i; + } + // check if there's a match for double-page spreads e.g. 100-101, 100_101, 100 101 + match = doublePageRegExp.exec(label); + if (!match) + continue; + labelPart1 = match[1]; + labelPart2 = match[2]; + if (!labelPart2) + continue; + regStr = "^" + labelPart1 + "\\D+" + labelPart2 + "$"; + regExp = new RegExp(regStr); + if (regExp.test(canvas.getLabel().toString())) { + return i; + } + } + return -1; + }; + Sequence.prototype.getLastCanvasLabel = function (alphanumeric) { + for (var i = this.getTotalCanvases() - 1; i >= 0; i--) { + var canvas = this.getCanvasByIndex(i); + var label = (canvas.getLabel().getValue(this.options.locale)); + 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); + var viewingDirection = this.getViewingDirection(); + if (viewingDirection && + viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) { + index = indices[0] + 1; + } + else { + index = indices[indices.length - 1] + 1; + } + } + else { + index = canvasIndex + 1; + } + if (index > this.getLastPageIndex()) { + return -1; + } + return index; + }; + Sequence.prototype.getPagedIndices = function (canvasIndex, pagingEnabled) { + var indices = []; + if (!pagingEnabled) { + indices.push(canvasIndex); + } + else { + if (this.isFirstCanvas(canvasIndex) || this.isLastCanvas(canvasIndex)) { + indices = [canvasIndex]; + } + else if (canvasIndex % 2) { + indices = [canvasIndex, canvasIndex + 1]; + } + else { + indices = [canvasIndex - 1, canvasIndex]; + } + var viewingDirection = this.getViewingDirection(); + if (viewingDirection && + viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) { + indices = indices.reverse(); + } + } + return indices; + }; + Sequence.prototype.getPrevPageIndex = function (canvasIndex, pagingEnabled) { + var index; + if (pagingEnabled) { + var indices = this.getPagedIndices(canvasIndex); + var viewingDirection = this.getViewingDirection(); + if (viewingDirection && + viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) { + index = indices[indices.length - 1] - 1; + } + else { + index = indices[0] - 1; + } + } + else { + index = canvasIndex - 1; + } + return index; + }; + /** + * @returns Array of Scene instances in the Sequence + **/ + Sequence.prototype.getScenes = function () { + var returnVal = []; + var low_items = this.__jsonld.elements || this.__jsonld; + if (low_items) { + for (var i = 0; i < low_items.length; ++i) { + var c = low_items[i]; + if (c.type === 'Scene') { + var scene = new internal_1.Scene(c, this.options); + //scene.index = i; + returnVal.push(scene); + } + } + } + return returnVal; + }; + Sequence.prototype.getStartCanvasIndex = function () { + var startCanvas = this.getStartCanvas(); + if (startCanvas) { + // if there's a startCanvas attribute, loop through the canvases and return the matching index. + for (var i = 0; i < this.getTotalCanvases(); i++) { + var canvas = this.getCanvasByIndex(i); + if (canvas.id === startCanvas) + return i; + } + } + // default to first canvas. + return 0; + }; + // todo: deprecate + Sequence.prototype.getThumbs = function (width, height) { + //console.warn('getThumbs will be deprecated, use getThumbnails instead'); + var thumbs = []; + var totalCanvases = this.getTotalCanvases(); + for (var i = 0; i < totalCanvases; i++) { + var canvas = this.getCanvasByIndex(i); + var thumb = new internal_1.Thumb(width, canvas); + thumbs.push(thumb); + } + return thumbs; + }; + Sequence.prototype.getThumbnails = function () { + if (this._thumbnails != null) + return this._thumbnails; + this._thumbnails = []; + var canvases = this.getCanvases(); + for (var i = 0; i < canvases.length; i++) { + var thumbnail = canvases[i].getThumbnail(); + if (thumbnail) { + this._thumbnails.push(thumbnail); + } + } + return this._thumbnails; + }; + Sequence.prototype.getStartCanvas = function () { + return this.getProperty("startCanvas"); + }; + Sequence.prototype.getTotalCanvases = function () { + return this.getCanvases().length; + }; + Sequence.prototype.getViewingDirection = function () { + if (this.getProperty("viewingDirection")) { + return this.getProperty("viewingDirection"); + } + else if (this.options.resource.getViewingDirection) { + return this.options.resource.getViewingDirection(); + } + return null; + }; + Sequence.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + Sequence.prototype.isCanvasIndexOutOfRange = function (canvasIndex) { + return canvasIndex > this.getTotalCanvases() - 1; + }; + Sequence.prototype.isFirstCanvas = function (canvasIndex) { + return canvasIndex === 0; + }; + Sequence.prototype.isLastCanvas = function (canvasIndex) { + return canvasIndex === this.getTotalCanvases() - 1; + }; + Sequence.prototype.isMultiCanvas = function () { + return this.getTotalCanvases() > 1; + }; + Sequence.prototype.isPagingEnabled = function () { + var viewingHint = this.getViewingHint(); + if (viewingHint) { + return viewingHint === dist_commonjs_1.ViewingHint.PAGED; + } + return false; + }; + // checks if the number of canvases is even - therefore has a front and back cover + Sequence.prototype.isTotalCanvasesEven = function () { + return this.getTotalCanvases() % 2 === 0; + }; + return Sequence; +}(internal_1.ManifestResource)); +exports.Sequence = Sequence; +//# sourceMappingURL=Sequence.js.map \ No newline at end of file diff --git a/dist-commonjs/Sequence.js.map b/dist-commonjs/Sequence.js.map new file mode 100644 index 00000000..98dbe74f --- /dev/null +++ b/dist-commonjs/Sequence.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Sequence.js","sourceRoot":"","sources":["../src/Sequence.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,gEAA+E;AAC/E,uCASoB;AAEpB;IAA8B,4BAAgB;IAI5C,kBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QAJlB,WAAK,GAAa,EAAE,CAAC;QACpB,iBAAW,GAAuB,IAAI,CAAC;;IAI/C,CAAC;IAED,8BAAW,GAAX;QACE,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;QAED,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAE7D,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,IA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O,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IACzC,CAAC;IAED,0CAAuB,GAAvB,UAAwB,WAAmB;QACzC,OAAO,WAAW,GAAG,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;IAED,gCAAa,GAAb,UAAc,WAAmB;QAC/B,OAAO,WAAW,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,+BAAY,GAAZ,UAAa,WAAmB;QAC9B,OAAO,WAAW,KAAK,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;IACrD,CAAC;IAED,gCAAa,GAAb;QACE,OAAO,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;IACrC,CAAC;IAED,kCAAe,GAAf;QACE,IAAM,WAAW,GAAuB,IAAI,CAAC,cAAc,EAAE,CAAC;QAE9D,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,WAAW,KAAK,2BAAW,CAAC,KAAK,CAAC;QAC3C,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,kFAAkF;IAClF,sCAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IACH,eAAC;AAAD,CAAC,AAzUD,CAA8B,2BAAgB,GAyU7C;AAzUY,4BAAQ"} \ No newline at end of file diff --git a/dist-commonjs/Serialisation.d.ts b/dist-commonjs/Serialisation.d.ts new file mode 100644 index 00000000..012f8bf6 --- /dev/null +++ b/dist-commonjs/Serialisation.d.ts @@ -0,0 +1,11 @@ +import { Collection, IIIFResource, IManifestoOptions, Manifest } from "./internal"; +export declare class Deserialiser { + static parse(manifest: any, options?: IManifestoOptions): IIIFResource | null; + static parseJson(json: any, options?: IManifestoOptions): IIIFResource | null; + static parseCollection(json: any, options?: IManifestoOptions): Collection; + static parseCollections(collection: Collection, options?: IManifestoOptions): void; + static parseManifest(json: any, options?: IManifestoOptions): Manifest; + static parseManifests(collection: Collection, options?: IManifestoOptions): void; + static parseItem(json: any, options?: IManifestoOptions): IIIFResource | null; + static parseItems(collection: Collection, options?: IManifestoOptions): void; +} diff --git a/dist-commonjs/Serialisation.js b/dist-commonjs/Serialisation.js new file mode 100644 index 00000000..3800c47d --- /dev/null +++ b/dist-commonjs/Serialisation.js @@ -0,0 +1,157 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Deserialiser = void 0; +var internal_1 = require("./internal"); +var Deserialiser = /** @class */ (function () { + function Deserialiser() { + } + Deserialiser.parse = function (manifest, options) { + if (typeof manifest === "string") { + manifest = JSON.parse(manifest); + } + return this.parseJson(manifest, options); + }; + Deserialiser.parseJson = function (json, options) { + var resource; + // have options been passed for the manifest to inherit? + if (options) { + if (options.navDate && !isNaN(options.navDate.getTime())) { + json.navDate = options.navDate.toString(); + } + } + if (json["@type"]) { + switch (json["@type"]) { + case "sc:Collection": + resource = this.parseCollection(json, options); + break; + case "sc:Manifest": + resource = this.parseManifest(json, options); + break; + default: + return null; + } + } + else { + // presentation 3 + switch (json["type"]) { + case "Collection": + resource = this.parseCollection(json, options); + break; + case "Manifest": + resource = this.parseManifest(json, options); + break; + default: + return null; + } + } + // Top-level resource was loaded from a URI, so flag it to prevent + // unnecessary reload: + resource.isLoaded = true; + return resource; + }; + Deserialiser.parseCollection = function (json, options) { + var collection = new internal_1.Collection(json, options); + if (options) { + collection.index = options.index || 0; + if (options.resource) { + collection.parentCollection = options.resource.parentCollection; + } + } + else { + collection.index = 0; + } + this.parseCollections(collection, options); + this.parseManifests(collection, options); + this.parseItems(collection, options); + return collection; + }; + Deserialiser.parseCollections = function (collection, options) { + var items; + if (collection.__jsonld.collections) { + items = collection.__jsonld.collections; + } + else if (collection.__jsonld.items) { + items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "collection"; }); + } + if (items) { + for (var i = 0; i < items.length; i++) { + if (options) { + options.index = i; + } + var item = this.parseCollection(items[i], options); + item.index = i; + item.parentCollection = collection; + collection.items.push(item); + } + } + }; + Deserialiser.parseManifest = function (json, options) { + var manifest = new internal_1.Manifest(json, options); + return manifest; + }; + Deserialiser.parseManifests = function (collection, options) { + var items; + if (collection.__jsonld.manifests) { + items = collection.__jsonld.manifests; + } + else if (collection.__jsonld.items) { + items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "manifest"; }); + } + if (items) { + for (var i = 0; i < items.length; i++) { + var item = this.parseManifest(items[i], options); + item.index = i; + item.parentCollection = collection; + collection.items.push(item); + } + } + }; + Deserialiser.parseItem = function (json, options) { + if (json["@type"]) { + if (json["@type"].toLowerCase() === "sc:manifest") { + return this.parseManifest(json, options); + } + else if (json["@type"].toLowerCase() === "sc:collection") { + return this.parseCollection(json, options); + } + } + else if (json.type) { + if (json.type.toLowerCase() === "manifest") { + return this.parseManifest(json, options); + } + else if (json.type.toLowerCase() === "collection") { + return this.parseCollection(json, options); + } + } + return null; + }; + Deserialiser.parseItems = function (collection, options) { + var items = collection.__jsonld.members || collection.__jsonld.items; + if (items) { + var _loop_1 = function (i) { + if (options) { + options.index = i; + } + var item = this_1.parseItem(items[i], options); + if (!item) + return { value: void 0 }; + // only add to items if not already parsed from backwards-compatible collections/manifests arrays + if (collection.items.filter(function (m) { return m.id === item.id; })[0]) { + return "continue"; + } + item.index = i; + item.parentCollection = collection; + collection.items.push(item); + }; + var this_1 = this; + for (var i = 0; i < items.length; i++) { + var state_1 = _loop_1(i); + if (typeof state_1 === "object") + return state_1.value; + } + } + }; + return Deserialiser; +}()); +exports.Deserialiser = Deserialiser; +//# sourceMappingURL=Serialisation.js.map \ No newline at end of file diff --git a/dist-commonjs/Serialisation.js.map b/dist-commonjs/Serialisation.js.map new file mode 100644 index 00000000..78dade25 --- /dev/null +++ b/dist-commonjs/Serialisation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Serialisation.js","sourceRoot":"","sources":["../src/Serialisation.ts"],"names":[],"mappings":";;;AAAA,uCAKoB;AAEpB;IAAA;IA8KA,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;QACvE,IAAI,KAAK,EAAE,CAAC;oCACD,CAAC;gBACR,IAAI,OAAO,EAAE,CAAC;oBACZ,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;gBACpB,CAAC;gBACD,IAAM,IAAI,GAAwB,OAAK,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;gBACpE,IAAI,CAAC,IAAI;6CAAS;gBAClB,iGAAiG;gBACjG,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,KAAoB,IAAK,CAAC,EAAE,EAAhC,CAAgC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;;gBAExE,CAAC;gBACD,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;gBACf,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC;gBACnC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;YAZ9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE;sCAA5B,CAAC;;;aAaT;QACH,CAAC;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AA9KD,IA8KC;AA9KY,oCAAY"} \ No newline at end of file diff --git a/dist-commonjs/Service.d.ts b/dist-commonjs/Service.d.ts new file mode 100644 index 00000000..69080c10 --- /dev/null +++ b/dist-commonjs/Service.d.ts @@ -0,0 +1,13 @@ +import { ServiceProfile } from "@iiif/vocabulary/dist-commonjs"; +import { IManifestoOptions, ManifestResource } from "./internal"; +export declare class Service extends ManifestResource { + constructor(jsonld?: any, options?: IManifestoOptions); + getProfile(): ServiceProfile; + getConfirmLabel(): string | null; + getDescription(): string | null; + getFailureDescription(): string | null; + getFailureHeader(): string | null; + getHeader(): string | null; + getServiceLabel(): string | null; + getInfoUri(): string; +} diff --git a/dist-commonjs/Service.js b/dist-commonjs/Service.js new file mode 100644 index 00000000..8616f4f4 --- /dev/null +++ b/dist-commonjs/Service.js @@ -0,0 +1,64 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Service = void 0; +var internal_1 = require("./internal"); +var Service = /** @class */ (function (_super) { + __extends(Service, _super); + function Service(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + Service.prototype.getProfile = function () { + var profile = this.getProperty("profile"); + if (!profile) { + profile = this.getProperty("dcterms:conformsTo"); + } + if (Array.isArray(profile)) { + return profile[0]; + } + return profile; + }; + Service.prototype.getConfirmLabel = function () { + return internal_1.Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale); + }; + Service.prototype.getDescription = function () { + return internal_1.Utils.getLocalisedValue(this.getProperty("description"), this.options.locale); + }; + Service.prototype.getFailureDescription = function () { + return internal_1.Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale); + }; + Service.prototype.getFailureHeader = function () { + return internal_1.Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale); + }; + Service.prototype.getHeader = function () { + return internal_1.Utils.getLocalisedValue(this.getProperty("header"), this.options.locale); + }; + Service.prototype.getServiceLabel = function () { + return internal_1.Utils.getLocalisedValue(this.getProperty("label"), this.options.locale); + }; + Service.prototype.getInfoUri = function () { + var infoUri = this.id; + if (!infoUri.endsWith("/")) { + infoUri += "/"; + } + infoUri += "info.json"; + return infoUri; + }; + return Service; +}(internal_1.ManifestResource)); +exports.Service = Service; +//# sourceMappingURL=Service.js.map \ No newline at end of file diff --git a/dist-commonjs/Service.js.map b/dist-commonjs/Service.js.map new file mode 100644 index 00000000..3d9dcbc2 --- /dev/null +++ b/dist-commonjs/Service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Service.js","sourceRoot":"","sources":["../src/Service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,uCAAwE;AAExE;IAA6B,2BAAgB;IAC3C,iBAAY,MAAY,EAAE,OAA2B;QACnD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IAED,4BAAU,GAAV;QACE,IAAI,OAAO,GAAQ,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAE/C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3B,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,iCAAe,GAAf;QACE,OAAO,gBAAK,CAAC,iBAAiB,CAC5B,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,EAChC,IAAI,CAAC,OAAO,CAAC,MAAM,CACpB,CAAC;IACJ,CAAC;IAED,gCAAc,GAAd;QACE,OAAO,gBAAK,CAAC,iBAAiB,CAC5B,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,EAC/B,IAAI,CAAC,OAAO,CAAC,MAAM,CACpB,CAAC;IACJ,CAAC;IAED,uCAAqB,GAArB;QACE,OAAO,gBAAK,CAAC,iBAAiB,CAC5B,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,EACtC,IAAI,CAAC,OAAO,CAAC,MAAM,CACpB,CAAC;IACJ,CAAC;IAED,kCAAgB,GAAhB;QACE,OAAO,gBAAK,CAAC,iBAAiB,CAC5B,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,EACjC,IAAI,CAAC,OAAO,CAAC,MAAM,CACpB,CAAC;IACJ,CAAC;IAED,2BAAS,GAAT;QACE,OAAO,gBAAK,CAAC,iBAAiB,CAC5B,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAC1B,IAAI,CAAC,OAAO,CAAC,MAAM,CACpB,CAAC;IACJ,CAAC;IAED,iCAAe,GAAf;QACE,OAAO,gBAAK,CAAC,iBAAiB,CAC5B,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EACzB,IAAI,CAAC,OAAO,CAAC,MAAM,CACpB,CAAC;IACJ,CAAC;IAED,4BAAU,GAAV;QACE,IAAI,OAAO,GAAW,IAAI,CAAC,EAAE,CAAC;QAE9B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,GAAG,CAAC;QACjB,CAAC;QAED,OAAO,IAAI,WAAW,CAAC;QAEvB,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,cAAC;AAAD,CAAC,AAxED,CAA6B,2BAAgB,GAwE5C;AAxEY,0BAAO"} \ No newline at end of file diff --git a/dist-commonjs/Size.d.ts b/dist-commonjs/Size.d.ts new file mode 100644 index 00000000..ff76ec44 --- /dev/null +++ b/dist-commonjs/Size.d.ts @@ -0,0 +1,5 @@ +export declare class Size { + width: number; + height: number; + constructor(width: number, height: number); +} diff --git a/dist-commonjs/Size.js b/dist-commonjs/Size.js new file mode 100644 index 00000000..06b0ea11 --- /dev/null +++ b/dist-commonjs/Size.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Size = void 0; +var Size = /** @class */ (function () { + function Size(width, height) { + this.width = width; + this.height = height; + } + return Size; +}()); +exports.Size = Size; +//# sourceMappingURL=Size.js.map \ No newline at end of file diff --git a/dist-commonjs/Size.js.map b/dist-commonjs/Size.js.map new file mode 100644 index 00000000..87f3e543 --- /dev/null +++ b/dist-commonjs/Size.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Size.js","sourceRoot":"","sources":["../src/Size.ts"],"names":[],"mappings":";;;AAAA;IAIE,cAAY,KAAa,EAAE,MAAc;QACvC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACH,WAAC;AAAD,CAAC,AARD,IAQC;AARY,oBAAI"} \ No newline at end of file diff --git a/dist-commonjs/SpecificResource.d.ts b/dist-commonjs/SpecificResource.d.ts new file mode 100644 index 00000000..d7b0e79e --- /dev/null +++ b/dist-commonjs/SpecificResource.d.ts @@ -0,0 +1,21 @@ +import { IManifestoOptions, ManifestResource, AnnotationBody, Transform, PointSelector } from "./internal"; +/** + Developer note: This implementation does not strictly adhere + to the description of SpecificResource in the Web Annotation Model + document https://www.w3.org/TR/annotation-model/ + section 4 : https://www.w3.org/TR/annotation-model/#specific-resources + + The getTransform() method returning an Array of 3D Transfom resources, is + an extension of SpecificResource beyond the web annotation model. +*/ +export declare class SpecificResource extends ManifestResource { + isAnnotationBody: boolean; + isSpecificResource: boolean; + constructor(jsonld: any, options?: IManifestoOptions); + getSource(): object | AnnotationBody; + get Source(): object | AnnotationBody; + getSelector(): PointSelector | null; + get Selector(): PointSelector | null; + getTransform(): Transform[]; + get Transform(): Transform[]; +} diff --git a/dist-commonjs/SpecificResource.js b/dist-commonjs/SpecificResource.js new file mode 100644 index 00000000..e5c2246d --- /dev/null +++ b/dist-commonjs/SpecificResource.js @@ -0,0 +1,115 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SpecificResource = void 0; +var internal_1 = require("./internal"); +/** + Developer note: This implementation does not strictly adhere + to the description of SpecificResource in the Web Annotation Model + document https://www.w3.org/TR/annotation-model/ + section 4 : https://www.w3.org/TR/annotation-model/#specific-resources + + The getTransform() method returning an Array of 3D Transfom resources, is + an extension of SpecificResource beyond the web annotation model. +*/ +var SpecificResource = /** @class */ (function (_super) { + __extends(SpecificResource, _super); + function SpecificResource(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + /* + property distinguishing instances of SpecificResource from instances of AnnotionBody. + The return type of the Annotation.getBody() method is an array of instances of the + union type ( AnnotationBody | SpecificResource ) + */ + _this.isAnnotationBody = false; + /* + property distinguishing instances of SpecificResource from instances of AnnotionBody. + The return type of the Annotation.getBody() method is an array of instances of the + union type ( AnnotationBody | SpecificResource ) + */ + _this.isSpecificResource = true; + _this.isSpecificResource = true; + return _this; + } + ; + SpecificResource.prototype.getSource = function () { + var raw = this.getPropertyAsObject("source"); + if (raw.isIRI) + return raw; + /* + this logic gets a little convoluted, because we have to preserve + the cases where the raw json is an array for the sources of a + SpecificResource applied to an annotation body, while for a target + of an Annotation we just want a single object + */ + // case of a source of a SpecificResource which is an Annotation target + if (raw) { + var containerTypes = ["Scene", "Canvas"]; + var singleItem = ([].concat(raw))[0]; + if (containerTypes.includes(singleItem["type"])) + return singleItem; + } + if (raw) { + var item = ([].concat(raw))[0]; + if (item) { + return internal_1.AnnotationBodyParser.BuildFromJson(item, this.options); + } + } + throw new Error("cannot resolve Source " + JSON.stringify(raw)); + }; + Object.defineProperty(SpecificResource.prototype, "Source", { + get: function () { return this.getSource(); }, + enumerable: false, + configurable: true + }); + SpecificResource.prototype.getSelector = function () { + var raw = this.getProperty("selector"); + if (raw) { + var item = ([].concat(raw))[0]; + if (item) { + if (item["type"] === "PointSelector") + return new internal_1.PointSelector(item); + } + throw new Error("unable to resolve SpecificResource selector " + JSON.stringify(this.__jsonld)); + } + return null; + }; + ; + Object.defineProperty(SpecificResource.prototype, "Selector", { + get: function () { return this.getSelector(); }, + enumerable: false, + configurable: true + }); + SpecificResource.prototype.getTransform = function () { + var retVal = []; + var transformItems = this.getProperty("transform"); + for (var i = 0; i < transformItems.length; ++i) { + var transformItem = transformItems[i]; + retVal.push(internal_1.TransformParser.BuildFromJson(transformItem)); + } + return retVal; + }; + ; + Object.defineProperty(SpecificResource.prototype, "Transform", { + get: function () { return this.getTransform(); }, + enumerable: false, + configurable: true + }); + return SpecificResource; +}(internal_1.ManifestResource)); +exports.SpecificResource = SpecificResource; +//# sourceMappingURL=SpecificResource.js.map \ No newline at end of file diff --git a/dist-commonjs/SpecificResource.js.map b/dist-commonjs/SpecificResource.js.map new file mode 100644 index 00000000..f558dbd7 --- /dev/null +++ b/dist-commonjs/SpecificResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SpecificResource.js","sourceRoot":"","sources":["../src/SpecificResource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAQoB;AAGpB;;;;;;;;EAQE;AACF;IAAsC,oCAAgB;IAgBpD,0BAAY,MAAW,EAAE,OAA2B;QAClD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QAfzB;;;;UAIE;QACF,sBAAgB,GAAa,KAAK,CAAC;QAEnC;;;;UAIE;QACF,wBAAkB,GAAa,IAAI,CAAC;QAIlC,KAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;;IACjC,CAAC;IAAA,CAAC;IAEF,oCAAS,GAAT;QAEC,IAAI,GAAG,GAAI,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,GAAG,CAAC,KAAK;YAAE,OAAO,GAAG,CAAC;QAE1B;;;;;UAKE;QACF,uEAAuE;QACvE,IAAI,GAAG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AA,CAAC;IACF,sBAAI,sCAAQ;aAAZ,cAAuC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAElE,uCAAY,GAAZ;QAEE,IAAI,MAAM,GAAgB,EAAE,CAAC;QAC7B,IAAI,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC,EAC9C,CAAC;YACG,IAAI,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAE,0BAAe,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAA,CAAC;IAEF,sBAAI,uCAAS;aAAb,cAAgC,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAE9D,uBAAC;AAAD,CAAC,AAlFD,CAAsC,2BAAgB,GAkFrD;AAlFY,4CAAgB"} \ No newline at end of file diff --git a/dist-commonjs/StatusCode.d.ts b/dist-commonjs/StatusCode.d.ts new file mode 100644 index 00000000..c2792a67 --- /dev/null +++ b/dist-commonjs/StatusCode.d.ts @@ -0,0 +1,6 @@ +export declare enum StatusCode { + AUTHORIZATION_FAILED = 1, + FORBIDDEN = 2, + INTERNAL_SERVER_ERROR = 3, + RESTRICTED = 4 +} diff --git a/dist-commonjs/StatusCode.js b/dist-commonjs/StatusCode.js new file mode 100644 index 00000000..948ff514 --- /dev/null +++ b/dist-commonjs/StatusCode.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StatusCode = void 0; +var StatusCode; +(function (StatusCode) { + StatusCode[StatusCode["AUTHORIZATION_FAILED"] = 1] = "AUTHORIZATION_FAILED"; + StatusCode[StatusCode["FORBIDDEN"] = 2] = "FORBIDDEN"; + StatusCode[StatusCode["INTERNAL_SERVER_ERROR"] = 3] = "INTERNAL_SERVER_ERROR"; + StatusCode[StatusCode["RESTRICTED"] = 4] = "RESTRICTED"; +})(StatusCode || (exports.StatusCode = StatusCode = {})); +//# sourceMappingURL=StatusCode.js.map \ No newline at end of file diff --git a/dist-commonjs/StatusCode.js.map b/dist-commonjs/StatusCode.js.map new file mode 100644 index 00000000..f6143d54 --- /dev/null +++ b/dist-commonjs/StatusCode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StatusCode.js","sourceRoot":"","sources":["../src/StatusCode.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2EAAwB,CAAA;IACxB,qDAAa,CAAA;IACb,6EAAyB,CAAA;IACzB,uDAAc,CAAA;AAChB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB"} \ No newline at end of file diff --git a/dist-commonjs/Thumb.d.ts b/dist-commonjs/Thumb.d.ts new file mode 100644 index 00000000..7f002a58 --- /dev/null +++ b/dist-commonjs/Thumb.d.ts @@ -0,0 +1,13 @@ +import { ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +import { Canvas } from "./internal"; +export declare class Thumb { + data: any; + index: number; + uri: string; + label: string; + width: number; + height: number; + visible: boolean; + viewingHint: ViewingHint | null; + constructor(width: number, canvas: Canvas); +} diff --git a/dist-commonjs/Thumb.js b/dist-commonjs/Thumb.js new file mode 100644 index 00000000..746319f2 --- /dev/null +++ b/dist-commonjs/Thumb.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Thumb = void 0; +// todo: deprecate +// this is used by Sequence.getThumbs +var Thumb = /** @class */ (function () { + function Thumb(width, canvas) { + this.data = canvas; + this.index = canvas.index; + this.width = width; + var heightRatio = canvas.getHeight() / canvas.getWidth(); + if (heightRatio) { + this.height = Math.floor(this.width * heightRatio); + } + else { + this.height = width; + } + this.uri = canvas.getCanonicalImageUri(width); + this.label = canvas.getLabel().getValue(); // todo: pass locale? + this.viewingHint = canvas.getViewingHint(); + } + return Thumb; +}()); +exports.Thumb = Thumb; +//# sourceMappingURL=Thumb.js.map \ No newline at end of file diff --git a/dist-commonjs/Thumb.js.map b/dist-commonjs/Thumb.js.map new file mode 100644 index 00000000..e39bfcab --- /dev/null +++ b/dist-commonjs/Thumb.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Thumb.js","sourceRoot":"","sources":["../src/Thumb.ts"],"names":[],"mappings":";;;AAGA,kBAAkB;AAClB,qCAAqC;AACrC;IAUE,eAAY,KAAa,EAAE,MAAc;QACvC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAM,WAAW,GAAW,MAAM,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAEnE,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,CAAC;QACrD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;QAED,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,CAAC,KAAK,GAAW,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,qBAAqB;QACxE,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;IAC7C,CAAC;IACH,YAAC;AAAD,CAAC,AA3BD,IA2BC;AA3BY,sBAAK"} \ No newline at end of file diff --git a/dist-commonjs/Thumbnail.d.ts b/dist-commonjs/Thumbnail.d.ts new file mode 100644 index 00000000..43fcf69e --- /dev/null +++ b/dist-commonjs/Thumbnail.d.ts @@ -0,0 +1,4 @@ +import { IManifestoOptions, Resource } from "./internal"; +export declare class Thumbnail extends Resource { + constructor(jsonld: any, options: IManifestoOptions); +} diff --git a/dist-commonjs/Thumbnail.js b/dist-commonjs/Thumbnail.js new file mode 100644 index 00000000..cd28e675 --- /dev/null +++ b/dist-commonjs/Thumbnail.js @@ -0,0 +1,28 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Thumbnail = void 0; +var internal_1 = require("./internal"); +var Thumbnail = /** @class */ (function (_super) { + __extends(Thumbnail, _super); + function Thumbnail(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + return Thumbnail; +}(internal_1.Resource)); +exports.Thumbnail = Thumbnail; +//# sourceMappingURL=Thumbnail.js.map \ No newline at end of file diff --git a/dist-commonjs/Thumbnail.js.map b/dist-commonjs/Thumbnail.js.map new file mode 100644 index 00000000..0a9a5dee --- /dev/null +++ b/dist-commonjs/Thumbnail.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Thumbnail.js","sourceRoot":"","sources":["../src/Thumbnail.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAyD;AAEzD;IAA+B,6BAAQ;IACrC,mBAAY,MAAW,EAAE,OAA0B;QACjD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IACH,gBAAC;AAAD,CAAC,AAJD,CAA+B,mBAAQ,GAItC;AAJY,8BAAS"} \ No newline at end of file diff --git a/dist-commonjs/Transform.d.ts b/dist-commonjs/Transform.d.ts new file mode 100644 index 00000000..b29c7ccf --- /dev/null +++ b/dist-commonjs/Transform.d.ts @@ -0,0 +1,8 @@ +import { JSONLDResource } from "./internal"; +export declare abstract class Transform extends JSONLDResource { + constructor(jsonld?: any); + isTransform: boolean; + isRotateTransform: boolean | undefined; + isScaleTransform: boolean | undefined; + isTranslateTransform: boolean | undefined; +} diff --git a/dist-commonjs/Transform.js b/dist-commonjs/Transform.js new file mode 100644 index 00000000..1d09b5c3 --- /dev/null +++ b/dist-commonjs/Transform.js @@ -0,0 +1,31 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Transform = void 0; +var internal_1 = require("./internal"); +var Transform = /** @class */ (function (_super) { + __extends(Transform, _super); + function Transform(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isTransform = true; + _this.isTransform = true; + return _this; + } + return Transform; +}(internal_1.JSONLDResource)); +exports.Transform = Transform; +//# sourceMappingURL=Transform.js.map \ No newline at end of file diff --git a/dist-commonjs/Transform.js.map b/dist-commonjs/Transform.js.map new file mode 100644 index 00000000..0d3fd518 --- /dev/null +++ b/dist-commonjs/Transform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../src/Transform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAEoB;AAGpB;IAAyC,6BAAc;IAEnD,mBAAY,MAAY;QACpB,YAAA,MAAK,YAAC,MAAM,CAAE,SAAC;QAInB,iBAAW,GAAa,IAAI,CAAC;QAHzB,KAAI,CAAC,WAAW,GAAG,IAAI,CAAC;;IAC5B,CAAC;IAML,gBAAC;AAAD,CAAC,AAXD,CAAyC,yBAAc,GAWtD;AAXsB,8BAAS"} \ No newline at end of file diff --git a/dist-commonjs/TransformParser.d.ts b/dist-commonjs/TransformParser.d.ts new file mode 100644 index 00000000..c0fd74d4 --- /dev/null +++ b/dist-commonjs/TransformParser.d.ts @@ -0,0 +1,4 @@ +import { Transform } from "./internal"; +export declare class TransformParser { + static BuildFromJson(jsonld: any): Transform; +} diff --git a/dist-commonjs/TransformParser.js b/dist-commonjs/TransformParser.js new file mode 100644 index 00000000..c7f5a2f2 --- /dev/null +++ b/dist-commonjs/TransformParser.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TransformParser = void 0; +var internal_1 = require("./internal"); +var TransformParser = /** @class */ (function () { + function TransformParser() { + } + TransformParser.BuildFromJson = function (jsonld) { + if (jsonld.type === "TranslateTransform") + return new internal_1.TranslateTransform(jsonld); + else if (jsonld.type === "RotateTransform") + return new internal_1.RotateTransform(jsonld); + else if (jsonld.type === "ScaleTransform") + return new internal_1.ScaleTransform(jsonld); + else + throw new Error("Unknown transform type " + jsonld.type); + }; + return TransformParser; +}()); +exports.TransformParser = TransformParser; +//# sourceMappingURL=TransformParser.js.map \ No newline at end of file diff --git a/dist-commonjs/TransformParser.js.map b/dist-commonjs/TransformParser.js.map new file mode 100644 index 00000000..6735b8eb --- /dev/null +++ b/dist-commonjs/TransformParser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TransformParser.js","sourceRoot":"","sources":["../src/TransformParser.ts"],"names":[],"mappings":";;;AAAA,uCAKoB;AAGpB;IAAA;IAWA,CAAC;IAVU,6BAAa,GAApB,UAAsB,MAAW;QAC7B,IAAI,MAAM,CAAC,IAAI,KAAK,oBAAoB;YACpC,OAAO,IAAI,6BAAkB,CAAC,MAAM,CAAC,CAAC;aACrC,IAAI,MAAM,CAAC,IAAI,KAAK,iBAAiB;YACtC,OAAO,IAAI,0BAAe,CAAC,MAAM,CAAC,CAAC;aAClC,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB;YACrC,OAAO,IAAI,yBAAc,CAAC,MAAM,CAAC,CAAC;;YAElC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;IACL,sBAAC;AAAD,CAAC,AAXD,IAWC;AAXa,0CAAe"} \ No newline at end of file diff --git a/dist-commonjs/TranslateTransform.d.ts b/dist-commonjs/TranslateTransform.d.ts new file mode 100644 index 00000000..935c6092 --- /dev/null +++ b/dist-commonjs/TranslateTransform.d.ts @@ -0,0 +1,5 @@ +import { Transform } from "./internal"; +export declare class TranslateTransform extends Transform { + constructor(jsonld?: any); + getTranslation(): object; +} diff --git a/dist-commonjs/TranslateTransform.js b/dist-commonjs/TranslateTransform.js new file mode 100644 index 00000000..c3f41bdf --- /dev/null +++ b/dist-commonjs/TranslateTransform.js @@ -0,0 +1,40 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TranslateTransform = void 0; +var internal_1 = require("./internal"); +var TranslateTransform = /** @class */ (function (_super) { + __extends(TranslateTransform, _super); + function TranslateTransform(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isTranslateTransform = true; + return _this; + } + TranslateTransform.prototype.getTranslation = function () { + var retVal = {}; + for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) { + var attrib = _a[_i]; + var raw = this.__jsonld[attrib]; + retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0; + } + return retVal; + }; + return TranslateTransform; +}(internal_1.Transform)); +exports.TranslateTransform = TranslateTransform; +; +//# sourceMappingURL=TranslateTransform.js.map \ No newline at end of file diff --git a/dist-commonjs/TranslateTransform.js.map b/dist-commonjs/TranslateTransform.js.map new file mode 100644 index 00000000..abcf58a2 --- /dev/null +++ b/dist-commonjs/TranslateTransform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TranslateTransform.js","sourceRoot":"","sources":["../src/TranslateTransform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,uCAEoB;AAEpB;IAAwC,sCAAS;IAC7C,4BAAY,MAAY;QACpB,YAAA,MAAK,YAAC,MAAM,CAAE,SAAC;QACf,KAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;;IACrC,CAAC;IAED,2CAAc,GAAd;QACI,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAqB,UAAa,EAAb,MAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC,EAAb,cAAa,EAAb,IAAa,EAAC,CAAC;YAA/B,IAAM,MAAM,SAAA;YACb,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAA,CAAC,CAAA,MAAM,CAAC,GAAG,CAAC,CAAA,CAAC,CAAA,GAAG,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEL,yBAAC;AAAD,CAAC,AAfD,CAAwC,oBAAS,GAehD;AAfY,gDAAkB;AAe9B,CAAC"} \ No newline at end of file diff --git a/dist-commonjs/TreeNode.d.ts b/dist-commonjs/TreeNode.d.ts new file mode 100644 index 00000000..2d757448 --- /dev/null +++ b/dist-commonjs/TreeNode.d.ts @@ -0,0 +1,15 @@ +export declare class TreeNode { + data: any; + nodes: TreeNode[]; + selected: boolean; + expanded: boolean; + id: string; + label: string; + navDate: Date; + parentNode: TreeNode; + constructor(label?: string, data?: any); + addNode(node: TreeNode): void; + isCollection(): boolean; + isManifest(): boolean; + isRange(): boolean; +} diff --git a/dist-commonjs/TreeNode.js b/dist-commonjs/TreeNode.js new file mode 100644 index 00000000..a67af2eb --- /dev/null +++ b/dist-commonjs/TreeNode.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TreeNode = void 0; +var internal_1 = require("./internal"); +var TreeNode = /** @class */ (function () { + function TreeNode(label, data) { + this.label = label; + this.data = data || {}; + this.nodes = []; + } + TreeNode.prototype.addNode = function (node) { + this.nodes.push(node); + node.parentNode = this; + }; + TreeNode.prototype.isCollection = function () { + return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION); + }; + TreeNode.prototype.isManifest = function () { + return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST); + }; + TreeNode.prototype.isRange = function () { + return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE); + }; + return TreeNode; +}()); +exports.TreeNode = TreeNode; +//# sourceMappingURL=TreeNode.js.map \ No newline at end of file diff --git a/dist-commonjs/TreeNode.js.map b/dist-commonjs/TreeNode.js.map new file mode 100644 index 00000000..f288cfcf --- /dev/null +++ b/dist-commonjs/TreeNode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeNode.js","sourceRoot":"","sources":["../src/TreeNode.ts"],"names":[],"mappings":";;;AAAA,uCAAiD;AAEjD;IAUE,kBAAY,KAAc,EAAE,IAAU;QACpC,IAAI,CAAC,KAAK,GAAW,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAEM,0BAAO,GAAd,UAAe,IAAc;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAEM,+BAAY,GAAnB;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,gBAAK,CAAC,aAAa,CAAC,uBAAY,CAAC,UAAU,CAAC,CAAC;IACzE,CAAC;IAEM,6BAAU,GAAjB;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,gBAAK,CAAC,aAAa,CAAC,uBAAY,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC;IAEM,0BAAO,GAAd;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,gBAAK,CAAC,aAAa,CAAC,uBAAY,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC;IACH,eAAC;AAAD,CAAC,AAhCD,IAgCC;AAhCY,4BAAQ"} \ No newline at end of file diff --git a/dist-commonjs/TreeNodeType.d.ts b/dist-commonjs/TreeNodeType.d.ts new file mode 100644 index 00000000..812a5b99 --- /dev/null +++ b/dist-commonjs/TreeNodeType.d.ts @@ -0,0 +1,5 @@ +export declare enum TreeNodeType { + COLLECTION = "collection", + MANIFEST = "manifest", + RANGE = "range" +} diff --git a/dist-commonjs/TreeNodeType.js b/dist-commonjs/TreeNodeType.js new file mode 100644 index 00000000..28508fd4 --- /dev/null +++ b/dist-commonjs/TreeNodeType.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TreeNodeType = void 0; +var TreeNodeType; +(function (TreeNodeType) { + TreeNodeType["COLLECTION"] = "collection"; + TreeNodeType["MANIFEST"] = "manifest"; + TreeNodeType["RANGE"] = "range"; +})(TreeNodeType || (exports.TreeNodeType = TreeNodeType = {})); +//# sourceMappingURL=TreeNodeType.js.map \ No newline at end of file diff --git a/dist-commonjs/TreeNodeType.js.map b/dist-commonjs/TreeNodeType.js.map new file mode 100644 index 00000000..f2ae663c --- /dev/null +++ b/dist-commonjs/TreeNodeType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeNodeType.js","sourceRoot":"","sources":["../src/TreeNodeType.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;AACjB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB"} \ No newline at end of file diff --git a/dist-commonjs/Utils.d.ts b/dist-commonjs/Utils.d.ts new file mode 100644 index 00000000..f6fdc27d --- /dev/null +++ b/dist-commonjs/Utils.d.ts @@ -0,0 +1,47 @@ +import { IAccessToken, IExternalResource, IIIFResource, IManifestoOptions, JSONLDResource, Service, StatusCode, TreeNode } from "./internal"; +import { MediaType, ServiceProfile } from "@iiif/vocabulary/dist-commonjs"; +import "isomorphic-unfetch"; +export declare class Utils { + static getMediaType(type: string): MediaType; + static getImageQuality(profile: ServiceProfile): string; + static getInexactLocale(locale: string): string; + static getLocalisedValue(resource: any, locale: string): string | null; + static generateTreeNodeIds(treeNode: TreeNode, index?: number): void; + static normaliseType(type: string): string; + static normaliseUrl(url: string): string; + static normalisedUrlsMatch(url1: string, url2: string): boolean; + static isImageProfile(profile: ServiceProfile): boolean; + static isImageServiceType(type: string | null): boolean; + static isLevel0ImageProfile(profile: ServiceProfile): boolean; + static isLevel1ImageProfile(profile: ServiceProfile): boolean; + static isLevel2ImageProfile(profile: ServiceProfile): boolean; + static parseManifest(manifest: any, options?: IManifestoOptions | undefined): IIIFResource | null; + static checkStatus(response: any): any; + static loadManifest(url: string): Promise; + static loadExternalResourcesAuth1(resources: IExternalResource[], openContentProviderInteraction: (service: Service) => any, openTokenService: (resource: IExternalResource, tokenService: Service) => Promise, getStoredAccessToken: (resource: IExternalResource) => Promise, userInteractedWithContentProvider: (contentProviderInteraction: any) => Promise, getContentProviderInteraction: (resource: IExternalResource, service: Service) => Promise, handleMovedTemporarily: (resource: IExternalResource) => Promise, showOutOfOptionsMessages: (resource: IExternalResource, service: Service) => void): Promise; + static loadExternalResourceAuth1(resource: IExternalResource, openContentProviderInteraction: (service: Service) => any, openTokenService: (resource: IExternalResource, tokenService: Service) => Promise, getStoredAccessToken: (resource: IExternalResource) => Promise, userInteractedWithContentProvider: (contentProviderInteraction: any) => Promise, getContentProviderInteraction: (resource: IExternalResource, service: Service) => Promise, handleMovedTemporarily: (resource: IExternalResource) => Promise, showOutOfOptionsMessages: (resource: IExternalResource, service: Service) => void): Promise; + static doAuthChain(resource: IExternalResource, openContentProviderInteraction: (service: Service) => any, openTokenService: (resource: IExternalResource, tokenService: Service) => Promise, userInteractedWithContentProvider: (contentProviderInteraction: any) => Promise, getContentProviderInteraction: (resource: IExternalResource, service: Service) => Promise, handleMovedTemporarily: (resource: IExternalResource) => Promise, showOutOfOptionsMessages: (resource: IExternalResource, service: Service) => void): Promise; + static attemptResourceWithToken(resource: IExternalResource, openTokenService: (resource: IExternalResource, tokenService: Service) => Promise, authService: Service): Promise; + static loadExternalResourcesAuth09(resources: IExternalResource[], tokenStorageStrategy: string, clickThrough: (resource: IExternalResource) => Promise, restricted: (resource: IExternalResource) => Promise, login: (resource: IExternalResource) => Promise, getAccessToken: (resource: IExternalResource, rejectOnError: boolean) => Promise, storeAccessToken: (resource: IExternalResource, token: IAccessToken, tokenStorageStrategy: string) => Promise, getStoredAccessToken: (resource: IExternalResource, tokenStorageStrategy: string) => Promise, handleResourceResponse: (resource: IExternalResource) => Promise, options?: IManifestoOptions): Promise; + static loadExternalResourceAuth09(resource: IExternalResource, tokenStorageStrategy: string, clickThrough: (resource: IExternalResource) => Promise, restricted: (resource: IExternalResource) => Promise, login: (resource: IExternalResource) => Promise, getAccessToken: (resource: IExternalResource, rejectOnError: boolean) => Promise, storeAccessToken: (resource: IExternalResource, token: IAccessToken, tokenStorageStrategy: string) => Promise, getStoredAccessToken: (resource: IExternalResource, tokenStorageStrategy: string) => Promise, handleResourceResponse: (resource: IExternalResource) => Promise, options?: IManifestoOptions): Promise; + static createError(name: StatusCode, message: string): Error; + static createAuthorizationFailedError(): Error; + static createRestrictedError(): Error; + static createInternalServerError(message: string): Error; + static authorize(resource: IExternalResource, tokenStorageStrategy: string, clickThrough: (resource: IExternalResource) => Promise, restricted: (resource: IExternalResource) => Promise, login: (resource: IExternalResource) => Promise, getAccessToken: (resource: IExternalResource, rejectOnError: boolean) => Promise, storeAccessToken: (resource: IExternalResource, token: IAccessToken, tokenStorageStrategy: string) => Promise, getStoredAccessToken: (resource: IExternalResource, tokenStorageStrategy: string) => Promise): Promise; + private static showAuthInteraction; + static getService(resource: any, profile: ServiceProfile): Service | null; + static getResourceById(parentResource: JSONLDResource, id: string): JSONLDResource; + /** + * Does a depth first traversal of an Object, returning an Object that + * matches provided k and v arguments + * @example Utils.traverseAndFind({foo: 'bar'}, 'foo', 'bar') + */ + static traverseAndFind(object: any, k: string, v: string): object | undefined; + static getServices(resource: any, { onlyService, onlyServices, skipParentResources }?: { + onlyServices?: boolean; + skipParentResources?: boolean; + onlyService?: boolean; + }): Service[]; + static getTemporalComponent(target: string): number[] | null; +} diff --git a/dist-commonjs/Utils.js b/dist-commonjs/Utils.js new file mode 100644 index 00000000..c439558f --- /dev/null +++ b/dist-commonjs/Utils.js @@ -0,0 +1,749 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Utils = void 0; +var internal_1 = require("./internal"); +var dist_commonjs_1 = require("@iiif/vocabulary/dist-commonjs"); +var dist_commonjs_2 = require("@edsilv/http-status-codes/dist-commonjs"); +require("isomorphic-unfetch"); +var Utils = /** @class */ (function () { + function Utils() { + } + Utils.getMediaType = function (type) { + type = type.toLowerCase(); + type = type.split(";")[0]; + return type.trim(); + }; + Utils.getImageQuality = function (profile) { + if (profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2 || + profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) { + return "native"; + } + return "default"; + }; + Utils.getInexactLocale = function (locale) { + if (locale.indexOf("-") !== -1) { + return locale.substr(0, locale.indexOf("-")); + } + return locale; + }; + Utils.getLocalisedValue = function (resource, locale) { + // if the resource is not an array of translations, return the string. + if (!Array.isArray(resource)) { + return resource; + } + // test for exact match + for (var i = 0; i < resource.length; i++) { + var value_1 = resource[i]; + var language_1 = value_1["@language"]; + if (locale === language_1) { + return value_1["@value"]; + } + } + // test for inexact match + var match = locale.substr(0, locale.indexOf("-")); + for (var i = 0; i < resource.length; i++) { + var value = resource[i]; + var language = value["@language"]; + if (language === match) { + return value["@value"]; + } + } + return null; + }; + Utils.generateTreeNodeIds = function (treeNode, index) { + if (index === void 0) { index = 0; } + var id; + if (!treeNode.parentNode) { + id = "0"; + } + else { + id = treeNode.parentNode.id + "-" + index; + } + treeNode.id = id; + for (var i = 0; i < treeNode.nodes.length; i++) { + var n = treeNode.nodes[i]; + Utils.generateTreeNodeIds(n, i); + } + }; + Utils.normaliseType = function (type) { + type = (type || "").toLowerCase(); + if (type.indexOf(":") !== -1) { + var split = type.split(":"); + return split[1]; + } + return type; + }; + Utils.normaliseUrl = function (url) { + url = url.substr(url.indexOf("://")); + if (url.indexOf("#") !== -1) { + url = url.split("#")[0]; + } + return url; + }; + Utils.normalisedUrlsMatch = function (url1, url2) { + return Utils.normaliseUrl(url1) === Utils.normaliseUrl(url2); + }; + Utils.isImageProfile = function (profile) { + if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) { + return true; + } + return false; + }; + Utils.isImageServiceType = function (type) { + return ((type !== null && + type.toLowerCase() === dist_commonjs_1.ServiceType.IMAGE_SERVICE_2.toLowerCase()) || + type === dist_commonjs_1.ServiceType.IMAGE_SERVICE_3.toLowerCase()); + }; + Utils.isLevel0ImageProfile = function (profile) { + if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) { + return true; + } + return false; + }; + Utils.isLevel1ImageProfile = function (profile) { + if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) { + return true; + } + return false; + }; + Utils.isLevel2ImageProfile = function (profile) { + if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) { + return true; + } + return false; + }; + Utils.parseManifest = function (manifest, options) { + return internal_1.Deserialiser.parse(manifest, options); + }; + Utils.checkStatus = function (response) { + if (response.ok) { + return response; + } + else { + var error = new Error(response.statusText); + error.response = response; + return Promise.reject(error); + } + }; + Utils.loadManifest = function (url) { + return new Promise(function (resolve, reject) { + fetch(url) + .then(Utils.checkStatus) + .then(function (r) { return r.json(); }) + .then(function (data) { + resolve(data); + }) + .catch(function (err) { + reject(); + }); + }); + }; + Utils.loadExternalResourcesAuth1 = function (resources, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) { + return new Promise(function (resolve, reject) { + var promises = resources.map(function (resource) { + return Utils.loadExternalResourceAuth1(resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages); + }); + Promise.all(promises) + .then(function () { + resolve(resources); + })["catch"](function (error) { + reject(error); + }); + }); + }; + Utils.loadExternalResourceAuth1 = function (resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) { + return __awaiter(this, void 0, void 0, function () { + var storedAccessToken; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, getStoredAccessToken(resource)]; + case 1: + storedAccessToken = _a.sent(); + if (!storedAccessToken) return [3 /*break*/, 6]; + return [4 /*yield*/, resource.getData(storedAccessToken)]; + case 2: + _a.sent(); + if (!(resource.status === dist_commonjs_2.OK)) return [3 /*break*/, 3]; + return [2 /*return*/, resource]; + case 3: + // the stored token is no good for this resource + return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)]; + case 4: + // the stored token is no good for this resource + _a.sent(); + _a.label = 5; + case 5: + if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) { + return [2 /*return*/, resource]; + } + throw Utils.createAuthorizationFailedError(); + case 6: return [4 /*yield*/, resource.getData()]; + case 7: + _a.sent(); + if (!(resource.status === dist_commonjs_2.MOVED_TEMPORARILY || + resource.status === dist_commonjs_2.UNAUTHORIZED)) return [3 /*break*/, 9]; + return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)]; + case 8: + _a.sent(); + _a.label = 9; + case 9: + if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) { + return [2 /*return*/, resource]; + } + throw Utils.createAuthorizationFailedError(); + } + }); + }); + }; + Utils.doAuthChain = function (resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) { + return __awaiter(this, void 0, void 0, function () { + var externalService, kioskService, clickThroughService, loginService, serviceToTry, lastAttempted, kioskInteraction, contentProviderInteraction, contentProviderInteraction; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + // This function enters the flowchart at the < External? > junction + // http://iiif.io/api/auth/1.0/#workflow-from-the-browser-client-perspective + if (!resource.isAccessControlled()) { + return [2 /*return*/, resource]; // no services found + } + externalService = resource.externalService; + if (externalService) { + externalService.options = resource.options; + } + kioskService = resource.kioskService; + if (kioskService) { + kioskService.options = resource.options; + } + clickThroughService = resource.clickThroughService; + if (clickThroughService) { + clickThroughService.options = resource.options; + } + loginService = resource.loginService; + if (loginService) { + loginService.options = resource.options; + } + if (!(!resource.isResponseHandled && resource.status === dist_commonjs_2.MOVED_TEMPORARILY)) return [3 /*break*/, 2]; + return [4 /*yield*/, handleMovedTemporarily(resource)]; + case 1: + _a.sent(); + return [2 /*return*/, resource]; + case 2: + serviceToTry = null; + lastAttempted = null; + // repetition of logic is left in these steps for clarity: + // Looking for external pattern + serviceToTry = externalService; + if (!serviceToTry) return [3 /*break*/, 4]; + lastAttempted = serviceToTry; + return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)]; + case 3: + _a.sent(); + return [2 /*return*/, resource]; + case 4: + // Looking for kiosk pattern + serviceToTry = kioskService; + if (!serviceToTry) return [3 /*break*/, 7]; + lastAttempted = serviceToTry; + kioskInteraction = openContentProviderInteraction(serviceToTry); + if (!kioskInteraction) return [3 /*break*/, 7]; + return [4 /*yield*/, userInteractedWithContentProvider(kioskInteraction)]; + case 5: + _a.sent(); + return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)]; + case 6: + _a.sent(); + return [2 /*return*/, resource]; + case 7: + // The code for the next two patterns is identical (other than the profile name). + // The difference is in the expected behaviour of + // + // await userInteractedWithContentProvider(contentProviderInteraction); + // + // For clickthrough the opened window should close immediately having established + // a session, whereas for login the user might spend some time entering credentials etc. + // Looking for clickthrough pattern + serviceToTry = clickThroughService; + if (!serviceToTry) return [3 /*break*/, 11]; + lastAttempted = serviceToTry; + return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)]; + case 8: + contentProviderInteraction = _a.sent(); + if (!contentProviderInteraction) return [3 /*break*/, 11]; + // should close immediately + return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)]; + case 9: + // should close immediately + _a.sent(); + return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)]; + case 10: + _a.sent(); + return [2 /*return*/, resource]; + case 11: + // Looking for login pattern + serviceToTry = loginService; + if (!serviceToTry) return [3 /*break*/, 15]; + lastAttempted = serviceToTry; + return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)]; + case 12: + contentProviderInteraction = _a.sent(); + if (!contentProviderInteraction) return [3 /*break*/, 15]; + // we expect the user to spend some time interacting + return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)]; + case 13: + // we expect the user to spend some time interacting + _a.sent(); + return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)]; + case 14: + _a.sent(); + return [2 /*return*/, resource]; + case 15: + // nothing worked! Use the most recently tried service as the source of + // messages to show to the user. + if (lastAttempted) { + showOutOfOptionsMessages(resource, lastAttempted); + } + return [2 /*return*/]; + } + }); + }); + }; + Utils.attemptResourceWithToken = function (resource, openTokenService, authService) { + return __awaiter(this, void 0, void 0, function () { + var tokenService, tokenMessage; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + tokenService = authService.getService(dist_commonjs_1.ServiceProfile.AUTH_1_TOKEN); + if (!tokenService) return [3 /*break*/, 3]; + return [4 /*yield*/, openTokenService(resource, tokenService)]; + case 1: + tokenMessage = _a.sent(); + if (!(tokenMessage && tokenMessage.accessToken)) return [3 /*break*/, 3]; + return [4 /*yield*/, resource.getData(tokenMessage)]; + case 2: + _a.sent(); + return [2 /*return*/, resource]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + Utils.loadExternalResourcesAuth09 = function (resources, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) { + return new Promise(function (resolve, reject) { + var promises = resources.map(function (resource) { + return Utils.loadExternalResourceAuth09(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options); + }); + Promise.all(promises) + .then(function () { + resolve(resources); + })["catch"](function (error) { + reject(error); + }); + }); + }; + // IIIF auth api pre v1.0 + // Keeping this around for now until the auth 1.0 implementation is stable + Utils.loadExternalResourceAuth09 = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) { + return new Promise(function (resolve, reject) { + if (options && options.pessimisticAccessControl) { + // pessimistic: access control cookies may have been deleted. + // always request the access token for every access controlled info.json request + // returned access tokens are not stored, therefore the login window flashes for every request. + resource + .getData() + .then(function () { + if (resource.isAccessControlled()) { + // if the resource has a click through service, use that. + if (resource.clickThroughService) { + resolve(clickThrough(resource)); + //} else if(resource.restrictedService) { + resolve(restricted(resource)); + } + else { + login(resource) + .then(function () { + getAccessToken(resource, true) + .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)); + }); + } + } + else { + // this info.json isn't access controlled, therefore no need to request an access token. + resolve(resource); + } + })["catch"](function (message) { + reject(Utils.createInternalServerError(message)); + }); + } + else { + // optimistic: access control cookies may not have been deleted. + // store access tokens to avoid login window flashes. + // if cookies are deleted a page refresh is required. + // try loading the resource using an access token that matches the info.json domain. + // if an access token is found, request the resource using it regardless of whether it is access controlled. + getStoredAccessToken(resource, tokenStorageStrategy) + .then(function (storedAccessToken) { + if (storedAccessToken) { + // try using the stored access token + resource + .getData(storedAccessToken) + .then(function () { + // if the info.json loaded using the stored access token + if (resource.status === dist_commonjs_2.OK) { + resolve(handleResourceResponse(resource)); + } + else { + // otherwise, load the resource data to determine the correct access control services. + // if access controlled, do login. + Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) + .then(function () { + resolve(handleResourceResponse(resource)); + })["catch"](function (error) { + // if (resource.restrictedService){ + // reject(Utils.createRestrictedError()); + // } else { + reject(Utils.createAuthorizationFailedError()); + //} + }); + } + })["catch"](function (error) { + reject(Utils.createAuthorizationFailedError()); + }); + } + else { + 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(); + error.message = message; + error.name = String(name); + return error; + }; + Utils.createAuthorizationFailedError = function () { + return Utils.createError(internal_1.StatusCode.AUTHORIZATION_FAILED, "Authorization failed"); + }; + Utils.createRestrictedError = function () { + return Utils.createError(internal_1.StatusCode.RESTRICTED, "Restricted"); + }; + Utils.createInternalServerError = function (message) { + return Utils.createError(internal_1.StatusCode.INTERNAL_SERVER_ERROR, message); + }; + Utils.authorize = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) { + return new Promise(function (resolve, reject) { + resource.getData().then(function () { + if (resource.isAccessControlled()) { + getStoredAccessToken(resource, tokenStorageStrategy) + .then(function (storedAccessToken) { + if (storedAccessToken) { + // try using the stored access token + resource + .getData(storedAccessToken) + .then(function () { + if (resource.status === dist_commonjs_2.OK) { + resolve(resource); // happy path ended + } + else { + // the stored token is no good for this resource + Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject); + } + })["catch"](function (message) { + reject(Utils.createInternalServerError(message)); + }); + } + else { + // There was no stored token, but the user might have a cookie that will grant a token + getAccessToken(resource, false).then(function (accessToken) { + if (accessToken) { + storeAccessToken(resource, accessToken, tokenStorageStrategy) + .then(function () { + // try using the fresh access token + resource + .getData(accessToken) + .then(function () { + if (resource.status === dist_commonjs_2.OK) { + resolve(resource); + } + else { + // User has a token, but it's not good enough + Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject); + } + })["catch"](function (message) { + reject(Utils.createInternalServerError(message)); + }); + })["catch"](function (message) { + // not able to store access token + reject(Utils.createInternalServerError(message)); + }); + } + else { + // The user did not have a cookie that granted a token + Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject); + } + }); + } + })["catch"](function (message) { + reject(Utils.createInternalServerError(message)); + }); + } + else { + // this info.json isn't access controlled, therefore there's no need to request an access token + resolve(resource); + } + }); + }); + }; + Utils.showAuthInteraction = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject) { + if (resource.status === dist_commonjs_2.MOVED_TEMPORARILY && !resource.isResponseHandled) { + // if the resource was redirected to a degraded version + // and the response hasn't been handled yet. + // if the client wishes to trigger a login, set resource.isResponseHandled to true + // and call loadExternalResources() again passing the resource. + resolve(resource); + // } else if (resource.restrictedService) { + // resolve(restricted(resource)); + // // TODO: move to next etc + } + else if (resource.clickThroughService && !resource.isResponseHandled) { + // if the resource has a click through service, use that. + clickThrough(resource).then(function () { + getAccessToken(resource, true) + .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)); + }); + }); + } + else { + // get an access token + login(resource).then(function () { + getAccessToken(resource, true) + .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)); + }); + }); + } + }; + Utils.getService = function (resource, profile) { + var services = this.getServices(resource); + for (var i = 0; i < services.length; i++) { + var service = services[i]; + if (service.getProfile() === profile) { + return service; + } + } + return null; + }; + Utils.getResourceById = function (parentResource, id) { + return (Utils.traverseAndFind(parentResource.__jsonld, "@id", id)); + }; + /** + * Does a depth first traversal of an Object, returning an Object that + * matches provided k and v arguments + * @example Utils.traverseAndFind({foo: 'bar'}, 'foo', 'bar') + */ + Utils.traverseAndFind = function (object, k, v) { + if (object.hasOwnProperty(k) && object[k] === v) { + return object; + } + for (var i = 0; i < Object.keys(object).length; i++) { + if (typeof object[Object.keys(object)[i]] === "object") { + var o = Utils.traverseAndFind(object[Object.keys(object)[i]], k, v); + if (o != null) { + return o; + } + } + } + return undefined; + }; + Utils.getServices = function (resource, _a) { + var _b = _a === void 0 ? {} : _a, _c = _b.onlyService, onlyService = _c === void 0 ? false : _c, _d = _b.onlyServices, onlyServices = _d === void 0 ? false : _d, _e = _b.skipParentResources, skipParentResources = _e === void 0 ? false : _e; + var services = []; + // Resources can reference "services" on the manifest. This is a bit of a hack to just get the services from the manifest + // too. What would be better is if this was used as a "Map" of full services. + // So when you come across { id: '...' } without any data, you can "lookup" services from the manifest. + // I would have implemented this if I was confident that it was reliable. Instead, I opted for the safest option that + // should not break any existing services. + if (!skipParentResources && + resource && + resource.options && + resource.options.resource && + resource.options.resource !== resource) { + services.push.apply(services, Utils.getServices(resource.options.resource, { onlyServices: true })); + } + var service = !onlyServices + ? (resource.__jsonld || resource).service || [] + : []; + // coerce to array + if (!Array.isArray(service)) { + service = [service]; + } + if (!onlyService) { + // Some resources also have a `.services` property. + // https://iiif.io/api/presentation/3.0/#services + service.push.apply(service, ((resource.__jsonld || resource).services || [])); + } + if (service.length === 0) { + return services; + } + for (var i = 0; i < service.length; i++) { + var s = service[i]; + if (typeof s === "string") { + var r = this.getResourceById(resource.options.resource, s); + if (r) { + services.push(new internal_1.Service(r.__jsonld || r, resource.options)); + } + } + else { + services.push(new internal_1.Service(s, resource.options)); + } + } + return services; + }; + Utils.getTemporalComponent = function (target) { + var temporal = /t=([^&]+)/g.exec(target); + var t = null; + if (temporal && temporal[1]) { + t = temporal[1].split(","); + } + return t; + }; + return Utils; +}()); +exports.Utils = Utils; +//# sourceMappingURL=Utils.js.map \ No newline at end of file diff --git a/dist-commonjs/Utils.js.map b/dist-commonjs/Utils.js.map new file mode 100644 index 00000000..19902066 --- /dev/null +++ b/dist-commonjs/Utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../src/Utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAUoB;AACpB,gEAIwC;AACxC,yEAIiD;AACjD,8BAA4B;AAE5B;IAAA;IAunCA,CAAC;IAtnCQ,kBAAY,GAAnB,UAAoB,IAAY;QAC9B,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1B,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1B,OAAkB,IAAI,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAEM,qBAAe,GAAtB,UAAuB,OAAuB;QAC5C,IACE,OAAO,KAAK,8BAAc,CAAC,0BAA0B;YACrD,OAAO,KAAK,8BAAc,CAAC,0BAA0B;YACrD,OAAO,KAAK,8BAAc,CAAC,0BAA0B;YACrD,OAAO,KAAK,8BAAc,CAAC,0BAA0B;YACrD,OAAO,KAAK,8BAAc,CAAC,2BAA2B;YACtD,OAAO,KAAK,8BAAc,CAAC,2BAA2B;YACtD,OAAO,KAAK,8BAAc,CAAC,2BAA2B;YACtD,OAAO,KAAK,8BAAc,CAAC,2BAA2B;YACtD,OAAO,KAAK,8BAAc,CAAC,eAAe;YAC1C,OAAO,KAAK,8BAAc,CAAC,uBAAuB;YAClD,OAAO,KAAK,8BAAc,CAAC,eAAe;YAC1C,OAAO,KAAK,8BAAc,CAAC,uBAAuB,EAClD,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,sBAAgB,GAAvB,UAAwB,MAAc;QACpC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC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C,CAAC,CAAC;YAE1B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,IAAM,CAAC,GAAmB,IAAI,CAAC,eAAe,CAC5C,QAAQ,CAAC,OAAO,CAAC,QAAQ,EACzB,CAAC,CACF,CAAC;gBAEF,IAAI,CAAC,EAAE,CAAC;oBACN,QAAQ,CAAC,IAAI,CAAC,IAAI,kBAAO,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;gBAChE,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,IAAI,CAAC,IAAI,kBAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,0BAAoB,GAA3B,UAA4B,MAAc;QACxC,IAAM,QAAQ,GAA2B,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnE,IAAI,CAAC,GAAoB,IAAI,CAAC;QAE9B,IAAI,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5B,CAAC,GAAQ,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,CAAC;QAED,OAAO,CAAC,CAAC;IACX,CAAC;IACH,YAAC;AAAD,CAAC,AAvnCD,IAunCC;AAvnCY,sBAAK"} \ No newline at end of file diff --git a/dist-commonjs/index.d.ts b/dist-commonjs/index.d.ts new file mode 100644 index 00000000..5348276d --- /dev/null +++ b/dist-commonjs/index.d.ts @@ -0,0 +1,19 @@ +export * from "./internal"; +import { IIIFResource } from "./IIIFResource"; +import { IManifestoOptions } from "./IManifestoOptions"; +/** +Initiates downloading an IIIF manifest json file from URL. Returns a Promise +to allow subsequent processing on a successful fetch. + +@param url string containing the URL to Fetch +@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text. +**/ +export declare const loadManifest: (url: string) => Promise; +/** +Parses IIIF manifest file to return a manifesto Manifest instance + +@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file. +@param options? TODO Not yet documented +@returns instance of Manifest class. +**/ +export declare const parseManifest: (manifest: any, options?: IManifestoOptions | undefined) => IIIFResource | null; diff --git a/dist-commonjs/index.js b/dist-commonjs/index.js new file mode 100644 index 00000000..81d27195 --- /dev/null +++ b/dist-commonjs/index.js @@ -0,0 +1,42 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseManifest = exports.loadManifest = void 0; +__exportStar(require("./internal"), exports); +var Utils_1 = require("./Utils"); +/** +Initiates downloading an IIIF manifest json file from URL. Returns a Promise +to allow subsequent processing on a successful fetch. + +@param url string containing the URL to Fetch +@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text. +**/ +var loadManifest = function (url) { + return Utils_1.Utils.loadManifest(url); +}; +exports.loadManifest = loadManifest; +/** +Parses IIIF manifest file to return a manifesto Manifest instance + +@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file. +@param options? TODO Not yet documented +@returns instance of Manifest class. +**/ +var parseManifest = function (manifest, options) { + return Utils_1.Utils.parseManifest(manifest, options); +}; +exports.parseManifest = parseManifest; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist-commonjs/index.js.map b/dist-commonjs/index.js.map new file mode 100644 index 00000000..8148bd22 --- /dev/null +++ b/dist-commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAI3B,iCAAgC;AAGhC;;;;;;GAMG;AACI,IAAM,YAAY,GAAkC,UAAC,GAAW;IACrE,OAAO,aAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF;;;;;;GAMG;AACI,IAAM,aAAa,GAGC,UAAC,QAAgB,EAAE,OAA2B;IACvE,OAAO,aAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC,CAAC;AALW,QAAA,aAAa,iBAKxB"} \ No newline at end of file diff --git a/dist-commonjs/internal.d.ts b/dist-commonjs/internal.d.ts new file mode 100644 index 00000000..8a53131b --- /dev/null +++ b/dist-commonjs/internal.d.ts @@ -0,0 +1,50 @@ +export * from "./JSONLDResource"; +export * from "./Transform"; +export * from "./ManifestResource"; +export * from "./Resource"; +export * from "./IIIFResource"; +export * from "./SpecificResource"; +export * from "./AnnotationBody"; +export * from "./Light"; +export * from "./Camera"; +export * from "./AnnotationBodyParser"; +export * from "./Annotation"; +export * from "./AnnotationList"; +export * from "./AnnotationPage"; +export * from "./Canvas"; +export * from "./Collection"; +export * from "./Duration"; +export * from "./IAccessToken"; +export * from "./IExternalImageResourceData"; +export * from "./IExternalResource"; +export * from "./IExternalResourceData"; +export * from "./IExternalResourceOptions"; +export * from "./IManifestoOptions"; +export * from "./LabelValuePair"; +export * from "./Language"; +export * from "./LanguageMap"; +export * from "./PropertyValue"; +export * from "./Manifest"; +export * from "./ManifestType"; +export * from "./PointSelector"; +export * from "./Range"; +export * from "./Rendering"; +export * from "./Scene"; +export * from "./Sequence"; +export * from "./Serialisation"; +export * from "./Service"; +export * from "./Size"; +export * from "./StatusCode"; +export * from "./Thumb"; +export * from "./Thumbnail"; +export * from "./Transform"; +export * from "./TranslateTransform"; +export * from "./TransformParser"; +export * from "./TreeNode"; +export * from "./TreeNodeType"; +export * from "./Utils"; +export * from "./TranslateTransform"; +export * from "./RotateTransform"; +export * from "./ScaleTransform"; +export * from "./Color"; +export * from "./Geometry3d"; diff --git a/dist-commonjs/internal.js b/dist-commonjs/internal.js new file mode 100644 index 00000000..0e96d385 --- /dev/null +++ b/dist-commonjs/internal.js @@ -0,0 +1,69 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./JSONLDResource"), exports); +__exportStar(require("./Transform"), exports); +__exportStar(require("./ManifestResource"), exports); +__exportStar(require("./Resource"), exports); +__exportStar(require("./IIIFResource"), exports); +__exportStar(require("./SpecificResource"), exports); +//export * from "./SpecificResourceForTarget"; +//export * from "./SpecificResourceForBody"; +__exportStar(require("./AnnotationBody"), exports); +__exportStar(require("./Light"), exports); +__exportStar(require("./Camera"), exports); +__exportStar(require("./AnnotationBodyParser"), exports); +__exportStar(require("./Annotation"), exports); +__exportStar(require("./AnnotationList"), exports); +__exportStar(require("./AnnotationPage"), exports); +__exportStar(require("./Canvas"), exports); +__exportStar(require("./Collection"), exports); +__exportStar(require("./Duration"), exports); +__exportStar(require("./IAccessToken"), exports); +__exportStar(require("./IExternalImageResourceData"), exports); +__exportStar(require("./IExternalResource"), exports); +__exportStar(require("./IExternalResourceData"), exports); +__exportStar(require("./IExternalResourceOptions"), exports); +__exportStar(require("./IManifestoOptions"), exports); +__exportStar(require("./LabelValuePair"), exports); +__exportStar(require("./Language"), exports); +__exportStar(require("./LanguageMap"), exports); +__exportStar(require("./PropertyValue"), exports); +__exportStar(require("./Manifest"), exports); +__exportStar(require("./ManifestType"), exports); +__exportStar(require("./PointSelector"), exports); +__exportStar(require("./Range"), exports); +__exportStar(require("./Rendering"), exports); +__exportStar(require("./Scene"), exports); +__exportStar(require("./Sequence"), exports); +__exportStar(require("./Serialisation"), exports); +__exportStar(require("./Service"), exports); +__exportStar(require("./Size"), exports); +__exportStar(require("./StatusCode"), exports); +__exportStar(require("./Thumb"), exports); +__exportStar(require("./Thumbnail"), exports); +__exportStar(require("./Transform"), exports); +__exportStar(require("./TranslateTransform"), exports); +__exportStar(require("./TransformParser"), exports); +__exportStar(require("./TreeNode"), exports); +__exportStar(require("./TreeNodeType"), exports); +__exportStar(require("./Utils"), exports); +__exportStar(require("./TranslateTransform"), exports); +__exportStar(require("./RotateTransform"), exports); +__exportStar(require("./ScaleTransform"), exports); +__exportStar(require("./Color"), exports); +__exportStar(require("./Geometry3d"), exports); +//# sourceMappingURL=internal.js.map \ No newline at end of file diff --git a/dist-commonjs/internal.js.map b/dist-commonjs/internal.js.map new file mode 100644 index 00000000..112e03ba --- /dev/null +++ b/dist-commonjs/internal.js.map @@ -0,0 +1 @@ +{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,8CAA4B;AAC5B,qDAAmC;AACnC,6CAA2B;AAC3B,iDAA+B;AAC/B,qDAAmC;AACnC,8CAA8C;AAC9C,4CAA4C;AAE5C,mDAAiC;AACjC,0CAAwB;AACxB,2CAAyB;AACzB,yDAAuC;AACvC,+CAA6B;AAE7B,mDAAiC;AACjC,mDAAiC;AACjC,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,iDAA+B;AAC/B,+DAA6C;AAC7C,sDAAoC;AACpC,0DAAwC;AACxC,6DAA2C;AAC3C,sDAAoC;AACpC,mDAAiC;AACjC,6CAA2B;AAC3B,gDAA8B;AAC9B,kDAAgC;AAChC,6CAA2B;AAC3B,iDAA+B;AAC/B,kDAAgC;AAChC,0CAAwB;AACxB,8CAA4B;AAC5B,0CAAwB;AACxB,6CAA2B;AAC3B,kDAAgC;AAChC,4CAA0B;AAC1B,yCAAuB;AAEvB,+CAA6B;AAC7B,0CAAwB;AACxB,8CAA4B;AAC5B,8CAA4B;AAE5B,uDAAqC;AACrC,oDAAkC;AAClC,6CAA2B;AAC3B,iDAA+B;AAC/B,0CAAwB;AACxB,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,0CAAwB;AAExB,+CAA6B"} \ No newline at end of file diff --git a/dist-esmodule/Annotation.d.ts b/dist-esmodule/Annotation.d.ts new file mode 100644 index 00000000..6afc5e98 --- /dev/null +++ b/dist-esmodule/Annotation.d.ts @@ -0,0 +1,56 @@ +import { AnnotationMotivation } from "@iiif/vocabulary/dist-commonjs"; +import { AnnotationBody, IManifestoOptions, ManifestResource, Resource, SpecificResource } from "./internal"; +import { Vector3 } from "threejs-math"; +export declare class Annotation extends ManifestResource { + constructor(jsonld: any, options: IManifestoOptions); + /** + In spite of its name, this method returns an array of objects, each of which + represents a potential body annotations + + @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ } + **/ + getBody(): (AnnotationBody | SpecificResource)[]; + get Body(): (SpecificResource | AnnotationBody)[]; + /** + auxiliary function to getBody; intended to hande an object that has an element items + which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/ + seems to be the use case for this + **/ + private parseBodiesFromItemsList; + /** + auxiliary function to parseBodiesFromItemsList and getBody, this is the last + step on recursively going through collections of bodies. + **/ + private parseSingletonBody; + /** + Developer Note: 8 April 2024 + getBody3D function was developed in the early stages of the 3D API Feb-March 2024 + as alternative to the existing Annotation getBody function, but the signature for + getBody3D was chosen to be a single object instance, not an array. + + At this stage, the merging of the 2D API anf the draft 3D API has been completed, so + 3D applications can use the getBody() function to retrieve the body of an Annotation intended + to target a scene. For compatibily the return value of the function is still an + array. + + 3D clients using getBody are responsible for choosing the appropriate instance from the + returned array. In most cases this will be the sole 0th element. + **/ + getBody3D(): (AnnotationBody | SpecificResource); + getMotivation(): AnnotationMotivation | null; + getOn(): string; + getTarget(): any; + get Target(): any; + getResource(): Resource; + /** + * A 3D point coordinate object for the location of an Annotation + * to satisfy the requirements of the lookAt property of camera and + * spotlight resources, according to the draft v4 API as of April 1 2024 + * + * Is the position of the point for a target which is a SpecificResource with + * a PointSelector + * Otherwise, for example when the annotation target is an entire Scene, the + * location for lookAt is the origin (0,0,0) + **/ + get LookAtLocation(): Vector3; +} diff --git a/dist-esmodule/Annotation.js b/dist-esmodule/Annotation.js new file mode 100644 index 00000000..f7d0b818 --- /dev/null +++ b/dist-esmodule/Annotation.js @@ -0,0 +1,153 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { AnnotationBodyParser, ManifestResource, Resource, SpecificResource } from "./internal"; +import { Vector3 } from "threejs-math"; +var Annotation = /** @class */ (function (_super) { + __extends(Annotation, _super); + function Annotation(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + /** + In spite of its name, this method returns an array of objects, each of which + represents a potential body annotations + + @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ } + **/ + Annotation.prototype.getBody = function () { + var bodies = []; + var body = this.getProperty("body"); + // the following is intended to handle the following cases for + /// the raw json of the body property of __jsonld + // -- body is an array, each element of which is parsed + // == body is an object with property items, each item is parsed + // -- body is parsed + if (body) { + for (var _i = 0, _a = [].concat(body); _i < _a.length; _i++) { + var bd = _a[_i]; + var items = bd.items; + if (items) + bodies = bodies.concat(this.parseBodiesFromItemsList(items)); + else + bodies.push(this.parseSingletonBody(bd)); + } + } + return bodies; + }; + Object.defineProperty(Annotation.prototype, "Body", { + get: function () { return this.getBody(); }, + enumerable: false, + configurable: true + }); + /** + auxiliary function to getBody; intended to hande an object that has an element items + which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/ + seems to be the use case for this + **/ + Annotation.prototype.parseBodiesFromItemsList = function (rawbodies) { + var retVal = []; + for (var _i = 0, _a = [].concat(rawbodies); _i < _a.length; _i++) { + var bd = _a[_i]; + retVal.push(this.parseSingletonBody(bd)); + } + return retVal; + }; + /** + auxiliary function to parseBodiesFromItemsList and getBody, this is the last + step on recursively going through collections of bodies. + **/ + Annotation.prototype.parseSingletonBody = function (rawbody) { + if (rawbody.type === "SpecificResource") { + return new SpecificResource(rawbody, this.options); + } + else { + return AnnotationBodyParser.BuildFromJson(rawbody, this.options); + } + }; + /** + Developer Note: 8 April 2024 + getBody3D function was developed in the early stages of the 3D API Feb-March 2024 + as alternative to the existing Annotation getBody function, but the signature for + getBody3D was chosen to be a single object instance, not an array. + + At this stage, the merging of the 2D API anf the draft 3D API has been completed, so + 3D applications can use the getBody() function to retrieve the body of an Annotation intended + to target a scene. For compatibily the return value of the function is still an + array. + + 3D clients using getBody are responsible for choosing the appropriate instance from the + returned array. In most cases this will be the sole 0th element. + **/ + Annotation.prototype.getBody3D = function () { + console.warn("Annotation.getBody3D is deprecated: replace with getBody3D() with getBody()[0]"); + return this.getBody()[0]; + }; + Annotation.prototype.getMotivation = function () { + var motivation = this.getProperty("motivation"); + if (motivation) { + //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation); + return motivation; + } + return null; + }; + // open annotation + Annotation.prototype.getOn = function () { + return this.getProperty("on"); + }; + Annotation.prototype.getTarget = function () { + var rawTarget = this.getPropertyAsObject("target"); + if (rawTarget.isIRI) + return rawTarget; + if (rawTarget.type && rawTarget.type == "SpecificResource") { + return new SpecificResource(rawTarget, this.options); + } + else { + throw new Error("unknown target specified"); + } + }; + Object.defineProperty(Annotation.prototype, "Target", { + get: function () { return this.getTarget(); }, + enumerable: false, + configurable: true + }); + Annotation.prototype.getResource = function () { + return new Resource(this.getProperty("resource"), this.options); + }; + Object.defineProperty(Annotation.prototype, "LookAtLocation", { + /** + * A 3D point coordinate object for the location of an Annotation + * to satisfy the requirements of the lookAt property of camera and + * spotlight resources, according to the draft v4 API as of April 1 2024 + * + * Is the position of the point for a target which is a SpecificResource with + * a PointSelector + * Otherwise, for example when the annotation target is an entire Scene, the + * location for lookAt is the origin (0,0,0) + **/ + get: function () { + var _a; + var target = this.getTarget(); + if (target.isSpecificResource && ((_a = target.getSelector()) === null || _a === void 0 ? void 0 : _a.isPointSelector)) + return target.getSelector().getLocation(); + else + return new Vector3(0.0, 0.0, 0.0); + }, + enumerable: false, + configurable: true + }); + return Annotation; +}(ManifestResource)); +export { Annotation }; +//# sourceMappingURL=Annotation.js.map \ No newline at end of file diff --git a/dist-esmodule/Annotation.js.map b/dist-esmodule/Annotation.js.map new file mode 100644 index 00000000..9ffd7d70 --- /dev/null +++ b/dist-esmodule/Annotation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Annotation.js","sourceRoot":"","sources":["../src/Annotation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAEL,oBAAoB,EAEpB,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;IAAgC,8BAAgB;IAC9C,oBAAY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AAX;QACE,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;IAYD,sBAAI,sCAAc;QAVlB;;;;;;;;;WASG;aACH;;YACE,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,EAAS,CAAC;YAErC,IAAI,MAAM,CAAC,kBAAkB,KAAI,MAAA,MAAM,CAAC,WAAW,EAAE,0CAAE,eAAe,CAAA;gBAClE,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC;;gBAE1C,OAAO,IAAI,OAAO,CAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC,CAAC;QACtC,CAAC;;;OAAA;IACH,iBAAC;AAAD,CAAC,AA1ID,CAAgC,gBAAgB,GA0I/C"} \ No newline at end of file diff --git a/dist-esmodule/AnnotationBody.d.ts b/dist-esmodule/AnnotationBody.d.ts new file mode 100644 index 00000000..62982da4 --- /dev/null +++ b/dist-esmodule/AnnotationBody.d.ts @@ -0,0 +1,23 @@ +import { ExternalResourceType, MediaType } from "@iiif/vocabulary/dist-commonjs"; +import { IManifestoOptions, ManifestResource } from "./internal"; +/** +With the 3D extensions to the IIIF Presentation API the name of this +class is misleading, but for now is being retained for the sake backward +compatibility with earlier manifesto code and tests. + +The 3D extensions allow that the body property of an annotation can be +a light, camera, or model, or a SpecificResource object wrapping a light, camera, +or model. +**/ +export declare class AnnotationBody extends ManifestResource { + constructor(jsonld?: any, options?: IManifestoOptions); + isAnnotationBody: boolean; + isSpecificResource: boolean; + getFormat(): MediaType | null; + getType(): ExternalResourceType | null; + getWidth(): number; + getHeight(): number; + isModel: boolean; + isLight: boolean; + isCamera: boolean; +} diff --git a/dist-esmodule/AnnotationBody.js b/dist-esmodule/AnnotationBody.js new file mode 100644 index 00000000..52ce0411 --- /dev/null +++ b/dist-esmodule/AnnotationBody.js @@ -0,0 +1,74 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ManifestResource, Utils } from "./internal"; +/** +With the 3D extensions to the IIIF Presentation API the name of this +class is misleading, but for now is being retained for the sake backward +compatibility with earlier manifesto code and tests. + +The 3D extensions allow that the body property of an annotation can be +a light, camera, or model, or a SpecificResource object wrapping a light, camera, +or model. +**/ +var AnnotationBody = /** @class */ (function (_super) { + __extends(AnnotationBody, _super); + function AnnotationBody(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + /* + property distinguishing instances of SpecificResource from instances of AnnotionBody. + The return type of the Annotation.getBody() method is an array of instances of the + union type ( AnnotationBody | SpecificResource ) + */ + _this.isAnnotationBody = true; + /* + property distinguishing instances of SpecificResource from instances of AnnotionBody. + The return type of the Annotation.getBody() method is an array of instances of the + union type ( AnnotationBody | SpecificResource ) + */ + _this.isSpecificResource = false; + // following class members were added to support 3D and mixed 2D/3D content + // these boolean switches will be appropriately set when the manifest json is parsed + _this.isModel = true; + _this.isLight = false; + _this.isCamera = false; + return _this; + } + // Format, Type, Width, and Height are the body properties supported + // in the code that supports Presentation 3 + AnnotationBody.prototype.getFormat = function () { + var format = this.getProperty("format"); + if (format) { + return Utils.getMediaType(format); + } + return null; + }; + AnnotationBody.prototype.getType = function () { + var type = this.getProperty("type"); + if (type) { + return (Utils.normaliseType(this.getProperty("type"))); + } + return null; + }; + AnnotationBody.prototype.getWidth = function () { + return this.getProperty("width"); + }; + AnnotationBody.prototype.getHeight = function () { + return this.getProperty("height"); + }; + return AnnotationBody; +}(ManifestResource)); +export { AnnotationBody }; +//# sourceMappingURL=AnnotationBody.js.map \ No newline at end of file diff --git a/dist-esmodule/AnnotationBody.js.map b/dist-esmodule/AnnotationBody.js.map new file mode 100644 index 00000000..29c60803 --- /dev/null +++ b/dist-esmodule/AnnotationBody.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AnnotationBody.js","sourceRoot":"","sources":["../src/AnnotationBody.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,OAAO,EAAqB,gBAAgB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxE;;;;;;;;GAQG;AACH;IAAoC,kCAAgB;IAClD,wBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QAIzB;;;;UAIE;QACF,sBAAgB,GAAa,IAAI,CAAC;QAElC;;;;UAIE;QACF,wBAAkB,GAAa,KAAK,CAAC;QAsCrC,2EAA2E;QAC3E,oFAAoF;QAEpF,aAAO,GAAa,IAAI,CAAC;QAEzB,aAAO,GAAa,KAAK,CAAC;QAE1B,cAAQ,GAAa,KAAK,CAAC;;IA5D3B,CAAC;IAkBD,oEAAoE;IACpE,2CAA2C;IAC3C,kCAAS,GAAT;QACE,IAAM,MAAM,GAAW,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAElD,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gCAAO,GAAP;QACE,IAAM,IAAI,GAAW,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAE9C,IAAI,IAAI,EAAE,CAAC;YACT,OAA6B,CAC3B,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAC9C,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iCAAQ,GAAR;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,kCAAS,GAAT;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAcH,qBAAC;AAAD,CAAC,AAjED,CAAoC,gBAAgB,GAiEnD"} \ No newline at end of file diff --git a/dist-esmodule/AnnotationBodyParser.d.ts b/dist-esmodule/AnnotationBodyParser.d.ts new file mode 100644 index 00000000..dcde1769 --- /dev/null +++ b/dist-esmodule/AnnotationBodyParser.d.ts @@ -0,0 +1,4 @@ +import { AnnotationBody, IManifestoOptions } from "./internal"; +export declare class AnnotationBodyParser { + static BuildFromJson(jsonld: any, options?: IManifestoOptions): AnnotationBody; +} diff --git a/dist-esmodule/AnnotationBodyParser.js b/dist-esmodule/AnnotationBodyParser.js new file mode 100644 index 00000000..d0543434 --- /dev/null +++ b/dist-esmodule/AnnotationBodyParser.js @@ -0,0 +1,21 @@ +import { AnnotationBody, Light, Camera } from "./internal"; +var LightTypes = ["AmbientLight", "DirectionalLight", "SpotLight"]; +var CameraTypes = ["PerspectiveCamera", "OrthographicCamera"]; +var DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"]; +var AnnotationBodyParser = /** @class */ (function () { + function AnnotationBodyParser() { + } + AnnotationBodyParser.BuildFromJson = function (jsonld, options) { + if (DisplayedTypes.includes(jsonld.type)) + return new AnnotationBody(jsonld, options); + else if (LightTypes.includes(jsonld.type)) + return new Light(jsonld, options); + else if (CameraTypes.includes(jsonld.type)) + return new Camera(jsonld, options); + else + throw new Error("unimplemented type for AnnotationBody: " + jsonld.type); + }; + return AnnotationBodyParser; +}()); +export { AnnotationBodyParser }; +//# sourceMappingURL=AnnotationBodyParser.js.map \ No newline at end of file diff --git a/dist-esmodule/AnnotationBodyParser.js.map b/dist-esmodule/AnnotationBodyParser.js.map new file mode 100644 index 00000000..f1a94af5 --- /dev/null +++ b/dist-esmodule/AnnotationBodyParser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AnnotationBodyParser.js","sourceRoot":"","sources":["../src/AnnotationBodyParser.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EAEd,KAAK,EACL,MAAM,EACT,MAAM,YAAY,CAAC;AAGpB,IAAI,UAAU,GAAY,CAAC,cAAc,EAAG,kBAAkB,EAAE,WAAW,CAAC,CAAC;AAC7E,IAAI,WAAW,GAAY,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;AACvE,IAAI,cAAc,GAAY,CAAC,OAAO,EAAE,UAAU,EAAC,OAAO,EAAC,OAAO,EAAC,OAAO,CAAC,CAAC;AAC5E;IAAA;IAYA,CAAC;IAXU,kCAAa,GAApB,UAAsB,MAAW,EAAG,OAA2B;QAC3D,IAAI,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;YACpC,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;aAC1C,IAAK,UAAU,CAAC,QAAQ,CAAE,MAAM,CAAC,IAAI,CAAE;YACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;aACjC,IAAK,WAAW,CAAC,QAAQ,CAAE,MAAM,CAAC,IAAI,CAAE;YACzC,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;YAEnC,MAAM,IAAI,KAAK,CAAC,yCAAyC,GAAG,MAAM,CAAC,IAAI,CAAE,CAAC;IAElF,CAAC;IACL,2BAAC;AAAD,CAAC,AAZD,IAYC"} \ No newline at end of file diff --git a/dist-esmodule/AnnotationList.d.ts b/dist-esmodule/AnnotationList.d.ts new file mode 100644 index 00000000..7225a12e --- /dev/null +++ b/dist-esmodule/AnnotationList.d.ts @@ -0,0 +1,12 @@ +import { IIIFResourceType } from "@iiif/vocabulary/dist-commonjs"; +import { Annotation, IManifestoOptions, JSONLDResource } from "./internal"; +export declare class AnnotationList extends JSONLDResource { + options: IManifestoOptions; + label: string; + isLoaded: boolean; + constructor(label: any, jsonld?: any, options?: IManifestoOptions); + getIIIFResourceType(): IIIFResourceType; + getLabel(): string; + getResources(): Annotation[]; + load(): Promise; +} diff --git a/dist-esmodule/AnnotationList.js b/dist-esmodule/AnnotationList.js new file mode 100644 index 00000000..fb1bee94 --- /dev/null +++ b/dist-esmodule/AnnotationList.js @@ -0,0 +1,62 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Annotation, JSONLDResource, Utils } from "./internal"; +var AnnotationList = /** @class */ (function (_super) { + __extends(AnnotationList, _super); + function AnnotationList(label, jsonld, options) { + var _this = _super.call(this, jsonld) || this; + _this.label = label; + _this.options = options; + return _this; + } + AnnotationList.prototype.getIIIFResourceType = function () { + return Utils.normaliseType(this.getProperty("type")); + }; + AnnotationList.prototype.getLabel = function () { + return this.label; + }; + AnnotationList.prototype.getResources = function () { + var _this = this; + var resources = this.getProperty("resources"); + return resources.map(function (resource) { return new Annotation(resource, _this.options); }); + }; + AnnotationList.prototype.load = function () { + var _this = this; + return new Promise(function (resolve, reject) { + if (_this.isLoaded) { + resolve(_this); + } + else { + var id = _this.__jsonld.id; + if (!id) { + id = _this.__jsonld["@id"]; + } + Utils.loadManifest(id) + .then(function (data) { + _this.__jsonld = data; + _this.context = _this.getProperty("context"); + _this.id = _this.getProperty("id"); + _this.isLoaded = true; + resolve(_this); + }) + .catch(reject); + } + }); + }; + return AnnotationList; +}(JSONLDResource)); +export { AnnotationList }; +//# sourceMappingURL=AnnotationList.js.map \ No newline at end of file diff --git a/dist-esmodule/AnnotationList.js.map b/dist-esmodule/AnnotationList.js.map new file mode 100644 index 00000000..6d8ee4e2 --- /dev/null +++ b/dist-esmodule/AnnotationList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AnnotationList.js","sourceRoot":"","sources":["../src/AnnotationList.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EACL,UAAU,EAEV,cAAc,EACd,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB;IAAoC,kCAAc;IAKhD,wBAAY,KAAK,EAAE,MAAY,EAAE,OAA2B;QAC1D,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QACd,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAI,CAAC,OAAO,GAAsB,OAAO,CAAC;;IAC5C,CAAC;IAED,4CAAmB,GAAnB;QACE,OAAyB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,iCAAQ,GAAR;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,qCAAY,GAAZ;QAAA,iBAGC;QAFC,IAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChD,OAAO,SAAS,CAAC,GAAG,CAAC,UAAA,QAAQ,IAAI,OAAA,IAAI,UAAU,CAAC,QAAQ,EAAE,KAAI,CAAC,OAAO,CAAC,EAAtC,CAAsC,CAAC,CAAC;IAC3E,CAAC;IAED,6BAAI,GAAJ;QAAA,iBAsBC;QArBC,OAAO,IAAI,OAAO,CAAiB,UAAC,OAAO,EAAE,MAAM;YACjD,IAAI,KAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,OAAO,CAAC,KAAI,CAAC,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACN,IAAI,EAAE,GAAW,KAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAElC,IAAI,CAAC,EAAE,EAAE,CAAC;oBACR,EAAE,GAAG,KAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAC5B,CAAC;gBAED,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;qBACnB,IAAI,CAAC,UAAA,IAAI;oBACR,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACrB,KAAI,CAAC,OAAO,GAAG,KAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;oBAC3C,KAAI,CAAC,EAAE,GAAG,KAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;oBACjC,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACrB,OAAO,CAAC,KAAI,CAAC,CAAC;gBAChB,CAAC,CAAC;qBACD,KAAK,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,qBAAC;AAAD,CAAC,AA/CD,CAAoC,cAAc,GA+CjD"} \ No newline at end of file diff --git a/dist-esmodule/AnnotationPage.d.ts b/dist-esmodule/AnnotationPage.d.ts new file mode 100644 index 00000000..6b166146 --- /dev/null +++ b/dist-esmodule/AnnotationPage.d.ts @@ -0,0 +1,5 @@ +import { Annotation, IManifestoOptions, ManifestResource } from "./internal"; +export declare class AnnotationPage extends ManifestResource { + constructor(jsonld: any, options: IManifestoOptions); + getItems(): Annotation[]; +} diff --git a/dist-esmodule/AnnotationPage.js b/dist-esmodule/AnnotationPage.js new file mode 100644 index 00000000..ccc4ce9f --- /dev/null +++ b/dist-esmodule/AnnotationPage.js @@ -0,0 +1,28 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ManifestResource } from "./internal"; +var AnnotationPage = /** @class */ (function (_super) { + __extends(AnnotationPage, _super); + function AnnotationPage(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + AnnotationPage.prototype.getItems = function () { + return this.getProperty("items"); + }; + return AnnotationPage; +}(ManifestResource)); +export { AnnotationPage }; +//# sourceMappingURL=AnnotationPage.js.map \ No newline at end of file diff --git a/dist-esmodule/AnnotationPage.js.map b/dist-esmodule/AnnotationPage.js.map new file mode 100644 index 00000000..e88b8d98 --- /dev/null +++ b/dist-esmodule/AnnotationPage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AnnotationPage.js","sourceRoot":"","sources":["../src/AnnotationPage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAiC,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE7E;IAAoC,kCAAgB;IAClD,wBAAY,MAAW,EAAE,OAA0B;QACjD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IAED,iCAAQ,GAAR;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IACH,qBAAC;AAAD,CAAC,AARD,CAAoC,gBAAgB,GAQnD"} \ No newline at end of file diff --git a/dist-esmodule/Camera.d.ts b/dist-esmodule/Camera.d.ts new file mode 100644 index 00000000..0486fc31 --- /dev/null +++ b/dist-esmodule/Camera.d.ts @@ -0,0 +1,21 @@ +import { IManifestoOptions, AnnotationBody, PointSelector } from "./internal"; +export declare class Camera extends AnnotationBody { + constructor(jsonld?: any, options?: IManifestoOptions); + get isPerspectiveCamera(): boolean; + /** + @returns full angular size of perspective viewport in vertical direction. + Angular unit is degrees + **/ + getFieldOfView(): number | undefined; + /** + Full angular size of perspective viewport in vertical direction. + Angular unit is degrees + **/ + get FieldOfView(): number | undefined; + /** + * @return : if not null, is either a PointSelector, or an object + * with an id matching the id of an Annotation instance. + **/ + getLookAt(): object | PointSelector | null; + get LookAt(): object | null; +} diff --git a/dist-esmodule/Camera.js b/dist-esmodule/Camera.js new file mode 100644 index 00000000..4e3bf4f3 --- /dev/null +++ b/dist-esmodule/Camera.js @@ -0,0 +1,81 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Utils, AnnotationBody, PointSelector } from "./internal"; +var Camera = /** @class */ (function (_super) { + __extends(Camera, _super); + function Camera(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.isModel = false; + _this.isLight = false; + _this.isCamera = true; + return _this; + } + Object.defineProperty(Camera.prototype, "isPerspectiveCamera", { + get: function () { + return (Utils.normaliseType(this.getProperty("type")) === "perspectivecamera"); + }, + enumerable: false, + configurable: true + }); + /** + @returns full angular size of perspective viewport in vertical direction. + Angular unit is degrees + **/ + Camera.prototype.getFieldOfView = function () { + if (this.isPerspectiveCamera) { + var value = this.getProperty("fieldOfView"); + if (value) + return value; + else + return 45.0; + } + else + return undefined; + }; + Object.defineProperty(Camera.prototype, "FieldOfView", { + /** + Full angular size of perspective viewport in vertical direction. + Angular unit is degrees + **/ + get: function () { return this.getFieldOfView(); }, + enumerable: false, + configurable: true + }); + /** + * @return : if not null, is either a PointSelector, or an object + * with an id matching the id of an Annotation instance. + **/ + Camera.prototype.getLookAt = function () { + var rawObj = this.getPropertyAsObject("lookAt"); + var rawType = (rawObj["type"] || rawObj["@type"]); + if (rawType == "Annotation") { + return rawObj; + } + if (rawType == "PointSelector") { + return new PointSelector(rawObj); + } + throw new Error('unidentified value of lookAt ${rawType}'); + }; + Object.defineProperty(Camera.prototype, "LookAt", { + get: function () { return this.getLookAt(); }, + enumerable: false, + configurable: true + }); + return Camera; +}(AnnotationBody)); +export { Camera }; +; +//# sourceMappingURL=Camera.js.map \ No newline at end of file diff --git a/dist-esmodule/Camera.js.map b/dist-esmodule/Camera.js.map new file mode 100644 index 00000000..7e0255af --- /dev/null +++ b/dist-esmodule/Camera.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../src/Camera.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEH,KAAK,EACL,cAAc,EACd,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtC;IAA4B,0BAAc;IACxC,gBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QACvB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,QAAQ,GAAI,IAAI,CAAC;;IACxB,CAAC;IAID,sBAAI,uCAAmB;aAAvB;YACE,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC;QACjF,CAAC;;;OAAA;IAED;;;OAGG;IACH,+BAAc,GAAd;QAEE,IAAI,IAAI,CAAC,mBAAmB,EAAC,CAAC;YAC1B,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAC5C,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;;gBACnB,OAAO,IAAI,CAAC;QACrB,CAAC;;YACI,OAAO,SAAS,CAAC;IACxB,CAAC;IAKD,sBAAI,+BAAW;QAJf;;;WAGG;aACH,cAAwC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAEtE;;;OAGG;IACH,0BAAS,GAAT;QACE,IAAI,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;QAChD,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,OAAO,IAAI,YAAY,EAAC,CAAC;YACzB,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,IAAI,OAAO,IAAI,eAAe,EAAC,CAAC;YAC5B,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IACD,sBAAI,0BAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAGzD,aAAC;AAAD,CAAC,AAnDD,CAA4B,cAAc,GAmDzC;;AAAA,CAAC"} \ No newline at end of file diff --git a/dist-esmodule/Canvas.d.ts b/dist-esmodule/Canvas.d.ts new file mode 100644 index 00000000..38497209 --- /dev/null +++ b/dist-esmodule/Canvas.d.ts @@ -0,0 +1,31 @@ +import { ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +import { Annotation, AnnotationList, IManifestoOptions, Range, Resource, Size } from "./internal"; +export declare class Canvas extends Resource { + ranges: Range[]; + constructor(jsonld?: any, options?: IManifestoOptions); + getCanonicalImageUri(w?: number): string; + getMaxDimensions(): Size | null; + getContent(): Annotation[]; + getDuration(): number | null; + getImages(): Annotation[]; + getIndex(): number; + getOtherContent(): Promise; + getWidth(): number; + getHeight(): number; + getViewingHint(): ViewingHint | null; + get imageResources(): any; + get resourceAnnotations(): any; + /** + * Returns a given resource Annotation, based on a contained resource or body + * id + */ + resourceAnnotation(id: any): any; + /** + * Returns the fragment placement values if a resourceAnnotation is placed on + * a canvas somewhere besides the full extent + */ + onFragment(id: any): any; + get iiifImageResources(): any; + get imageServiceIds(): any; + get aspectRatio(): number; +} diff --git a/dist-esmodule/Canvas.js b/dist-esmodule/Canvas.js new file mode 100644 index 00000000..b82eca91 --- /dev/null +++ b/dist-esmodule/Canvas.js @@ -0,0 +1,345 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ExternalResourceType } from "@iiif/vocabulary/dist-commonjs"; +import { Annotation, AnnotationList, AnnotationPage, Resource, Size, Utils } from "./internal"; +// @ts-ignore +import flatten from "lodash/flatten"; +// @ts-ignore +import flattenDeep from "lodash/flattenDeep"; +var Canvas = /** @class */ (function (_super) { + __extends(Canvas, _super); + function Canvas(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + // http://iiif.io/api/image/2.1/#canonical-uri-syntax + Canvas.prototype.getCanonicalImageUri = function (w) { + var id = null; + var region = "full"; + var rotation = 0; + var quality = "default"; + var width = w; + var size; + // if an info.json has been loaded + if (this.externalResource && + this.externalResource.data && + this.externalResource.data["@id"]) { + id = this.externalResource.data["@id"]; + if (!width) { + width = this.externalResource.data.width; + } + if (this.externalResource.data["@context"]) { + if (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 { + // info.json hasn't been loaded yet + var images = void 0; + // presentation 2.0 + images = this.getImages(); + if (images && images.length) { + var firstImage = images[0]; + var resource = firstImage.getResource(); + var services = resource.getServices(); + if (!width) { + width = resource.getWidth(); + } + var service = services + ? services.find(function (service) { + return (Utils.isImageProfile(service.getProfile()) || + Utils.isImageServiceType(service.getIIIFResourceType())); + }) + : null; + if (service) { + id = service.id; + quality = Utils.getImageQuality(service.getProfile()); + } + else if (width === resource.getWidth()) { + // if the passed width is the same as the resource width + // i.e. not looking for a thumbnail + // return the full size image. + // used for download options when loading static images. + return resource.id; + } + } + // presentation 3.0 + images = this.getContent(); + if (images && images.length) { + var firstImage = images[0]; + // Developer note: Since Canvas in Presentation 3 doesn't use + // SpecificResource resources in the body, force a cast + var body = firstImage.getBody(); + var anno = body[0]; + var services = anno.getServices(); + if (!width) { + width = anno.getWidth(); + } + var service = services + ? services.find(function (service) { + return Utils.isImageServiceType(service.getIIIFResourceType()); + }) + : null; + if (service) { + id = service.id; + quality = Utils.getImageQuality(service.getProfile()); + } + else if (width === anno.getWidth()) { + // if the passed width is the same as the resource width + // i.e. not looking for a thumbnail + // return the full size image. + // used for download options when loading static images. + return anno.id; + } + } + // todo: should this be moved to getThumbUri? + if (!id) { + var thumbnail = this.getProperty("thumbnail"); + if (thumbnail) { + if (typeof thumbnail === "string") { + return thumbnail; + } + else { + if (thumbnail["@id"]) { + return thumbnail["@id"]; + } + else if (thumbnail.length) { + return thumbnail[0].id; + } + } + } + } + } + size = width + ","; + // trim off trailing '/' + if (id && id.endsWith("/")) { + id = id.substr(0, id.length - 1); + } + var uri = [id, region, size, rotation, quality + ".jpg"].join("/"); + return uri; + }; + Canvas.prototype.getMaxDimensions = function () { + var maxDimensions = null; + var profile; + if (this.externalResource && + this.externalResource.data && + this.externalResource.data.profile) { + profile = this.externalResource.data.profile; + if (Array.isArray(profile)) { + profile = profile.filter(function (p) { return p["maxWidth" || "maxwidth"]; })[0]; + if (profile) { + maxDimensions = new Size(profile.maxWidth, profile.maxHeight ? profile.maxHeight : profile.maxWidth); + } + } + } + return maxDimensions; + }; + // Presentation API 3.0 + Canvas.prototype.getContent = function () { + var content = []; + var items = this.__jsonld.items || this.__jsonld.content; + if (!items) + return content; + // should be contained in an AnnotationPage + var annotationPage = null; + if (items.length) { + annotationPage = new AnnotationPage(items[0], this.options); + } + if (!annotationPage) { + return content; + } + var annotations = annotationPage.getItems(); + for (var i = 0; i < annotations.length; i++) { + var a = annotations[i]; + var annotation = new Annotation(a, this.options); + content.push(annotation); + } + return content; + }; + Canvas.prototype.getDuration = function () { + return this.getProperty("duration"); + }; + // presentation 2.0 + 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]; + var annotation = new Annotation(a, this.options); + images.push(annotation); + } + return images; + }; + Canvas.prototype.getIndex = function () { + return this.getProperty("index"); + }; + Canvas.prototype.getOtherContent = function () { + var _this = this; + var otherContent = Array.isArray(this.getProperty("otherContent")) + ? this.getProperty("otherContent") + : [this.getProperty("otherContent")]; + var canonicalComparison = function (typeA, typeB) { + if (typeof typeA !== "string" || typeof typeB !== "string") { + return false; + } + return typeA.toLowerCase() === typeA.toLowerCase(); + }; + var otherPromises = otherContent + .filter(function (otherContent) { + return otherContent && + canonicalComparison(otherContent["@type"], "sc:AnnotationList"); + }) + .map(function (annotationList, i) { + return new AnnotationList(annotationList["label"] || "Annotation list ".concat(i), annotationList, _this.options); + }) + .map(function (annotationList) { return annotationList.load(); }); + return Promise.all(otherPromises); + }; + // Prefer thumbnail service to image service if supplied and if + // the thumbnail service can provide a satisfactory size +/- x pixels. + // this is used to get thumb URIs *before* the info.json has been requested + // and populate thumbnails in a viewer. + // the publisher may also provide pre-computed fixed-size thumbs for better performance. + //getThumbUri(width: number): string { + // + // var uri; + // var images: IAnnotation[] = this.getImages(); + // + // if (images && images.length) { + // var firstImage = images[0]; + // var resource: IResource = firstImage.getResource(); + // var services: IService[] = resource.getServices(); + // + // for (let i = 0; i < services.length; i++) { + // var service: IService = services[i]; + // var id = service.id; + // + // if (!_endsWith(id, '/')) { + // id += '/'; + // } + // + // uri = id + 'full/' + width + ',/0/' + Utils.getImageQuality(service.getProfile()) + '.jpg'; + // } + // } + // + // return uri; + //} + //getType(): CanvasType { + // return new CanvasType(this.getProperty('@type').toLowerCase()); + //} + Canvas.prototype.getWidth = function () { + return this.getProperty("width"); + }; + Canvas.prototype.getHeight = function () { + return this.getProperty("height"); + }; + Canvas.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + Object.defineProperty(Canvas.prototype, "imageResources", { + get: function () { + var _this = this; + var resources = flattenDeep([ + this.getImages().map(function (i) { return i.getResource(); }), + this.getContent().map(function (i) { return i.getBody(); }) + ]); + return flatten(resources.map(function (resource) { + switch (resource.getProperty("type").toLowerCase()) { + case ExternalResourceType.CHOICE: + case ExternalResourceType.OA_CHOICE: + return new Canvas({ + images: flatten([ + resource.getProperty("default"), + resource.getProperty("item") + ]).map(function (r) { return ({ resource: r }); }) + }, _this.options) + .getImages() + .map(function (i) { return i.getResource(); }); + default: + return resource; + } + })); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Canvas.prototype, "resourceAnnotations", { + get: function () { + return flattenDeep([this.getImages(), this.getContent()]); + }, + enumerable: false, + configurable: true + }); + /** + * Returns a given resource Annotation, based on a contained resource or body + * id + */ + Canvas.prototype.resourceAnnotation = function (id) { + return this.resourceAnnotations.find(function (anno) { + return anno.getResource().id === id || + flatten(new Array(anno.getBody())).some(function (body) { return body.id === id; }); + }); + }; + /** + * Returns the fragment placement values if a resourceAnnotation is placed on + * a canvas somewhere besides the full extent + */ + Canvas.prototype.onFragment = function (id) { + var resourceAnnotation = this.resourceAnnotation(id); + if (!resourceAnnotation) + return undefined; + // IIIF v2 + var on = resourceAnnotation.getProperty("on"); + // IIIF v3 + var target = resourceAnnotation.getProperty("target"); + if (!on || !target) { + return undefined; + } + var fragmentMatch = (on || target).match(/xywh=(.*)$/); + if (!fragmentMatch) + return undefined; + return fragmentMatch[1].split(",").map(function (str) { return parseInt(str, 10); }); + }; + Object.defineProperty(Canvas.prototype, "iiifImageResources", { + get: function () { + return this.imageResources.filter(function (r) { return r && r.getServices()[0] && r.getServices()[0].id; }); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Canvas.prototype, "imageServiceIds", { + get: function () { + return this.iiifImageResources.map(function (r) { return r.getServices()[0].id; }); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Canvas.prototype, "aspectRatio", { + get: function () { + return this.getWidth() / this.getHeight(); + }, + enumerable: false, + configurable: true + }); + return Canvas; +}(Resource)); +export { Canvas }; +//# sourceMappingURL=Canvas.js.map \ No newline at end of file diff --git a/dist-esmodule/Canvas.js.map b/dist-esmodule/Canvas.js.map new file mode 100644 index 00000000..0834f6b4 --- /dev/null +++ b/dist-esmodule/Canvas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Canvas.js","sourceRoot":"","sources":["../src/Canvas.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,oBAAoB,EAErB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,UAAU,EAEV,cAAc,EACd,cAAc,EAId,QAAQ,EAER,IAAI,EACJ,KAAK,EACN,MAAM,YAAY,CAAC;AACpB,aAAa;AACb,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,aAAa;AACb,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAE7C;IAA4B,0BAAQ;IAGlC,gBAAY,MAAY,EAAE,OAA2B;QACnD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IAED,qDAAqD;IACrD,qCAAoB,GAApB,UAAqB,CAAU;QAC7B,IAAI,EAAE,GAAkB,IAAI,CAAC;QAC7B,IAAM,MAAM,GAAW,MAAM,CAAC;QAC9B,IAAM,QAAQ,GAAW,CAAC,CAAC;QAC3B,IAAI,OAAO,GAAW,SAAS,CAAC;QAChC,IAAI,KAAK,GAAuB,CAAC,CAAC;QACl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AAC,CAAC;QACxD,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;YAAC,OAAO,SAAS,CAAC;QAAC,CAAC;QACzC,IAAM,aAAa,GAAG,CAAC,EAAE,IAAI,MAAM,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACzD,IAAI,CAAC,aAAa;YAAE,OAAO,SAAS,CAAC;QACrC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,EAAjB,CAAiB,CAAC,CAAC;IACnE,CAAC;IAED,sBAAI,sCAAkB;aAAtB;YACE,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAC/B,UAAA,CAAC,IAAI,OAAA,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAhD,CAAgD,CACtD,CAAC;QACJ,CAAC;;;OAAA;IAED,sBAAI,mCAAe;aAAnB;YACE,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAArB,CAAqB,CAAC,CAAC;QACjE,CAAC;;;OAAA;IAED,sBAAI,+BAAW;aAAf;YACE,OAAO,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5C,CAAC;;;OAAA;IACH,aAAC;AAAD,CAAC,AAnXD,CAA4B,QAAQ,GAmXnC"} \ No newline at end of file diff --git a/dist-esmodule/Collection.d.ts b/dist-esmodule/Collection.d.ts new file mode 100644 index 00000000..5db37554 --- /dev/null +++ b/dist-esmodule/Collection.d.ts @@ -0,0 +1,28 @@ +import { Behavior, ViewingDirection, ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +import { IIIFResource, IManifestoOptions, Manifest, TreeNode } from "./internal"; +export declare class Collection extends IIIFResource { + items: IIIFResource[]; + private _collections; + private _manifests; + constructor(jsonld: any, options: IManifestoOptions); + getCollections(): Collection[]; + getManifests(): Manifest[]; + getCollectionByIndex(collectionIndex: number): Promise; + getManifestByIndex(manifestIndex: number): Promise; + getTotalCollections(): number; + getTotalManifests(): number; + getTotalItems(): number; + getViewingDirection(): ViewingDirection; + /** + * Note: this only will return the first behavior as per the manifesto convention + * IIIF v3 supports multiple behaviors + */ + getBehavior(): Behavior | null; + getViewingHint(): ViewingHint | null; + /** + * Get a tree of sub collections and manifests, using each child manifest's first 'top' range. + */ + getDefaultTree(): TreeNode; + private _parseManifests; + private _parseCollections; +} diff --git a/dist-esmodule/Collection.js b/dist-esmodule/Collection.js new file mode 100644 index 00000000..a2f21f90 --- /dev/null +++ b/dist-esmodule/Collection.js @@ -0,0 +1,157 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ViewingDirection } from "@iiif/vocabulary/dist-commonjs"; +import { IIIFResource, TreeNodeType, Utils } from "./internal"; +var Collection = /** @class */ (function (_super) { + __extends(Collection, _super); + function Collection(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.items = []; + _this._collections = null; + _this._manifests = null; + jsonld.__collection = _this; + return _this; + } + Collection.prototype.getCollections = function () { + if (this._collections) { + return this._collections; + } + return (this._collections = (this.items.filter(function (m) { return m.isCollection(); }))); + }; + Collection.prototype.getManifests = function () { + if (this._manifests) { + return this._manifests; + } + return (this._manifests = (this.items.filter(function (m) { return m.isManifest(); }))); + }; + Collection.prototype.getCollectionByIndex = function (collectionIndex) { + var collections = this.getCollections(); + var collection; + for (var i = 0; i < collections.length; i++) { + var c = collections[i]; + if (c.index === collectionIndex) { + collection = c; + } + } + if (collection) { + collection.options.index = collectionIndex; + // id for collection MUST be dereferenceable + return collection.load(); + } + else { + throw new Error("Collection index not found"); + } + }; + Collection.prototype.getManifestByIndex = function (manifestIndex) { + var manifests = this.getManifests(); + var manifest; + for (var i = 0; i < manifests.length; i++) { + var m = manifests[i]; + if (m.index === manifestIndex) { + manifest = m; + } + } + if (manifest) { + manifest.options.index = manifestIndex; + return manifest.load(); + } + else { + throw new Error("Manifest index not found"); + } + }; + Collection.prototype.getTotalCollections = function () { + return this.getCollections().length; + }; + Collection.prototype.getTotalManifests = function () { + return this.getManifests().length; + }; + Collection.prototype.getTotalItems = function () { + return this.items.length; + }; + Collection.prototype.getViewingDirection = function () { + if (this.getProperty("viewingDirection")) { + return this.getProperty("viewingDirection"); + } + return ViewingDirection.LEFT_TO_RIGHT; + }; + /** + * Note: this only will return the first behavior as per the manifesto convention + * IIIF v3 supports multiple behaviors + */ + Collection.prototype.getBehavior = function () { + var behavior = this.getProperty("behavior"); + if (Array.isArray(behavior)) { + behavior = behavior[0]; + } + if (behavior) { + return behavior; + } + return null; + }; + Collection.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + /** + * Get a tree of sub collections and manifests, using each child manifest's first 'top' range. + */ + Collection.prototype.getDefaultTree = function () { + _super.prototype.getDefaultTree.call(this); + //console.log("get default tree for ", this.id); + this.defaultTree.data.type = Utils.normaliseType(TreeNodeType.COLLECTION); + this._parseManifests(this); + this._parseCollections(this); + Utils.generateTreeNodeIds(this.defaultTree); + return this.defaultTree; + }; + Collection.prototype._parseManifests = function (parentCollection) { + if (parentCollection.getManifests() && + parentCollection.getManifests().length) { + for (var i = 0; i < parentCollection.getManifests().length; i++) { + var manifest = parentCollection.getManifests()[i]; + var tree = manifest.getDefaultTree(); + tree.label = + manifest.parentLabel || + manifest.getLabel().getValue(this.options.locale) || + "manifest " + (i + 1); + tree.navDate = manifest.getNavDate(); + tree.data.id = manifest.id; + tree.data.type = Utils.normaliseType(TreeNodeType.MANIFEST); + parentCollection.defaultTree.addNode(tree); + } + } + }; + Collection.prototype._parseCollections = function (parentCollection) { + //console.log("parse collections for ", parentCollection.id); + if (parentCollection.getCollections() && + parentCollection.getCollections().length) { + for (var i = 0; i < parentCollection.getCollections().length; i++) { + var collection = parentCollection.getCollections()[i]; + var tree = collection.getDefaultTree(); + tree.label = + collection.parentLabel || + collection.getLabel().getValue(this.options.locale) || + "collection " + (i + 1); + tree.navDate = collection.getNavDate(); + tree.data.id = collection.id; + tree.data.type = Utils.normaliseType(TreeNodeType.COLLECTION); + parentCollection.defaultTree.addNode(tree); + } + } + }; + return Collection; +}(IIIFResource)); +export { Collection }; +//# sourceMappingURL=Collection.js.map \ No newline at end of file diff --git a/dist-esmodule/Collection.js.map b/dist-esmodule/Collection.js.map new file mode 100644 index 00000000..22515254 --- /dev/null +++ b/dist-esmodule/Collection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../src/Collection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,YAAY,EAIZ,YAAY,EACZ,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB;IAAgC,8BAAY;IAK1C,oBAAY,MAAW,EAAE,OAA0B;QACjD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QALlB,WAAK,GAAmB,EAAE,CAAC;QAC1B,kBAAY,GAAwB,IAAI,CAAC;QACzC,gBAAU,GAAsB,IAAI,CAAC;QAI3C,MAAM,CAAC,YAAY,GAAG,KAAI,CAAC;;IAC7B,CAAC;I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,AAzKD,CAAgC,YAAY,GAyK3C"} \ No newline at end of file diff --git a/dist-esmodule/Color.d.ts b/dist-esmodule/Color.d.ts new file mode 100644 index 00000000..7f58cc84 --- /dev/null +++ b/dist-esmodule/Color.d.ts @@ -0,0 +1,36 @@ +/** + * class structure with red, green, blue values in 0-255 range + * Uses the {@link https://www.npmjs.com/package.color-string | color-string } + * library for conversion from and to string representations of color. +**/ +export declare class Color { + /** + * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red + * @returns Color instance. + **/ + static fromCSS(cssTerm: string): Color; + /** + * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red + **/ + constructor(rgbValue: number[]); + /** + * @returns Array of 3 integers in range 0-255 + **/ + value: number[]; + /** + * @return 0 to 255 value of red color component + **/ + get red(): number; + /** + * @return 0 to 255 value of green color component + **/ + get green(): number; + /** + * @return 0 to 255 value of blue color component + **/ + get blue(): number; + /** + * @returns hex string (as for CSS ) representation of r,g,b components + **/ + get CSS(): string; +} diff --git a/dist-esmodule/Color.js b/dist-esmodule/Color.js new file mode 100644 index 00000000..0ffb46cb --- /dev/null +++ b/dist-esmodule/Color.js @@ -0,0 +1,60 @@ +//import { colorString } from "color-string" +var colorString = require("color-string"); +/** + * class structure with red, green, blue values in 0-255 range + * Uses the {@link https://www.npmjs.com/package.color-string | color-string } + * library for conversion from and to string representations of color. +**/ +var Color = /** @class */ (function () { + /** + * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red + **/ + function Color(rgbValue) { + this.value = rgbValue; + } + /** + * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red + * @returns Color instance. + **/ + Color.fromCSS = function (cssTerm) { + var rv = colorString.get(cssTerm); + if (rv.model !== 'rgb') + throw new Error("unsupported color string: " + cssTerm); + return new Color([rv.value[0], rv.value[1], rv.value[2]]); + }; + Object.defineProperty(Color.prototype, "red", { + /** + * @return 0 to 255 value of red color component + **/ + get: function () { return this.value[0]; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Color.prototype, "green", { + /** + * @return 0 to 255 value of green color component + **/ + get: function () { return this.value[1]; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Color.prototype, "blue", { + /** + * @return 0 to 255 value of blue color component + **/ + get: function () { return this.value[2]; }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Color.prototype, "CSS", { + /** + * @returns hex string (as for CSS ) representation of r,g,b components + **/ + get: function () { return colorString.to.hex(this.value); }, + enumerable: false, + configurable: true + }); + return Color; +}()); +export { Color }; +//# sourceMappingURL=Color.js.map \ No newline at end of file diff --git a/dist-esmodule/Color.js.map b/dist-esmodule/Color.js.map new file mode 100644 index 00000000..cee32359 --- /dev/null +++ b/dist-esmodule/Color.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Color.js","sourceRoot":"","sources":["../src/Color.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,IAAI,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE1C;;;;GAIG;AACH;IAaE;;OAEG;IACH,eAAa,QAAmB;QAC9B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAG;IAC1B,CAAC;IAhBD;;;OAGG;IACI,aAAO,GAAd,UAAgB,OAAgB;QAC1B,IAAI,EAAE,GAAG,WAAW,CAAC,GAAG,CAAE,OAAO,CAAE,CAAC;QACpC,IAAI,EAAE,CAAC,KAAK,KAAK,KAAK;YAClB,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,OAAO,CAAE,CAAC;QAC7D,OAAO,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;IAiBD,sBAAW,sBAAG;QAHd;;WAEG;aACH,cAA0B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;;;OAAA;IAKhD,sBAAW,wBAAK;QAHhB;;WAEG;aACH,cAA2B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;;;OAAA;IAKjD,sBAAW,uBAAI;QAHf;;WAEG;aACH,cAA2B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA,CAAC;;;OAAA;IAKjD,sBAAW,sBAAG;QAHd;;WAEG;aACH,cAA2B,OAAO,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC;;;OAAA;IACpE,YAAC;AAAD,CAAC,AA5CD,IA4CC"} \ No newline at end of file diff --git a/dist-esmodule/Duration.d.ts b/dist-esmodule/Duration.d.ts new file mode 100644 index 00000000..639d0314 --- /dev/null +++ b/dist-esmodule/Duration.d.ts @@ -0,0 +1,6 @@ +export declare class Duration { + start: number; + end: number; + constructor(start: number, end: number); + getLength(): number; +} diff --git a/dist-esmodule/Duration.js b/dist-esmodule/Duration.js new file mode 100644 index 00000000..ad588064 --- /dev/null +++ b/dist-esmodule/Duration.js @@ -0,0 +1,12 @@ +var Duration = /** @class */ (function () { + function Duration(start, end) { + this.start = start; + this.end = end; + } + Duration.prototype.getLength = function () { + return this.end - this.start; + }; + return Duration; +}()); +export { Duration }; +//# sourceMappingURL=Duration.js.map \ No newline at end of file diff --git a/dist-esmodule/Duration.js.map b/dist-esmodule/Duration.js.map new file mode 100644 index 00000000..c64d93f4 --- /dev/null +++ b/dist-esmodule/Duration.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Duration.js","sourceRoot":"","sources":["../src/Duration.ts"],"names":[],"mappings":"AAAA;IACE,kBAAmB,KAAa,EAAS,GAAW;QAAjC,UAAK,GAAL,KAAK,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAEjD,4BAAS,GAAhB;QACE,OAAO,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC;IAC/B,CAAC;IACH,eAAC;AAAD,CAAC,AAND,IAMC"} \ No newline at end of file diff --git a/dist-esmodule/Geometry3d.d.ts b/dist-esmodule/Geometry3d.d.ts new file mode 100644 index 00000000..965aa220 --- /dev/null +++ b/dist-esmodule/Geometry3d.d.ts @@ -0,0 +1,23 @@ +import { Vector3, Euler } from "threejs-math"; +/** +* performs the calculation required for the lookAt +* property of a camera resource. Determines the +* required angles of two rotations, the first about +* the x axis and the second about the y axis, which will +* rotate the default camera direction (0,0,-1) into the +* direction of the input arguments +* +* Result of calculation is returned as a instance of EulerAngle from the +* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The +* three-js library uses body-fixed axes to represent EulerAngles, which reverse +* the ordering of the "relative rotation" algorithm described in the +* draft 3d api. + +* @param direction A vector interpreted as a direction. Client code +* responsible for not passing a 0-length vector, else a + +* +* @returns threejs-math.EulerAngle instance +**/ +export declare function cameraRelativeRotation(direction: Vector3): Euler; +export declare function lightRelativeRotation(direction: Vector3): Euler; diff --git a/dist-esmodule/Geometry3d.js b/dist-esmodule/Geometry3d.js new file mode 100644 index 00000000..52ab72fa --- /dev/null +++ b/dist-esmodule/Geometry3d.js @@ -0,0 +1,58 @@ +import { Vector3, MathUtils, Euler, Quaternion } from "threejs-math"; +// https://ros2jsguy.github.io/threejs-math/index.html +/** +* performs the calculation required for the lookAt +* property of a camera resource. Determines the +* required angles of two rotations, the first about +* the x axis and the second about the y axis, which will +* rotate the default camera direction (0,0,-1) into the +* direction of the input arguments +* +* Result of calculation is returned as a instance of EulerAngle from the +* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The +* three-js library uses body-fixed axes to represent EulerAngles, which reverse +* the ordering of the "relative rotation" algorithm described in the +* draft 3d api. + +* @param direction A vector interpreted as a direction. Client code +* responsible for not passing a 0-length vector, else a + +* +* @returns threejs-math.EulerAngle instance +**/ +export function cameraRelativeRotation(direction) { + if (direction.length() == 0.0) + throw new Error("degenerate geometry: cameraRelativeRotation"); + // projDirection is the direction projected onto the xz plane + var projDirection = direction.clone().setComponent(1, 0.0); + var projLength = projDirection.length(); + // handle the edge case, desired viewing direction is either straight up + // or straight down + if (projLength == 0.0) { + if (direction.y > 0.0) { + // looking straight up fro below + return new Euler(MathUtils.degToRad(+90.0), MathUtils.degToRad(180.0), 0, "YXZ"); + } + else { + return new Euler(MathUtils.degToRad(-90.0), MathUtils.degToRad(180.0), 0, "YXZ"); + } + } + var yAngleRad = Math.atan2(-projDirection.x, -projDirection.z); + var xAngleRad = Math.atan2(direction.y, projLength); + return new Euler(xAngleRad, yAngleRad, 0.0, "YXZ"); +} +; +export function lightRelativeRotation(direction) { + if (direction.length() == 0.0) + throw new Error("degenerate geometry: cameraRelativeRotation"); + var unit_direction = direction.clone().divideScalar(direction.length()); + // negative y axis is initial direction of DirectionalLight, SpotLight + // in draft 3D API + var ny_axis = new Vector3(0.0, -1.0, 0.0); + var quat = new Quaternion().setFromUnitVectors(ny_axis, unit_direction); + var tmp = new Euler().setFromQuaternion(quat, "ZXY"); + // standard be setting the final intrinsic Y rotation, which is + // along desired direction, to 0 + return new Euler(tmp.x, 0.0, tmp.z, "ZXY"); +} +//# sourceMappingURL=Geometry3d.js.map \ No newline at end of file diff --git a/dist-esmodule/Geometry3d.js.map b/dist-esmodule/Geometry3d.js.map new file mode 100644 index 00000000..4b4c5870 --- /dev/null +++ b/dist-esmodule/Geometry3d.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Geometry3d.js","sourceRoot":"","sources":["../src/Geometry3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAG,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtE,sDAAsD;AAGtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAmB;IACtD,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG;QACzB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;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,kBAAkB;IAClB,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,EAAC,CAAC,GAAG,EAAC,GAAG,CAAC,CAAC;IAExC,IAAI,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IACxE,IAAI,GAAG,GAAI,IAAI,KAAK,EAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACtD,+DAA+D;IAC/D,gCAAgC;IAChC,OAAO,IAAI,KAAK,CAAE,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,KAAK,CAAE,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/dist-esmodule/IAccessToken.d.ts b/dist-esmodule/IAccessToken.d.ts new file mode 100644 index 00000000..a645064a --- /dev/null +++ b/dist-esmodule/IAccessToken.d.ts @@ -0,0 +1,7 @@ +export interface IAccessToken { + accessToken: string; + error: string; + errorDescription: string; + expiresIn: number; + tokenType: string; +} diff --git a/dist-esmodule/IAccessToken.js b/dist-esmodule/IAccessToken.js new file mode 100644 index 00000000..46fa1d7e --- /dev/null +++ b/dist-esmodule/IAccessToken.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=IAccessToken.js.map \ No newline at end of file diff --git a/dist-esmodule/IAccessToken.js.map b/dist-esmodule/IAccessToken.js.map new file mode 100644 index 00000000..2bf7cee0 --- /dev/null +++ b/dist-esmodule/IAccessToken.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IAccessToken.js","sourceRoot":"","sources":["../src/IAccessToken.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-esmodule/IExternalImageResourceData.d.ts b/dist-esmodule/IExternalImageResourceData.d.ts new file mode 100644 index 00000000..7ca03189 --- /dev/null +++ b/dist-esmodule/IExternalImageResourceData.d.ts @@ -0,0 +1,5 @@ +import { IExternalResourceData } from "./internal"; +export interface IExternalImageResourceData extends IExternalResourceData { + width: number; + height: number; +} diff --git a/dist-esmodule/IExternalImageResourceData.js b/dist-esmodule/IExternalImageResourceData.js new file mode 100644 index 00000000..c2da079e --- /dev/null +++ b/dist-esmodule/IExternalImageResourceData.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=IExternalImageResourceData.js.map \ No newline at end of file diff --git a/dist-esmodule/IExternalImageResourceData.js.map b/dist-esmodule/IExternalImageResourceData.js.map new file mode 100644 index 00000000..386fcc2b --- /dev/null +++ b/dist-esmodule/IExternalImageResourceData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IExternalImageResourceData.js","sourceRoot":"","sources":["../src/IExternalImageResourceData.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-esmodule/IExternalResource.d.ts b/dist-esmodule/IExternalResource.d.ts new file mode 100644 index 00000000..e7e62892 --- /dev/null +++ b/dist-esmodule/IExternalResource.d.ts @@ -0,0 +1,24 @@ +import { IAccessToken, IExternalResourceData, IManifestoOptions, Service } from "./internal"; +export interface IExternalResource { + authAPIVersion: number; + authHoldingPage: any; + clickThroughService: Service | null; + data: IExternalResourceData; + dataUri: string | null; + error: any; + externalService: Service | null; + getData(accessToken?: IAccessToken): Promise; + hasServiceDescriptor(): boolean; + height: number; + index: number; + isAccessControlled(): boolean; + isResponseHandled: boolean; + kioskService: Service | null; + loginService: Service | null; + logoutService: Service | null; + options?: IManifestoOptions; + restrictedService: Service | null; + status: number; + tokenService: Service | null; + width: number; +} diff --git a/dist-esmodule/IExternalResource.js b/dist-esmodule/IExternalResource.js new file mode 100644 index 00000000..44ae9bb6 --- /dev/null +++ b/dist-esmodule/IExternalResource.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=IExternalResource.js.map \ No newline at end of file diff --git a/dist-esmodule/IExternalResource.js.map b/dist-esmodule/IExternalResource.js.map new file mode 100644 index 00000000..fb86491b --- /dev/null +++ b/dist-esmodule/IExternalResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IExternalResource.js","sourceRoot":"","sources":["../src/IExternalResource.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-esmodule/IExternalResourceData.d.ts b/dist-esmodule/IExternalResourceData.d.ts new file mode 100644 index 00000000..55a6955e --- /dev/null +++ b/dist-esmodule/IExternalResourceData.d.ts @@ -0,0 +1,7 @@ +export interface IExternalResourceData { + contentLocation: string; + hasServiceDescriptor: boolean; + id: string; + index: number; + profile: string | any[]; +} diff --git a/dist-esmodule/IExternalResourceData.js b/dist-esmodule/IExternalResourceData.js new file mode 100644 index 00000000..9131050b --- /dev/null +++ b/dist-esmodule/IExternalResourceData.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=IExternalResourceData.js.map \ No newline at end of file diff --git a/dist-esmodule/IExternalResourceData.js.map b/dist-esmodule/IExternalResourceData.js.map new file mode 100644 index 00000000..0f3073cd --- /dev/null +++ b/dist-esmodule/IExternalResourceData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IExternalResourceData.js","sourceRoot":"","sources":["../src/IExternalResourceData.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-esmodule/IExternalResourceOptions.d.ts b/dist-esmodule/IExternalResourceOptions.d.ts new file mode 100644 index 00000000..b0c2d334 --- /dev/null +++ b/dist-esmodule/IExternalResourceOptions.d.ts @@ -0,0 +1,3 @@ +export interface IExternalResourceOptions { + authApiVersion: number; +} diff --git a/dist-esmodule/IExternalResourceOptions.js b/dist-esmodule/IExternalResourceOptions.js new file mode 100644 index 00000000..4f619649 --- /dev/null +++ b/dist-esmodule/IExternalResourceOptions.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=IExternalResourceOptions.js.map \ No newline at end of file diff --git a/dist-esmodule/IExternalResourceOptions.js.map b/dist-esmodule/IExternalResourceOptions.js.map new file mode 100644 index 00000000..28f88ed3 --- /dev/null +++ b/dist-esmodule/IExternalResourceOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IExternalResourceOptions.js","sourceRoot":"","sources":["../src/IExternalResourceOptions.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-esmodule/IIIFResource.d.ts b/dist-esmodule/IIIFResource.d.ts new file mode 100644 index 00000000..1c76ebc3 --- /dev/null +++ b/dist-esmodule/IIIFResource.d.ts @@ -0,0 +1,28 @@ +import { ManifestResource, PropertyValue, LabelValuePair, TreeNode, IManifestoOptions, Collection } from "./internal"; +import { IIIFResourceType } from "@iiif/vocabulary/dist-commonjs"; +export declare class IIIFResource extends ManifestResource { + defaultTree: TreeNode; + index: number; + isLoaded: boolean; + parentCollection: Collection; + parentLabel: string; + constructor(jsonld?: any, options?: IManifestoOptions); + /** + * @deprecated + */ + getAttribution(): PropertyValue; + getDescription(): PropertyValue; + getHomepage(): string | null; + getIIIFResourceType(): IIIFResourceType; + getLogo(): string | null; + getLicense(): string | null; + getNavDate(): Date; + getRelated(): any; + getSeeAlso(): any; + getTrackingLabel(): string; + getDefaultTree(): TreeNode; + getRequiredStatement(): LabelValuePair | null; + isCollection(): boolean; + isManifest(): boolean; + load(): Promise; +} diff --git a/dist-esmodule/IIIFResource.js b/dist-esmodule/IIIFResource.js new file mode 100644 index 00000000..28b84f9d --- /dev/null +++ b/dist-esmodule/IIIFResource.js @@ -0,0 +1,168 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ManifestResource, Utils, PropertyValue, Deserialiser, LabelValuePair, TreeNode } from "./internal"; +import { IIIFResourceType, ServiceProfile } from "@iiif/vocabulary/dist-commonjs"; +var IIIFResource = /** @class */ (function (_super) { + __extends(IIIFResource, _super); + function IIIFResource(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.index = -1; + _this.isLoaded = false; + var defaultOptions = { + defaultLabel: "-", + locale: "en-GB", + resource: _this, + pessimisticAccessControl: false + }; + _this.options = Object.assign(defaultOptions, options); + return _this; + } + /** + * @deprecated + */ + IIIFResource.prototype.getAttribution = function () { + //console.warn('getAttribution will be deprecated, use getRequiredStatement instead.'); + var attribution = this.getProperty("attribution"); + if (attribution) { + return PropertyValue.parse(attribution, this.options.locale); + } + return new PropertyValue([], this.options.locale); + }; + IIIFResource.prototype.getDescription = function () { + var description = this.getProperty("description"); + if (description) { + return PropertyValue.parse(description, this.options.locale); + } + return new PropertyValue([], this.options.locale); + }; + IIIFResource.prototype.getHomepage = function () { + var homepage = this.getProperty("homepage"); + if (!homepage) + return null; + if (typeof homepage == "string") + return homepage; + if (Array.isArray(homepage) && homepage.length) { + homepage = homepage[0]; + } + return homepage["@id"] || homepage.id; + }; + IIIFResource.prototype.getIIIFResourceType = function () { + return Utils.normaliseType(this.getProperty("type")); + }; + IIIFResource.prototype.getLogo = function () { + var logo = this.getProperty("logo"); + // Presentation 3. + // The logo is exclusive to the "provider" property, which is of type "Agent". + // In order to fulfil `manifest.getLogo()` we should check + // When P3 is fully supported, the following should work. + // return this.getProvider()?.getLogo(); + if (!logo) { + var provider = this.getProperty("provider"); + if (!provider) { + return null; + } + logo = provider.logo; + } + if (!logo) + return null; + if (typeof logo === "string") + return logo; + if (Array.isArray(logo) && logo.length) { + logo = logo[0]; + } + return logo["@id"] || logo.id; + }; + IIIFResource.prototype.getLicense = function () { + return 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 this.getProperty("seeAlso"); + }; + IIIFResource.prototype.getTrackingLabel = function () { + var service = (this.getService(ServiceProfile.TRACKING_EXTENSIONS)); + if (service) { + return service.getProperty("trackingLabel"); + } + return ""; + }; + IIIFResource.prototype.getDefaultTree = function () { + this.defaultTree = new TreeNode("root"); + this.defaultTree.data = this; + return this.defaultTree; + }; + IIIFResource.prototype.getRequiredStatement = function () { + var requiredStatement = null; + var _requiredStatement = this.getProperty("requiredStatement"); + if (_requiredStatement) { + requiredStatement = new LabelValuePair(this.options.locale); + requiredStatement.parse(_requiredStatement); + } + else { + // fall back to attribution (if it exists) + var attribution = this.getAttribution(); + if (attribution) { + requiredStatement = new LabelValuePair(this.options.locale); + requiredStatement.value = attribution; + } + } + return requiredStatement; + }; + IIIFResource.prototype.isCollection = function () { + if (this.getIIIFResourceType() === IIIFResourceType.COLLECTION) { + return true; + } + return false; + }; + IIIFResource.prototype.isManifest = function () { + if (this.getIIIFResourceType() === IIIFResourceType.MANIFEST) { + return true; + } + return false; + }; + IIIFResource.prototype.load = function () { + var that = this; + return new Promise(function (resolve) { + if (that.isLoaded) { + resolve(that); + } + else { + var options_1 = that.options; + options_1.navDate = that.getNavDate(); + var id = that.__jsonld.id; + if (!id) { + id = that.__jsonld["@id"]; + } + Utils.loadManifest(id).then(function (data) { + that.parentLabel = that.getLabel().getValue(options_1.locale); + var parsed = Deserialiser.parse(data, options_1); + that = Object.assign(that, parsed); + //that.parentCollection = options.resource.parentCollection; + that.index = options_1.index; + resolve(that); + }); + } + }); + }; + return IIIFResource; +}(ManifestResource)); +export { IIIFResource }; +//# sourceMappingURL=IIIFResource.js.map \ No newline at end of file diff --git a/dist-esmodule/IIIFResource.js.map b/dist-esmodule/IIIFResource.js.map new file mode 100644 index 00000000..8344ea48 --- /dev/null +++ b/dist-esmodule/IIIFResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IIIFResource.js","sourceRoot":"","sources":["../src/IIIFResource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,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AM,CAAC,CAAC;oBACpE,IAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,SAAO,CAAC,CAAC;oBACjD,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBACnC,4DAA4D;oBAC5D,IAAI,CAAC,KAAK,GAAW,SAAO,CAAC,KAAK,CAAC;oBAEnC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAChB,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,mBAAC;AAAD,CAAC,AArLD,CAAkC,gBAAgB,GAqLjD"} \ No newline at end of file diff --git a/dist-esmodule/IManifestoOptions.d.ts b/dist-esmodule/IManifestoOptions.d.ts new file mode 100644 index 00000000..d09b0f79 --- /dev/null +++ b/dist-esmodule/IManifestoOptions.d.ts @@ -0,0 +1,9 @@ +import { IIIFResource } from "./internal"; +export interface IManifestoOptions { + defaultLabel: string; + index?: number; + locale: string; + navDate?: Date; + pessimisticAccessControl: boolean; + resource: IIIFResource; +} diff --git a/dist-esmodule/IManifestoOptions.js b/dist-esmodule/IManifestoOptions.js new file mode 100644 index 00000000..76e166f6 --- /dev/null +++ b/dist-esmodule/IManifestoOptions.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=IManifestoOptions.js.map \ No newline at end of file diff --git a/dist-esmodule/IManifestoOptions.js.map b/dist-esmodule/IManifestoOptions.js.map new file mode 100644 index 00000000..b1a1813c --- /dev/null +++ b/dist-esmodule/IManifestoOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IManifestoOptions.js","sourceRoot":"","sources":["../src/IManifestoOptions.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-esmodule/JSONLDResource.d.ts b/dist-esmodule/JSONLDResource.d.ts new file mode 100644 index 00000000..6520634b --- /dev/null +++ b/dist-esmodule/JSONLDResource.d.ts @@ -0,0 +1,20 @@ +export declare class JSONLDResource { + context: string; + id: string; + __jsonld: any; + constructor(jsonld?: any); + getProperty(name: string): any; + /** + A function that wraps the getProperty function, which client + code can use if it is needed to identify when the json value of + a property is an IRI -- Internationalized Resource Identifier + + If the value of the json value is a bare string, then it will be + wrapped in a json object with the string in the property 'id', + additionally that property will have a property 'isIRI' which will + be true for the literal string case, otherwise false meaning the + returned getProperty should be parsed as before. + + **/ + getPropertyAsObject(name: string): any; +} diff --git a/dist-esmodule/JSONLDResource.js b/dist-esmodule/JSONLDResource.js new file mode 100644 index 00000000..59a56999 --- /dev/null +++ b/dist-esmodule/JSONLDResource.js @@ -0,0 +1,47 @@ +var JSONLDResource = /** @class */ (function () { + function JSONLDResource(jsonld) { + this.__jsonld = jsonld; + this.context = this.getProperty("context"); + this.id = this.getProperty("id"); + } + JSONLDResource.prototype.getProperty = function (name) { + var prop = null; + if (this.__jsonld) { + prop = this.__jsonld[name]; + if (!prop) { + // property may have a prepended '@' + prop = this.__jsonld["@" + name]; + } + } + return prop; + }; + /** + A function that wraps the getProperty function, which client + code can use if it is needed to identify when the json value of + a property is an IRI -- Internationalized Resource Identifier + + If the value of the json value is a bare string, then it will be + wrapped in a json object with the string in the property 'id', + additionally that property will have a property 'isIRI' which will + be true for the literal string case, otherwise false meaning the + returned getProperty should be parsed as before. + + **/ + JSONLDResource.prototype.getPropertyAsObject = function (name) { + var prop = this.getProperty(name); + if (prop === null) + return prop; + else if (typeof (prop) === 'string') + return { "id": prop, + "isIRI": true + }; + else if (prop === Object(prop)) + return prop; + else { + throw new Error("cannot resolve prop as object: " + prop); + } + }; + return JSONLDResource; +}()); +export { JSONLDResource }; +//# sourceMappingURL=JSONLDResource.js.map \ No newline at end of file diff --git a/dist-esmodule/JSONLDResource.js.map b/dist-esmodule/JSONLDResource.js.map new file mode 100644 index 00000000..11500b9f --- /dev/null +++ b/dist-esmodule/JSONLDResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"JSONLDResource.js","sourceRoot":"","sources":["../src/JSONLDResource.ts"],"names":[],"mappings":"AAAA;IAKE,wBAAY,MAAY;QACtB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,oCAAW,GAAX,UAAY,IAAY;QACtB,IAAI,IAAI,GAAQ,IAAI,CAAC;QAErB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAE3B,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,oCAAoC;gBACpC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAGD;;;;;;;;;;;OAWG;IACH,4CAAmB,GAAnB,UAAoB,IAAY;QAE9B,IAAI,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAElC,IAAK,IAAI,KAAK,IAAI;YACd,OAAO,IAAI,CAAC;aACX,IAAK,OAAM,CAAC,IAAI,CAAC,KAAK,QAAQ;YAC/B,OAAO,EAAE,IAAI,EAAG,IAAI;gBACX,OAAO,EAAG,IAAI;aACf,CAAC;aACR,IAAK,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC;YAC3B,OAAO,IAAI,CAAC;aACZ,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,IAAI,CAAE,CAAC;QAC/D,CAAC;IACH,CAAC;IACH,qBAAC;AAAD,CAAC,AAvDD,IAuDC"} \ No newline at end of file diff --git a/dist-esmodule/LabelValuePair.d.ts b/dist-esmodule/LabelValuePair.d.ts new file mode 100644 index 00000000..85354a6e --- /dev/null +++ b/dist-esmodule/LabelValuePair.d.ts @@ -0,0 +1,14 @@ +import { PropertyValue } from "./internal"; +export declare class LabelValuePair { + label: PropertyValue | null; + value: PropertyValue | null; + defaultLocale: string; + resource: any; + constructor(defaultLocale: string); + parse(resource: any): void; + getLabel(locale?: string | string[]): string | null; + setLabel(value: string): void; + getValue(locale?: string | string[], joinWith?: string): string | null; + getValues(locale?: string | string[]): Array; + setValue(value: string): void; +} diff --git a/dist-esmodule/LabelValuePair.js b/dist-esmodule/LabelValuePair.js new file mode 100644 index 00000000..844585f8 --- /dev/null +++ b/dist-esmodule/LabelValuePair.js @@ -0,0 +1,55 @@ +import { PropertyValue } from "./internal"; +var LabelValuePair = /** @class */ (function () { + function LabelValuePair(defaultLocale) { + this.defaultLocale = defaultLocale; + } + LabelValuePair.prototype.parse = function (resource) { + this.resource = resource; + this.label = PropertyValue.parse(this.resource.label, this.defaultLocale); + this.value = PropertyValue.parse(this.resource.value, this.defaultLocale); + }; + // shortcuts to get/set values based on user or default locale + LabelValuePair.prototype.getLabel = function (locale) { + if (this.label === null) { + return null; + } + if (Array.isArray(locale) && !locale.length) { + locale = undefined; + } + return this.label.getValue(locale || this.defaultLocale); + }; + LabelValuePair.prototype.setLabel = function (value) { + if (this.label === null) { + this.label = new PropertyValue([]); + } + this.label.setValue(value, this.defaultLocale); + }; + LabelValuePair.prototype.getValue = function (locale, joinWith) { + if (joinWith === void 0) { joinWith = "
"; } + if (this.value === null) { + return null; + } + if (Array.isArray(locale) && !locale.length) { + locale = undefined; + } + return this.value.getValue(locale || this.defaultLocale, joinWith); + }; + LabelValuePair.prototype.getValues = function (locale) { + if (this.value === null) { + return []; + } + if (Array.isArray(locale) && !locale.length) { + locale = undefined; + } + return this.value.getValues(locale || this.defaultLocale); + }; + LabelValuePair.prototype.setValue = function (value) { + if (this.value === null) { + this.value = new PropertyValue([]); + } + this.value.setValue(value, this.defaultLocale); + }; + return LabelValuePair; +}()); +export { LabelValuePair }; +//# sourceMappingURL=LabelValuePair.js.map \ No newline at end of file diff --git a/dist-esmodule/LabelValuePair.js.map b/dist-esmodule/LabelValuePair.js.map new file mode 100644 index 00000000..9824ba8c --- /dev/null +++ b/dist-esmodule/LabelValuePair.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LabelValuePair.js","sourceRoot":"","sources":["../src/LabelValuePair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;IAME,wBAAY,aAAqB;QAC/B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAEM,8BAAK,GAAZ,UAAa,QAAa;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1E,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAC5E,CAAC;IAED,8DAA8D;IAEvD,iCAAQ,GAAf,UAAgB,MAA0B;QACxC,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC5C,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC;IAC3D,CAAC;IAEM,iCAAQ,GAAf,UAAgB,KAAa;QAC3B,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,QAAQ,CA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-esmodule/Language.d.ts @@ -0,0 +1,5 @@ +/** @deprecated Use LocalizedValue instead */ +export default interface Language { + value: string; + locale: string; +} diff --git a/dist-esmodule/Language.js b/dist-esmodule/Language.js new file mode 100644 index 00000000..7e329aa2 --- /dev/null +++ b/dist-esmodule/Language.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=Language.js.map \ No newline at end of file diff --git a/dist-esmodule/Language.js.map b/dist-esmodule/Language.js.map new file mode 100644 index 00000000..bc35b163 --- /dev/null +++ b/dist-esmodule/Language.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Language.js","sourceRoot":"","sources":["../src/Language.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist-esmodule/LanguageMap.d.ts b/dist-esmodule/LanguageMap.d.ts new file mode 100644 index 00000000..deb11321 --- /dev/null +++ b/dist-esmodule/LanguageMap.d.ts @@ -0,0 +1,8 @@ +import Language from "./Language"; +/** @deprecated Use PropertyValue instead */ +export declare class LanguageMap extends Array { + /** @deprecated Use the `PropertyValue#getValue` instance method instead */ + static getValue(languageCollection: LanguageMap, locale?: string): string | null; + /** @deprecated Use the `PropertyValue#getValues` instance method instead */ + static getValues(languageCollection: LanguageMap, locale?: string): Array; +} diff --git a/dist-esmodule/LanguageMap.js b/dist-esmodule/LanguageMap.js new file mode 100644 index 00000000..5d82f32b --- /dev/null +++ b/dist-esmodule/LanguageMap.js @@ -0,0 +1,33 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/** @deprecated Use PropertyValue instead */ +var LanguageMap = /** @class */ (function (_super) { + __extends(LanguageMap, _super); + function LanguageMap() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** @deprecated Use the `PropertyValue#getValue` instance method instead */ + LanguageMap.getValue = function (languageCollection, locale) { + return languageCollection.getValue(locale, "
"); + }; + /** @deprecated Use the `PropertyValue#getValues` instance method instead */ + LanguageMap.getValues = function (languageCollection, locale) { + return languageCollection.getValues(locale); + }; + return LanguageMap; +}(Array)); +export { LanguageMap }; +//# sourceMappingURL=LanguageMap.js.map \ No newline at end of file diff --git a/dist-esmodule/LanguageMap.js.map b/dist-esmodule/LanguageMap.js.map new file mode 100644 index 00000000..53b9062f --- /dev/null +++ b/dist-esmodule/LanguageMap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LanguageMap.js","sourceRoot":"","sources":["../src/LanguageMap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,4CAA4C;AAC5C;IAAiC,+BAAe;IAAhD;;IAgBA,CAAC;IAfC,2EAA2E;IACpE,oBAAQ,GAAf,UACE,kBAA+B,EAC/B,MAAe;QAEf,OAAQ,kBAAoC,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED,4EAA4E;IACrE,qBAAS,GAAhB,UACE,kBAA+B,EAC/B,MAAe;QAEf,OAAQ,kBAAoC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC;IACH,kBAAC;AAAD,CAAC,AAhBD,CAAiC,KAAK,GAgBrC"} \ No newline at end of file diff --git a/dist-esmodule/Light.d.ts b/dist-esmodule/Light.d.ts new file mode 100644 index 00000000..b3ccfef6 --- /dev/null +++ b/dist-esmodule/Light.d.ts @@ -0,0 +1,48 @@ +import { IManifestoOptions, AnnotationBody, Color, PointSelector } from "./internal"; +export declare class Light extends AnnotationBody { + constructor(jsonld?: any, options?: IManifestoOptions); + get isAmbientLight(): boolean; + get isDirectionalLight(): boolean; + get isSpotLight(): boolean; + getColor(): Color; + get Color(): Color; + /** + * The implementation of the intensity is based on + * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md } + * and the example 3D manifests + * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights } + * on 24 Mar 2024. The intensity property in the manifest is an object + * with declared type 'Value', a numeric property named 'value' and a + * property named unit . This implementation will only work with a unit == 'relative' + * and it will be assumed that a relative unit value of 1.0 corresponds to the + * brightest light source a rendering engine supports. + * + * This code will implement a default intensity of 1.0 + **/ + getIntensity(): number; + get Intensity(): number; + /** + * As defined in the temp-draft-4.md ( + * https://github.com/IIIF/3d/blob/main/temp-draft-4.md#lights ; 12 May 2024) + * this quantity is the half-angle of the cone of the spotlight. + * + * The inconsistency between this definition of the angle and the definition of + * fieldOfView for PerspectiveCamera (where the property value defines the full angle) has + * already been noted: https://github.com/IIIF/api/issues/2284 + * + * provisional decision is to return undefined in case that this property + * is accessed in a light that is not a spotlight + * + * + * @returns number + + **/ + getAngle(): number | undefined; + get Angle(): number | undefined; + /** + * @return : if not null, is either a PointSelector, or an object + * with an id matching the id of an Annotation instance. + **/ + getLookAt(): object | PointSelector | null; + get LookAt(): object | null; +} diff --git a/dist-esmodule/Light.js b/dist-esmodule/Light.js new file mode 100644 index 00000000..95d2dee3 --- /dev/null +++ b/dist-esmodule/Light.js @@ -0,0 +1,143 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Utils, AnnotationBody, Color, PointSelector } from "./internal"; +var Light = /** @class */ (function (_super) { + __extends(Light, _super); + function Light(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.isLight = true; + _this.isModel = false; + return _this; + } + Object.defineProperty(Light.prototype, "isAmbientLight", { + get: function () { + return (Utils.normaliseType(this.getProperty("type")) === "ambientlight"); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Light.prototype, "isDirectionalLight", { + get: function () { + return (Utils.normaliseType(this.getProperty("type")) === "directionallight"); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Light.prototype, "isSpotLight", { + get: function () { + return (Utils.normaliseType(this.getProperty("type")) === "spotlight"); + }, + enumerable: false, + configurable: true + }); + Light.prototype.getColor = function () { + var hexColor = this.getProperty("color"); + if (hexColor) + return Color.fromCSS(hexColor); + else + return new Color([255, 255, 255]); // white light + }; + Object.defineProperty(Light.prototype, "Color", { + get: function () { return this.getColor(); }, + enumerable: false, + configurable: true + }); + /** + * The implementation of the intensity is based on + * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md } + * and the example 3D manifests + * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights } + * on 24 Mar 2024. The intensity property in the manifest is an object + * with declared type 'Value', a numeric property named 'value' and a + * property named unit . This implementation will only work with a unit == 'relative' + * and it will be assumed that a relative unit value of 1.0 corresponds to the + * brightest light source a rendering engine supports. + * + * This code will implement a default intensity of 1.0 + **/ + Light.prototype.getIntensity = function () { + var intObject = this.getProperty("intensity"); + if (intObject) { + try { + if (!(intObject.type === "Value" && intObject.unit === "relative")) + throw new Error(); + return intObject.value; + } + catch (err) { + throw new Error("unable to interpret raw intensity object " + JSON.stringify(intObject)); + } + } + else + return 1.0; + }; + Object.defineProperty(Light.prototype, "Intensity", { + get: function () { return this.getIntensity(); }, + enumerable: false, + configurable: true + }); + /** + * As defined in the temp-draft-4.md ( + * https://github.com/IIIF/3d/blob/main/temp-draft-4.md#lights ; 12 May 2024) + * this quantity is the half-angle of the cone of the spotlight. + * + * The inconsistency between this definition of the angle and the definition of + * fieldOfView for PerspectiveCamera (where the property value defines the full angle) has + * already been noted: https://github.com/IIIF/api/issues/2284 + * + * provisional decision is to return undefined in case that this property + * is accessed in a light that is not a spotlight + * + * + * @returns number + + **/ + Light.prototype.getAngle = function () { + if (this.isSpotLight) { + return Number(this.getProperty("angle")); + } + else { + return undefined; + } + }; + Object.defineProperty(Light.prototype, "Angle", { + get: function () { return this.getAngle(); }, + enumerable: false, + configurable: true + }); + /** + * @return : if not null, is either a PointSelector, or an object + * with an id matching the id of an Annotation instance. + **/ + Light.prototype.getLookAt = function () { + var rawObj = this.getPropertyAsObject("lookAt"); + var rawType = (rawObj["type"] || rawObj["@type"]); + if (rawType == "Annotation") { + return rawObj; + } + if (rawType == "PointSelector") { + return new PointSelector(rawObj); + } + throw new Error('unidentified value of lookAt ${rawType}'); + }; + Object.defineProperty(Light.prototype, "LookAt", { + get: function () { return this.getLookAt(); }, + enumerable: false, + configurable: true + }); + return Light; +}(AnnotationBody)); +export { Light }; +//# sourceMappingURL=Light.js.map \ No newline at end of file diff --git a/dist-esmodule/Light.js.map b/dist-esmodule/Light.js.map new file mode 100644 index 00000000..abd82933 --- /dev/null +++ b/dist-esmodule/Light.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Light.js","sourceRoot":"","sources":["../src/Light.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAEH,KAAK,EACL,cAAc,EACd,KAAK,EACL,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtC;IAA2B,yBAAc;IACvC,eAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QACvB,KAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,KAAI,CAAC,OAAO,GAAG,KAAK,CAAC;;IACvB,CAAC;IAGD,sBAAI,iCAAc;aAAlB;YACE,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAA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;YAEG,OAAO,GAAG,CAAC;IACjB,CAAC;IAED,sBAAI,4BAAS;aAAb,cAA2B,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAExD;;;;;;;;;;;;;;;OAeG;IACH,wBAAQ,GAAR;QACE,IAAI,IAAI,CAAC,WAAW,EAAC,CAAC;YAClB,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAE,CAAC;QAC9C,CAAC;aACG,CAAC;YACD,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;IAED,sBAAI,wBAAK;aAAT,cAAgC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAExD;;;OAGG;IACH,yBAAS,GAAT;QACE,IAAI,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;QAChD,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,OAAO,IAAI,YAAY,EAAC,CAAC;YACzB,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,IAAI,OAAO,IAAI,eAAe,EAAC,CAAC;YAC5B,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IACD,sBAAI,yBAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAEzD,YAAC;AAAD,CAAC,AAvGD,CAA2B,cAAc,GAuGxC"} \ No newline at end of file diff --git a/dist-esmodule/Manifest.d.ts b/dist-esmodule/Manifest.d.ts new file mode 100644 index 00000000..5bf20d3f --- /dev/null +++ b/dist-esmodule/Manifest.d.ts @@ -0,0 +1,59 @@ +import { ViewingHint, Behavior, ViewingDirection } from "@iiif/vocabulary/dist-commonjs"; +import { Canvas, IManifestoOptions, IIIFResource, ManifestType, Range, Sequence, TreeNode } from "./internal"; +/** +* @remarks Scenes are conveniently retrieved from a Manifest by iterating through +* Sequence in the Manifest, inner loop the Scenes in each sequence +* @see {@link Sequence } +* +* @example +* var manifest: Manifest; +* function doSomethingWithScene(scene:Scene)... +* ... +* foreach(var seq:Sequence of manifest.getSequences() +* foreach(var scene : Scene of seq.getScenes() +* doSomethingWithScene(scene); +**/ +export declare class Manifest extends IIIFResource { + index: number; + private _allRanges; + items: Sequence[]; + private _topRanges; + constructor(jsonld?: any, options?: IManifestoOptions); + /** @deprecated Use getAccompanyingCanvas instead */ + getPosterCanvas(): Canvas | null; + getAccompanyingCanvas(): Canvas | null; + getBehavior(): Behavior | null; + getDefaultTree(): TreeNode; + private _getTopRanges; + getTopRanges(): Range[]; + private _getRangeById; + private _parseRanges; + getAllRanges(): Range[]; + getRangeById(id: string): Range | null; + getRangeByPath(path: string): Range | null; + /** + * @returns Array of Sequence instances + **/ + getSequences(): Sequence[]; + getSequenceByIndex(sequenceIndex: number): Sequence; + getTotalSequences(): number; + getManifestType(): ManifestType; + isMultiSequence(): boolean; + isPagingEnabled(): boolean; + getViewingDirection(): ViewingDirection | null; + getViewingHint(): ViewingHint | null; + _annotationIdMap: any; + /** + * Developer Note: The concept of the "id map" appear in the + * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map + * This functionality may be available as well in the 'nodeMap' code of the + * digitalbazaar/jsonld library + * + * this very simplified version just returns a mao of id -> Annotation nodes + * in manifest + * + * THe annotationIdMap is a Javascript object whose property names are + * IRI (id values) and property values are instances of the Annotation class + **/ + get annotationIdMap(): Object; +} diff --git a/dist-esmodule/Manifest.js b/dist-esmodule/Manifest.js new file mode 100644 index 00000000..9ebeb683 --- /dev/null +++ b/dist-esmodule/Manifest.js @@ -0,0 +1,312 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ViewingHint, Behavior, ServiceProfile } from "@iiif/vocabulary/dist-commonjs"; +import { Canvas, IIIFResource, ManifestType, Range, Sequence, TreeNodeType, Utils } from "./internal"; +/** +* @remarks Scenes are conveniently retrieved from a Manifest by iterating through +* Sequence in the Manifest, inner loop the Scenes in each sequence +* @see {@link Sequence } +* +* @example +* var manifest: Manifest; +* function doSomethingWithScene(scene:Scene)... +* ... +* foreach(var seq:Sequence of manifest.getSequences() +* foreach(var scene : Scene of seq.getScenes() +* doSomethingWithScene(scene); +**/ +var Manifest = /** @class */ (function (_super) { + __extends(Manifest, _super); + function Manifest(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.index = 0; + _this._allRanges = null; + _this.items = []; + _this._topRanges = []; + if (_this.__jsonld.structures && _this.__jsonld.structures.length) { + var topRanges = _this._getTopRanges(); + for (var i = 0; i < topRanges.length; i++) { + var range = topRanges[i]; + _this._parseRanges(range, String(i)); + } + } + // initialization the cached _annotationIdMap to null + // it will be populated if and only if client calls make a request + // to the getter annotationIdMap + _this._annotationIdMap = null; + return _this; + } + /** @deprecated Use getAccompanyingCanvas instead */ + Manifest.prototype.getPosterCanvas = function () { + var posterCanvas = this.getProperty("posterCanvas"); + if (posterCanvas) { + posterCanvas = new Canvas(posterCanvas, this.options); + } + return posterCanvas; + }; + Manifest.prototype.getAccompanyingCanvas = function () { + var accompanyingCanvas = this.getProperty("accompanyingCanvas"); + if (accompanyingCanvas) { + accompanyingCanvas = new Canvas(accompanyingCanvas, this.options); + } + return accompanyingCanvas; + }; + Manifest.prototype.getBehavior = function () { + var behavior = this.getProperty("behavior"); + if (Array.isArray(behavior)) { + behavior = behavior[0]; + } + if (behavior) { + return behavior; + } + return null; + }; + Manifest.prototype.getDefaultTree = function () { + _super.prototype.getDefaultTree.call(this); + this.defaultTree.data.type = Utils.normaliseType(TreeNodeType.MANIFEST); + if (!this.isLoaded) { + return this.defaultTree; + } + var topRanges = this.getTopRanges(); + // if there are any ranges in the manifest, default to the first 'top' range or generated placeholder + if (topRanges.length) { + topRanges[0].getTree(this.defaultTree); + } + Utils.generateTreeNodeIds(this.defaultTree); + return this.defaultTree; + }; + Manifest.prototype._getTopRanges = function () { + var topRanges = []; + if (this.__jsonld.structures && this.__jsonld.structures.length) { + for (var i = 0; i < this.__jsonld.structures.length; i++) { + var json = this.__jsonld.structures[i]; + if (json.viewingHint === ViewingHint.TOP) { + topRanges.push(json); + } + } + // if no viewingHint="top" range was found, create a default one + if (!topRanges.length) { + var range = {}; + range.ranges = this.__jsonld.structures; + topRanges.push(range); + } + } + return topRanges; + }; + Manifest.prototype.getTopRanges = function () { + return this._topRanges; + }; + 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 || r.id === id) { + return r; + } + } + } + return null; + }; + //private _parseRangeCanvas(json: any, range: Range): void { + // todo: currently this isn't needed + //var canvas: IJSONLDResource = new JSONLDResource(json); + //range.items.push(canvas); + //} + Manifest.prototype._parseRanges = function (r, path, parentRange) { + var range; + var id = null; + if (typeof r === "string") { + id = r; + r = this._getRangeById(id); + } + if (!r) { + console.warn("Range:", id, "does not exist"); + return; + } + range = new Range(r, this.options); + range.parentRange = parentRange; + range.path = path; + if (!parentRange) { + this._topRanges.push(range); + } + else { + parentRange.items.push(range); + } + var items = r.items || r.members; + if (items) { + for (var i = 0; i < items.length; i++) { + var item = items[i]; + // todo: use an ItemType constant? + if ((item["@type"] && item["@type"].toLowerCase() === "sc:range") || + (item["type"] && item["type"].toLowerCase() === "range")) { + this._parseRanges(item, path + "/" + i, range); + } + else if ((item["@type"] && item["@type"].toLowerCase() === "sc:canvas") || + (item["type"] && item["type"].toLowerCase() === "canvas")) { + // store the ids on the __jsonld object to be used by Range.getCanvasIds() + if (!range.canvases) { + range.canvases = []; + } + var id_1 = item.id || item["@id"]; + range.canvases.push(id_1); + } + } + } + else if (r.ranges) { + for (var i = 0; i < r.ranges.length; i++) { + this._parseRanges(r.ranges[i], path + "/" + i, range); + } + } + }; + Manifest.prototype.getAllRanges = function () { + if (this._allRanges != null) + return this._allRanges; + this._allRanges = []; + var topRanges = this.getTopRanges(); + var _loop_1 = function (i) { + var topRange = topRanges[i]; + if (topRange.id) { + this_1._allRanges.push(topRange); // it might be a placeholder root range + } + var reducer = function (acc, next) { + acc.add(next); + var nextRanges = next.getRanges(); + if (nextRanges.length) { + return nextRanges.reduce(reducer, acc); + } + return acc; + }; + var subRanges = Array.from(topRange.getRanges().reduce(reducer, new Set())); + this_1._allRanges = this_1._allRanges.concat(subRanges); + }; + var this_1 = this; + for (var i = 0; i < topRanges.length; i++) { + _loop_1(i); + } + return this._allRanges; + }; + Manifest.prototype.getRangeById = function (id) { + var ranges = this.getAllRanges(); + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.id === id) { + return range; + } + } + return null; + }; + Manifest.prototype.getRangeByPath = function (path) { + var ranges = this.getAllRanges(); + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + if (range.path === path) { + return range; + } + } + return null; + }; + /** + * @returns Array of Sequence instances + **/ + Manifest.prototype.getSequences = function () { + if (this.items.length) { + return this.items; + } + // IxIF mediaSequences overrode sequences, so need to be checked first. + // deprecate this when presentation 3 ships + var items = this.__jsonld.mediaSequences || this.__jsonld.sequences; + if (items) { + for (var i = 0; i < items.length; i++) { + var s = items[i]; + var sequence = new Sequence(s, this.options); + this.items.push(sequence); + } + } + else if (this.__jsonld.items) { + var sequence = new Sequence(this.__jsonld.items, this.options); + this.items.push(sequence); + } + return this.items; + }; + Manifest.prototype.getSequenceByIndex = function (sequenceIndex) { + return this.getSequences()[sequenceIndex]; + }; + Manifest.prototype.getTotalSequences = function () { + return this.getSequences().length; + }; + Manifest.prototype.getManifestType = function () { + var service = (this.getService(ServiceProfile.UI_EXTENSIONS)); + if (service) { + return service.getProperty("manifestType"); + } + return ManifestType.EMPTY; + }; + Manifest.prototype.isMultiSequence = function () { + return this.getTotalSequences() > 1; + }; + Manifest.prototype.isPagingEnabled = function () { + var viewingHint = this.getViewingHint(); + if (viewingHint) { + return viewingHint === ViewingHint.PAGED; + } + var behavior = this.getBehavior(); + if (behavior) { + return behavior === Behavior.PAGED; + } + return false; + }; + Manifest.prototype.getViewingDirection = function () { + return this.getProperty("viewingDirection"); + }; + Manifest.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + Object.defineProperty(Manifest.prototype, "annotationIdMap", { + /** + * Developer Note: The concept of the "id map" appear in the + * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map + * This functionality may be available as well in the 'nodeMap' code of the + * digitalbazaar/jsonld library + * + * this very simplified version just returns a mao of id -> Annotation nodes + * in manifest + * + * THe annotationIdMap is a Javascript object whose property names are + * IRI (id values) and property values are instances of the Annotation class + **/ + get: function () { + if (this._annotationIdMap == null) { + this._annotationIdMap = {}; + for (var _i = 0, _a = this.getSequences(); _i < _a.length; _i++) { + var seq = _a[_i]; + for (var _b = 0, _c = seq.getScenes(); _b < _c.length; _b++) { + var scene = _c[_b]; + for (var _d = 0, _e = scene.getContent(); _d < _e.length; _d++) { + var anno = _e[_d]; + this._annotationIdMap[anno.id] = anno; + } + } + } + } + return this._annotationIdMap; + }, + enumerable: false, + configurable: true + }); + return Manifest; +}(IIIFResource)); +export { Manifest }; +//# sourceMappingURL=Manifest.js.map \ No newline at end of file diff --git a/dist-esmodule/Manifest.js.map b/dist-esmodule/Manifest.js.map new file mode 100644 index 00000000..f418ed0e --- /dev/null +++ b/dist-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AkB,CAAC,CAAC;IAC9C,CAAC;IAED,iCAAc,GAAd;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IACzC,CAAC;IAgBD,sBAAI,qCAAe;QAZnB;;;;;;;;;;;WAWG;aACH;YACE,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,EAAC,CAAC;gBAE/B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;gBAC3B,KAAiB,UAAmB,EAAnB,KAAA,IAAI,CAAC,YAAY,EAAE,EAAnB,cAAmB,EAAnB,IAAmB;oBAA9B,IAAI,GAAG,SAAA;oBACT,KAAkB,UAAe,EAAf,KAAA,GAAG,CAAC,SAAS,EAAE,EAAf,cAAe,EAAf,IAAe;wBAA5B,IAAI,KAAK,SAAA;wBACV,KAAiB,UAAkB,EAAlB,KAAA,KAAK,CAAC,UAAU,EAAE,EAAlB,cAAkB,EAAlB,IAAkB;4BAA9B,IAAI,IAAI,SAAA;4BACT,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;yBAAA;qBAAA;iBAAA;YAEtD,CAAC;YACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;QAC/B,CAAC;;;OAAA;IACH,eAAC;AAAD,CAAC,AA/UD,CAA8B,YAAY,GA+UzC"} \ No newline at end of file diff --git a/dist-esmodule/ManifestResource.d.ts b/dist-esmodule/ManifestResource.d.ts new file mode 100644 index 00000000..85b6d8d4 --- /dev/null +++ b/dist-esmodule/ManifestResource.d.ts @@ -0,0 +1,24 @@ +import { JSONLDResource, Thumbnail, Service, Rendering, LabelValuePair, PropertyValue, IManifestoOptions, IExternalResource } from "./internal"; +import { ServiceProfile, RenderingFormat, IIIFResourceType } from "@iiif/vocabulary/dist-commonjs"; +export declare class ManifestResource extends JSONLDResource { + externalResource: IExternalResource; + options: IManifestoOptions; + constructor(jsonld: any, options?: IManifestoOptions); + getIIIFResourceType(): IIIFResourceType; + getLabel(): PropertyValue; + getDefaultLabel(): string | null; + getMetadata(): LabelValuePair[]; + getRendering(format: RenderingFormat): Rendering | null; + getRenderings(): Rendering[]; + getRequiredStatement(): LabelValuePair | null; + getService(profile: ServiceProfile): Service | null; + getServices(): Service[]; + getThumbnail(): Thumbnail | null; + isAnnotation(): boolean; + isCanvas(): boolean; + isCollection(): boolean; + isManifest(): boolean; + isRange(): boolean; + isScene(): boolean; + isSequence(): boolean; +} diff --git a/dist-esmodule/ManifestResource.js b/dist-esmodule/ManifestResource.js new file mode 100644 index 00000000..4b1b5614 --- /dev/null +++ b/dist-esmodule/ManifestResource.js @@ -0,0 +1,135 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { JSONLDResource, Thumbnail, Utils, Rendering, LabelValuePair, PropertyValue } from "./internal"; +import { IIIFResourceType } from "@iiif/vocabulary/dist-commonjs"; +var ManifestResource = /** @class */ (function (_super) { + __extends(ManifestResource, _super); + function ManifestResource(jsonld, options) { + var _this = _super.call(this, jsonld) || this; + _this.options = options; + return _this; + } + ManifestResource.prototype.getIIIFResourceType = function () { + return Utils.normaliseType(this.getProperty("type")); + }; + ManifestResource.prototype.getLabel = function () { + var label = this.getProperty("label"); + if (label) { + return PropertyValue.parse(label, this.options.locale); + } + return new PropertyValue([], this.options.locale); + }; + ManifestResource.prototype.getDefaultLabel = function () { + return this.getLabel().getValue(this.options.locale); + }; + ManifestResource.prototype.getMetadata = function () { + var _metadata = this.getProperty("metadata"); + var metadata = []; + if (!_metadata) + return metadata; + for (var i = 0; i < _metadata.length; i++) { + var item = _metadata[i]; + var metadataItem = new LabelValuePair(this.options.locale); + metadataItem.parse(item); + metadata.push(metadataItem); + } + return metadata; + }; + ManifestResource.prototype.getRendering = function (format) { + var renderings = this.getRenderings(); + for (var i = 0; i < renderings.length; i++) { + var rendering = renderings[i]; + if (rendering.getFormat() === format) { + return rendering; + } + } + return null; + }; + ManifestResource.prototype.getRenderings = function () { + var rendering; + // if passing a manifesto-parsed object, use the __jsonld.rendering property, + // otherwise look for a rendering property + if (this.__jsonld) { + rendering = this.__jsonld.rendering; + } + else { + rendering = this.rendering; + } + var renderings = []; + if (!rendering) + return renderings; + // coerce to array + if (!Array.isArray(rendering)) { + rendering = [rendering]; + } + for (var i = 0; i < rendering.length; i++) { + var r = rendering[i]; + renderings.push(new Rendering(r, this.options)); + } + return renderings; + }; + ManifestResource.prototype.getRequiredStatement = function () { + var requiredStatement = null; + var _requiredStatement = this.getProperty("requiredStatement"); + if (_requiredStatement) { + requiredStatement = new LabelValuePair(this.options.locale); + requiredStatement.parse(_requiredStatement); + } + return requiredStatement; + }; + ManifestResource.prototype.getService = function (profile) { + return Utils.getService(this, profile); + }; + ManifestResource.prototype.getServices = function () { + return Utils.getServices(this); + }; + ManifestResource.prototype.getThumbnail = function () { + var thumbnail = this.getProperty("thumbnail"); + if (Array.isArray(thumbnail)) { + thumbnail = thumbnail[0]; + } + if (thumbnail) { + return new Thumbnail(thumbnail, this.options); + } + return null; + }; + ManifestResource.prototype.isAnnotation = function () { + return this.getIIIFResourceType() === IIIFResourceType.ANNOTATION; + }; + ManifestResource.prototype.isCanvas = function () { + return this.getIIIFResourceType() === IIIFResourceType.CANVAS; + }; + ManifestResource.prototype.isCollection = function () { + return this.getIIIFResourceType() === IIIFResourceType.COLLECTION; + }; + ManifestResource.prototype.isManifest = function () { + return this.getIIIFResourceType() === IIIFResourceType.MANIFEST; + }; + ManifestResource.prototype.isRange = function () { + return this.getIIIFResourceType() === IIIFResourceType.RANGE; + }; + // this different implementation is necessary until such time as the + // SCENE is added to the @iiif/vocabulary package. + ManifestResource.prototype.isScene = function () { + return this.getIIIFResourceType() === Utils.normaliseType('Scene'); + }; + ManifestResource.prototype.isSequence = function () { + return this.getIIIFResourceType() === IIIFResourceType.SEQUENCE; + }; + return ManifestResource; +}(JSONLDResource)); +export { ManifestResource }; +//# sourceMappingURL=ManifestResource.js.map \ No newline at end of file diff --git a/dist-esmodule/ManifestResource.js.map b/dist-esmodule/ManifestResource.js.map new file mode 100644 index 00000000..89d9ab4a --- /dev/null +++ b/dist-esmodule/ManifestResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ManifestResource.js","sourceRoot":"","sources":["../src/ManifestResource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,cAAc,EACd,SAAS,EAET,KAAK,EACL,SAAS,EACT,cAAc,EACd,aAAa,EAGd,MAAM,YAAY,CAAC;AACpB,OAAO,EAGL,gBAAgB,EACjB,MAAM,gCAAgC,CAAC;AAExC;IAAsC,oCAAc;IAIlD,0BAAY,MAAW,EAAE,OAA2B;QAClD,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QACd,KAAI,CAAC,OAAO,GAAsB,OAAO,CAAC;;IAC5C,CAAC;IAED,8CAAmB,GAAnB;QACE,OAAyB,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,mCAAQ,GAAR;QACE,IAAM,KAAK,GAAQ,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAE7C,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,IAAI,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAED,0CAAe,GA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AC;QAEnD,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,IAAI,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uCAAY,GAAZ;QACE,OAAO,IAAI,CAAC,mBAAmB,EAAE,KAAK,gBAAgB,CAAC,UAAU,CAAC;IACpE,CAAC;IAED,mCAAQ,GAAR;QACE,OAAO,IAAI,CAAC,mBAAmB,EAAE,KAAK,gBAAgB,CAAC,MAAM,CAAC;IAChE,CAAC;IAED,uCAAY,GAAZ;QACE,OAAO,IAAI,CAAC,mBAAmB,EAAE,KAAK,gBAAgB,CAAC,UAAU,CAAC;IACpE,CAAC;IAED,qCAAU,GAAV;QACE,OAAO,IAAI,CAAC,mBAAmB,EAAE,KAAK,gBAAgB,CAAC,QAAQ,CAAC;IAClE,CAAC;IAED,kCAAO,GAAP;QACE,OAAO,IAAI,CAAC,mBAAmB,EAAE,KAAK,gBAAgB,CAAC,KAAK,CAAC;IAC/D,CAAC;IAED,qEAAqE;IACrE,kDAAkD;IAClD,kCAAO,GAAP;QACE,OAAO,IAAI,CAAC,mBAAmB,EAAE,KAAuB,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACvF,CAAC;IAED,qCAAU,GAAV;QACE,OAAO,IAAI,CAAC,mBAAmB,EAAE,KAAK,gBAAgB,CAAC,QAAQ,CAAC;IAClE,CAAC;IACH,uBAAC;AAAD,CAAC,AAvJD,CAAsC,cAAc,GAuJnD"} \ No newline at end of file diff --git a/dist-esmodule/ManifestType.d.ts b/dist-esmodule/ManifestType.d.ts new file mode 100644 index 00000000..a6fe49a2 --- /dev/null +++ b/dist-esmodule/ManifestType.d.ts @@ -0,0 +1,5 @@ +export declare enum ManifestType { + EMPTY = "", + MANUSCRIPT = "manuscript", + MONOGRAPH = "monograph" +} diff --git a/dist-esmodule/ManifestType.js b/dist-esmodule/ManifestType.js new file mode 100644 index 00000000..99b12cf9 --- /dev/null +++ b/dist-esmodule/ManifestType.js @@ -0,0 +1,7 @@ +export var ManifestType; +(function (ManifestType) { + ManifestType["EMPTY"] = ""; + ManifestType["MANUSCRIPT"] = "manuscript"; + ManifestType["MONOGRAPH"] = "monograph"; +})(ManifestType || (ManifestType = {})); +//# sourceMappingURL=ManifestType.js.map \ No newline at end of file diff --git a/dist-esmodule/ManifestType.js.map b/dist-esmodule/ManifestType.js.map new file mode 100644 index 00000000..aab83d88 --- /dev/null +++ b/dist-esmodule/ManifestType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ManifestType.js","sourceRoot":"","sources":["../src/ManifestType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,0BAAU,CAAA;IACV,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;AACzB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB"} \ No newline at end of file diff --git a/dist-esmodule/PointSelector.d.ts b/dist-esmodule/PointSelector.d.ts new file mode 100644 index 00000000..6da73cf8 --- /dev/null +++ b/dist-esmodule/PointSelector.d.ts @@ -0,0 +1,14 @@ +import { JSONLDResource } from "./internal"; +import { Vector3 } from "threejs-math"; +export declare class PointSelector extends JSONLDResource { + isPointSelector: boolean; + constructor(jsonld: any); + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ + getLocation(): Vector3; + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ + get Location(): Vector3; +} diff --git a/dist-esmodule/PointSelector.js b/dist-esmodule/PointSelector.js new file mode 100644 index 00000000..92c5f39b --- /dev/null +++ b/dist-esmodule/PointSelector.js @@ -0,0 +1,42 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { JSONLDResource, } from "./internal"; +import { Vector3 } from "threejs-math"; +var PointSelector = /** @class */ (function (_super) { + __extends(PointSelector, _super); + function PointSelector(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isPointSelector = true; + return _this; + } + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ + PointSelector.prototype.getLocation = function () { + return new Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z); + }; + Object.defineProperty(PointSelector.prototype, "Location", { + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ + get: function () { return this.getLocation(); }, + enumerable: false, + configurable: true + }); + return PointSelector; +}(JSONLDResource)); +export { PointSelector }; +//# sourceMappingURL=PointSelector.js.map \ No newline at end of file diff --git a/dist-esmodule/PointSelector.js.map b/dist-esmodule/PointSelector.js.map new file mode 100644 index 00000000..4c705fac --- /dev/null +++ b/dist-esmodule/PointSelector.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PointSelector.js","sourceRoot":"","sources":["../src/PointSelector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEL,cAAc,GAEf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;IAAmC,iCAAc;IAI/C,uBAAY,MAAW;QACrB,YAAA,MAAK,YAAC,MAAM,CAAC,SAAC;QAHhB,qBAAe,GAAa,IAAI,CAAC;;IAIjC,CAAC;IAED;;OAEG;IACH,mCAAW,GAAX;QACE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAE,CAAC;IACzE,CAAC;IAKD,sBAAI,mCAAQ;QAHZ;;WAEG;aACH,cAA2B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;;;OAAA;IACzD,oBAAC;AAAD,CAAC,AAnBD,CAAmC,cAAc,GAmBhD"} \ No newline at end of file diff --git a/dist-esmodule/PropertyValue.d.ts b/dist-esmodule/PropertyValue.d.ts new file mode 100644 index 00000000..415e6cea --- /dev/null +++ b/dist-esmodule/PropertyValue.d.ts @@ -0,0 +1,58 @@ +import Language from "./Language"; +/** Utility class to hold one or more values with their associated (optional) locale */ +export declare class LocalizedValue implements Language { + _value: string | string[]; + _locale?: string; + _defaultLocale: string; + /** Parse a localized value from a IIIF v2 property value + * + * @param {string | string[] | object | object[]} rawVal value from IIIF resource + * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value + */ + static parseV2Value(rawVal: any, defaultLocale?: string): LocalizedValue | null; + constructor(value: string | string[], locale?: string, defaultLocale?: string); + /*** @deprecated Use PropertyValue#getValue instead */ + get value(): string; + /*** @deprecated Don't use, only used for backwards compatibility reasons */ + get locale(): string; + addValue(value: string | string[]): void; +} +/*** + * Holds a collection of values and their (optional) languages and allows + * language-based value retrieval as per the algorithm described in + * https://iiif.io/api/presentation/2.1/#language-of-property-values + */ +export declare class PropertyValue extends Array { + _defaultLocale?: string; + static parse(rawVal: any, defaultLocale?: string): PropertyValue; + constructor(values?: LocalizedValue[], defaultLocale?: string); + /*** Try to find the available locale that best fit's the user's preferences. */ + private getSuitableLocale; + /** + * Set the value(s) for a given locale. + * + * If there's an existing locale that matches the given locale, it will be updated. + * + * @param locale Locale to set the value for + * @param value value to set + */ + setValue(value: string | string[], locale?: string): void; + /** + * Get a value in the most suitable locale. + * + * @param {string | string[] | undefined} locales Desired locale, can be a list of + * locales sorted by descending priority. + * @param {string | undefined} joinWith String to join multiple available values by, + * if undefined only the first available value will be returned + * @returns the first value in the most suitable locale or null if none could be found + */ + getValue(locales?: string | string[], joinWith?: string): string | null; + /** + * Get all values available in the most suitable locale. + * + * @param {string | string[]} userLocales Desired locale, can be a list of + * locales sorted by descending priority. + * @returns the values for the most suitable locale, empty if none could be found + */ + getValues(userLocales?: string | string[]): string[]; +} diff --git a/dist-esmodule/PropertyValue.js b/dist-esmodule/PropertyValue.js new file mode 100644 index 00000000..9709af93 --- /dev/null +++ b/dist-esmodule/PropertyValue.js @@ -0,0 +1,289 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Utils } from "./Utils"; +/** Utility class to hold one or more values with their associated (optional) locale */ +var LocalizedValue = /** @class */ (function () { + function LocalizedValue(value, locale, defaultLocale) { + if (defaultLocale === void 0) { defaultLocale = "none"; } + if (Array.isArray(value) && value.length === 1) { + this._value = value[0]; + } + else { + this._value = value; + } + if (locale === "none" || locale === "@none") { + locale = undefined; + } + this._locale = locale; + this._defaultLocale = defaultLocale; + } + /** Parse a localized value from a IIIF v2 property value + * + * @param {string | string[] | object | object[]} rawVal value from IIIF resource + * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value + */ + LocalizedValue.parseV2Value = function (rawVal, defaultLocale) { + if (typeof rawVal === "string") { + return new LocalizedValue(rawVal, undefined, defaultLocale); + } + else if (rawVal["@value"]) { + return new LocalizedValue(rawVal["@value"], rawVal["@language"], defaultLocale); + } + return null; + }; + Object.defineProperty(LocalizedValue.prototype, "value", { + /*** @deprecated Use PropertyValue#getValue instead */ + get: function () { + if (Array.isArray(this._value)) { + return this._value.join("
"); + } + return this._value; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(LocalizedValue.prototype, "locale", { + /*** @deprecated Don't use, only used for backwards compatibility reasons */ + get: function () { + if (this._locale === undefined) { + return this._defaultLocale; + } + return this._locale; + }, + enumerable: false, + configurable: true + }); + LocalizedValue.prototype.addValue = function (value) { + if (!Array.isArray(this._value)) { + this._value = [this._value]; + } + if (Array.isArray(value)) { + this._value = this._value.concat(value); + } + else { + this._value.push(value); + } + }; + return LocalizedValue; +}()); +export { LocalizedValue }; +/*** + * Holds a collection of values and their (optional) languages and allows + * language-based value retrieval as per the algorithm described in + * https://iiif.io/api/presentation/2.1/#language-of-property-values + */ +var PropertyValue = /** @class */ (function (_super) { + __extends(PropertyValue, _super); + function PropertyValue(values, defaultLocale) { + if (values === void 0) { values = []; } + var _this = _super.apply(this, values) || this; + // Needed for ES5 compatibility, see https://stackoverflow.com/a/40967939 + _this.__proto__ = PropertyValue.prototype; + _this._defaultLocale = defaultLocale; + return _this; + } + PropertyValue.parse = function (rawVal, defaultLocale) { + if (!rawVal) { + return new PropertyValue([], defaultLocale); + } + if (Array.isArray(rawVal)) { + // Collection of IIIF v2 property values + var parsed = rawVal + .map(function (v) { return LocalizedValue.parseV2Value(v, defaultLocale); }) + .filter(function (v) { return v !== null; }); + var byLocale = parsed.reduce(function (acc, lv) { + var loc = lv._locale; + if (!loc) { + // Cannot use undefined as an object key + loc = "none"; + } + if (acc[loc]) { + acc[loc].addValue(lv._value); + } + else { + acc[loc] = lv; + } + return acc; + }, {}); + return new PropertyValue(Object.values(byLocale), defaultLocale); + } + else if (typeof rawVal === "string") { + return new PropertyValue([new LocalizedValue(rawVal, undefined, defaultLocale)], defaultLocale); + } + else if (rawVal["@language"]) { + // Single IIIF v2 property value + var parsed = LocalizedValue.parseV2Value(rawVal); + return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale); + } + else if (rawVal["@value"]) { + // Single IIIF v2 property value without language + var parsed = LocalizedValue.parseV2Value(rawVal); + return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale); + } + else { + // IIIF v3 property value + return new PropertyValue(Object.keys(rawVal).map(function (locale) { + var val = rawVal[locale]; + if (!Array.isArray(val)) { + throw new Error("A IIIF v3 localized property value must have an array as the value for a given language."); + } + return new LocalizedValue(val, locale, defaultLocale); + }), defaultLocale); + } + }; + /*** Try to find the available locale that best fit's the user's preferences. */ + PropertyValue.prototype.getSuitableLocale = function (locales) { + // If any of the values have a language associated with them, the client + // must display all of the values associated with the language that best + // matches the language preference. + if (locales.length == 0 && this._defaultLocale) + locales.push(this._defaultLocale); + // create an array of the language codes for all different LocalizedValue instances in this PropertyValue + var allLocales = new Array(); + for (var _i = 0, _a = this; _i < _a.length; _i++) { + var lv = _a[_i]; + if (lv._locale != undefined) + allLocales.push(lv._locale); + } + var _loop_1 = function (userLocale) { + var matchingLocale = allLocales.find(function (l) { return l === userLocale; }); + if (matchingLocale) { + return { value: matchingLocale }; + } + }; + // First, look for a precise match + for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) { + var userLocale = locales_1[_b]; + var state_1 = _loop_1(userLocale); + if (typeof state_1 === "object") + return state_1.value; + } + var _loop_2 = function (userLocale) { + var matchingLocale = allLocales.find(function (l) { return Utils.getInexactLocale(l) === Utils.getInexactLocale(userLocale); }); + if (matchingLocale) { + return { value: matchingLocale }; + } + }; + // Look for an inexact match + for (var _c = 0, locales_2 = locales; _c < locales_2.length; _c++) { + var userLocale = locales_2[_c]; + var state_2 = _loop_2(userLocale); + if (typeof state_2 === "object") + return state_2.value; + } + return undefined; + }; + /** + * Set the value(s) for a given locale. + * + * If there's an existing locale that matches the given locale, it will be updated. + * + * @param locale Locale to set the value for + * @param value value to set + */ + PropertyValue.prototype.setValue = function (value, locale) { + var existing = undefined; + if (!locale) { + existing = this.find(function (lv) { return lv._locale === undefined; }); + } + else { + var bestLocale_1 = this.getSuitableLocale([locale]); + if (bestLocale_1) { + existing = this.find(function (lv) { return lv._locale === bestLocale_1; }); + } + } + if (existing) { + // Mutate existing localized value + existing._value = value; + } + else { + // Create a new localized value + this.push(new LocalizedValue(value, locale, this._defaultLocale)); + } + }; + /** + * Get a value in the most suitable locale. + * + * @param {string | string[] | undefined} locales Desired locale, can be a list of + * locales sorted by descending priority. + * @param {string | undefined} joinWith String to join multiple available values by, + * if undefined only the first available value will be returned + * @returns the first value in the most suitable locale or null if none could be found + */ + PropertyValue.prototype.getValue = function (locales, joinWith) { + var vals = this.getValues(locales); + if (vals.length === 0) { + return null; + } + if (joinWith) { + return vals.join(joinWith); + } + return vals[0]; + }; + /** + * Get all values available in the most suitable locale. + * + * @param {string | string[]} userLocales Desired locale, can be a list of + * locales sorted by descending priority. + * @returns the values for the most suitable locale, empty if none could be found + */ + PropertyValue.prototype.getValues = function (userLocales) { + if (!this.length) { + return []; + } + var locales; + if (!userLocales) { + locales = []; + } + else if (!Array.isArray(userLocales)) { + locales = [userLocales]; + } + else { + locales = userLocales; + } + // If none of the values have a language associated with them, the client + // must display all of the values. + if (this.length === 1 && this[0]._locale === undefined) { + var val = this[0]._value; + return Array.isArray(val) ? val : [val]; + } + // Try to determine the available locale that best fits the user's preferences + var matchingLocale = this.getSuitableLocale(locales); + if (matchingLocale) { + var val = this.find(function (lv) { return lv._locale === matchingLocale; })._value; + return Array.isArray(val) ? val : [val]; + } + // If all of the values have a language associated with them, and none match + // the language preference, the client must select a language and display + // all of the values associated with that language. + var allHaveLang = !this.find(function (lv) { return lv._locale === undefined; }); + if (allHaveLang) { + var val = this[0]._value; + return Array.isArray(val) ? val : [val]; + } + // If some of the values have a language associated with them, but none + // match the language preference, the client must display all of the values + // that do not have a language associated with them. + var lv = this.find(function (lv) { return lv._locale === undefined; }); + if (lv) { + return Array.isArray(lv._value) ? lv._value : [lv._value]; + } + return []; + }; + return PropertyValue; +}(Array)); +export { PropertyValue }; +//# sourceMappingURL=PropertyValue.js.map \ No newline at end of file diff --git a/dist-esmodule/PropertyValue.js.map b/dist-esmodule/PropertyValue.js.map new file mode 100644 index 00000000..53313a65 --- /dev/null +++ b/dist-esmodule/PropertyValue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PropertyValue.js","sourceRoot":"","sources":["../src/PropertyValue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,uFAAuF;AACvF;IA4BE,wBACE,KAAwB,EACxB,MAAe,EACf,aAA8B;QAA9B,8BAAA,EAAA,sBAA8B;QAE9B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;QACD,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YAC5C,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IApCD;;;;OAIG;IACI,2BAAY,GAAnB,UACE,MAAW,EACX,aAAsB;QAEtB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QAC9D,CAAC;aAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,cAAc,CACvB,MAAM,CAAC,QAAQ,CAAC,EAChB,MAAM,CAAC,WAAW,CAAC,EACnB,aAAa,CACd,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CA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QACpD,IAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,OAAO,KAAK,SAAS,EAAxB,CAAwB,CAAC,CAAC;QACrD,IAAI,EAAE,EAAE,CAAC;YACP,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAC5D,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,oBAAC;AAAD,CAAC,AA3MD,CAAmC,KAAK,GA2MvC"} \ No newline at end of file diff --git a/dist-esmodule/Range.d.ts b/dist-esmodule/Range.d.ts new file mode 100644 index 00000000..4b14fb6a --- /dev/null +++ b/dist-esmodule/Range.d.ts @@ -0,0 +1,20 @@ +import { Duration, IManifestoOptions, ManifestResource, TreeNode } from "./internal"; +import { Behavior, ViewingDirection, ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +export declare class Range extends ManifestResource { + private _ranges; + canvases: string[] | null; + items: ManifestResource[]; + parentRange: Range | undefined; + path: string; + treeNode: TreeNode; + constructor(jsonld?: any, options?: IManifestoOptions); + getCanvasIds(): string[]; + getDuration(): Duration | undefined; + getRanges(): Range[]; + getBehavior(): Behavior | null; + getViewingDirection(): ViewingDirection | null; + getViewingHint(): ViewingHint | null; + getTree(treeRoot: TreeNode): TreeNode; + spansTime(time: number): boolean; + private _parseTreeNode; +} diff --git a/dist-esmodule/Range.js b/dist-esmodule/Range.js new file mode 100644 index 00000000..57d87d0c --- /dev/null +++ b/dist-esmodule/Range.js @@ -0,0 +1,198 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Duration, ManifestResource, TreeNode, TreeNodeType, Utils } from "./internal"; +import { Behavior } from "@iiif/vocabulary/dist-commonjs"; +var Range = /** @class */ (function (_super) { + __extends(Range, _super); + function Range(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this._ranges = null; + _this.canvases = null; + _this.items = []; + return _this; + } + Range.prototype.getCanvasIds = function () { + if (this.__jsonld.canvases) { + return this.__jsonld.canvases; + } + else if (this.canvases) { + return this.canvases; + } + return []; + }; + Range.prototype.getDuration = function () { + // For this implementation, we want to catch SOME of the temporal cases - i.e. when there is a t=1,100 + if (this.canvases && this.canvases.length) { + var startTimes = []; + var endTimes = []; + // When we loop through all of the canvases we store the recorded start and end times. + // Then we choose the maximum and minimum values from this. This will give us a more accurate duration for the + // Chosen range. However this is still not perfect and does not cover more complex ranges. These cases are out of + // scope for this change. + for (var _i = 0, _a = this.canvases; _i < _a.length; _i++) { + var canvas = _a[_i]; + if (!canvas) + continue; + var _b = (canvas.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [undefined, canvas]), canvasId = _b[1], start_1 = _b[2], end_1 = _b[3]; + if (canvasId) { + startTimes.push(parseFloat(start_1)); + endTimes.push(parseFloat(end_1)); + } + } + if (startTimes.length && endTimes.length) { + return new Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes)); + } + } + else { + // get child ranges and calculate the start and end based on them + var childRanges = this.getRanges(); + var startTimes = []; + var endTimes = []; + // Once again, we use a max/min to get the ranges. + for (var _c = 0, childRanges_1 = childRanges; _c < childRanges_1.length; _c++) { + var childRange = childRanges_1[_c]; + var duration = childRange.getDuration(); + if (duration) { + startTimes.push(duration.start); + endTimes.push(duration.end); + } + } + // And return the minimum as the start, and the maximum as the end. + if (startTimes.length && endTimes.length) { + return new Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes)); + } + } + var start; + var end; + // There are 2 paths for this implementation. Either we have a list of canvases, or a list of ranges + // which may have a list of ranges. + // This is one of the limitations of this implementation. + if (this.canvases && this.canvases.length) { + // When we loop through each of the canvases we are expecting to see a fragment or a link to the whole canvas. + // For example - if we have http://example.org/canvas#t=1,100 it will extract 1 and 100 as the start and end. + for (var i = 0; i < this.canvases.length; i++) { + var canvas = this.canvases[i]; + var temporal = Utils.getTemporalComponent(canvas); + if (temporal && temporal.length > 1) { + if (i === 0) { + // Note: Cannot guarantee ranges are sequential (fixed above) + start = Number(temporal[0]); + } + if (i === this.canvases.length - 1) { + end = Number(temporal[1]); // Note: The end of this duration may be targeting a different canvas. + } + } + } + } + else { + // In this second case, where there are nested ranges, we recursively get the duration + // from each of the child ranges (a start and end) and then choose the first and last for the bounds of this range. + var childRanges = this.getRanges(); + for (var i = 0; i < childRanges.length; i++) { + var childRange = childRanges[i]; + var duration = childRange.getDuration(); + if (duration) { + if (i === 0) { + start = duration.start; + } + if (i === childRanges.length - 1) { + end = duration.end; + } + } + } + } + if (start !== undefined && end !== undefined) { + return new Duration(start, end); + } + return undefined; + }; + // getCanvases(): ICanvas[] { + // if (this._canvases) { + // return this._canvases; + // } + // return this._canvases = this.items.en().where(m => m.isCanvas()).toArray(); + // } + Range.prototype.getRanges = function () { + if (this._ranges) { + return this._ranges; + } + return (this._ranges = this.items.filter(function (m) { return m.isRange(); })); + }; + Range.prototype.getBehavior = function () { + var behavior = this.getProperty("behavior"); + if (Array.isArray(behavior)) { + behavior = behavior[0]; + } + if (behavior) { + return behavior; + } + return null; + }; + Range.prototype.getViewingDirection = function () { + return this.getProperty("viewingDirection"); + }; + Range.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + Range.prototype.getTree = function (treeRoot) { + treeRoot.data = this; + this.treeNode = treeRoot; + var ranges = this.getRanges(); + if (ranges && ranges.length) { + for (var i = 0; i < ranges.length; i++) { + var range = ranges[i]; + var node = new TreeNode(); + treeRoot.addNode(node); + this._parseTreeNode(node, range); + } + } + Utils.generateTreeNodeIds(treeRoot); + return treeRoot; + }; + Range.prototype.spansTime = function (time) { + var duration = this.getDuration(); + if (duration) { + if (time >= duration.start && time <= duration.end) { + return true; + } + } + return false; + }; + Range.prototype._parseTreeNode = function (node, range) { + node.label = range.getLabel().getValue(this.options.locale); + node.data = range; + node.data.type = Utils.normaliseType(TreeNodeType.RANGE); + range.treeNode = node; + var ranges = range.getRanges(); + if (ranges && ranges.length) { + for (var i = 0; i < ranges.length; i++) { + var childRange = ranges[i]; + var behavior = childRange.getBehavior(); + if (behavior === Behavior.NO_NAV) { + continue; + } + else { + var childNode = new TreeNode(); + node.addNode(childNode); + this._parseTreeNode(childNode, childRange); + } + } + } + }; + return Range; +}(ManifestResource)); +export { Range }; +//# sourceMappingURL=Range.js.map \ No newline at end of file diff --git a/dist-esmodule/Range.js.map b/dist-esmodule/Range.js.map new file mode 100644 index 00000000..e884b786 --- /dev/null +++ b/dist-esmodule/Range.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Range.js","sourceRoot":"","sources":["../src/Range.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,QAAQ,EAER,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,KAAK,EACN,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,QAAQ,EAGT,MAAM,gCAAgC,CAAC;AAExC;IAA2B,yBAAgB;IAQzC,eAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QARjB,aAAO,GAAmB,IAAI,CAAC;QAChC,cAAQ,GAAoB,IAAI,CAAC;QACjC,WAAK,GAAuB,EAAE,CAAC;;IAOtC,CAAC;IAED,4BAAY,GAAZ;QACE,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YAC3B,OAAO,IAAI,CA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M,SAAS,GAAa,IAAI,QAAQ,EAAE,CAAC;oBAC3C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;oBACxB,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBAC7C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACH,YAAC;AAAD,CAAC,AArND,CAA2B,gBAAgB,GAqN1C"} \ No newline at end of file diff --git a/dist-esmodule/Rendering.d.ts b/dist-esmodule/Rendering.d.ts new file mode 100644 index 00000000..59b3fa48 --- /dev/null +++ b/dist-esmodule/Rendering.d.ts @@ -0,0 +1,6 @@ +import { RenderingFormat } from "@iiif/vocabulary/dist-commonjs"; +import { IManifestoOptions, ManifestResource } from "./internal"; +export declare class Rendering extends ManifestResource { + constructor(jsonld?: any, options?: IManifestoOptions); + getFormat(): RenderingFormat; +} diff --git a/dist-esmodule/Rendering.js b/dist-esmodule/Rendering.js new file mode 100644 index 00000000..568ec8a0 --- /dev/null +++ b/dist-esmodule/Rendering.js @@ -0,0 +1,28 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ManifestResource } from "./internal"; +var Rendering = /** @class */ (function (_super) { + __extends(Rendering, _super); + function Rendering(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + Rendering.prototype.getFormat = function () { + return this.getProperty("format"); + }; + return Rendering; +}(ManifestResource)); +export { Rendering }; +//# sourceMappingURL=Rendering.js.map \ No newline at end of file diff --git a/dist-esmodule/Rendering.js.map b/dist-esmodule/Rendering.js.map new file mode 100644 index 00000000..c9e157a0 --- /dev/null +++ b/dist-esmodule/Rendering.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Rendering.js","sourceRoot":"","sources":["../src/Rendering.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAqB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEjE;IAA+B,6BAAgB;IAC7C,mBAAY,MAAY,EAAE,OAA2B;QACnD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IAED,6BAAS,GAAT;QACE,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IACH,gBAAC;AAAD,CAAC,AARD,CAA+B,gBAAgB,GAQ9C"} \ No newline at end of file diff --git a/dist-esmodule/Resource.d.ts b/dist-esmodule/Resource.d.ts new file mode 100644 index 00000000..e41ff9a2 --- /dev/null +++ b/dist-esmodule/Resource.d.ts @@ -0,0 +1,13 @@ +import { ExternalResourceType, MediaType } from "@iiif/vocabulary/dist-commonjs"; +import { Annotation, IManifestoOptions, ManifestResource } from "./internal"; +export declare class Resource extends ManifestResource { + index: number; + constructor(jsonld?: any, options?: IManifestoOptions); + getFormat(): MediaType | null; + getResources(): Annotation[]; + getType(): ExternalResourceType | null; + getWidth(): number; + getHeight(): number; + getMaxWidth(): number; + getMaxHeight(): number | null; +} diff --git a/dist-esmodule/Resource.js b/dist-esmodule/Resource.js new file mode 100644 index 00000000..38f7eb32 --- /dev/null +++ b/dist-esmodule/Resource.js @@ -0,0 +1,68 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Annotation, ManifestResource, Utils } from "./internal"; +var Resource = /** @class */ (function (_super) { + __extends(Resource, _super); + function Resource(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + Resource.prototype.getFormat = function () { + var format = this.getProperty("format"); + if (format) { + return format.toLowerCase(); + } + return null; + }; + Resource.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]; + var annotation = new Annotation(a, this.options); + resources.push(annotation); + } + return resources; + }; + Resource.prototype.getType = function () { + var type = this.getProperty("type"); + if (type) { + return Utils.normaliseType(type); + } + return 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 a maxHeight hasn't been specified, default to maxWidth. + // maxWidth in essence becomes maxEdge + if (!maxHeight) { + return this.getMaxWidth(); + } + return null; + }; + return Resource; +}(ManifestResource)); +export { Resource }; +//# sourceMappingURL=Resource.js.map \ No newline at end of file diff --git a/dist-esmodule/Resource.js.map b/dist-esmodule/Resource.js.map new file mode 100644 index 00000000..35c83b08 --- /dev/null +++ b/dist-esmodule/Resource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Resource.js","sourceRoot":"","sources":["../src/Resource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,OAAO,EACL,UAAU,EAEV,gBAAgB,EAChB,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB;IAA8B,4BAAgB;IAG5C,kBAAY,MAAY,EAAE,OAA2B;QACnD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB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AAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAEhD,6DAA6D;QAC7D,sCAAsC;QACtC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IACH,eAAC;AAAD,CAAC,AAhED,CAA8B,gBAAgB,GAgE7C"} \ No newline at end of file diff --git a/dist-esmodule/RotateTransform.d.ts b/dist-esmodule/RotateTransform.d.ts new file mode 100644 index 00000000..d6d62b88 --- /dev/null +++ b/dist-esmodule/RotateTransform.d.ts @@ -0,0 +1,5 @@ +import { Transform } from "./internal"; +export declare class RotateTransform extends Transform { + constructor(jsonld?: any); + getRotation(): object; +} diff --git a/dist-esmodule/RotateTransform.js b/dist-esmodule/RotateTransform.js new file mode 100644 index 00000000..fa2242c2 --- /dev/null +++ b/dist-esmodule/RotateTransform.js @@ -0,0 +1,37 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Transform } from "./internal"; +var RotateTransform = /** @class */ (function (_super) { + __extends(RotateTransform, _super); + function RotateTransform(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isRotateTransform = true; + return _this; + } + RotateTransform.prototype.getRotation = function () { + var retVal = {}; + for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) { + var attrib = _a[_i]; + var raw = this.__jsonld[attrib]; + retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0; + } + return retVal; + }; + return RotateTransform; +}(Transform)); +export { RotateTransform }; +; +//# sourceMappingURL=RotateTransform.js.map \ No newline at end of file diff --git a/dist-esmodule/RotateTransform.js.map b/dist-esmodule/RotateTransform.js.map new file mode 100644 index 00000000..3d238a36 --- /dev/null +++ b/dist-esmodule/RotateTransform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RotateTransform.js","sourceRoot":"","sources":["../src/RotateTransform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACH,SAAS,EACZ,MAAM,YAAY,CAAC;AAEpB;IAAqC,mCAAS;IAC1C,yBAAY,MAAY;QACpB,YAAA,MAAK,YAAE,MAAM,CAAE,SAAC;QAChB,KAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;;IAElC,CAAC;IAGD,qCAAW,GAAX;QACI,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAqB,UAAa,EAAb,MAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC,EAAb,cAAa,EAAb,IAAa,EAAC,CAAC;YAA/B,IAAM,MAAM,SAAA;YACb,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAA,CAAC,CAAA,MAAM,CAAC,GAAG,CAAC,CAAA,CAAC,CAAA,GAAG,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEL,sBAAC;AAAD,CAAC,AAjBD,CAAqC,SAAS,GAiB7C;;AAAA,CAAC"} \ No newline at end of file diff --git a/dist-esmodule/ScaleTransform.d.ts b/dist-esmodule/ScaleTransform.d.ts new file mode 100644 index 00000000..db2b44b2 --- /dev/null +++ b/dist-esmodule/ScaleTransform.d.ts @@ -0,0 +1,5 @@ +import { Transform } from "./internal"; +export declare class ScaleTransform extends Transform { + constructor(jsonld?: any); + getScale(): object; +} diff --git a/dist-esmodule/ScaleTransform.js b/dist-esmodule/ScaleTransform.js new file mode 100644 index 00000000..e6b3daa3 --- /dev/null +++ b/dist-esmodule/ScaleTransform.js @@ -0,0 +1,38 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Transform } from "./internal"; +var ScaleTransform = /** @class */ (function (_super) { + __extends(ScaleTransform, _super); + function ScaleTransform(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isScaleTransform = true; + return _this; + } + ScaleTransform.prototype.getScale = function () { + var retVal = {}; + for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) { + var attrib = _a[_i]; + var raw = this.__jsonld[attrib]; + // note that default scaling is 1.0 + retVal[attrib] = (raw !== undefined) ? Number(raw) : 1.0; + } + return retVal; + }; + return ScaleTransform; +}(Transform)); +export { ScaleTransform }; +; +//# sourceMappingURL=ScaleTransform.js.map \ No newline at end of file diff --git a/dist-esmodule/ScaleTransform.js.map b/dist-esmodule/ScaleTransform.js.map new file mode 100644 index 00000000..b29c4145 --- /dev/null +++ b/dist-esmodule/ScaleTransform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ScaleTransform.js","sourceRoot":"","sources":["../src/ScaleTransform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACH,SAAS,EACZ,MAAM,YAAY,CAAC;AAEpB;IAAoC,kCAAS;IACzC,wBAAY,MAAY;QACpB,YAAA,MAAK,YAAC,MAAM,CAAE,SAAC;QACf,KAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;;IACjC,CAAC;IAED,iCAAQ,GAAR;QACI,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAqB,UAAa,EAAb,MAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC,EAAb,cAAa,EAAb,IAAa,EAAC,CAAC;YAA/B,IAAM,MAAM,SAAA;YACb,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAEhC,mCAAmC;YACnC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAA,CAAC,CAAA,MAAM,CAAC,GAAG,CAAC,CAAA,CAAC,CAAA,GAAG,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEL,qBAAC;AAAD,CAAC,AAjBD,CAAoC,SAAS,GAiB5C;;AAAA,CAAC"} \ No newline at end of file diff --git a/dist-esmodule/Scene.d.ts b/dist-esmodule/Scene.d.ts new file mode 100644 index 00000000..2ffc8f6e --- /dev/null +++ b/dist-esmodule/Scene.d.ts @@ -0,0 +1,8 @@ +import { Annotation, IManifestoOptions, ManifestResource, Color } from "./internal"; +export declare class Scene extends ManifestResource { + constructor(jsonld: any, options: IManifestoOptions); + getContent(): Annotation[]; + get Content(): Annotation[]; + getAnnotationById(searchId: string): Annotation | null; + getBackgroundColor(): Color | null; +} diff --git a/dist-esmodule/Scene.js b/dist-esmodule/Scene.js new file mode 100644 index 00000000..e247abee --- /dev/null +++ b/dist-esmodule/Scene.js @@ -0,0 +1,78 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Annotation, AnnotationPage, ManifestResource, Color } from "./internal"; +var Scene = /** @class */ (function (_super) { + __extends(Scene, _super); + function Scene(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + // Presentation API 3.0 + Scene.prototype.getContent = function () { + var content = []; + var items = this.__jsonld.items || this.__jsonld.content; + if (!items) + return content; + // should be contained in an AnnotationPage + var annotationPage = null; + if (items.length) { + annotationPage = new AnnotationPage(items[0], this.options); + } + if (!annotationPage) { + return content; + } + var annotations = annotationPage.getItems(); + for (var i = 0; i < annotations.length; i++) { + var a = annotations[i]; + var annotation = new Annotation(a, this.options); + content.push(annotation); + } + ; + return content; + }; + ; + Object.defineProperty(Scene.prototype, "Content", { + // 3D extension + get: function () { return this.getContent(); }, + enumerable: false, + configurable: true + }); + Scene.prototype.getAnnotationById = function (searchId) { + for (var _i = 0, _a = this.Content; _i < _a.length; _i++) { + var anno = _a[_i]; + if (anno.id === searchId) + return anno; + } + return null; + }; + Scene.prototype.getBackgroundColor = function () { + // regular expression intended to match strings like + // "#FF00FF" -- interpreted as three hexadecimal values + // in range 0-255 . Not that the \w escape matches digits, + // upper and lower case latin characters, and underscore + // currently only supports the form for CSS + // https://www.w3.org/wiki/CSS/Properties/color/RGB + // with 6 hexadecimal digits + var bgc = this.getProperty("backgroundColor"); + if (bgc) + return Color.fromCSS(bgc); + else + return null; + }; + ; + return Scene; +}(ManifestResource)); +export { Scene }; +//# sourceMappingURL=Scene.js.map \ No newline at end of file diff --git a/dist-esmodule/Scene.js.map b/dist-esmodule/Scene.js.map new file mode 100644 index 00000000..b6564ad3 --- /dev/null +++ b/dist-esmodule/Scene.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Scene.js","sourceRoot":"","sources":["../src/Scene.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EACL,UAAU,EACV,cAAc,EAEd,gBAAgB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AZ,KAAA,IAAI,CAAC,OAAO,EAAZ,cAAY,EAAZ,IAAY;YAAxB,IAAI,IAAI,SAAA;YACT,IAAI,IAAI,CAAC,EAAE,KAAK,QAAQ;gBAAG,OAAO,IAAI,CAAC;SAAA;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,kCAAkB,GAAlB;QACE,oDAAoD;QACpD,uDAAuD;QACvD,0DAA0D;QAC1D,wDAAwD;QACxD,2CAA2C;QAC3C,mDAAmD;QACnD,4BAA4B;QAE5B,IAAI,GAAG,GAAwB,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QACnE,IAAI,GAAG;YACH,OAAO,KAAK,CAAC,OAAO,CAAE,GAAa,CAAE,CAAC;;YAEtC,OAAO,IAAI,CAAC;IAClB,CAAC;IAAA,CAAC;IAEJ,YAAC;AAAD,CAAC,AA9DD,CAA2B,gBAAgB,GA8D1C"} \ No newline at end of file diff --git a/dist-esmodule/Sequence.d.ts b/dist-esmodule/Sequence.d.ts new file mode 100644 index 00000000..45c1e0e8 --- /dev/null +++ b/dist-esmodule/Sequence.d.ts @@ -0,0 +1,34 @@ +import { ViewingDirection, ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +import { Canvas, IManifestoOptions, ManifestResource, Scene, Thumb, Thumbnail } from "./internal"; +export declare class Sequence extends ManifestResource { + items: Canvas[]; + private _thumbnails; + constructor(jsonld?: any, options?: IManifestoOptions); + getCanvases(): Canvas[]; + getCanvasById(id: string): Canvas | null; + getCanvasByIndex(canvasIndex: number): any; + getCanvasIndexById(id: string): number | null; + getCanvasIndexByLabel(label: string, foliated?: boolean): number; + getLastCanvasLabel(alphanumeric?: boolean): string; + getLastPageIndex(): number; + getNextPageIndex(canvasIndex: number, pagingEnabled?: boolean): number; + getPagedIndices(canvasIndex: number, pagingEnabled?: boolean): number[]; + getPrevPageIndex(canvasIndex: number, pagingEnabled?: boolean): number; + /** + * @returns Array of Scene instances in the Sequence + **/ + getScenes(): Scene[]; + getStartCanvasIndex(): number; + getThumbs(width: number, height?: number): Thumb[]; + getThumbnails(): Thumbnail[]; + getStartCanvas(): string; + getTotalCanvases(): number; + getViewingDirection(): ViewingDirection | null; + getViewingHint(): ViewingHint | null; + isCanvasIndexOutOfRange(canvasIndex: number): boolean; + isFirstCanvas(canvasIndex: number): boolean; + isLastCanvas(canvasIndex: number): boolean; + isMultiCanvas(): boolean; + isPagingEnabled(): boolean; + isTotalCanvasesEven(): boolean; +} diff --git a/dist-esmodule/Sequence.js b/dist-esmodule/Sequence.js new file mode 100644 index 00000000..a8fde209 --- /dev/null +++ b/dist-esmodule/Sequence.js @@ -0,0 +1,285 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ViewingDirection, ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +import { Canvas, ManifestResource, Scene, Thumb, Utils } from "./internal"; +var Sequence = /** @class */ (function (_super) { + __extends(Sequence, _super); + function Sequence(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + _this.items = []; + _this._thumbnails = null; + return _this; + } + Sequence.prototype.getCanvases = function () { + if (this.items.length) { + return this.items; + } + var items = this.__jsonld.canvases || this.__jsonld.elements; + if (items) { + for (var i = 0; i < items.length; i++) { + var c = items[i]; + var canvas = new Canvas(c, this.options); + canvas.index = i; + this.items.push(canvas); + } + } + else if (this.__jsonld) { + for (var i = 0; i < this.__jsonld.length; i++) { + var c = this.__jsonld[i]; + var canvas = new Canvas(c, this.options); + canvas.index = i; + this.items.push(canvas); + } + } + return this.items; + }; + Sequence.prototype.getCanvasById = function (id) { + for (var i = 0; i < this.getTotalCanvases(); i++) { + var canvas = this.getCanvasByIndex(i); + // normalise canvas id + var canvasId = Utils.normaliseUrl(canvas.id); + if (Utils.normaliseUrl(id) === canvasId) { + 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(); + if (!isNaN(label)) { + // if the label is numeric + label = parseInt(label, 10).toString(); // trim any preceding zeros. + if (foliated) + label += "r"; // default to recto + } + var doublePageRegExp = /(\d*)\D+(\d*)/; + var match, regExp, regStr, labelPart1, labelPart2; + for (var i = 0; i < this.getTotalCanvases(); i++) { + var canvas = this.getCanvasByIndex(i); + // check if there's a literal match + if (canvas.getLabel().getValue(this.options.locale) === label) { + return i; + } + // check if there's a match for double-page spreads e.g. 100-101, 100_101, 100 101 + match = doublePageRegExp.exec(label); + if (!match) + continue; + labelPart1 = match[1]; + labelPart2 = match[2]; + if (!labelPart2) + continue; + regStr = "^" + labelPart1 + "\\D+" + labelPart2 + "$"; + regExp = new RegExp(regStr); + if (regExp.test(canvas.getLabel().toString())) { + return i; + } + } + return -1; + }; + Sequence.prototype.getLastCanvasLabel = function (alphanumeric) { + for (var i = this.getTotalCanvases() - 1; i >= 0; i--) { + var canvas = this.getCanvasByIndex(i); + var label = (canvas.getLabel().getValue(this.options.locale)); + 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); + var viewingDirection = this.getViewingDirection(); + if (viewingDirection && + viewingDirection === ViewingDirection.RIGHT_TO_LEFT) { + index = indices[0] + 1; + } + else { + index = indices[indices.length - 1] + 1; + } + } + else { + index = canvasIndex + 1; + } + if (index > this.getLastPageIndex()) { + return -1; + } + return index; + }; + Sequence.prototype.getPagedIndices = function (canvasIndex, pagingEnabled) { + var indices = []; + if (!pagingEnabled) { + indices.push(canvasIndex); + } + else { + if (this.isFirstCanvas(canvasIndex) || this.isLastCanvas(canvasIndex)) { + indices = [canvasIndex]; + } + else if (canvasIndex % 2) { + indices = [canvasIndex, canvasIndex + 1]; + } + else { + indices = [canvasIndex - 1, canvasIndex]; + } + var viewingDirection = this.getViewingDirection(); + if (viewingDirection && + viewingDirection === ViewingDirection.RIGHT_TO_LEFT) { + indices = indices.reverse(); + } + } + return indices; + }; + Sequence.prototype.getPrevPageIndex = function (canvasIndex, pagingEnabled) { + var index; + if (pagingEnabled) { + var indices = this.getPagedIndices(canvasIndex); + var viewingDirection = this.getViewingDirection(); + if (viewingDirection && + viewingDirection === ViewingDirection.RIGHT_TO_LEFT) { + index = indices[indices.length - 1] - 1; + } + else { + index = indices[0] - 1; + } + } + else { + index = canvasIndex - 1; + } + return index; + }; + /** + * @returns Array of Scene instances in the Sequence + **/ + Sequence.prototype.getScenes = function () { + var returnVal = []; + var low_items = this.__jsonld.elements || this.__jsonld; + if (low_items) { + for (var i = 0; i < low_items.length; ++i) { + var c = low_items[i]; + if (c.type === 'Scene') { + var scene = new Scene(c, this.options); + //scene.index = i; + returnVal.push(scene); + } + } + } + return returnVal; + }; + Sequence.prototype.getStartCanvasIndex = function () { + var startCanvas = this.getStartCanvas(); + if (startCanvas) { + // if there's a startCanvas attribute, loop through the canvases and return the matching index. + for (var i = 0; i < this.getTotalCanvases(); i++) { + var canvas = this.getCanvasByIndex(i); + if (canvas.id === startCanvas) + return i; + } + } + // default to first canvas. + return 0; + }; + // todo: deprecate + Sequence.prototype.getThumbs = function (width, height) { + //console.warn('getThumbs will be deprecated, use getThumbnails instead'); + var thumbs = []; + var totalCanvases = this.getTotalCanvases(); + for (var i = 0; i < totalCanvases; i++) { + var canvas = this.getCanvasByIndex(i); + var thumb = new Thumb(width, canvas); + thumbs.push(thumb); + } + return thumbs; + }; + Sequence.prototype.getThumbnails = function () { + if (this._thumbnails != null) + return this._thumbnails; + this._thumbnails = []; + var canvases = this.getCanvases(); + for (var i = 0; i < canvases.length; i++) { + var thumbnail = canvases[i].getThumbnail(); + if (thumbnail) { + this._thumbnails.push(thumbnail); + } + } + return this._thumbnails; + }; + Sequence.prototype.getStartCanvas = function () { + return this.getProperty("startCanvas"); + }; + Sequence.prototype.getTotalCanvases = function () { + return this.getCanvases().length; + }; + Sequence.prototype.getViewingDirection = function () { + if (this.getProperty("viewingDirection")) { + return this.getProperty("viewingDirection"); + } + else if (this.options.resource.getViewingDirection) { + return this.options.resource.getViewingDirection(); + } + return null; + }; + Sequence.prototype.getViewingHint = function () { + return this.getProperty("viewingHint"); + }; + Sequence.prototype.isCanvasIndexOutOfRange = function (canvasIndex) { + return canvasIndex > this.getTotalCanvases() - 1; + }; + Sequence.prototype.isFirstCanvas = function (canvasIndex) { + return canvasIndex === 0; + }; + Sequence.prototype.isLastCanvas = function (canvasIndex) { + return canvasIndex === this.getTotalCanvases() - 1; + }; + Sequence.prototype.isMultiCanvas = function () { + return this.getTotalCanvases() > 1; + }; + Sequence.prototype.isPagingEnabled = function () { + var viewingHint = this.getViewingHint(); + if (viewingHint) { + return viewingHint === ViewingHint.PAGED; + } + return false; + }; + // checks if the number of canvases is even - therefore has a front and back cover + Sequence.prototype.isTotalCanvasesEven = function () { + return this.getTotalCanvases() % 2 === 0; + }; + return Sequence; +}(ManifestResource)); +export { Sequence }; +//# sourceMappingURL=Sequence.js.map \ No newline at end of file diff --git a/dist-esmodule/Sequence.js.map b/dist-esmodule/Sequence.js.map new file mode 100644 index 00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WAAW,GAAuB,IAAI,CAAC,cAAc,EAAE,CAAC;QAE9D,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,WAAW,KAAK,WAAW,CAAC,KAAK,CAAC;QAC3C,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,kFAAkF;IAClF,sCAAmB,GAAnB;QACE,OAAO,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IACH,eAAC;AAAD,CAAC,AAzUD,CAA8B,gBAAgB,GAyU7C"} \ No newline at end of file diff --git a/dist-esmodule/Serialisation.d.ts b/dist-esmodule/Serialisation.d.ts new file mode 100644 index 00000000..012f8bf6 --- /dev/null +++ b/dist-esmodule/Serialisation.d.ts @@ -0,0 +1,11 @@ +import { Collection, IIIFResource, IManifestoOptions, Manifest } from "./internal"; +export declare class Deserialiser { + static parse(manifest: any, options?: IManifestoOptions): IIIFResource | null; + static parseJson(json: any, options?: IManifestoOptions): IIIFResource | null; + static parseCollection(json: any, options?: IManifestoOptions): Collection; + static parseCollections(collection: Collection, options?: IManifestoOptions): void; + static parseManifest(json: any, options?: IManifestoOptions): Manifest; + static parseManifests(collection: Collection, options?: IManifestoOptions): void; + static parseItem(json: any, options?: IManifestoOptions): IIIFResource | null; + static parseItems(collection: Collection, options?: IManifestoOptions): void; +} diff --git a/dist-esmodule/Serialisation.js b/dist-esmodule/Serialisation.js new file mode 100644 index 00000000..b1f93e5f --- /dev/null +++ b/dist-esmodule/Serialisation.js @@ -0,0 +1,154 @@ +import { Collection, Manifest } from "./internal"; +var Deserialiser = /** @class */ (function () { + function Deserialiser() { + } + Deserialiser.parse = function (manifest, options) { + if (typeof manifest === "string") { + manifest = JSON.parse(manifest); + } + return this.parseJson(manifest, options); + }; + Deserialiser.parseJson = function (json, options) { + var resource; + // have options been passed for the manifest to inherit? + if (options) { + if (options.navDate && !isNaN(options.navDate.getTime())) { + json.navDate = options.navDate.toString(); + } + } + if (json["@type"]) { + switch (json["@type"]) { + case "sc:Collection": + resource = this.parseCollection(json, options); + break; + case "sc:Manifest": + resource = this.parseManifest(json, options); + break; + default: + return null; + } + } + else { + // presentation 3 + switch (json["type"]) { + case "Collection": + resource = this.parseCollection(json, options); + break; + case "Manifest": + resource = this.parseManifest(json, options); + break; + default: + return null; + } + } + // Top-level resource was loaded from a URI, so flag it to prevent + // unnecessary reload: + resource.isLoaded = true; + return resource; + }; + Deserialiser.parseCollection = function (json, options) { + var collection = new Collection(json, options); + if (options) { + collection.index = options.index || 0; + if (options.resource) { + collection.parentCollection = options.resource.parentCollection; + } + } + else { + collection.index = 0; + } + this.parseCollections(collection, options); + this.parseManifests(collection, options); + this.parseItems(collection, options); + return collection; + }; + Deserialiser.parseCollections = function (collection, options) { + var items; + if (collection.__jsonld.collections) { + items = collection.__jsonld.collections; + } + else if (collection.__jsonld.items) { + items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "collection"; }); + } + if (items) { + for (var i = 0; i < items.length; i++) { + if (options) { + options.index = i; + } + var item = this.parseCollection(items[i], options); + item.index = i; + item.parentCollection = collection; + collection.items.push(item); + } + } + }; + Deserialiser.parseManifest = function (json, options) { + var manifest = new Manifest(json, options); + return manifest; + }; + Deserialiser.parseManifests = function (collection, options) { + var items; + if (collection.__jsonld.manifests) { + items = collection.__jsonld.manifests; + } + else if (collection.__jsonld.items) { + items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "manifest"; }); + } + if (items) { + for (var i = 0; i < items.length; i++) { + var item = this.parseManifest(items[i], options); + item.index = i; + item.parentCollection = collection; + collection.items.push(item); + } + } + }; + Deserialiser.parseItem = function (json, options) { + if (json["@type"]) { + if (json["@type"].toLowerCase() === "sc:manifest") { + return this.parseManifest(json, options); + } + else if (json["@type"].toLowerCase() === "sc:collection") { + return this.parseCollection(json, options); + } + } + else if (json.type) { + if (json.type.toLowerCase() === "manifest") { + return this.parseManifest(json, options); + } + else if (json.type.toLowerCase() === "collection") { + return this.parseCollection(json, options); + } + } + return null; + }; + Deserialiser.parseItems = function (collection, options) { + var items = collection.__jsonld.members || collection.__jsonld.items; + if (items) { + var _loop_1 = function (i) { + if (options) { + options.index = i; + } + var item = this_1.parseItem(items[i], options); + if (!item) + return { value: void 0 }; + // only add to items if not already parsed from backwards-compatible collections/manifests arrays + if (collection.items.filter(function (m) { return m.id === item.id; })[0]) { + return "continue"; + } + item.index = i; + item.parentCollection = collection; + collection.items.push(item); + }; + var this_1 = this; + for (var i = 0; i < items.length; i++) { + var state_1 = _loop_1(i); + if (typeof state_1 === "object") + return state_1.value; + } + } + }; + return Deserialiser; +}()); +export { Deserialiser }; +//# sourceMappingURL=Serialisation.js.map \ No newline at end of file diff --git a/dist-esmodule/Serialisation.js.map b/dist-esmodule/Serialisation.js.map new file mode 100644 index 00000000..783d4991 --- /dev/null +++ b/dist-esmodule/Serialisation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Serialisation.js","sourceRoot":"","sources":["../src/Serialisation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAGV,QAAQ,EACT,MAAM,YAAY,CAAC;AAEpB;IAAA;IA8KA,CAAC;IA7KQ,kBAAK,GAAZ,UACE,QAAa,EACb,OAA2B;QAE3B,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACjC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAEM,sBAAS,GAAhB,UACE,IAAS,EACT,OAA2B;QAE3B,IAAI,QAAsB,CAAC;QAE3B,wDAAwD;QACxD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;gBACzD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OA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U,CAAC;gBACnC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;YAZ9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE;sCAA5B,CAAC;;;aAaT;QACH,CAAC;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AA9KD,IA8KC"} \ No newline at end of file diff --git a/dist-esmodule/Service.d.ts b/dist-esmodule/Service.d.ts new file mode 100644 index 00000000..69080c10 --- /dev/null +++ b/dist-esmodule/Service.d.ts @@ -0,0 +1,13 @@ +import { ServiceProfile } from "@iiif/vocabulary/dist-commonjs"; +import { IManifestoOptions, ManifestResource } from "./internal"; +export declare class Service extends ManifestResource { + constructor(jsonld?: any, options?: IManifestoOptions); + getProfile(): ServiceProfile; + getConfirmLabel(): string | null; + getDescription(): string | null; + getFailureDescription(): string | null; + getFailureHeader(): string | null; + getHeader(): string | null; + getServiceLabel(): string | null; + getInfoUri(): string; +} diff --git a/dist-esmodule/Service.js b/dist-esmodule/Service.js new file mode 100644 index 00000000..17bd8d85 --- /dev/null +++ b/dist-esmodule/Service.js @@ -0,0 +1,61 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ManifestResource, Utils } from "./internal"; +var Service = /** @class */ (function (_super) { + __extends(Service, _super); + function Service(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + Service.prototype.getProfile = function () { + var profile = this.getProperty("profile"); + if (!profile) { + profile = this.getProperty("dcterms:conformsTo"); + } + if (Array.isArray(profile)) { + return profile[0]; + } + return profile; + }; + Service.prototype.getConfirmLabel = function () { + return Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale); + }; + Service.prototype.getDescription = function () { + return Utils.getLocalisedValue(this.getProperty("description"), this.options.locale); + }; + Service.prototype.getFailureDescription = function () { + return Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale); + }; + Service.prototype.getFailureHeader = function () { + return Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale); + }; + Service.prototype.getHeader = function () { + return Utils.getLocalisedValue(this.getProperty("header"), this.options.locale); + }; + Service.prototype.getServiceLabel = function () { + return Utils.getLocalisedValue(this.getProperty("label"), this.options.locale); + }; + Service.prototype.getInfoUri = function () { + var infoUri = this.id; + if (!infoUri.endsWith("/")) { + infoUri += "/"; + } + infoUri += "info.json"; + return infoUri; + }; + return Service; +}(ManifestResource)); +export { Service }; +//# sourceMappingURL=Service.js.map \ No newline at end of file diff --git a/dist-esmodule/Service.js.map b/dist-esmodule/Service.js.map new file mode 100644 index 00000000..87e5f8bc --- /dev/null +++ b/dist-esmodule/Service.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Service.js","sourceRoot":"","sources":["../src/Service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAqB,gBAAgB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExE;IAA6B,2BAAgB;IAC3C,iBAAY,MAAY,EAAE,OAA2B;QACnD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IAED,4BAAU,GAAV;QACE,IAAI,OAAO,GAAQ,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAE/C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,KAAK,CAAC,OAAO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AO,IAAI,WAAW,CAAC;QAEvB,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,cAAC;AAAD,CAAC,AAxED,CAA6B,gBAAgB,GAwE5C"} \ No newline at end of file diff --git a/dist-esmodule/Size.d.ts b/dist-esmodule/Size.d.ts new file mode 100644 index 00000000..ff76ec44 --- /dev/null +++ b/dist-esmodule/Size.d.ts @@ -0,0 +1,5 @@ +export declare class Size { + width: number; + height: number; + constructor(width: number, height: number); +} diff --git a/dist-esmodule/Size.js b/dist-esmodule/Size.js new file mode 100644 index 00000000..89b7f58d --- /dev/null +++ b/dist-esmodule/Size.js @@ -0,0 +1,9 @@ +var Size = /** @class */ (function () { + function Size(width, height) { + this.width = width; + this.height = height; + } + return Size; +}()); +export { Size }; +//# sourceMappingURL=Size.js.map \ No newline at end of file diff --git a/dist-esmodule/Size.js.map b/dist-esmodule/Size.js.map new file mode 100644 index 00000000..e7630988 --- /dev/null +++ b/dist-esmodule/Size.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Size.js","sourceRoot":"","sources":["../src/Size.ts"],"names":[],"mappings":"AAAA;IAIE,cAAY,KAAa,EAAE,MAAc;QACvC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IACH,WAAC;AAAD,CAAC,AARD,IAQC"} \ No newline at end of file diff --git a/dist-esmodule/SpecificResource.d.ts b/dist-esmodule/SpecificResource.d.ts new file mode 100644 index 00000000..d7b0e79e --- /dev/null +++ b/dist-esmodule/SpecificResource.d.ts @@ -0,0 +1,21 @@ +import { IManifestoOptions, ManifestResource, AnnotationBody, Transform, PointSelector } from "./internal"; +/** + Developer note: This implementation does not strictly adhere + to the description of SpecificResource in the Web Annotation Model + document https://www.w3.org/TR/annotation-model/ + section 4 : https://www.w3.org/TR/annotation-model/#specific-resources + + The getTransform() method returning an Array of 3D Transfom resources, is + an extension of SpecificResource beyond the web annotation model. +*/ +export declare class SpecificResource extends ManifestResource { + isAnnotationBody: boolean; + isSpecificResource: boolean; + constructor(jsonld: any, options?: IManifestoOptions); + getSource(): object | AnnotationBody; + get Source(): object | AnnotationBody; + getSelector(): PointSelector | null; + get Selector(): PointSelector | null; + getTransform(): Transform[]; + get Transform(): Transform[]; +} diff --git a/dist-esmodule/SpecificResource.js b/dist-esmodule/SpecificResource.js new file mode 100644 index 00000000..01a49f3a --- /dev/null +++ b/dist-esmodule/SpecificResource.js @@ -0,0 +1,112 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { ManifestResource, AnnotationBodyParser, TransformParser, PointSelector } from "./internal"; +/** + Developer note: This implementation does not strictly adhere + to the description of SpecificResource in the Web Annotation Model + document https://www.w3.org/TR/annotation-model/ + section 4 : https://www.w3.org/TR/annotation-model/#specific-resources + + The getTransform() method returning an Array of 3D Transfom resources, is + an extension of SpecificResource beyond the web annotation model. +*/ +var SpecificResource = /** @class */ (function (_super) { + __extends(SpecificResource, _super); + function SpecificResource(jsonld, options) { + var _this = _super.call(this, jsonld, options) || this; + /* + property distinguishing instances of SpecificResource from instances of AnnotionBody. + The return type of the Annotation.getBody() method is an array of instances of the + union type ( AnnotationBody | SpecificResource ) + */ + _this.isAnnotationBody = false; + /* + property distinguishing instances of SpecificResource from instances of AnnotionBody. + The return type of the Annotation.getBody() method is an array of instances of the + union type ( AnnotationBody | SpecificResource ) + */ + _this.isSpecificResource = true; + _this.isSpecificResource = true; + return _this; + } + ; + SpecificResource.prototype.getSource = function () { + var raw = this.getPropertyAsObject("source"); + if (raw.isIRI) + return raw; + /* + this logic gets a little convoluted, because we have to preserve + the cases where the raw json is an array for the sources of a + SpecificResource applied to an annotation body, while for a target + of an Annotation we just want a single object + */ + // case of a source of a SpecificResource which is an Annotation target + if (raw) { + var containerTypes = ["Scene", "Canvas"]; + var singleItem = ([].concat(raw))[0]; + if (containerTypes.includes(singleItem["type"])) + return singleItem; + } + if (raw) { + var item = ([].concat(raw))[0]; + if (item) { + return AnnotationBodyParser.BuildFromJson(item, this.options); + } + } + throw new Error("cannot resolve Source " + JSON.stringify(raw)); + }; + Object.defineProperty(SpecificResource.prototype, "Source", { + get: function () { return this.getSource(); }, + enumerable: false, + configurable: true + }); + SpecificResource.prototype.getSelector = function () { + var raw = this.getProperty("selector"); + if (raw) { + var item = ([].concat(raw))[0]; + if (item) { + if (item["type"] === "PointSelector") + return new PointSelector(item); + } + throw new Error("unable to resolve SpecificResource selector " + JSON.stringify(this.__jsonld)); + } + return null; + }; + ; + Object.defineProperty(SpecificResource.prototype, "Selector", { + get: function () { return this.getSelector(); }, + enumerable: false, + configurable: true + }); + SpecificResource.prototype.getTransform = function () { + var retVal = []; + var transformItems = this.getProperty("transform"); + for (var i = 0; i < transformItems.length; ++i) { + var transformItem = transformItems[i]; + retVal.push(TransformParser.BuildFromJson(transformItem)); + } + return retVal; + }; + ; + Object.defineProperty(SpecificResource.prototype, "Transform", { + get: function () { return this.getTransform(); }, + enumerable: false, + configurable: true + }); + return SpecificResource; +}(ManifestResource)); +export { SpecificResource }; +//# sourceMappingURL=SpecificResource.js.map \ No newline at end of file diff --git a/dist-esmodule/SpecificResource.js.map b/dist-esmodule/SpecificResource.js.map new file mode 100644 index 00000000..beccad73 --- /dev/null +++ b/dist-esmodule/SpecificResource.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SpecificResource.js","sourceRoot":"","sources":["../src/SpecificResource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEL,gBAA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at end of file diff --git a/dist-esmodule/StatusCode.d.ts b/dist-esmodule/StatusCode.d.ts new file mode 100644 index 00000000..c2792a67 --- /dev/null +++ b/dist-esmodule/StatusCode.d.ts @@ -0,0 +1,6 @@ +export declare enum StatusCode { + AUTHORIZATION_FAILED = 1, + FORBIDDEN = 2, + INTERNAL_SERVER_ERROR = 3, + RESTRICTED = 4 +} diff --git a/dist-esmodule/StatusCode.js b/dist-esmodule/StatusCode.js new file mode 100644 index 00000000..4bab29fe --- /dev/null +++ b/dist-esmodule/StatusCode.js @@ -0,0 +1,8 @@ +export var StatusCode; +(function (StatusCode) { + StatusCode[StatusCode["AUTHORIZATION_FAILED"] = 1] = "AUTHORIZATION_FAILED"; + StatusCode[StatusCode["FORBIDDEN"] = 2] = "FORBIDDEN"; + StatusCode[StatusCode["INTERNAL_SERVER_ERROR"] = 3] = "INTERNAL_SERVER_ERROR"; + StatusCode[StatusCode["RESTRICTED"] = 4] = "RESTRICTED"; +})(StatusCode || (StatusCode = {})); +//# sourceMappingURL=StatusCode.js.map \ No newline at end of file diff --git a/dist-esmodule/StatusCode.js.map b/dist-esmodule/StatusCode.js.map new file mode 100644 index 00000000..2adb53d1 --- /dev/null +++ b/dist-esmodule/StatusCode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StatusCode.js","sourceRoot":"","sources":["../src/StatusCode.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2EAAwB,CAAA;IACxB,qDAAa,CAAA;IACb,6EAAyB,CAAA;IACzB,uDAAc,CAAA;AAChB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB"} \ No newline at end of file diff --git a/dist-esmodule/Thumb.d.ts b/dist-esmodule/Thumb.d.ts new file mode 100644 index 00000000..7f002a58 --- /dev/null +++ b/dist-esmodule/Thumb.d.ts @@ -0,0 +1,13 @@ +import { ViewingHint } from "@iiif/vocabulary/dist-commonjs"; +import { Canvas } from "./internal"; +export declare class Thumb { + data: any; + index: number; + uri: string; + label: string; + width: number; + height: number; + visible: boolean; + viewingHint: ViewingHint | null; + constructor(width: number, canvas: Canvas); +} diff --git a/dist-esmodule/Thumb.js b/dist-esmodule/Thumb.js new file mode 100644 index 00000000..73b90b44 --- /dev/null +++ b/dist-esmodule/Thumb.js @@ -0,0 +1,22 @@ +// todo: deprecate +// this is used by Sequence.getThumbs +var Thumb = /** @class */ (function () { + function Thumb(width, canvas) { + this.data = canvas; + this.index = canvas.index; + this.width = width; + var heightRatio = canvas.getHeight() / canvas.getWidth(); + if (heightRatio) { + this.height = Math.floor(this.width * heightRatio); + } + else { + this.height = width; + } + this.uri = canvas.getCanonicalImageUri(width); + this.label = canvas.getLabel().getValue(); // todo: pass locale? + this.viewingHint = canvas.getViewingHint(); + } + return Thumb; +}()); +export { Thumb }; +//# sourceMappingURL=Thumb.js.map \ No newline at end of file diff --git a/dist-esmodule/Thumb.js.map b/dist-esmodule/Thumb.js.map new file mode 100644 index 00000000..46ebe973 --- /dev/null +++ b/dist-esmodule/Thumb.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Thumb.js","sourceRoot":"","sources":["../src/Thumb.ts"],"names":[],"mappings":"AAGA,kBAAkB;AAClB,qCAAqC;AACrC;IAUE,eAAY,KAAa,EAAE,MAAc;QACvC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAM,WAAW,GAAW,MAAM,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAEnE,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,CAAC;QACrD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;QAED,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,CAAC,KAAK,GAAW,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,qBAAqB;QACxE,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;IAC7C,CAAC;IACH,YAAC;AAAD,CAAC,AA3BD,IA2BC"} \ No newline at end of file diff --git a/dist-esmodule/Thumbnail.d.ts b/dist-esmodule/Thumbnail.d.ts new file mode 100644 index 00000000..43fcf69e --- /dev/null +++ b/dist-esmodule/Thumbnail.d.ts @@ -0,0 +1,4 @@ +import { IManifestoOptions, Resource } from "./internal"; +export declare class Thumbnail extends Resource { + constructor(jsonld: any, options: IManifestoOptions); +} diff --git a/dist-esmodule/Thumbnail.js b/dist-esmodule/Thumbnail.js new file mode 100644 index 00000000..2a995a81 --- /dev/null +++ b/dist-esmodule/Thumbnail.js @@ -0,0 +1,25 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Resource } from "./internal"; +var Thumbnail = /** @class */ (function (_super) { + __extends(Thumbnail, _super); + function Thumbnail(jsonld, options) { + return _super.call(this, jsonld, options) || this; + } + return Thumbnail; +}(Resource)); +export { Thumbnail }; +//# sourceMappingURL=Thumbnail.js.map \ No newline at end of file diff --git a/dist-esmodule/Thumbnail.js.map b/dist-esmodule/Thumbnail.js.map new file mode 100644 index 00000000..06740ba5 --- /dev/null +++ b/dist-esmodule/Thumbnail.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Thumbnail.js","sourceRoot":"","sources":["../src/Thumbnail.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAqB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEzD;IAA+B,6BAAQ;IACrC,mBAAY,MAAW,EAAE,OAA0B;QACjD,OAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;IACzB,CAAC;IACH,gBAAC;AAAD,CAAC,AAJD,CAA+B,QAAQ,GAItC"} \ No newline at end of file diff --git a/dist-esmodule/Transform.d.ts b/dist-esmodule/Transform.d.ts new file mode 100644 index 00000000..b29c7ccf --- /dev/null +++ b/dist-esmodule/Transform.d.ts @@ -0,0 +1,8 @@ +import { JSONLDResource } from "./internal"; +export declare abstract class Transform extends JSONLDResource { + constructor(jsonld?: any); + isTransform: boolean; + isRotateTransform: boolean | undefined; + isScaleTransform: boolean | undefined; + isTranslateTransform: boolean | undefined; +} diff --git a/dist-esmodule/Transform.js b/dist-esmodule/Transform.js new file mode 100644 index 00000000..d03b0e21 --- /dev/null +++ b/dist-esmodule/Transform.js @@ -0,0 +1,28 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { JSONLDResource } from "./internal"; +var Transform = /** @class */ (function (_super) { + __extends(Transform, _super); + function Transform(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isTransform = true; + _this.isTransform = true; + return _this; + } + return Transform; +}(JSONLDResource)); +export { Transform }; +//# sourceMappingURL=Transform.js.map \ No newline at end of file diff --git a/dist-esmodule/Transform.js.map b/dist-esmodule/Transform.js.map new file mode 100644 index 00000000..c3b92fe9 --- /dev/null +++ b/dist-esmodule/Transform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../src/Transform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACH,cAAc,EACjB,MAAM,YAAY,CAAC;AAGpB;IAAyC,6BAAc;IAEnD,mBAAY,MAAY;QACpB,YAAA,MAAK,YAAC,MAAM,CAAE,SAAC;QAInB,iBAAW,GAAa,IAAI,CAAC;QAHzB,KAAI,CAAC,WAAW,GAAG,IAAI,CAAC;;IAC5B,CAAC;IAML,gBAAC;AAAD,CAAC,AAXD,CAAyC,cAAc,GAWtD"} \ No newline at end of file diff --git a/dist-esmodule/TransformParser.d.ts b/dist-esmodule/TransformParser.d.ts new file mode 100644 index 00000000..c0fd74d4 --- /dev/null +++ b/dist-esmodule/TransformParser.d.ts @@ -0,0 +1,4 @@ +import { Transform } from "./internal"; +export declare class TransformParser { + static BuildFromJson(jsonld: any): Transform; +} diff --git a/dist-esmodule/TransformParser.js b/dist-esmodule/TransformParser.js new file mode 100644 index 00000000..97755b0a --- /dev/null +++ b/dist-esmodule/TransformParser.js @@ -0,0 +1,18 @@ +import { TranslateTransform, RotateTransform, ScaleTransform } from "./internal"; +var TransformParser = /** @class */ (function () { + function TransformParser() { + } + TransformParser.BuildFromJson = function (jsonld) { + if (jsonld.type === "TranslateTransform") + return new TranslateTransform(jsonld); + else if (jsonld.type === "RotateTransform") + return new RotateTransform(jsonld); + else if (jsonld.type === "ScaleTransform") + return new ScaleTransform(jsonld); + else + throw new Error("Unknown transform type " + jsonld.type); + }; + return TransformParser; +}()); +export { TransformParser }; +//# sourceMappingURL=TransformParser.js.map \ No newline at end of file diff --git a/dist-esmodule/TransformParser.js.map b/dist-esmodule/TransformParser.js.map new file mode 100644 index 00000000..16143c6d --- /dev/null +++ b/dist-esmodule/TransformParser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TransformParser.js","sourceRoot":"","sources":["../src/TransformParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,kBAAkB,EAClB,eAAe,EACf,cAAc,EACjB,MAAM,YAAY,CAAC;AAGpB;IAAA;IAWA,CAAC;IAVU,6BAAa,GAApB,UAAsB,MAAW;QAC7B,IAAI,MAAM,CAAC,IAAI,KAAK,oBAAoB;YACpC,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;aACrC,IAAI,MAAM,CAAC,IAAI,KAAK,iBAAiB;YACtC,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;aAClC,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB;YACrC,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;;YAElC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;IACL,sBAAC;AAAD,CAAC,AAXD,IAWC"} \ No newline at end of file diff --git a/dist-esmodule/TranslateTransform.d.ts b/dist-esmodule/TranslateTransform.d.ts new file mode 100644 index 00000000..935c6092 --- /dev/null +++ b/dist-esmodule/TranslateTransform.d.ts @@ -0,0 +1,5 @@ +import { Transform } from "./internal"; +export declare class TranslateTransform extends Transform { + constructor(jsonld?: any); + getTranslation(): object; +} diff --git a/dist-esmodule/TranslateTransform.js b/dist-esmodule/TranslateTransform.js new file mode 100644 index 00000000..929be75e --- /dev/null +++ b/dist-esmodule/TranslateTransform.js @@ -0,0 +1,37 @@ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +import { Transform } from "./internal"; +var TranslateTransform = /** @class */ (function (_super) { + __extends(TranslateTransform, _super); + function TranslateTransform(jsonld) { + var _this = _super.call(this, jsonld) || this; + _this.isTranslateTransform = true; + return _this; + } + TranslateTransform.prototype.getTranslation = function () { + var retVal = {}; + for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) { + var attrib = _a[_i]; + var raw = this.__jsonld[attrib]; + retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0; + } + return retVal; + }; + return TranslateTransform; +}(Transform)); +export { TranslateTransform }; +; +//# sourceMappingURL=TranslateTransform.js.map \ No newline at end of file diff --git a/dist-esmodule/TranslateTransform.js.map b/dist-esmodule/TranslateTransform.js.map new file mode 100644 index 00000000..8e933ffe --- /dev/null +++ b/dist-esmodule/TranslateTransform.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TranslateTransform.js","sourceRoot":"","sources":["../src/TranslateTransform.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EACH,SAAS,EACZ,MAAM,YAAY,CAAC;AAEpB;IAAwC,sCAAS;IAC7C,4BAAY,MAAY;QACpB,YAAA,MAAK,YAAC,MAAM,CAAE,SAAC;QACf,KAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;;IACrC,CAAC;IAED,2CAAc,GAAd;QACI,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAqB,UAAa,EAAb,MAAC,GAAG,EAAC,GAAG,EAAC,GAAG,CAAC,EAAb,cAAa,EAAb,IAAa,EAAC,CAAC;YAA/B,IAAM,MAAM,SAAA;YACb,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAChC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAA,CAAC,CAAA,MAAM,CAAC,GAAG,CAAC,CAAA,CAAC,CAAA,GAAG,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAEL,yBAAC;AAAD,CAAC,AAfD,CAAwC,SAAS,GAehD;;AAAA,CAAC"} \ No newline at end of file diff --git a/dist-esmodule/TreeNode.d.ts b/dist-esmodule/TreeNode.d.ts new file mode 100644 index 00000000..2d757448 --- /dev/null +++ b/dist-esmodule/TreeNode.d.ts @@ -0,0 +1,15 @@ +export declare class TreeNode { + data: any; + nodes: TreeNode[]; + selected: boolean; + expanded: boolean; + id: string; + label: string; + navDate: Date; + parentNode: TreeNode; + constructor(label?: string, data?: any); + addNode(node: TreeNode): void; + isCollection(): boolean; + isManifest(): boolean; + isRange(): boolean; +} diff --git a/dist-esmodule/TreeNode.js b/dist-esmodule/TreeNode.js new file mode 100644 index 00000000..28a00e1b --- /dev/null +++ b/dist-esmodule/TreeNode.js @@ -0,0 +1,24 @@ +import { TreeNodeType, Utils } from "./internal"; +var TreeNode = /** @class */ (function () { + function TreeNode(label, data) { + this.label = label; + this.data = data || {}; + this.nodes = []; + } + TreeNode.prototype.addNode = function (node) { + this.nodes.push(node); + node.parentNode = this; + }; + TreeNode.prototype.isCollection = function () { + return this.data.type === Utils.normaliseType(TreeNodeType.COLLECTION); + }; + TreeNode.prototype.isManifest = function () { + return this.data.type === Utils.normaliseType(TreeNodeType.MANIFEST); + }; + TreeNode.prototype.isRange = function () { + return this.data.type === Utils.normaliseType(TreeNodeType.RANGE); + }; + return TreeNode; +}()); +export { TreeNode }; +//# sourceMappingURL=TreeNode.js.map \ No newline at end of file diff --git a/dist-esmodule/TreeNode.js.map b/dist-esmodule/TreeNode.js.map new file mode 100644 index 00000000..e75225d3 --- /dev/null +++ b/dist-esmodule/TreeNode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeNode.js","sourceRoot":"","sources":["../src/TreeNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjD;IAUE,kBAAY,KAAc,EAAE,IAAU;QACpC,IAAI,CAAC,KAAK,GAAW,KAAK,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAEM,0BAAO,GAAd,UAAe,IAAc;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAEM,+BAAY,GAAnB;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACzE,CAAC;IAEM,6BAAU,GAAjB;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACvE,CAAC;IAEM,0BAAO,GAAd;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC;IACH,eAAC;AAAD,CAAC,AAhCD,IAgCC"} \ No newline at end of file diff --git a/dist-esmodule/TreeNodeType.d.ts b/dist-esmodule/TreeNodeType.d.ts new file mode 100644 index 00000000..812a5b99 --- /dev/null +++ b/dist-esmodule/TreeNodeType.d.ts @@ -0,0 +1,5 @@ +export declare enum TreeNodeType { + COLLECTION = "collection", + MANIFEST = "manifest", + RANGE = "range" +} diff --git a/dist-esmodule/TreeNodeType.js b/dist-esmodule/TreeNodeType.js new file mode 100644 index 00000000..6a7ae012 --- /dev/null +++ b/dist-esmodule/TreeNodeType.js @@ -0,0 +1,7 @@ +export var TreeNodeType; +(function (TreeNodeType) { + TreeNodeType["COLLECTION"] = "collection"; + TreeNodeType["MANIFEST"] = "manifest"; + TreeNodeType["RANGE"] = "range"; +})(TreeNodeType || (TreeNodeType = {})); +//# sourceMappingURL=TreeNodeType.js.map \ No newline at end of file diff --git a/dist-esmodule/TreeNodeType.js.map b/dist-esmodule/TreeNodeType.js.map new file mode 100644 index 00000000..43614245 --- /dev/null +++ b/dist-esmodule/TreeNodeType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeNodeType.js","sourceRoot":"","sources":["../src/TreeNodeType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,yCAAyB,CAAA;IACzB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;AACjB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB"} \ No newline at end of file diff --git a/dist-esmodule/Utils.d.ts b/dist-esmodule/Utils.d.ts new file mode 100644 index 00000000..f6fdc27d --- /dev/null +++ b/dist-esmodule/Utils.d.ts @@ -0,0 +1,47 @@ +import { IAccessToken, IExternalResource, IIIFResource, IManifestoOptions, JSONLDResource, Service, StatusCode, TreeNode } from "./internal"; +import { MediaType, ServiceProfile } from "@iiif/vocabulary/dist-commonjs"; +import "isomorphic-unfetch"; +export declare class Utils { + static getMediaType(type: string): MediaType; + static getImageQuality(profile: ServiceProfile): string; + static getInexactLocale(locale: string): string; + static getLocalisedValue(resource: any, locale: string): string | null; + static generateTreeNodeIds(treeNode: TreeNode, index?: number): void; + static normaliseType(type: string): string; + static normaliseUrl(url: string): string; + static normalisedUrlsMatch(url1: string, url2: string): boolean; + static isImageProfile(profile: ServiceProfile): boolean; + static isImageServiceType(type: string | null): boolean; + static isLevel0ImageProfile(profile: ServiceProfile): boolean; + static isLevel1ImageProfile(profile: ServiceProfile): boolean; + static isLevel2ImageProfile(profile: ServiceProfile): boolean; + static parseManifest(manifest: any, options?: IManifestoOptions | undefined): IIIFResource | null; + static checkStatus(response: any): any; + static loadManifest(url: string): Promise; + static loadExternalResourcesAuth1(resources: IExternalResource[], openContentProviderInteraction: (service: Service) => any, openTokenService: (resource: IExternalResource, tokenService: Service) => Promise, getStoredAccessToken: (resource: IExternalResource) => Promise, userInteractedWithContentProvider: (contentProviderInteraction: any) => Promise, getContentProviderInteraction: (resource: IExternalResource, service: Service) => Promise, handleMovedTemporarily: (resource: IExternalResource) => Promise, showOutOfOptionsMessages: (resource: IExternalResource, service: Service) => void): Promise; + static loadExternalResourceAuth1(resource: IExternalResource, openContentProviderInteraction: (service: Service) => any, openTokenService: (resource: IExternalResource, tokenService: Service) => Promise, getStoredAccessToken: (resource: IExternalResource) => Promise, userInteractedWithContentProvider: (contentProviderInteraction: any) => Promise, getContentProviderInteraction: (resource: IExternalResource, service: Service) => Promise, handleMovedTemporarily: (resource: IExternalResource) => Promise, showOutOfOptionsMessages: (resource: IExternalResource, service: Service) => void): Promise; + static doAuthChain(resource: IExternalResource, openContentProviderInteraction: (service: Service) => any, openTokenService: (resource: IExternalResource, tokenService: Service) => Promise, userInteractedWithContentProvider: (contentProviderInteraction: any) => Promise, getContentProviderInteraction: (resource: IExternalResource, service: Service) => Promise, handleMovedTemporarily: (resource: IExternalResource) => Promise, showOutOfOptionsMessages: (resource: IExternalResource, service: Service) => void): Promise; + static attemptResourceWithToken(resource: IExternalResource, openTokenService: (resource: IExternalResource, tokenService: Service) => Promise, authService: Service): Promise; + static loadExternalResourcesAuth09(resources: IExternalResource[], tokenStorageStrategy: string, clickThrough: (resource: IExternalResource) => Promise, restricted: (resource: IExternalResource) => Promise, login: (resource: IExternalResource) => Promise, getAccessToken: (resource: IExternalResource, rejectOnError: boolean) => Promise, storeAccessToken: (resource: IExternalResource, token: IAccessToken, tokenStorageStrategy: string) => Promise, getStoredAccessToken: (resource: IExternalResource, tokenStorageStrategy: string) => Promise, handleResourceResponse: (resource: IExternalResource) => Promise, options?: IManifestoOptions): Promise; + static loadExternalResourceAuth09(resource: IExternalResource, tokenStorageStrategy: string, clickThrough: (resource: IExternalResource) => Promise, restricted: (resource: IExternalResource) => Promise, login: (resource: IExternalResource) => Promise, getAccessToken: (resource: IExternalResource, rejectOnError: boolean) => Promise, storeAccessToken: (resource: IExternalResource, token: IAccessToken, tokenStorageStrategy: string) => Promise, getStoredAccessToken: (resource: IExternalResource, tokenStorageStrategy: string) => Promise, handleResourceResponse: (resource: IExternalResource) => Promise, options?: IManifestoOptions): Promise; + static createError(name: StatusCode, message: string): Error; + static createAuthorizationFailedError(): Error; + static createRestrictedError(): Error; + static createInternalServerError(message: string): Error; + static authorize(resource: IExternalResource, tokenStorageStrategy: string, clickThrough: (resource: IExternalResource) => Promise, restricted: (resource: IExternalResource) => Promise, login: (resource: IExternalResource) => Promise, getAccessToken: (resource: IExternalResource, rejectOnError: boolean) => Promise, storeAccessToken: (resource: IExternalResource, token: IAccessToken, tokenStorageStrategy: string) => Promise, getStoredAccessToken: (resource: IExternalResource, tokenStorageStrategy: string) => Promise): Promise; + private static showAuthInteraction; + static getService(resource: any, profile: ServiceProfile): Service | null; + static getResourceById(parentResource: JSONLDResource, id: string): JSONLDResource; + /** + * Does a depth first traversal of an Object, returning an Object that + * matches provided k and v arguments + * @example Utils.traverseAndFind({foo: 'bar'}, 'foo', 'bar') + */ + static traverseAndFind(object: any, k: string, v: string): object | undefined; + static getServices(resource: any, { onlyService, onlyServices, skipParentResources }?: { + onlyServices?: boolean; + skipParentResources?: boolean; + onlyService?: boolean; + }): Service[]; + static getTemporalComponent(target: string): number[] | null; +} diff --git a/dist-esmodule/Utils.js b/dist-esmodule/Utils.js new file mode 100644 index 00000000..f347f4a5 --- /dev/null +++ b/dist-esmodule/Utils.js @@ -0,0 +1,746 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +import { Deserialiser, Service, StatusCode } from "./internal"; +import { ServiceProfile, ServiceType } from "@iiif/vocabulary/dist-commonjs"; +import { OK, MOVED_TEMPORARILY, UNAUTHORIZED } from "@edsilv/http-status-codes/dist-commonjs"; +import "isomorphic-unfetch"; +var Utils = /** @class */ (function () { + function Utils() { + } + Utils.getMediaType = function (type) { + type = type.toLowerCase(); + type = type.split(";")[0]; + return type.trim(); + }; + Utils.getImageQuality = function (profile) { + if (profile === ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 || + profile === ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 || + profile === ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 || + profile === ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 || + profile === ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 || + profile === ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 || + profile === ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 || + profile === ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 || + profile === ServiceProfile.IMAGE_1_LEVEL_1 || + profile === ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 || + profile === ServiceProfile.IMAGE_1_LEVEL_2 || + profile === ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) { + return "native"; + } + return "default"; + }; + Utils.getInexactLocale = function (locale) { + if (locale.indexOf("-") !== -1) { + return locale.substr(0, locale.indexOf("-")); + } + return locale; + }; + Utils.getLocalisedValue = function (resource, locale) { + // if the resource is not an array of translations, return the string. + if (!Array.isArray(resource)) { + return resource; + } + // test for exact match + for (var i = 0; i < resource.length; i++) { + var value_1 = resource[i]; + var language_1 = value_1["@language"]; + if (locale === language_1) { + return value_1["@value"]; + } + } + // test for inexact match + var match = locale.substr(0, locale.indexOf("-")); + for (var i = 0; i < resource.length; i++) { + var value = resource[i]; + var language = value["@language"]; + if (language === match) { + return value["@value"]; + } + } + return null; + }; + Utils.generateTreeNodeIds = function (treeNode, index) { + if (index === void 0) { index = 0; } + var id; + if (!treeNode.parentNode) { + id = "0"; + } + else { + id = treeNode.parentNode.id + "-" + index; + } + treeNode.id = id; + for (var i = 0; i < treeNode.nodes.length; i++) { + var n = treeNode.nodes[i]; + Utils.generateTreeNodeIds(n, i); + } + }; + Utils.normaliseType = function (type) { + type = (type || "").toLowerCase(); + if (type.indexOf(":") !== -1) { + var split = type.split(":"); + return split[1]; + } + return type; + }; + Utils.normaliseUrl = function (url) { + url = url.substr(url.indexOf("://")); + if (url.indexOf("#") !== -1) { + url = url.split("#")[0]; + } + return url; + }; + Utils.normalisedUrlsMatch = function (url1, url2) { + return Utils.normaliseUrl(url1) === Utils.normaliseUrl(url2); + }; + Utils.isImageProfile = function (profile) { + if (Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) { + return true; + } + return false; + }; + Utils.isImageServiceType = function (type) { + return ((type !== null && + type.toLowerCase() === ServiceType.IMAGE_SERVICE_2.toLowerCase()) || + type === ServiceType.IMAGE_SERVICE_3.toLowerCase()); + }; + Utils.isLevel0ImageProfile = function (profile) { + if (Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_LEVEL_0) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) { + return true; + } + return false; + }; + Utils.isLevel1ImageProfile = function (profile) { + if (Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_LEVEL_1) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) { + return true; + } + return false; + }; + Utils.isLevel2ImageProfile = function (profile) { + if (Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_LEVEL_2) || + Utils.normalisedUrlsMatch(profile, ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) { + return true; + } + return false; + }; + Utils.parseManifest = function (manifest, options) { + return Deserialiser.parse(manifest, options); + }; + Utils.checkStatus = function (response) { + if (response.ok) { + return response; + } + else { + var error = new Error(response.statusText); + error.response = response; + return Promise.reject(error); + } + }; + Utils.loadManifest = function (url) { + return new Promise(function (resolve, reject) { + fetch(url) + .then(Utils.checkStatus) + .then(function (r) { return r.json(); }) + .then(function (data) { + resolve(data); + }) + .catch(function (err) { + reject(); + }); + }); + }; + Utils.loadExternalResourcesAuth1 = function (resources, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) { + return new Promise(function (resolve, reject) { + var promises = resources.map(function (resource) { + return Utils.loadExternalResourceAuth1(resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages); + }); + Promise.all(promises) + .then(function () { + resolve(resources); + })["catch"](function (error) { + reject(error); + }); + }); + }; + Utils.loadExternalResourceAuth1 = function (resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) { + return __awaiter(this, void 0, void 0, function () { + var storedAccessToken; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, getStoredAccessToken(resource)]; + case 1: + storedAccessToken = _a.sent(); + if (!storedAccessToken) return [3 /*break*/, 6]; + return [4 /*yield*/, resource.getData(storedAccessToken)]; + case 2: + _a.sent(); + if (!(resource.status === OK)) return [3 /*break*/, 3]; + return [2 /*return*/, resource]; + case 3: + // the stored token is no good for this resource + return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)]; + case 4: + // the stored token is no good for this resource + _a.sent(); + _a.label = 5; + case 5: + if (resource.status === OK || resource.status === MOVED_TEMPORARILY) { + return [2 /*return*/, resource]; + } + throw Utils.createAuthorizationFailedError(); + case 6: return [4 /*yield*/, resource.getData()]; + case 7: + _a.sent(); + if (!(resource.status === MOVED_TEMPORARILY || + resource.status === UNAUTHORIZED)) return [3 /*break*/, 9]; + return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)]; + case 8: + _a.sent(); + _a.label = 9; + case 9: + if (resource.status === OK || resource.status === MOVED_TEMPORARILY) { + return [2 /*return*/, resource]; + } + throw Utils.createAuthorizationFailedError(); + } + }); + }); + }; + Utils.doAuthChain = function (resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) { + return __awaiter(this, void 0, void 0, function () { + var externalService, kioskService, clickThroughService, loginService, serviceToTry, lastAttempted, kioskInteraction, contentProviderInteraction, contentProviderInteraction; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + // This function enters the flowchart at the < External? > junction + // http://iiif.io/api/auth/1.0/#workflow-from-the-browser-client-perspective + if (!resource.isAccessControlled()) { + return [2 /*return*/, resource]; // no services found + } + externalService = resource.externalService; + if (externalService) { + externalService.options = resource.options; + } + kioskService = resource.kioskService; + if (kioskService) { + kioskService.options = resource.options; + } + clickThroughService = resource.clickThroughService; + if (clickThroughService) { + clickThroughService.options = resource.options; + } + loginService = resource.loginService; + if (loginService) { + loginService.options = resource.options; + } + if (!(!resource.isResponseHandled && resource.status === MOVED_TEMPORARILY)) return [3 /*break*/, 2]; + return [4 /*yield*/, handleMovedTemporarily(resource)]; + case 1: + _a.sent(); + return [2 /*return*/, resource]; + case 2: + serviceToTry = null; + lastAttempted = null; + // repetition of logic is left in these steps for clarity: + // Looking for external pattern + serviceToTry = externalService; + if (!serviceToTry) return [3 /*break*/, 4]; + lastAttempted = serviceToTry; + return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)]; + case 3: + _a.sent(); + return [2 /*return*/, resource]; + case 4: + // Looking for kiosk pattern + serviceToTry = kioskService; + if (!serviceToTry) return [3 /*break*/, 7]; + lastAttempted = serviceToTry; + kioskInteraction = openContentProviderInteraction(serviceToTry); + if (!kioskInteraction) return [3 /*break*/, 7]; + return [4 /*yield*/, userInteractedWithContentProvider(kioskInteraction)]; + case 5: + _a.sent(); + return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)]; + case 6: + _a.sent(); + return [2 /*return*/, resource]; + case 7: + // The code for the next two patterns is identical (other than the profile name). + // The difference is in the expected behaviour of + // + // await userInteractedWithContentProvider(contentProviderInteraction); + // + // For clickthrough the opened window should close immediately having established + // a session, whereas for login the user might spend some time entering credentials etc. + // Looking for clickthrough pattern + serviceToTry = clickThroughService; + if (!serviceToTry) return [3 /*break*/, 11]; + lastAttempted = serviceToTry; + return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)]; + case 8: + contentProviderInteraction = _a.sent(); + if (!contentProviderInteraction) return [3 /*break*/, 11]; + // should close immediately + return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)]; + case 9: + // should close immediately + _a.sent(); + return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)]; + case 10: + _a.sent(); + return [2 /*return*/, resource]; + case 11: + // Looking for login pattern + serviceToTry = loginService; + if (!serviceToTry) return [3 /*break*/, 15]; + lastAttempted = serviceToTry; + return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)]; + case 12: + contentProviderInteraction = _a.sent(); + if (!contentProviderInteraction) return [3 /*break*/, 15]; + // we expect the user to spend some time interacting + return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)]; + case 13: + // we expect the user to spend some time interacting + _a.sent(); + return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)]; + case 14: + _a.sent(); + return [2 /*return*/, resource]; + case 15: + // nothing worked! Use the most recently tried service as the source of + // messages to show to the user. + if (lastAttempted) { + showOutOfOptionsMessages(resource, lastAttempted); + } + return [2 /*return*/]; + } + }); + }); + }; + Utils.attemptResourceWithToken = function (resource, openTokenService, authService) { + return __awaiter(this, void 0, void 0, function () { + var tokenService, tokenMessage; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + tokenService = authService.getService(ServiceProfile.AUTH_1_TOKEN); + if (!tokenService) return [3 /*break*/, 3]; + return [4 /*yield*/, openTokenService(resource, tokenService)]; + case 1: + tokenMessage = _a.sent(); + if (!(tokenMessage && tokenMessage.accessToken)) return [3 /*break*/, 3]; + return [4 /*yield*/, resource.getData(tokenMessage)]; + case 2: + _a.sent(); + return [2 /*return*/, resource]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + Utils.loadExternalResourcesAuth09 = function (resources, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) { + return new Promise(function (resolve, reject) { + var promises = resources.map(function (resource) { + return Utils.loadExternalResourceAuth09(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options); + }); + Promise.all(promises) + .then(function () { + resolve(resources); + })["catch"](function (error) { + reject(error); + }); + }); + }; + // IIIF auth api pre v1.0 + // Keeping this around for now until the auth 1.0 implementation is stable + Utils.loadExternalResourceAuth09 = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) { + return new Promise(function (resolve, reject) { + if (options && options.pessimisticAccessControl) { + // pessimistic: access control cookies may have been deleted. + // always request the access token for every access controlled info.json request + // returned access tokens are not stored, therefore the login window flashes for every request. + resource + .getData() + .then(function () { + if (resource.isAccessControlled()) { + // if the resource has a click through service, use that. + if (resource.clickThroughService) { + resolve(clickThrough(resource)); + //} else if(resource.restrictedService) { + resolve(restricted(resource)); + } + else { + login(resource) + .then(function () { + getAccessToken(resource, true) + .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)); + }); + } + } + else { + // this info.json isn't access controlled, therefore no need to request an access token. + resolve(resource); + } + })["catch"](function (message) { + reject(Utils.createInternalServerError(message)); + }); + } + else { + // optimistic: access control cookies may not have been deleted. + // store access tokens to avoid login window flashes. + // if cookies are deleted a page refresh is required. + // try loading the resource using an access token that matches the info.json domain. + // if an access token is found, request the resource using it regardless of whether it is access controlled. + getStoredAccessToken(resource, tokenStorageStrategy) + .then(function (storedAccessToken) { + if (storedAccessToken) { + // try using the stored access token + resource + .getData(storedAccessToken) + .then(function () { + // if the info.json loaded using the stored access token + if (resource.status === OK) { + resolve(handleResourceResponse(resource)); + } + else { + // otherwise, load the resource data to determine the correct access control services. + // if access controlled, do login. + Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) + .then(function () { + resolve(handleResourceResponse(resource)); + })["catch"](function (error) { + // if (resource.restrictedService){ + // reject(Utils.createRestrictedError()); + // } else { + reject(Utils.createAuthorizationFailedError()); + //} + }); + } + })["catch"](function (error) { + reject(Utils.createAuthorizationFailedError()); + }); + } + else { + 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(); + error.message = message; + error.name = String(name); + return error; + }; + Utils.createAuthorizationFailedError = function () { + return Utils.createError(StatusCode.AUTHORIZATION_FAILED, "Authorization failed"); + }; + Utils.createRestrictedError = function () { + return Utils.createError(StatusCode.RESTRICTED, "Restricted"); + }; + Utils.createInternalServerError = function (message) { + return Utils.createError(StatusCode.INTERNAL_SERVER_ERROR, message); + }; + Utils.authorize = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) { + return new Promise(function (resolve, reject) { + resource.getData().then(function () { + if (resource.isAccessControlled()) { + getStoredAccessToken(resource, tokenStorageStrategy) + .then(function (storedAccessToken) { + if (storedAccessToken) { + // try using the stored access token + resource + .getData(storedAccessToken) + .then(function () { + if (resource.status === OK) { + resolve(resource); // happy path ended + } + else { + // the stored token is no good for this resource + Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject); + } + })["catch"](function (message) { + reject(Utils.createInternalServerError(message)); + }); + } + else { + // There was no stored token, but the user might have a cookie that will grant a token + getAccessToken(resource, false).then(function (accessToken) { + if (accessToken) { + storeAccessToken(resource, accessToken, tokenStorageStrategy) + .then(function () { + // try using the fresh access token + resource + .getData(accessToken) + .then(function () { + if (resource.status === OK) { + resolve(resource); + } + else { + // User has a token, but it's not good enough + Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject); + } + })["catch"](function (message) { + reject(Utils.createInternalServerError(message)); + }); + })["catch"](function (message) { + // not able to store access token + reject(Utils.createInternalServerError(message)); + }); + } + else { + // The user did not have a cookie that granted a token + Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject); + } + }); + } + })["catch"](function (message) { + reject(Utils.createInternalServerError(message)); + }); + } + else { + // this info.json isn't access controlled, therefore there's no need to request an access token + resolve(resource); + } + }); + }); + }; + Utils.showAuthInteraction = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject) { + if (resource.status === MOVED_TEMPORARILY && !resource.isResponseHandled) { + // if the resource was redirected to a degraded version + // and the response hasn't been handled yet. + // if the client wishes to trigger a login, set resource.isResponseHandled to true + // and call loadExternalResources() again passing the resource. + resolve(resource); + // } else if (resource.restrictedService) { + // resolve(restricted(resource)); + // // TODO: move to next etc + } + else if (resource.clickThroughService && !resource.isResponseHandled) { + // if the resource has a click through service, use that. + clickThrough(resource).then(function () { + getAccessToken(resource, true) + .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)); + }); + }); + } + else { + // get an access token + login(resource).then(function () { + getAccessToken(resource, true) + .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)); + }); + }); + } + }; + Utils.getService = function (resource, profile) { + var services = this.getServices(resource); + for (var i = 0; i < services.length; i++) { + var service = services[i]; + if (service.getProfile() === profile) { + return service; + } + } + return null; + }; + Utils.getResourceById = function (parentResource, id) { + return (Utils.traverseAndFind(parentResource.__jsonld, "@id", id)); + }; + /** + * Does a depth first traversal of an Object, returning an Object that + * matches provided k and v arguments + * @example Utils.traverseAndFind({foo: 'bar'}, 'foo', 'bar') + */ + Utils.traverseAndFind = function (object, k, v) { + if (object.hasOwnProperty(k) && object[k] === v) { + return object; + } + for (var i = 0; i < Object.keys(object).length; i++) { + if (typeof object[Object.keys(object)[i]] === "object") { + var o = Utils.traverseAndFind(object[Object.keys(object)[i]], k, v); + if (o != null) { + return o; + } + } + } + return undefined; + }; + Utils.getServices = function (resource, _a) { + var _b = _a === void 0 ? {} : _a, _c = _b.onlyService, onlyService = _c === void 0 ? false : _c, _d = _b.onlyServices, onlyServices = _d === void 0 ? false : _d, _e = _b.skipParentResources, skipParentResources = _e === void 0 ? false : _e; + var services = []; + // Resources can reference "services" on the manifest. This is a bit of a hack to just get the services from the manifest + // too. What would be better is if this was used as a "Map" of full services. + // So when you come across { id: '...' } without any data, you can "lookup" services from the manifest. + // I would have implemented this if I was confident that it was reliable. Instead, I opted for the safest option that + // should not break any existing services. + if (!skipParentResources && + resource && + resource.options && + resource.options.resource && + resource.options.resource !== resource) { + services.push.apply(services, Utils.getServices(resource.options.resource, { onlyServices: true })); + } + var service = !onlyServices + ? (resource.__jsonld || resource).service || [] + : []; + // coerce to array + if (!Array.isArray(service)) { + service = [service]; + } + if (!onlyService) { + // Some resources also have a `.services` property. + // https://iiif.io/api/presentation/3.0/#services + service.push.apply(service, ((resource.__jsonld || resource).services || [])); + } + if (service.length === 0) { + return services; + } + for (var i = 0; i < service.length; i++) { + var s = service[i]; + if (typeof s === "string") { + var r = this.getResourceById(resource.options.resource, s); + if (r) { + services.push(new Service(r.__jsonld || r, resource.options)); + } + } + else { + services.push(new Service(s, resource.options)); + } + } + return services; + }; + Utils.getTemporalComponent = function (target) { + var temporal = /t=([^&]+)/g.exec(target); + var t = null; + if (temporal && temporal[1]) { + t = temporal[1].split(","); + } + return t; + }; + return Utils; +}()); +export { Utils }; +//# sourceMappingURL=Utils.js.map \ No newline at end of file diff --git a/dist-esmodule/Utils.js.map b/dist-esmodule/Utils.js.map new file mode 100644 index 00000000..361d92a8 --- /dev/null +++ b/dist-esmodule/Utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../src/Utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,YAAY,EAMZ,OAAO,EACP,UAAU,EAEX,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,cAAc,EACd,WAAW,EACZ,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,EAAE,EACF,iBAAiB,EACjB,YAAY,EACb,MAAM,yCAAyC,CAAC;AACjD,OAAO,oBAAoB,CAAC;AAE5B;IAAA;IAunCA,CAAC;IAtnCQ,kBAAY,GAAnB,UAAoB,IAAY;QAC9B,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1B,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1B,OAAkB,IAAI,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAEM,qBAAe,GAAtB,UAAuB,OAAuB;QAC5C,IACE,OAAO,KAAK,cAAc,CAAC,0BAA0B;YACrD,OAAO,KAAK,cAAc,CAAC,0BAA0B;Y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AC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,CAAC;QAED,OAAO,CAAC,CAAC;IACX,CAAC;IACH,YAAC;AAAD,CAAC,AAvnCD,IAunCC"} \ No newline at end of file diff --git a/dist-esmodule/index.d.ts b/dist-esmodule/index.d.ts new file mode 100644 index 00000000..5348276d --- /dev/null +++ b/dist-esmodule/index.d.ts @@ -0,0 +1,19 @@ +export * from "./internal"; +import { IIIFResource } from "./IIIFResource"; +import { IManifestoOptions } from "./IManifestoOptions"; +/** +Initiates downloading an IIIF manifest json file from URL. Returns a Promise +to allow subsequent processing on a successful fetch. + +@param url string containing the URL to Fetch +@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text. +**/ +export declare const loadManifest: (url: string) => Promise; +/** +Parses IIIF manifest file to return a manifesto Manifest instance + +@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file. +@param options? TODO Not yet documented +@returns instance of Manifest class. +**/ +export declare const parseManifest: (manifest: any, options?: IManifestoOptions | undefined) => IIIFResource | null; diff --git a/dist-esmodule/index.js b/dist-esmodule/index.js new file mode 100644 index 00000000..56f2087f --- /dev/null +++ b/dist-esmodule/index.js @@ -0,0 +1,23 @@ +export * from "./internal"; +import { Utils } from "./Utils"; +/** +Initiates downloading an IIIF manifest json file from URL. Returns a Promise +to allow subsequent processing on a successful fetch. + +@param url string containing the URL to Fetch +@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text. +**/ +export var loadManifest = function (url) { + return Utils.loadManifest(url); +}; +/** +Parses IIIF manifest file to return a manifesto Manifest instance + +@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file. +@param options? TODO Not yet documented +@returns instance of Manifest class. +**/ +export var parseManifest = function (manifest, options) { + return Utils.parseManifest(manifest, options); +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist-esmodule/index.js.map b/dist-esmodule/index.js.map new file mode 100644 index 00000000..26a4a834 --- /dev/null +++ b/dist-esmodule/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAI3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,YAAY,GAAkC,UAAC,GAAW;IACrE,OAAO,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,aAAa,GAGC,UAAC,QAAgB,EAAE,OAA2B;IACvE,OAAO,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC,CAAC"} \ No newline at end of file diff --git a/dist-esmodule/internal.d.ts b/dist-esmodule/internal.d.ts new file mode 100644 index 00000000..8a53131b --- /dev/null +++ b/dist-esmodule/internal.d.ts @@ -0,0 +1,50 @@ +export * from "./JSONLDResource"; +export * from "./Transform"; +export * from "./ManifestResource"; +export * from "./Resource"; +export * from "./IIIFResource"; +export * from "./SpecificResource"; +export * from "./AnnotationBody"; +export * from "./Light"; +export * from "./Camera"; +export * from "./AnnotationBodyParser"; +export * from "./Annotation"; +export * from "./AnnotationList"; +export * from "./AnnotationPage"; +export * from "./Canvas"; +export * from "./Collection"; +export * from "./Duration"; +export * from "./IAccessToken"; +export * from "./IExternalImageResourceData"; +export * from "./IExternalResource"; +export * from "./IExternalResourceData"; +export * from "./IExternalResourceOptions"; +export * from "./IManifestoOptions"; +export * from "./LabelValuePair"; +export * from "./Language"; +export * from "./LanguageMap"; +export * from "./PropertyValue"; +export * from "./Manifest"; +export * from "./ManifestType"; +export * from "./PointSelector"; +export * from "./Range"; +export * from "./Rendering"; +export * from "./Scene"; +export * from "./Sequence"; +export * from "./Serialisation"; +export * from "./Service"; +export * from "./Size"; +export * from "./StatusCode"; +export * from "./Thumb"; +export * from "./Thumbnail"; +export * from "./Transform"; +export * from "./TranslateTransform"; +export * from "./TransformParser"; +export * from "./TreeNode"; +export * from "./TreeNodeType"; +export * from "./Utils"; +export * from "./TranslateTransform"; +export * from "./RotateTransform"; +export * from "./ScaleTransform"; +export * from "./Color"; +export * from "./Geometry3d"; diff --git a/dist-esmodule/internal.js b/dist-esmodule/internal.js new file mode 100644 index 00000000..0bf97fdb --- /dev/null +++ b/dist-esmodule/internal.js @@ -0,0 +1,53 @@ +export * from "./JSONLDResource"; +export * from "./Transform"; +export * from "./ManifestResource"; +export * from "./Resource"; +export * from "./IIIFResource"; +export * from "./SpecificResource"; +//export * from "./SpecificResourceForTarget"; +//export * from "./SpecificResourceForBody"; +export * from "./AnnotationBody"; +export * from "./Light"; +export * from "./Camera"; +export * from "./AnnotationBodyParser"; +export * from "./Annotation"; +export * from "./AnnotationList"; +export * from "./AnnotationPage"; +export * from "./Canvas"; +export * from "./Collection"; +export * from "./Duration"; +export * from "./IAccessToken"; +export * from "./IExternalImageResourceData"; +export * from "./IExternalResource"; +export * from "./IExternalResourceData"; +export * from "./IExternalResourceOptions"; +export * from "./IManifestoOptions"; +export * from "./LabelValuePair"; +export * from "./Language"; +export * from "./LanguageMap"; +export * from "./PropertyValue"; +export * from "./Manifest"; +export * from "./ManifestType"; +export * from "./PointSelector"; +export * from "./Range"; +export * from "./Rendering"; +export * from "./Scene"; +export * from "./Sequence"; +export * from "./Serialisation"; +export * from "./Service"; +export * from "./Size"; +export * from "./StatusCode"; +export * from "./Thumb"; +export * from "./Thumbnail"; +export * from "./Transform"; +export * from "./TranslateTransform"; +export * from "./TransformParser"; +export * from "./TreeNode"; +export * from "./TreeNodeType"; +export * from "./Utils"; +export * from "./TranslateTransform"; +export * from "./RotateTransform"; +export * from "./ScaleTransform"; +export * from "./Color"; +export * from "./Geometry3d"; +//# sourceMappingURL=internal.js.map \ No newline at end of file diff --git a/dist-esmodule/internal.js.map b/dist-esmodule/internal.js.map new file mode 100644 index 00000000..ebf61722 --- /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c,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AAExB,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/dist-umd/manifesto.js b/dist-umd/manifesto.js new file mode 100644 index 00000000..6851b5d8 --- /dev/null +++ b/dist-umd/manifesto.js @@ -0,0 +1,2 @@ +/*! For license information please see manifesto.js.LICENSE.txt */ +!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("node-fetch")):"function"==typeof define&&define.amd?define("manifesto",["node-fetch"],n):"object"==typeof exports?exports.manifesto=n(require("node-fetch")):t.manifesto=n(t["node-fetch"])}("undefined"!=typeof self?self:this,(__WEBPACK_EXTERNAL_MODULE_node_fetch__=>(()=>{var __webpack_modules__={"./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\r\nObject.defineProperty(exports, "__esModule", ({ value: true }));\r\nexports.CONTINUE = 100;\r\nexports.SWITCHING_PROTOCOLS = 101;\r\nexports.PROCESSING = 102;\r\nexports.OK = 200;\r\nexports.CREATED = 201;\r\nexports.ACCEPTED = 202;\r\nexports.NON_AUTHORITATIVE_INFORMATION = 203;\r\nexports.NO_CONTENT = 204;\r\nexports.RESET_CONTENT = 205;\r\nexports.PARTIAL_CONTENT = 206;\r\nexports.MULTI_STATUS = 207;\r\nexports.MULTIPLE_CHOICES = 300;\r\nexports.MOVED_PERMANENTLY = 301;\r\nexports.MOVED_TEMPORARILY = 302;\r\nexports.SEE_OTHER = 303;\r\nexports.NOT_MODIFIED = 304;\r\nexports.USE_PROXY = 305;\r\nexports.TEMPORARY_REDIRECT = 307;\r\nexports.BAD_REQUEST = 400;\r\nexports.UNAUTHORIZED = 401;\r\nexports.PAYMENT_REQUIRED = 402;\r\nexports.FORBIDDEN = 403;\r\nexports.NOT_FOUND = 404;\r\nexports.METHOD_NOT_ALLOWED = 405;\r\nexports.NOT_ACCEPTABLE = 406;\r\nexports.PROXY_AUTHENTICATION_REQUIRED = 407;\r\nexports.REQUEST_TIME_OUT = 408;\r\nexports.CONFLICT = 409;\r\nexports.GONE = 410;\r\nexports.LENGTH_REQUIRED = 411;\r\nexports.PRECONDITION_FAILED = 412;\r\nexports.REQUEST_ENTITY_TOO_LARGE = 413;\r\nexports.REQUEST_URI_TOO_LARGE = 414;\r\nexports.UNSUPPORTED_MEDIA_TYPE = 415;\r\nexports.REQUESTED_RANGE_NOT_SATISFIABLE = 416;\r\nexports.EXPECTATION_FAILED = 417;\r\nexports.IM_A_TEAPOT = 418;\r\nexports.UNPROCESSABLE_ENTITY = 422;\r\nexports.LOCKED = 423;\r\nexports.FAILED_DEPENDENCY = 424;\r\nexports.UNORDERED_COLLECTION = 425;\r\nexports.UPGRADE_REQUIRED = 426;\r\nexports.PRECONDITION_REQUIRED = 428;\r\nexports.TOO_MANY_REQUESTS = 429;\r\nexports.REQUEST_HEADER_FIELDS_TOO_LARGE = 431;\r\nexports.INTERNAL_SERVER_ERROR = 500;\r\nexports.NOT_IMPLEMENTED = 501;\r\nexports.BAD_GATEWAY = 502;\r\nexports.SERVICE_UNAVAILABLE = 503;\r\nexports.GATEWAY_TIME_OUT = 504;\r\nexports.HTTP_VERSION_NOT_SUPPORTED = 505;\r\nexports.VARIANT_ALSO_NEGOTIATES = 506;\r\nexports.INSUFFICIENT_STORAGE = 507;\r\nexports.BANDWIDTH_LIMIT_EXCEEDED = 509;\r\nexports.NOT_EXTENDED = 510;\r\nexports.NETWORK_AUTHENTICATION_REQUIRED = 511;\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js?')},"./node_modules/@iiif/vocabulary/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar AnnotationMotivation;\n(function (AnnotationMotivation) {\n AnnotationMotivation["BOOKMARKING"] = "oa:bookmarking";\n AnnotationMotivation["CLASSIFYING"] = "oa:classifying";\n AnnotationMotivation["COMMENTING"] = "oa:commenting";\n AnnotationMotivation["DESCRIBING"] = "oa:describing";\n AnnotationMotivation["EDITING"] = "oa:editing";\n AnnotationMotivation["HIGHLIGHTING"] = "oa:highlighting";\n AnnotationMotivation["IDENTIFYING"] = "oa:identifying";\n AnnotationMotivation["LINKING"] = "oa:linking";\n AnnotationMotivation["MODERATING"] = "oa:moderating";\n AnnotationMotivation["PAINTING"] = "sc:painting";\n AnnotationMotivation["QUESTIONING"] = "oa:questioning";\n AnnotationMotivation["REPLYING"] = "oa:replying";\n AnnotationMotivation["TAGGING"] = "oa:tagging";\n AnnotationMotivation["TRANSCRIBING"] = "oad:transcribing";\n})(AnnotationMotivation = exports.AnnotationMotivation || (exports.AnnotationMotivation = {}));\nvar Behavior;\n(function (Behavior) {\n Behavior["AUTO_ADVANCE"] = "auto-advance";\n Behavior["CONTINUOUS"] = "continuous";\n Behavior["FACING_PAGES"] = "facing-pages";\n Behavior["HIDDEN"] = "hidden";\n Behavior["INDIVIDUALS"] = "individuals";\n Behavior["MULTI_PART"] = "multi-part";\n Behavior["NO_NAV"] = "no-nav";\n Behavior["NON_PAGED"] = "non-paged";\n Behavior["PAGED"] = "paged";\n Behavior["REPEAT"] = "repeat";\n Behavior["SEQUENCE"] = "sequence";\n Behavior["THUMBNAIL_NAV"] = "thumbnail-nav";\n Behavior["TOGETHER"] = "together";\n Behavior["UNORDERED"] = "unordered";\n})(Behavior = exports.Behavior || (exports.Behavior = {}));\nvar ExternalResourceType;\n(function (ExternalResourceType) {\n ExternalResourceType["CANVAS"] = "canvas";\n ExternalResourceType["CHOICE"] = "choice";\n ExternalResourceType["OA_CHOICE"] = "oa:choice";\n ExternalResourceType["CONTENT_AS_TEXT"] = "contentastext";\n ExternalResourceType["DATASET"] = "dataset";\n ExternalResourceType["DOCUMENT"] = "document";\n ExternalResourceType["IMAGE"] = "image";\n ExternalResourceType["MODEL"] = "model";\n ExternalResourceType["MOVING_IMAGE"] = "movingimage";\n ExternalResourceType["PDF"] = "pdf";\n ExternalResourceType["PHYSICAL_OBJECT"] = "physicalobject";\n ExternalResourceType["SOUND"] = "sound";\n ExternalResourceType["TEXT"] = "text";\n ExternalResourceType["TEXTUALBODY"] = "textualbody";\n ExternalResourceType["VIDEO"] = "video";\n})(ExternalResourceType = exports.ExternalResourceType || (exports.ExternalResourceType = {}));\nvar IIIFResourceType;\n(function (IIIFResourceType) {\n IIIFResourceType["ANNOTATION"] = "annotation";\n IIIFResourceType["CANVAS"] = "canvas";\n IIIFResourceType["COLLECTION"] = "collection";\n IIIFResourceType["MANIFEST"] = "manifest";\n IIIFResourceType["RANGE"] = "range";\n IIIFResourceType["SEQUENCE"] = "sequence";\n})(IIIFResourceType = exports.IIIFResourceType || (exports.IIIFResourceType = {}));\nvar MediaType;\n(function (MediaType) {\n MediaType["AUDIO_MP4"] = "audio/mp4";\n MediaType["CORTO"] = "application/corto";\n MediaType["DICOM"] = "application/dicom";\n MediaType["DRACO"] = "application/draco";\n MediaType["EPUB"] = "application/epub+zip";\n MediaType["GIRDER"] = "image/vnd.kitware.girder";\n MediaType["GLB"] = "model/gltf-binary";\n MediaType["GLTF"] = "model/gltf+json";\n MediaType["IIIF_PRESENTATION_2"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/2/context.json\\"";\n MediaType["IIIF_PRESENTATION_3"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/3/context.json\\"";\n MediaType["JPG"] = "image/jpeg";\n MediaType["M3U8"] = "application/vnd.apple.mpegurl";\n MediaType["MP3"] = "audio/mp3";\n MediaType["MPEG_DASH"] = "application/dash+xml";\n MediaType["OBJ"] = "text/plain";\n MediaType["OPF"] = "application/oebps-package+xml";\n MediaType["PDF"] = "application/pdf";\n MediaType["PLY"] = "application/ply";\n MediaType["THREEJS"] = "application/vnd.threejs+json";\n MediaType["USDZ"] = "model/vnd.usd+zip";\n MediaType["VIDEO_MP4"] = "video/mp4";\n MediaType["WAV"] = "audio/wav";\n MediaType["WEBM"] = "video/webm";\n})(MediaType = exports.MediaType || (exports.MediaType = {}));\nvar RenderingFormat;\n(function (RenderingFormat) {\n RenderingFormat["DOC"] = "application/msword";\n RenderingFormat["DOCX"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";\n RenderingFormat["PDF"] = "application/pdf";\n})(RenderingFormat = exports.RenderingFormat || (exports.RenderingFormat = {}));\nvar ServiceProfile;\n(function (ServiceProfile) {\n // image api\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level0";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level1";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level2";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level0";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level1";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level2";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2";\n ServiceProfile["IMAGE_1_LEVEL_0"] = "http://iiif.io/api/image/1/level0.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/1/profiles/level0.json";\n ServiceProfile["IMAGE_1_LEVEL_1"] = "http://iiif.io/api/image/1/level1.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/1/profiles/level1.json";\n ServiceProfile["IMAGE_1_LEVEL_2"] = "http://iiif.io/api/image/1/level2.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/1/profiles/level2.json";\n ServiceProfile["IMAGE_2_LEVEL_0"] = "http://iiif.io/api/image/2/level0.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/2/profiles/level0.json";\n ServiceProfile["IMAGE_2_LEVEL_1"] = "http://iiif.io/api/image/2/level1.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/2/profiles/level1.json";\n ServiceProfile["IMAGE_2_LEVEL_2"] = "http://iiif.io/api/image/2/level2.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/2/profiles/level2.json";\n // auth api\n ServiceProfile["AUTH_0_CLICK_THROUGH"] = "http://iiif.io/api/auth/0/login/clickthrough";\n ServiceProfile["AUTH_0_LOGIN"] = "http://iiif.io/api/auth/0/login";\n ServiceProfile["AUTH_0_LOGOUT"] = "http://iiif.io/api/auth/0/logout";\n ServiceProfile["AUTH_0_RESTRICTED"] = "http://iiif.io/api/auth/0/login/restricted";\n ServiceProfile["AUTH_0_TOKEN"] = "http://iiif.io/api/auth/0/token";\n ServiceProfile["AUTH_1_CLICK_THROUGH"] = "http://iiif.io/api/auth/1/clickthrough";\n ServiceProfile["AUTH_1_EXTERNAL"] = "http://iiif.io/api/auth/1/external";\n ServiceProfile["AUTH_1_KIOSK"] = "http://iiif.io/api/auth/1/kiosk";\n ServiceProfile["AUTH_1_LOGIN"] = "http://iiif.io/api/auth/1/login";\n ServiceProfile["AUTH_1_LOGOUT"] = "http://iiif.io/api/auth/1/logout";\n ServiceProfile["AUTH_1_PROBE"] = "http://iiif.io/api/auth/1/probe";\n ServiceProfile["AUTH_1_TOKEN"] = "http://iiif.io/api/auth/1/token";\n // search api\n ServiceProfile["SEARCH_0"] = "http://iiif.io/api/search/0/search";\n ServiceProfile["SEARCH_0_AUTO_COMPLETE"] = "http://iiif.io/api/search/0/autocomplete";\n ServiceProfile["SEARCH_1"] = "http://iiif.io/api/search/1/search";\n ServiceProfile["SEARCH_1_AUTO_COMPLETE"] = "http://iiif.io/api/search/1/autocomplete";\n // extensions\n ServiceProfile["TRACKING_EXTENSIONS"] = "http://universalviewer.io/tracking-extensions-profile";\n ServiceProfile["UI_EXTENSIONS"] = "http://universalviewer.io/ui-extensions-profile";\n ServiceProfile["PRINT_EXTENSIONS"] = "http://universalviewer.io/print-extensions-profile";\n ServiceProfile["SHARE_EXTENSIONS"] = "http://universalviewer.io/share-extensions-profile";\n ServiceProfile["DOWNLOAD_EXTENSIONS"] = "http://universalviewer.io/download-extensions-profile";\n // other\n ServiceProfile["OTHER_MANIFESTATIONS"] = "http://iiif.io/api/otherManifestations.json";\n ServiceProfile["IXIF"] = "http://wellcomelibrary.org/ld/ixif/0/alpha.json";\n})(ServiceProfile = exports.ServiceProfile || (exports.ServiceProfile = {}));\nvar ServiceType;\n(function (ServiceType) {\n ServiceType["IMAGE_SERVICE_2"] = "ImageService2";\n ServiceType["IMAGE_SERVICE_3"] = "ImageService3";\n})(ServiceType = exports.ServiceType || (exports.ServiceType = {}));\nvar ViewingDirection;\n(function (ViewingDirection) {\n ViewingDirection["BOTTOM_TO_TOP"] = "bottom-to-top";\n ViewingDirection["LEFT_TO_RIGHT"] = "left-to-right";\n ViewingDirection["RIGHT_TO_LEFT"] = "right-to-left";\n ViewingDirection["TOP_TO_BOTTOM"] = "top-to-bottom";\n})(ViewingDirection = exports.ViewingDirection || (exports.ViewingDirection = {}));\nvar ViewingHint;\n(function (ViewingHint) {\n ViewingHint["CONTINUOUS"] = "continuous";\n ViewingHint["INDIVIDUALS"] = "individuals";\n ViewingHint["NON_PAGED"] = "non-paged";\n ViewingHint["PAGED"] = "paged";\n ViewingHint["TOP"] = "top";\n})(ViewingHint = exports.ViewingHint || (exports.ViewingHint = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@iiif/vocabulary/dist-commonjs/index.js?')},"./node_modules/color-name/index.js":module=>{"use strict";eval('\r\n\r\nmodule.exports = {\r\n\t"aliceblue": [240, 248, 255],\r\n\t"antiquewhite": [250, 235, 215],\r\n\t"aqua": [0, 255, 255],\r\n\t"aquamarine": [127, 255, 212],\r\n\t"azure": [240, 255, 255],\r\n\t"beige": [245, 245, 220],\r\n\t"bisque": [255, 228, 196],\r\n\t"black": [0, 0, 0],\r\n\t"blanchedalmond": [255, 235, 205],\r\n\t"blue": [0, 0, 255],\r\n\t"blueviolet": [138, 43, 226],\r\n\t"brown": [165, 42, 42],\r\n\t"burlywood": [222, 184, 135],\r\n\t"cadetblue": [95, 158, 160],\r\n\t"chartreuse": [127, 255, 0],\r\n\t"chocolate": [210, 105, 30],\r\n\t"coral": [255, 127, 80],\r\n\t"cornflowerblue": [100, 149, 237],\r\n\t"cornsilk": [255, 248, 220],\r\n\t"crimson": [220, 20, 60],\r\n\t"cyan": [0, 255, 255],\r\n\t"darkblue": [0, 0, 139],\r\n\t"darkcyan": [0, 139, 139],\r\n\t"darkgoldenrod": [184, 134, 11],\r\n\t"darkgray": [169, 169, 169],\r\n\t"darkgreen": [0, 100, 0],\r\n\t"darkgrey": [169, 169, 169],\r\n\t"darkkhaki": [189, 183, 107],\r\n\t"darkmagenta": [139, 0, 139],\r\n\t"darkolivegreen": [85, 107, 47],\r\n\t"darkorange": [255, 140, 0],\r\n\t"darkorchid": [153, 50, 204],\r\n\t"darkred": [139, 0, 0],\r\n\t"darksalmon": [233, 150, 122],\r\n\t"darkseagreen": [143, 188, 143],\r\n\t"darkslateblue": [72, 61, 139],\r\n\t"darkslategray": [47, 79, 79],\r\n\t"darkslategrey": [47, 79, 79],\r\n\t"darkturquoise": [0, 206, 209],\r\n\t"darkviolet": [148, 0, 211],\r\n\t"deeppink": [255, 20, 147],\r\n\t"deepskyblue": [0, 191, 255],\r\n\t"dimgray": [105, 105, 105],\r\n\t"dimgrey": [105, 105, 105],\r\n\t"dodgerblue": [30, 144, 255],\r\n\t"firebrick": [178, 34, 34],\r\n\t"floralwhite": [255, 250, 240],\r\n\t"forestgreen": [34, 139, 34],\r\n\t"fuchsia": [255, 0, 255],\r\n\t"gainsboro": [220, 220, 220],\r\n\t"ghostwhite": [248, 248, 255],\r\n\t"gold": [255, 215, 0],\r\n\t"goldenrod": [218, 165, 32],\r\n\t"gray": [128, 128, 128],\r\n\t"green": [0, 128, 0],\r\n\t"greenyellow": [173, 255, 47],\r\n\t"grey": [128, 128, 128],\r\n\t"honeydew": [240, 255, 240],\r\n\t"hotpink": [255, 105, 180],\r\n\t"indianred": [205, 92, 92],\r\n\t"indigo": [75, 0, 130],\r\n\t"ivory": [255, 255, 240],\r\n\t"khaki": [240, 230, 140],\r\n\t"lavender": [230, 230, 250],\r\n\t"lavenderblush": [255, 240, 245],\r\n\t"lawngreen": [124, 252, 0],\r\n\t"lemonchiffon": [255, 250, 205],\r\n\t"lightblue": [173, 216, 230],\r\n\t"lightcoral": [240, 128, 128],\r\n\t"lightcyan": [224, 255, 255],\r\n\t"lightgoldenrodyellow": [250, 250, 210],\r\n\t"lightgray": [211, 211, 211],\r\n\t"lightgreen": [144, 238, 144],\r\n\t"lightgrey": [211, 211, 211],\r\n\t"lightpink": [255, 182, 193],\r\n\t"lightsalmon": [255, 160, 122],\r\n\t"lightseagreen": [32, 178, 170],\r\n\t"lightskyblue": [135, 206, 250],\r\n\t"lightslategray": [119, 136, 153],\r\n\t"lightslategrey": [119, 136, 153],\r\n\t"lightsteelblue": [176, 196, 222],\r\n\t"lightyellow": [255, 255, 224],\r\n\t"lime": [0, 255, 0],\r\n\t"limegreen": [50, 205, 50],\r\n\t"linen": [250, 240, 230],\r\n\t"magenta": [255, 0, 255],\r\n\t"maroon": [128, 0, 0],\r\n\t"mediumaquamarine": [102, 205, 170],\r\n\t"mediumblue": [0, 0, 205],\r\n\t"mediumorchid": [186, 85, 211],\r\n\t"mediumpurple": [147, 112, 219],\r\n\t"mediumseagreen": [60, 179, 113],\r\n\t"mediumslateblue": [123, 104, 238],\r\n\t"mediumspringgreen": [0, 250, 154],\r\n\t"mediumturquoise": [72, 209, 204],\r\n\t"mediumvioletred": [199, 21, 133],\r\n\t"midnightblue": [25, 25, 112],\r\n\t"mintcream": [245, 255, 250],\r\n\t"mistyrose": [255, 228, 225],\r\n\t"moccasin": [255, 228, 181],\r\n\t"navajowhite": [255, 222, 173],\r\n\t"navy": [0, 0, 128],\r\n\t"oldlace": [253, 245, 230],\r\n\t"olive": [128, 128, 0],\r\n\t"olivedrab": [107, 142, 35],\r\n\t"orange": [255, 165, 0],\r\n\t"orangered": [255, 69, 0],\r\n\t"orchid": [218, 112, 214],\r\n\t"palegoldenrod": [238, 232, 170],\r\n\t"palegreen": [152, 251, 152],\r\n\t"paleturquoise": [175, 238, 238],\r\n\t"palevioletred": [219, 112, 147],\r\n\t"papayawhip": [255, 239, 213],\r\n\t"peachpuff": [255, 218, 185],\r\n\t"peru": [205, 133, 63],\r\n\t"pink": [255, 192, 203],\r\n\t"plum": [221, 160, 221],\r\n\t"powderblue": [176, 224, 230],\r\n\t"purple": [128, 0, 128],\r\n\t"rebeccapurple": [102, 51, 153],\r\n\t"red": [255, 0, 0],\r\n\t"rosybrown": [188, 143, 143],\r\n\t"royalblue": [65, 105, 225],\r\n\t"saddlebrown": [139, 69, 19],\r\n\t"salmon": [250, 128, 114],\r\n\t"sandybrown": [244, 164, 96],\r\n\t"seagreen": [46, 139, 87],\r\n\t"seashell": [255, 245, 238],\r\n\t"sienna": [160, 82, 45],\r\n\t"silver": [192, 192, 192],\r\n\t"skyblue": [135, 206, 235],\r\n\t"slateblue": [106, 90, 205],\r\n\t"slategray": [112, 128, 144],\r\n\t"slategrey": [112, 128, 144],\r\n\t"snow": [255, 250, 250],\r\n\t"springgreen": [0, 255, 127],\r\n\t"steelblue": [70, 130, 180],\r\n\t"tan": [210, 180, 140],\r\n\t"teal": [0, 128, 128],\r\n\t"thistle": [216, 191, 216],\r\n\t"tomato": [255, 99, 71],\r\n\t"turquoise": [64, 224, 208],\r\n\t"violet": [238, 130, 238],\r\n\t"wheat": [245, 222, 179],\r\n\t"white": [255, 255, 255],\r\n\t"whitesmoke": [245, 245, 245],\r\n\t"yellow": [255, 255, 0],\r\n\t"yellowgreen": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-name/index.js?')},"./node_modules/color-string/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\nvar swizzle = __webpack_require__(/*! simple-swizzle */ \"./node_modules/simple-swizzle/index.js\");\nvar hasOwnProperty = Object.hasOwnProperty;\n\nvar reverseNames = Object.create(null);\n\n// create a list of reverse color names\nfor (var name in colorNames) {\n\tif (hasOwnProperty.call(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nvar cs = module.exports = {\n\tto: {},\n\tget: {}\n};\n\ncs.get = function (string) {\n\tvar prefix = string.substring(0, 3).toLowerCase();\n\tvar val;\n\tvar model;\n\tswitch (prefix) {\n\t\tcase 'hsl':\n\t\t\tval = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\tcase 'hwb':\n\t\t\tval = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tval = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t}\n\n\tif (!val) {\n\t\treturn null;\n\t}\n\n\treturn {model: model, value: val};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar abbr = /^#([a-f0-9]{3,4})$/i;\n\tvar hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;\n\tvar rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar keyword = /^(\\w+)$/;\n\n\tvar rgb = [0, 0, 0, 1];\n\tvar match;\n\tvar i;\n\tvar hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tvar i2 = i * 2;\n\t\t\trgb[i] = parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i + 1], 0);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!hasOwnProperty.call(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hsl = /^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hsl);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar s = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar l = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hwb = /^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hwb);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar w = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar b = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function () {\n\tvar rgba = swizzle(arguments);\n\n\tvar r = Math.round(rgba[0] / 255 * 100);\n\tvar g = Math.round(rgba[1] / 255 * 100);\n\tvar b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function () {\n\tvar hsla = swizzle(arguments);\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function () {\n\tvar hwba = swizzle(arguments);\n\n\tvar a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// helpers\nfunction clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n\tvar str = Math.round(num).toString(16).toUpperCase();\n\treturn (str.length < 2) ? '0' + str : str;\n}\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-string/index.js?")},"./node_modules/is-arrayish/index.js":module=>{eval("module.exports = function isArrayish(obj) {\n\tif (!obj || typeof obj === 'string') {\n\t\treturn false;\n\t}\n\n\treturn obj instanceof Array || Array.isArray(obj) ||\n\t\t(obj.length >= 0 && (obj.splice instanceof Function ||\n\t\t\t(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/is-arrayish/index.js?")},"./node_modules/isomorphic-unfetch/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('function r(m) {\n\treturn (m && m.default) || m;\n}\nmodule.exports = __webpack_require__.g.fetch =\n\t__webpack_require__.g.fetch ||\n\t(typeof process == "undefined"\n\t\t? r(__webpack_require__(/*! unfetch */ "./node_modules/unfetch/dist/unfetch.module.js"))\n\t\t: function (url, opts) {\n\t\t\t\tif (typeof url === "string" || url instanceof URL) {\n\t\t\t\t\turl = String(url).replace(/^\\/\\//g, "https://");\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! node-fetch */ "node-fetch", 23)).then((m) => r(m)(url, opts));\n\t\t });\n\n\n//# sourceURL=webpack://manifesto/./node_modules/isomorphic-unfetch/index.js?')},"./node_modules/lodash/_Symbol.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_Symbol.js?')},"./node_modules/lodash/_arrayPush.js":module=>{eval("/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_arrayPush.js?")},"./node_modules/lodash/_baseFlatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"),\n isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js");\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseFlatten.js?')},"./node_modules/lodash/_baseGetTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),\n objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");\n\n/** `Object#toString` result references. */\nvar nullTag = \'[object Null]\',\n undefinedTag = \'[object Undefined]\';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseGetTag.js?')},"./node_modules/lodash/_baseIsArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");\n\n/** `Object#toString` result references. */\nvar argsTag = \'[object Arguments]\';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseIsArguments.js?')},"./node_modules/lodash/_freeGlobal.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\nmodule.exports = freeGlobal;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_freeGlobal.js?")},"./node_modules/lodash/_getRawTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_getRawTag.js?')},"./node_modules/lodash/_isFlattenable.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"),\n isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js");\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_isFlattenable.js?')},"./node_modules/lodash/_objectToString.js":module=>{eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_objectToString.js?")},"./node_modules/lodash/_root.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_root.js?")},"./node_modules/lodash/flatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flatten.js?')},"./node_modules/lodash/flattenDeep.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flattenDeep.js?')},"./node_modules/lodash/isArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ \"./node_modules/lodash/_baseIsArguments.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArguments.js?")},"./node_modules/lodash/isArray.js":module=>{eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArray.js?")},"./node_modules/lodash/isObjectLike.js":module=>{eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isObjectLike.js?")},"./node_modules/simple-swizzle/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar isArrayish = __webpack_require__(/*! is-arrayish */ "./node_modules/is-arrayish/index.js");\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\nvar swizzle = module.exports = function swizzle(args) {\n\tvar results = [];\n\n\tfor (var i = 0, len = args.length; i < len; i++) {\n\t\tvar arg = args[i];\n\n\t\tif (isArrayish(arg)) {\n\t\t\t// http://jsperf.com/javascript-array-concat-vs-push/98\n\t\t\tresults = concat.call(results, slice.call(arg));\n\t\t} else {\n\t\t\tresults.push(arg);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nswizzle.wrap = function (fn) {\n\treturn function () {\n\t\treturn fn(swizzle(arguments));\n\t};\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/simple-swizzle/index.js?')},"./src/Annotation.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Annotation = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar Annotation = /** @class */ (function (_super) {\n __extends(Annotation, _super);\n function Annotation(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n /**\n In spite of its name, this method returns an array of objects, each of which\n represents a potential body annotations\n \n @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ }\n **/\n Annotation.prototype.getBody = function () {\n var bodies = [];\n var body = this.getProperty("body");\n // the following is intended to handle the following cases for\n /// the raw json of the body property of __jsonld\n // -- body is an array, each element of which is parsed\n // == body is an object with property items, each item is parsed\n // -- body is parsed\n if (body) {\n for (var _i = 0, _a = [].concat(body); _i < _a.length; _i++) {\n var bd = _a[_i];\n var items = bd.items;\n if (items)\n bodies = bodies.concat(this.parseBodiesFromItemsList(items));\n else\n bodies.push(this.parseSingletonBody(bd));\n }\n }\n return bodies;\n };\n Object.defineProperty(Annotation.prototype, "Body", {\n get: function () { return this.getBody(); },\n enumerable: false,\n configurable: true\n });\n /**\n auxiliary function to getBody; intended to hande an object that has an element items\n which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/\n seems to be the use case for this\n **/\n Annotation.prototype.parseBodiesFromItemsList = function (rawbodies) {\n var retVal = [];\n for (var _i = 0, _a = [].concat(rawbodies); _i < _a.length; _i++) {\n var bd = _a[_i];\n retVal.push(this.parseSingletonBody(bd));\n }\n return retVal;\n };\n /**\n auxiliary function to parseBodiesFromItemsList and getBody, this is the last\n step on recursively going through collections of bodies.\n **/\n Annotation.prototype.parseSingletonBody = function (rawbody) {\n if (rawbody.type === "SpecificResource") {\n return new internal_1.SpecificResource(rawbody, this.options);\n }\n else {\n return internal_1.AnnotationBodyParser.BuildFromJson(rawbody, this.options);\n }\n };\n /**\n Developer Note: 8 April 2024\n getBody3D function was developed in the early stages of the 3D API Feb-March 2024\n as alternative to the existing Annotation getBody function, but the signature for\n getBody3D was chosen to be a single object instance, not an array.\n \n At this stage, the merging of the 2D API anf the draft 3D API has been completed, so\n 3D applications can use the getBody() function to retrieve the body of an Annotation intended\n to target a scene. For compatibily the return value of the function is still an\n array.\n \n 3D clients using getBody are responsible for choosing the appropriate instance from the\n returned array. In most cases this will be the sole 0th element.\n **/\n Annotation.prototype.getBody3D = function () {\n console.warn("Annotation.getBody3D is deprecated: replace with getBody3D() with getBody()[0]");\n return this.getBody()[0];\n };\n Annotation.prototype.getMotivation = function () {\n var motivation = this.getProperty("motivation");\n if (motivation) {\n //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation);\n return motivation;\n }\n return null;\n };\n // open annotation\n Annotation.prototype.getOn = function () {\n return this.getProperty("on");\n };\n Annotation.prototype.getTarget = function () {\n var rawTarget = this.getPropertyAsObject("target");\n if (rawTarget.isIRI)\n return rawTarget;\n if (rawTarget.type && rawTarget.type == "SpecificResource") {\n return new internal_1.SpecificResource(rawTarget, this.options);\n }\n else {\n throw new Error("unknown target specified");\n }\n };\n Object.defineProperty(Annotation.prototype, "Target", {\n get: function () { return this.getTarget(); },\n enumerable: false,\n configurable: true\n });\n Annotation.prototype.getResource = function () {\n return new internal_1.Resource(this.getProperty("resource"), this.options);\n };\n Object.defineProperty(Annotation.prototype, "LookAtLocation", {\n /**\n * A 3D point coordinate object for the location of an Annotation\n * to satisfy the requirements of the lookAt property of camera and\n * spotlight resources, according to the draft v4 API as of April 1 2024\n *\n * Is the position of the point for a target which is a SpecificResource with\n * a PointSelector\n * Otherwise, for example when the annotation target is an entire Scene, the\n * location for lookAt is the origin (0,0,0)\n **/\n get: function () {\n var _a;\n var target = this.getTarget();\n if (target.isSpecificResource && ((_a = target.getSelector()) === null || _a === void 0 ? void 0 : _a.isPointSelector))\n return target.getSelector().getLocation();\n else\n return new threejs_math_1.Vector3(0.0, 0.0, 0.0);\n },\n enumerable: false,\n configurable: true\n });\n return Annotation;\n}(internal_1.ManifestResource));\nexports.Annotation = Annotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Annotation.ts?')},"./src/AnnotationBody.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBody = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\nWith the 3D extensions to the IIIF Presentation API the name of this\nclass is misleading, but for now is being retained for the sake backward\ncompatibility with earlier manifesto code and tests.\n\nThe 3D extensions allow that the body property of an annotation can be\na light, camera, or model, or a SpecificResource object wrapping a light, camera,\nor model.\n**/\nvar AnnotationBody = /** @class */ (function (_super) {\n __extends(AnnotationBody, _super);\n function AnnotationBody(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = true;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = false;\n // following class members were added to support 3D and mixed 2D/3D content\n // these boolean switches will be appropriately set when the manifest json is parsed\n _this.isModel = true;\n _this.isLight = false;\n _this.isCamera = false;\n return _this;\n }\n // Format, Type, Width, and Height are the body properties supported\n // in the code that supports Presentation 3\n AnnotationBody.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return internal_1.Utils.getMediaType(format);\n }\n return null;\n };\n AnnotationBody.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return (internal_1.Utils.normaliseType(this.getProperty("type")));\n }\n return null;\n };\n AnnotationBody.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n AnnotationBody.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n return AnnotationBody;\n}(internal_1.ManifestResource));\nexports.AnnotationBody = AnnotationBody;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBody.ts?')},"./src/AnnotationBodyParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBodyParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LightTypes = ["AmbientLight", "DirectionalLight", "SpotLight"];\nvar CameraTypes = ["PerspectiveCamera", "OrthographicCamera"];\nvar DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"];\nvar AnnotationBodyParser = /** @class */ (function () {\n function AnnotationBodyParser() {\n }\n AnnotationBodyParser.BuildFromJson = function (jsonld, options) {\n if (DisplayedTypes.includes(jsonld.type))\n return new internal_1.AnnotationBody(jsonld, options);\n else if (LightTypes.includes(jsonld.type))\n return new internal_1.Light(jsonld, options);\n else if (CameraTypes.includes(jsonld.type))\n return new internal_1.Camera(jsonld, options);\n else\n throw new Error("unimplemented type for AnnotationBody: " + jsonld.type);\n };\n return AnnotationBodyParser;\n}());\nexports.AnnotationBodyParser = AnnotationBodyParser;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBodyParser.ts?')},"./src/AnnotationList.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationList = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationList = /** @class */ (function (_super) {\n __extends(AnnotationList, _super);\n function AnnotationList(label, jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.label = label;\n _this.options = options;\n return _this;\n }\n AnnotationList.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n AnnotationList.prototype.getLabel = function () {\n return this.label;\n };\n AnnotationList.prototype.getResources = function () {\n var _this = this;\n var resources = this.getProperty("resources");\n return resources.map(function (resource) { return new internal_1.Annotation(resource, _this.options); });\n };\n AnnotationList.prototype.load = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.isLoaded) {\n resolve(_this);\n }\n else {\n var id = _this.__jsonld.id;\n if (!id) {\n id = _this.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id)\n .then(function (data) {\n _this.__jsonld = data;\n _this.context = _this.getProperty("context");\n _this.id = _this.getProperty("id");\n _this.isLoaded = true;\n resolve(_this);\n })\n .catch(reject);\n }\n });\n };\n return AnnotationList;\n}(internal_1.JSONLDResource));\nexports.AnnotationList = AnnotationList;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationList.ts?')},"./src/AnnotationPage.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationPage = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationPage = /** @class */ (function (_super) {\n __extends(AnnotationPage, _super);\n function AnnotationPage(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n AnnotationPage.prototype.getItems = function () {\n return this.getProperty("items");\n };\n return AnnotationPage;\n}(internal_1.ManifestResource));\nexports.AnnotationPage = AnnotationPage;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationPage.ts?')},"./src/Camera.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Camera = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Camera = /** @class */ (function (_super) {\n __extends(Camera, _super);\n function Camera(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isModel = false;\n _this.isLight = false;\n _this.isCamera = true;\n return _this;\n }\n Object.defineProperty(Camera.prototype, "isPerspectiveCamera", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "perspectivecamera");\n },\n enumerable: false,\n configurable: true\n });\n /**\n @returns full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n Camera.prototype.getFieldOfView = function () {\n if (this.isPerspectiveCamera) {\n var value = this.getProperty("fieldOfView");\n if (value)\n return value;\n else\n return 45.0;\n }\n else\n return undefined;\n };\n Object.defineProperty(Camera.prototype, "FieldOfView", {\n /**\n Full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n get: function () { return this.getFieldOfView(); },\n enumerable: false,\n configurable: true\n });\n /**\n * @return : if not null, is either a PointSelector, or an object\n * with an id matching the id of an Annotation instance.\n **/\n Camera.prototype.getLookAt = function () {\n var rawObj = this.getPropertyAsObject("lookAt");\n var rawType = (rawObj["type"] || rawObj["@type"]);\n if (rawType == "Annotation") {\n return rawObj;\n }\n if (rawType == "PointSelector") {\n return new internal_1.PointSelector(rawObj);\n }\n throw new Error(\'unidentified value of lookAt ${rawType}\');\n };\n Object.defineProperty(Camera.prototype, "LookAt", {\n get: function () { return this.getLookAt(); },\n enumerable: false,\n configurable: true\n });\n return Camera;\n}(internal_1.AnnotationBody));\nexports.Camera = Camera;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/Camera.ts?')},"./src/Canvas.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Canvas = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n// @ts-ignore\nvar flatten_1 = __importDefault(__webpack_require__(/*! lodash/flatten */ "./node_modules/lodash/flatten.js"));\n// @ts-ignore\nvar flattenDeep_1 = __importDefault(__webpack_require__(/*! lodash/flattenDeep */ "./node_modules/lodash/flattenDeep.js"));\nvar Canvas = /** @class */ (function (_super) {\n __extends(Canvas, _super);\n function Canvas(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // http://iiif.io/api/image/2.1/#canonical-uri-syntax\n Canvas.prototype.getCanonicalImageUri = function (w) {\n var id = null;\n var region = "full";\n var rotation = 0;\n var quality = "default";\n var width = w;\n var size;\n // if an info.json has been loaded\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data["@id"]) {\n id = this.externalResource.data["@id"];\n if (!width) {\n width = this.externalResource.data.width;\n }\n if (this.externalResource.data["@context"]) {\n if (this.externalResource.data["@context"].indexOf("/1.0/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1.1/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1/context.json") > -1) {\n quality = "native";\n }\n }\n }\n else {\n // info.json hasn\'t been loaded yet\n var images = void 0;\n // presentation 2.0\n images = this.getImages();\n if (images && images.length) {\n var firstImage = images[0];\n var resource = firstImage.getResource();\n var services = resource.getServices();\n if (!width) {\n width = resource.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return (internal_1.Utils.isImageProfile(service.getProfile()) ||\n internal_1.Utils.isImageServiceType(service.getIIIFResourceType()));\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === resource.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return resource.id;\n }\n }\n // presentation 3.0\n images = this.getContent();\n if (images && images.length) {\n var firstImage = images[0];\n // Developer note: Since Canvas in Presentation 3 doesn\'t use\n // SpecificResource resources in the body, force a cast\n var body = firstImage.getBody();\n var anno = body[0];\n var services = anno.getServices();\n if (!width) {\n width = anno.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return internal_1.Utils.isImageServiceType(service.getIIIFResourceType());\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === anno.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return anno.id;\n }\n }\n // todo: should this be moved to getThumbUri?\n if (!id) {\n var thumbnail = this.getProperty("thumbnail");\n if (thumbnail) {\n if (typeof thumbnail === "string") {\n return thumbnail;\n }\n else {\n if (thumbnail["@id"]) {\n return thumbnail["@id"];\n }\n else if (thumbnail.length) {\n return thumbnail[0].id;\n }\n }\n }\n }\n }\n size = width + ",";\n // trim off trailing \'/\'\n if (id && id.endsWith("/")) {\n id = id.substr(0, id.length - 1);\n }\n var uri = [id, region, size, rotation, quality + ".jpg"].join("/");\n return uri;\n };\n Canvas.prototype.getMaxDimensions = function () {\n var maxDimensions = null;\n var profile;\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data.profile) {\n profile = this.externalResource.data.profile;\n if (Array.isArray(profile)) {\n profile = profile.filter(function (p) { return p["maxWidth" || 0]; })[0];\n if (profile) {\n maxDimensions = new internal_1.Size(profile.maxWidth, profile.maxHeight ? profile.maxHeight : profile.maxWidth);\n }\n }\n }\n return maxDimensions;\n };\n // Presentation API 3.0\n Canvas.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n return content;\n };\n Canvas.prototype.getDuration = function () {\n return this.getProperty("duration");\n };\n // presentation 2.0\n Canvas.prototype.getImages = function () {\n var images = [];\n if (!this.__jsonld.images)\n return images;\n for (var i = 0; i < this.__jsonld.images.length; i++) {\n var a = this.__jsonld.images[i];\n var annotation = new internal_1.Annotation(a, this.options);\n images.push(annotation);\n }\n return images;\n };\n Canvas.prototype.getIndex = function () {\n return this.getProperty("index");\n };\n Canvas.prototype.getOtherContent = function () {\n var _this = this;\n var otherContent = Array.isArray(this.getProperty("otherContent"))\n ? this.getProperty("otherContent")\n : [this.getProperty("otherContent")];\n var canonicalComparison = function (typeA, typeB) {\n if (typeof typeA !== "string" || typeof typeB !== "string") {\n return false;\n }\n return typeA.toLowerCase() === typeA.toLowerCase();\n };\n var otherPromises = otherContent\n .filter(function (otherContent) {\n return otherContent &&\n canonicalComparison(otherContent["@type"], "sc:AnnotationList");\n })\n .map(function (annotationList, i) {\n return new internal_1.AnnotationList(annotationList["label"] || "Annotation list ".concat(i), annotationList, _this.options);\n })\n .map(function (annotationList) { return annotationList.load(); });\n return Promise.all(otherPromises);\n };\n // Prefer thumbnail service to image service if supplied and if\n // the thumbnail service can provide a satisfactory size +/- x pixels.\n // this is used to get thumb URIs *before* the info.json has been requested\n // and populate thumbnails in a viewer.\n // the publisher may also provide pre-computed fixed-size thumbs for better performance.\n //getThumbUri(width: number): string {\n //\n // var uri;\n // var images: IAnnotation[] = this.getImages();\n //\n // if (images && images.length) {\n // var firstImage = images[0];\n // var resource: IResource = firstImage.getResource();\n // var services: IService[] = resource.getServices();\n //\n // for (let i = 0; i < services.length; i++) {\n // var service: IService = services[i];\n // var id = service.id;\n //\n // if (!_endsWith(id, \'/\')) {\n // id += \'/\';\n // }\n //\n // uri = id + \'full/\' + width + \',/0/\' + Utils.getImageQuality(service.getProfile()) + \'.jpg\';\n // }\n // }\n //\n // return uri;\n //}\n //getType(): CanvasType {\n // return new CanvasType(this.getProperty(\'@type\').toLowerCase());\n //}\n Canvas.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Canvas.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Canvas.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Canvas.prototype, "imageResources", {\n get: function () {\n var _this = this;\n var resources = (0, flattenDeep_1.default)([\n this.getImages().map(function (i) { return i.getResource(); }),\n this.getContent().map(function (i) { return i.getBody(); })\n ]);\n return (0, flatten_1.default)(resources.map(function (resource) {\n switch (resource.getProperty("type").toLowerCase()) {\n case dist_commonjs_1.ExternalResourceType.CHOICE:\n case dist_commonjs_1.ExternalResourceType.OA_CHOICE:\n return new Canvas({\n images: (0, flatten_1.default)([\n resource.getProperty("default"),\n resource.getProperty("item")\n ]).map(function (r) { return ({ resource: r }); })\n }, _this.options)\n .getImages()\n .map(function (i) { return i.getResource(); });\n default:\n return resource;\n }\n }));\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "resourceAnnotations", {\n get: function () {\n return (0, flattenDeep_1.default)([this.getImages(), this.getContent()]);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns a given resource Annotation, based on a contained resource or body\n * id\n */\n Canvas.prototype.resourceAnnotation = function (id) {\n return this.resourceAnnotations.find(function (anno) {\n return anno.getResource().id === id ||\n (0, flatten_1.default)(new Array(anno.getBody())).some(function (body) { return body.id === id; });\n });\n };\n /**\n * Returns the fragment placement values if a resourceAnnotation is placed on\n * a canvas somewhere besides the full extent\n */\n Canvas.prototype.onFragment = function (id) {\n var resourceAnnotation = this.resourceAnnotation(id);\n if (!resourceAnnotation)\n return undefined;\n // IIIF v2\n var on = resourceAnnotation.getProperty("on");\n // IIIF v3\n var target = resourceAnnotation.getProperty("target");\n if (!on || !target) {\n return undefined;\n }\n var fragmentMatch = (on || target).match(/xywh=(.*)$/);\n if (!fragmentMatch)\n return undefined;\n return fragmentMatch[1].split(",").map(function (str) { return parseInt(str, 10); });\n };\n Object.defineProperty(Canvas.prototype, "iiifImageResources", {\n get: function () {\n return this.imageResources.filter(function (r) { return r && r.getServices()[0] && r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "imageServiceIds", {\n get: function () {\n return this.iiifImageResources.map(function (r) { return r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "aspectRatio", {\n get: function () {\n return this.getWidth() / this.getHeight();\n },\n enumerable: false,\n configurable: true\n });\n return Canvas;\n}(internal_1.Resource));\nexports.Canvas = Canvas;\n\n\n//# sourceURL=webpack://manifesto/./src/Canvas.ts?')},"./src/Collection.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Collection = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Collection = /** @class */ (function (_super) {\n __extends(Collection, _super);\n function Collection(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._collections = null;\n _this._manifests = null;\n jsonld.__collection = _this;\n return _this;\n }\n Collection.prototype.getCollections = function () {\n if (this._collections) {\n return this._collections;\n }\n return (this._collections = (this.items.filter(function (m) { return m.isCollection(); })));\n };\n Collection.prototype.getManifests = function () {\n if (this._manifests) {\n return this._manifests;\n }\n return (this._manifests = (this.items.filter(function (m) { return m.isManifest(); })));\n };\n Collection.prototype.getCollectionByIndex = function (collectionIndex) {\n var collections = this.getCollections();\n var collection;\n for (var i = 0; i < collections.length; i++) {\n var c = collections[i];\n if (c.index === collectionIndex) {\n collection = c;\n }\n }\n if (collection) {\n collection.options.index = collectionIndex;\n // id for collection MUST be dereferenceable\n return collection.load();\n }\n else {\n throw new Error("Collection index not found");\n }\n };\n Collection.prototype.getManifestByIndex = function (manifestIndex) {\n var manifests = this.getManifests();\n var manifest;\n for (var i = 0; i < manifests.length; i++) {\n var m = manifests[i];\n if (m.index === manifestIndex) {\n manifest = m;\n }\n }\n if (manifest) {\n manifest.options.index = manifestIndex;\n return manifest.load();\n }\n else {\n throw new Error("Manifest index not found");\n }\n };\n Collection.prototype.getTotalCollections = function () {\n return this.getCollections().length;\n };\n Collection.prototype.getTotalManifests = function () {\n return this.getManifests().length;\n };\n Collection.prototype.getTotalItems = function () {\n return this.items.length;\n };\n Collection.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n return dist_commonjs_1.ViewingDirection.LEFT_TO_RIGHT;\n };\n /**\n * Note: this only will return the first behavior as per the manifesto convention\n * IIIF v3 supports multiple behaviors\n */\n Collection.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Collection.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n /**\n * Get a tree of sub collections and manifests, using each child manifest\'s first \'top\' range.\n */\n Collection.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n //console.log("get default tree for ", this.id);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n this._parseManifests(this);\n this._parseCollections(this);\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Collection.prototype._parseManifests = function (parentCollection) {\n if (parentCollection.getManifests() &&\n parentCollection.getManifests().length) {\n for (var i = 0; i < parentCollection.getManifests().length; i++) {\n var manifest = parentCollection.getManifests()[i];\n var tree = manifest.getDefaultTree();\n tree.label =\n manifest.parentLabel ||\n manifest.getLabel().getValue(this.options.locale) ||\n "manifest " + (i + 1);\n tree.navDate = manifest.getNavDate();\n tree.data.id = manifest.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n Collection.prototype._parseCollections = function (parentCollection) {\n //console.log("parse collections for ", parentCollection.id);\n if (parentCollection.getCollections() &&\n parentCollection.getCollections().length) {\n for (var i = 0; i < parentCollection.getCollections().length; i++) {\n var collection = parentCollection.getCollections()[i];\n var tree = collection.getDefaultTree();\n tree.label =\n collection.parentLabel ||\n collection.getLabel().getValue(this.options.locale) ||\n "collection " + (i + 1);\n tree.navDate = collection.getNavDate();\n tree.data.id = collection.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n return Collection;\n}(internal_1.IIIFResource));\nexports.Collection = Collection;\n\n\n//# sourceURL=webpack://manifesto/./src/Collection.ts?')},"./src/Color.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n//import { colorString } from "color-string"\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Color = void 0;\nvar colorString = __webpack_require__(/*! color-string */ "./node_modules/color-string/index.js");\n/**\n * class structure with red, green, blue values in 0-255 range\n * Uses the {@link https://www.npmjs.com/package.color-string | color-string }\n * library for conversion from and to string representations of color.\n**/\nvar Color = /** @class */ (function () {\n /**\n * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red\n **/\n function Color(rgbValue) {\n this.value = rgbValue;\n }\n /**\n * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red\n * @returns Color instance.\n **/\n Color.fromCSS = function (cssTerm) {\n var rv = colorString.get(cssTerm);\n if (rv.model !== \'rgb\')\n throw new Error("unsupported color string: " + cssTerm);\n return new Color([rv.value[0], rv.value[1], rv.value[2]]);\n };\n Object.defineProperty(Color.prototype, "red", {\n /**\n * @return 0 to 255 value of red color component\n **/\n get: function () { return this.value[0]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "green", {\n /**\n * @return 0 to 255 value of green color component\n **/\n get: function () { return this.value[1]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "blue", {\n /**\n * @return 0 to 255 value of blue color component\n **/\n get: function () { return this.value[2]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "CSS", {\n /**\n * @returns hex string (as for CSS ) representation of r,g,b components\n **/\n get: function () { return colorString.to.hex(this.value); },\n enumerable: false,\n configurable: true\n });\n return Color;\n}());\nexports.Color = Color;\n\n\n//# sourceURL=webpack://manifesto/./src/Color.ts?')},"./src/Duration.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Duration = void 0;\nvar Duration = /** @class */ (function () {\n function Duration(start, end) {\n this.start = start;\n this.end = end;\n }\n Duration.prototype.getLength = function () {\n return this.end - this.start;\n };\n return Duration;\n}());\nexports.Duration = Duration;\n\n\n//# sourceURL=webpack://manifesto/./src/Duration.ts?')},"./src/Geometry3d.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.lightRelativeRotation = exports.cameraRelativeRotation = void 0;\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\n// https://ros2jsguy.github.io/threejs-math/index.html\n/**\n* performs the calculation required for the lookAt\n* property of a camera resource. Determines the\n* required angles of two rotations, the first about\n* the x axis and the second about the y axis, which will\n* rotate the default camera direction (0,0,-1) into the\n* direction of the input arguments\n*\n* Result of calculation is returned as a instance of EulerAngle from the\n* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The\n* three-js library uses body-fixed axes to represent EulerAngles, which reverse\n* the ordering of the "relative rotation" algorithm described in the\n* draft 3d api.\n\n* @param direction A vector interpreted as a direction. Client code\n* responsible for not passing a 0-length vector, else a\n\n*\n* @returns threejs-math.EulerAngle instance\n**/\nfunction cameraRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n // projDirection is the direction projected onto the xz plane\n var projDirection = direction.clone().setComponent(1, 0.0);\n var projLength = projDirection.length();\n // handle the edge case, desired viewing direction is either straight up\n // or straight down\n if (projLength == 0.0) {\n if (direction.y > 0.0) {\n // looking straight up fro below\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(+90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n else {\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(-90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n }\n var yAngleRad = Math.atan2(-projDirection.x, -projDirection.z);\n var xAngleRad = Math.atan2(direction.y, projLength);\n return new threejs_math_1.Euler(xAngleRad, yAngleRad, 0.0, "YXZ");\n}\nexports.cameraRelativeRotation = cameraRelativeRotation;\n;\nfunction lightRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n var unit_direction = direction.clone().divideScalar(direction.length());\n // negative y axis is initial direction of DirectionalLight, SpotLight\n // in draft 3D API\n var ny_axis = new threejs_math_1.Vector3(0.0, -1.0, 0.0);\n var quat = new threejs_math_1.Quaternion().setFromUnitVectors(ny_axis, unit_direction);\n var tmp = new threejs_math_1.Euler().setFromQuaternion(quat, "ZXY");\n // standard be setting the final intrinsic Y rotation, which is\n // along desired direction, to 0\n return new threejs_math_1.Euler(tmp.x, 0.0, tmp.z, "ZXY");\n}\nexports.lightRelativeRotation = lightRelativeRotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Geometry3d.ts?')},"./src/IAccessToken.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IAccessToken.ts?')},"./src/IExternalImageResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalImageResourceData.ts?')},"./src/IExternalResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResource.ts?')},"./src/IExternalResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceData.ts?')},"./src/IExternalResourceOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceOptions.ts?')},"./src/IIIFResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.IIIFResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar IIIFResource = /** @class */ (function (_super) {\n __extends(IIIFResource, _super);\n function IIIFResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = -1;\n _this.isLoaded = false;\n var defaultOptions = {\n defaultLabel: "-",\n locale: "en-GB",\n resource: _this,\n pessimisticAccessControl: false\n };\n _this.options = Object.assign(defaultOptions, options);\n return _this;\n }\n /**\n * @deprecated\n */\n IIIFResource.prototype.getAttribution = function () {\n //console.warn(\'getAttribution will be deprecated, use getRequiredStatement instead.\');\n var attribution = this.getProperty("attribution");\n if (attribution) {\n return internal_1.PropertyValue.parse(attribution, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getDescription = function () {\n var description = this.getProperty("description");\n if (description) {\n return internal_1.PropertyValue.parse(description, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getHomepage = function () {\n var homepage = this.getProperty("homepage");\n if (!homepage)\n return null;\n if (typeof homepage == "string")\n return homepage;\n if (Array.isArray(homepage) && homepage.length) {\n homepage = homepage[0];\n }\n return homepage["@id"] || homepage.id;\n };\n IIIFResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n IIIFResource.prototype.getLogo = function () {\n var logo = this.getProperty("logo");\n // Presentation 3.\n // The logo is exclusive to the "provider" property, which is of type "Agent".\n // In order to fulfil `manifest.getLogo()` we should check\n // When P3 is fully supported, the following should work.\n // return this.getProvider()?.getLogo();\n if (!logo) {\n var provider = this.getProperty("provider");\n if (!provider) {\n return null;\n }\n logo = provider.logo;\n }\n if (!logo)\n return null;\n if (typeof logo === "string")\n return logo;\n if (Array.isArray(logo) && logo.length) {\n logo = logo[0];\n }\n return logo["@id"] || logo.id;\n };\n IIIFResource.prototype.getLicense = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("license"), this.options.locale);\n };\n IIIFResource.prototype.getNavDate = function () {\n return new Date(this.getProperty("navDate"));\n };\n IIIFResource.prototype.getRelated = function () {\n return this.getProperty("related");\n };\n IIIFResource.prototype.getSeeAlso = function () {\n return this.getProperty("seeAlso");\n };\n IIIFResource.prototype.getTrackingLabel = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.TRACKING_EXTENSIONS));\n if (service) {\n return service.getProperty("trackingLabel");\n }\n return "";\n };\n IIIFResource.prototype.getDefaultTree = function () {\n this.defaultTree = new internal_1.TreeNode("root");\n this.defaultTree.data = this;\n return this.defaultTree;\n };\n IIIFResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n else {\n // fall back to attribution (if it exists)\n var attribution = this.getAttribution();\n if (attribution) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.value = attribution;\n }\n }\n return requiredStatement;\n };\n IIIFResource.prototype.isCollection = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.isManifest = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.load = function () {\n var that = this;\n return new Promise(function (resolve) {\n if (that.isLoaded) {\n resolve(that);\n }\n else {\n var options_1 = that.options;\n options_1.navDate = that.getNavDate();\n var id = that.__jsonld.id;\n if (!id) {\n id = that.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id).then(function (data) {\n that.parentLabel = that.getLabel().getValue(options_1.locale);\n var parsed = internal_1.Deserialiser.parse(data, options_1);\n that = Object.assign(that, parsed);\n //that.parentCollection = options.resource.parentCollection;\n that.index = options_1.index;\n resolve(that);\n });\n }\n });\n };\n return IIIFResource;\n}(internal_1.ManifestResource));\nexports.IIIFResource = IIIFResource;\n\n\n//# sourceURL=webpack://manifesto/./src/IIIFResource.ts?')},"./src/IManifestoOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IManifestoOptions.ts?')},"./src/JSONLDResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.JSONLDResource = void 0;\nvar JSONLDResource = /** @class */ (function () {\n function JSONLDResource(jsonld) {\n this.__jsonld = jsonld;\n this.context = this.getProperty("context");\n this.id = this.getProperty("id");\n }\n JSONLDResource.prototype.getProperty = function (name) {\n var prop = null;\n if (this.__jsonld) {\n prop = this.__jsonld[name];\n if (!prop) {\n // property may have a prepended \'@\'\n prop = this.__jsonld["@" + name];\n }\n }\n return prop;\n };\n /**\n A function that wraps the getProperty function, which client\n code can use if it is needed to identify when the json value of\n a property is an IRI -- Internationalized Resource Identifier\n \n If the value of the json value is a bare string, then it will be\n wrapped in a json object with the string in the property \'id\',\n additionally that property will have a property \'isIRI\' which will\n be true for the literal string case, otherwise false meaning the\n returned getProperty should be parsed as before.\n \n **/\n JSONLDResource.prototype.getPropertyAsObject = function (name) {\n var prop = this.getProperty(name);\n if (prop === null)\n return prop;\n else if (typeof (prop) === \'string\')\n return { "id": prop,\n "isIRI": true\n };\n else if (prop === Object(prop))\n return prop;\n else {\n throw new Error("cannot resolve prop as object: " + prop);\n }\n };\n return JSONLDResource;\n}());\nexports.JSONLDResource = JSONLDResource;\n\n\n//# sourceURL=webpack://manifesto/./src/JSONLDResource.ts?')},"./src/LabelValuePair.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LabelValuePair = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LabelValuePair = /** @class */ (function () {\n function LabelValuePair(defaultLocale) {\n this.defaultLocale = defaultLocale;\n }\n LabelValuePair.prototype.parse = function (resource) {\n this.resource = resource;\n this.label = internal_1.PropertyValue.parse(this.resource.label, this.defaultLocale);\n this.value = internal_1.PropertyValue.parse(this.resource.value, this.defaultLocale);\n };\n // shortcuts to get/set values based on user or default locale\n LabelValuePair.prototype.getLabel = function (locale) {\n if (this.label === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.label.getValue(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setLabel = function (value) {\n if (this.label === null) {\n this.label = new internal_1.PropertyValue([]);\n }\n this.label.setValue(value, this.defaultLocale);\n };\n LabelValuePair.prototype.getValue = function (locale, joinWith) {\n if (joinWith === void 0) { joinWith = "
"; }\n if (this.value === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValue(locale || this.defaultLocale, joinWith);\n };\n LabelValuePair.prototype.getValues = function (locale) {\n if (this.value === null) {\n return [];\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValues(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setValue = function (value) {\n if (this.value === null) {\n this.value = new internal_1.PropertyValue([]);\n }\n this.value.setValue(value, this.defaultLocale);\n };\n return LabelValuePair;\n}());\nexports.LabelValuePair = LabelValuePair;\n\n\n//# sourceURL=webpack://manifesto/./src/LabelValuePair.ts?')},"./src/Language.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/Language.ts?')},"./src/LanguageMap.ts":function(__unused_webpack_module,exports){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LanguageMap = void 0;\n/** @deprecated Use PropertyValue instead */\nvar LanguageMap = /** @class */ (function (_super) {\n __extends(LanguageMap, _super);\n function LanguageMap() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /** @deprecated Use the `PropertyValue#getValue` instance method instead */\n LanguageMap.getValue = function (languageCollection, locale) {\n return languageCollection.getValue(locale, "
");\n };\n /** @deprecated Use the `PropertyValue#getValues` instance method instead */\n LanguageMap.getValues = function (languageCollection, locale) {\n return languageCollection.getValues(locale);\n };\n return LanguageMap;\n}(Array));\nexports.LanguageMap = LanguageMap;\n\n\n//# sourceURL=webpack://manifesto/./src/LanguageMap.ts?')},"./src/Light.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Light = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Light = /** @class */ (function (_super) {\n __extends(Light, _super);\n function Light(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isLight = true;\n _this.isModel = false;\n return _this;\n }\n Object.defineProperty(Light.prototype, "isAmbientLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "ambientlight");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Light.prototype, "isDirectionalLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "directionallight");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Light.prototype, "isSpotLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "spotlight");\n },\n enumerable: false,\n configurable: true\n });\n Light.prototype.getColor = function () {\n var hexColor = this.getProperty("color");\n if (hexColor)\n return internal_1.Color.fromCSS(hexColor);\n else\n return new internal_1.Color([255, 255, 255]); // white light\n };\n Object.defineProperty(Light.prototype, "Color", {\n get: function () { return this.getColor(); },\n enumerable: false,\n configurable: true\n });\n /**\n * The implementation of the intensity is based on\n * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md }\n * and the example 3D manifests\n * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights }\n * on 24 Mar 2024. The intensity property in the manifest is an object\n * with declared type \'Value\', a numeric property named \'value\' and a\n * property named unit . This implementation will only work with a unit == \'relative\'\n * and it will be assumed that a relative unit value of 1.0 corresponds to the\n * brightest light source a rendering engine supports.\n *\n * This code will implement a default intensity of 1.0\n **/\n Light.prototype.getIntensity = function () {\n var intObject = this.getProperty("intensity");\n if (intObject) {\n try {\n if (!(intObject.type === "Value" && intObject.unit === "relative"))\n throw new Error();\n return intObject.value;\n }\n catch (err) {\n throw new Error("unable to interpret raw intensity object " + JSON.stringify(intObject));\n }\n }\n else\n return 1.0;\n };\n Object.defineProperty(Light.prototype, "Intensity", {\n get: function () { return this.getIntensity(); },\n enumerable: false,\n configurable: true\n });\n /**\n * As defined in the temp-draft-4.md (\n * https://github.com/IIIF/3d/blob/main/temp-draft-4.md#lights ; 12 May 2024)\n * this quantity is the half-angle of the cone of the spotlight.\n *\n * The inconsistency between this definition of the angle and the definition of\n * fieldOfView for PerspectiveCamera (where the property value defines the full angle) has\n * already been noted: https://github.com/IIIF/api/issues/2284\n *\n * provisional decision is to return undefined in case that this property\n * is accessed in a light that is not a spotlight\n *\n *\n * @returns number\n \n **/\n Light.prototype.getAngle = function () {\n if (this.isSpotLight) {\n return Number(this.getProperty("angle"));\n }\n else {\n return undefined;\n }\n };\n Object.defineProperty(Light.prototype, "Angle", {\n get: function () { return this.getAngle(); },\n enumerable: false,\n configurable: true\n });\n /**\n * @return : if not null, is either a PointSelector, or an object\n * with an id matching the id of an Annotation instance.\n **/\n Light.prototype.getLookAt = function () {\n var rawObj = this.getPropertyAsObject("lookAt");\n var rawType = (rawObj["type"] || rawObj["@type"]);\n if (rawType == "Annotation") {\n return rawObj;\n }\n if (rawType == "PointSelector") {\n return new internal_1.PointSelector(rawObj);\n }\n throw new Error(\'unidentified value of lookAt ${rawType}\');\n };\n Object.defineProperty(Light.prototype, "LookAt", {\n get: function () { return this.getLookAt(); },\n enumerable: false,\n configurable: true\n });\n return Light;\n}(internal_1.AnnotationBody));\nexports.Light = Light;\n\n\n//# sourceURL=webpack://manifesto/./src/Light.ts?')},"./src/Manifest.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Manifest = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n* @remarks Scenes are conveniently retrieved from a Manifest by iterating through\n* Sequence in the Manifest, inner loop the Scenes in each sequence\n* @see {@link Sequence }\n*\n* @example\n* var manifest: Manifest;\n* function doSomethingWithScene(scene:Scene)...\n* ...\n* foreach(var seq:Sequence of manifest.getSequences()\n* foreach(var scene : Scene of seq.getScenes()\n* doSomethingWithScene(scene);\n**/\nvar Manifest = /** @class */ (function (_super) {\n __extends(Manifest, _super);\n function Manifest(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = 0;\n _this._allRanges = null;\n _this.items = [];\n _this._topRanges = [];\n if (_this.__jsonld.structures && _this.__jsonld.structures.length) {\n var topRanges = _this._getTopRanges();\n for (var i = 0; i < topRanges.length; i++) {\n var range = topRanges[i];\n _this._parseRanges(range, String(i));\n }\n }\n // initialization the cached _annotationIdMap to null\n // it will be populated if and only if client calls make a request\n // to the getter annotationIdMap\n _this._annotationIdMap = null;\n return _this;\n }\n /** @deprecated Use getAccompanyingCanvas instead */\n Manifest.prototype.getPosterCanvas = function () {\n var posterCanvas = this.getProperty("posterCanvas");\n if (posterCanvas) {\n posterCanvas = new internal_1.Canvas(posterCanvas, this.options);\n }\n return posterCanvas;\n };\n Manifest.prototype.getAccompanyingCanvas = function () {\n var accompanyingCanvas = this.getProperty("accompanyingCanvas");\n if (accompanyingCanvas) {\n accompanyingCanvas = new internal_1.Canvas(accompanyingCanvas, this.options);\n }\n return accompanyingCanvas;\n };\n Manifest.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Manifest.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n if (!this.isLoaded) {\n return this.defaultTree;\n }\n var topRanges = this.getTopRanges();\n // if there are any ranges in the manifest, default to the first \'top\' range or generated placeholder\n if (topRanges.length) {\n topRanges[0].getTree(this.defaultTree);\n }\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Manifest.prototype._getTopRanges = function () {\n var topRanges = [];\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var json = this.__jsonld.structures[i];\n if (json.viewingHint === dist_commonjs_1.ViewingHint.TOP) {\n topRanges.push(json);\n }\n }\n // if no viewingHint="top" range was found, create a default one\n if (!topRanges.length) {\n var range = {};\n range.ranges = this.__jsonld.structures;\n topRanges.push(range);\n }\n }\n return topRanges;\n };\n Manifest.prototype.getTopRanges = function () {\n return this._topRanges;\n };\n Manifest.prototype._getRangeById = function (id) {\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var r = this.__jsonld.structures[i];\n if (r["@id"] === id || r.id === id) {\n return r;\n }\n }\n }\n return null;\n };\n //private _parseRangeCanvas(json: any, range: Range): void {\n // todo: currently this isn\'t needed\n //var canvas: IJSONLDResource = new JSONLDResource(json);\n //range.items.push(canvas);\n //}\n Manifest.prototype._parseRanges = function (r, path, parentRange) {\n var range;\n var id = null;\n if (typeof r === "string") {\n id = r;\n r = this._getRangeById(id);\n }\n if (!r) {\n console.warn("Range:", id, "does not exist");\n return;\n }\n range = new internal_1.Range(r, this.options);\n range.parentRange = parentRange;\n range.path = path;\n if (!parentRange) {\n this._topRanges.push(range);\n }\n else {\n parentRange.items.push(range);\n }\n var items = r.items || r.members;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n // todo: use an ItemType constant?\n if ((item["@type"] && item["@type"].toLowerCase() === "sc:range") ||\n (item["type"] && item["type"].toLowerCase() === "range")) {\n this._parseRanges(item, path + "/" + i, range);\n }\n else if ((item["@type"] && item["@type"].toLowerCase() === "sc:canvas") ||\n (item["type"] && item["type"].toLowerCase() === "canvas")) {\n // store the ids on the __jsonld object to be used by Range.getCanvasIds()\n if (!range.canvases) {\n range.canvases = [];\n }\n var id_1 = item.id || item["@id"];\n range.canvases.push(id_1);\n }\n }\n }\n else if (r.ranges) {\n for (var i = 0; i < r.ranges.length; i++) {\n this._parseRanges(r.ranges[i], path + "/" + i, range);\n }\n }\n };\n Manifest.prototype.getAllRanges = function () {\n if (this._allRanges != null)\n return this._allRanges;\n this._allRanges = [];\n var topRanges = this.getTopRanges();\n var _loop_1 = function (i) {\n var topRange = topRanges[i];\n if (topRange.id) {\n this_1._allRanges.push(topRange); // it might be a placeholder root range\n }\n var reducer = function (acc, next) {\n acc.add(next);\n var nextRanges = next.getRanges();\n if (nextRanges.length) {\n return nextRanges.reduce(reducer, acc);\n }\n return acc;\n };\n var subRanges = Array.from(topRange.getRanges().reduce(reducer, new Set()));\n this_1._allRanges = this_1._allRanges.concat(subRanges);\n };\n var this_1 = this;\n for (var i = 0; i < topRanges.length; i++) {\n _loop_1(i);\n }\n return this._allRanges;\n };\n Manifest.prototype.getRangeById = function (id) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.id === id) {\n return range;\n }\n }\n return null;\n };\n Manifest.prototype.getRangeByPath = function (path) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.path === path) {\n return range;\n }\n }\n return null;\n };\n /**\n * @returns Array of Sequence instances\n **/\n Manifest.prototype.getSequences = function () {\n if (this.items.length) {\n return this.items;\n }\n // IxIF mediaSequences overrode sequences, so need to be checked first.\n // deprecate this when presentation 3 ships\n var items = this.__jsonld.mediaSequences || this.__jsonld.sequences;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var s = items[i];\n var sequence = new internal_1.Sequence(s, this.options);\n this.items.push(sequence);\n }\n }\n else if (this.__jsonld.items) {\n var sequence = new internal_1.Sequence(this.__jsonld.items, this.options);\n this.items.push(sequence);\n }\n return this.items;\n };\n Manifest.prototype.getSequenceByIndex = function (sequenceIndex) {\n return this.getSequences()[sequenceIndex];\n };\n Manifest.prototype.getTotalSequences = function () {\n return this.getSequences().length;\n };\n Manifest.prototype.getManifestType = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.UI_EXTENSIONS));\n if (service) {\n return service.getProperty("manifestType");\n }\n return internal_1.ManifestType.EMPTY;\n };\n Manifest.prototype.isMultiSequence = function () {\n return this.getTotalSequences() > 1;\n };\n Manifest.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n var behavior = this.getBehavior();\n if (behavior) {\n return behavior === dist_commonjs_1.Behavior.PAGED;\n }\n return false;\n };\n Manifest.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Manifest.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Manifest.prototype, "annotationIdMap", {\n /**\n * Developer Note: The concept of the "id map" appear in the\n * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map\n * This functionality may be available as well in the \'nodeMap\' code of the\n * digitalbazaar/jsonld library\n *\n * this very simplified version just returns a mao of id -> Annotation nodes\n * in manifest\n *\n * THe annotationIdMap is a Javascript object whose property names are\n * IRI (id values) and property values are instances of the Annotation class\n **/\n get: function () {\n if (this._annotationIdMap == null) {\n this._annotationIdMap = {};\n for (var _i = 0, _a = this.getSequences(); _i < _a.length; _i++) {\n var seq = _a[_i];\n for (var _b = 0, _c = seq.getScenes(); _b < _c.length; _b++) {\n var scene = _c[_b];\n for (var _d = 0, _e = scene.getContent(); _d < _e.length; _d++) {\n var anno = _e[_d];\n this._annotationIdMap[anno.id] = anno;\n }\n }\n }\n }\n return this._annotationIdMap;\n },\n enumerable: false,\n configurable: true\n });\n return Manifest;\n}(internal_1.IIIFResource));\nexports.Manifest = Manifest;\n\n\n//# sourceURL=webpack://manifesto/./src/Manifest.ts?')},"./src/ManifestResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar ManifestResource = /** @class */ (function (_super) {\n __extends(ManifestResource, _super);\n function ManifestResource(jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.options = options;\n return _this;\n }\n ManifestResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n ManifestResource.prototype.getLabel = function () {\n var label = this.getProperty("label");\n if (label) {\n return internal_1.PropertyValue.parse(label, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n ManifestResource.prototype.getDefaultLabel = function () {\n return this.getLabel().getValue(this.options.locale);\n };\n ManifestResource.prototype.getMetadata = function () {\n var _metadata = this.getProperty("metadata");\n var metadata = [];\n if (!_metadata)\n return metadata;\n for (var i = 0; i < _metadata.length; i++) {\n var item = _metadata[i];\n var metadataItem = new internal_1.LabelValuePair(this.options.locale);\n metadataItem.parse(item);\n metadata.push(metadataItem);\n }\n return metadata;\n };\n ManifestResource.prototype.getRendering = function (format) {\n var renderings = this.getRenderings();\n for (var i = 0; i < renderings.length; i++) {\n var rendering = renderings[i];\n if (rendering.getFormat() === format) {\n return rendering;\n }\n }\n return null;\n };\n ManifestResource.prototype.getRenderings = function () {\n var rendering;\n // if passing a manifesto-parsed object, use the __jsonld.rendering property,\n // otherwise look for a rendering property\n if (this.__jsonld) {\n rendering = this.__jsonld.rendering;\n }\n else {\n rendering = this.rendering;\n }\n var renderings = [];\n if (!rendering)\n return renderings;\n // coerce to array\n if (!Array.isArray(rendering)) {\n rendering = [rendering];\n }\n for (var i = 0; i < rendering.length; i++) {\n var r = rendering[i];\n renderings.push(new internal_1.Rendering(r, this.options));\n }\n return renderings;\n };\n ManifestResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n return requiredStatement;\n };\n ManifestResource.prototype.getService = function (profile) {\n return internal_1.Utils.getService(this, profile);\n };\n ManifestResource.prototype.getServices = function () {\n return internal_1.Utils.getServices(this);\n };\n ManifestResource.prototype.getThumbnail = function () {\n var thumbnail = this.getProperty("thumbnail");\n if (Array.isArray(thumbnail)) {\n thumbnail = thumbnail[0];\n }\n if (thumbnail) {\n return new internal_1.Thumbnail(thumbnail, this.options);\n }\n return null;\n };\n ManifestResource.prototype.isAnnotation = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.ANNOTATION;\n };\n ManifestResource.prototype.isCanvas = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.CANVAS;\n };\n ManifestResource.prototype.isCollection = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION;\n };\n ManifestResource.prototype.isManifest = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST;\n };\n ManifestResource.prototype.isRange = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.RANGE;\n };\n // this different implementation is necessary until such time as the \n // SCENE is added to the @iiif/vocabulary package.\n ManifestResource.prototype.isScene = function () {\n return this.getIIIFResourceType() === internal_1.Utils.normaliseType(\'Scene\');\n };\n ManifestResource.prototype.isSequence = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.SEQUENCE;\n };\n return ManifestResource;\n}(internal_1.JSONLDResource));\nexports.ManifestResource = ManifestResource;\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestResource.ts?')},"./src/ManifestType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestType = void 0;\nvar ManifestType;\n(function (ManifestType) {\n ManifestType["EMPTY"] = "";\n ManifestType["MANUSCRIPT"] = "manuscript";\n ManifestType["MONOGRAPH"] = "monograph";\n})(ManifestType || (exports.ManifestType = ManifestType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestType.ts?')},"./src/PointSelector.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PointSelector = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar PointSelector = /** @class */ (function (_super) {\n __extends(PointSelector, _super);\n function PointSelector(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isPointSelector = true;\n return _this;\n }\n /**\n @returns the 3D coordinates of the point as a Vector3 instance.\n **/\n PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n };\n Object.defineProperty(PointSelector.prototype, "Location", {\n /**\n @returns the 3D coordinates of the point as a Vector3 instance.\n **/\n get: function () { return this.getLocation(); },\n enumerable: false,\n configurable: true\n });\n return PointSelector;\n}(internal_1.JSONLDResource));\nexports.PointSelector = PointSelector;\n\n\n//# sourceURL=webpack://manifesto/./src/PointSelector.ts?')},"./src/PropertyValue.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PropertyValue = exports.LocalizedValue = void 0;\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/** Utility class to hold one or more values with their associated (optional) locale */\nvar LocalizedValue = /** @class */ (function () {\n function LocalizedValue(value, locale, defaultLocale) {\n if (defaultLocale === void 0) { defaultLocale = "none"; }\n if (Array.isArray(value) && value.length === 1) {\n this._value = value[0];\n }\n else {\n this._value = value;\n }\n if (locale === "none" || locale === "@none") {\n locale = undefined;\n }\n this._locale = locale;\n this._defaultLocale = defaultLocale;\n }\n /** Parse a localized value from a IIIF v2 property value\n *\n * @param {string | string[] | object | object[]} rawVal value from IIIF resource\n * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value\n */\n LocalizedValue.parseV2Value = function (rawVal, defaultLocale) {\n if (typeof rawVal === "string") {\n return new LocalizedValue(rawVal, undefined, defaultLocale);\n }\n else if (rawVal["@value"]) {\n return new LocalizedValue(rawVal["@value"], rawVal["@language"], defaultLocale);\n }\n return null;\n };\n Object.defineProperty(LocalizedValue.prototype, "value", {\n /*** @deprecated Use PropertyValue#getValue instead */\n get: function () {\n if (Array.isArray(this._value)) {\n return this._value.join("
");\n }\n return this._value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizedValue.prototype, "locale", {\n /*** @deprecated Don\'t use, only used for backwards compatibility reasons */\n get: function () {\n if (this._locale === undefined) {\n return this._defaultLocale;\n }\n return this._locale;\n },\n enumerable: false,\n configurable: true\n });\n LocalizedValue.prototype.addValue = function (value) {\n if (!Array.isArray(this._value)) {\n this._value = [this._value];\n }\n if (Array.isArray(value)) {\n this._value = this._value.concat(value);\n }\n else {\n this._value.push(value);\n }\n };\n return LocalizedValue;\n}());\nexports.LocalizedValue = LocalizedValue;\n/***\n * Holds a collection of values and their (optional) languages and allows\n * language-based value retrieval as per the algorithm described in\n * https://iiif.io/api/presentation/2.1/#language-of-property-values\n */\nvar PropertyValue = /** @class */ (function (_super) {\n __extends(PropertyValue, _super);\n function PropertyValue(values, defaultLocale) {\n if (values === void 0) { values = []; }\n var _this = _super.apply(this, values) || this;\n // Needed for ES5 compatibility, see https://stackoverflow.com/a/40967939\n _this.__proto__ = PropertyValue.prototype;\n _this._defaultLocale = defaultLocale;\n return _this;\n }\n PropertyValue.parse = function (rawVal, defaultLocale) {\n if (!rawVal) {\n return new PropertyValue([], defaultLocale);\n }\n if (Array.isArray(rawVal)) {\n // Collection of IIIF v2 property values\n var parsed = rawVal\n .map(function (v) { return LocalizedValue.parseV2Value(v, defaultLocale); })\n .filter(function (v) { return v !== null; });\n var byLocale = parsed.reduce(function (acc, lv) {\n var loc = lv._locale;\n if (!loc) {\n // Cannot use undefined as an object key\n loc = "none";\n }\n if (acc[loc]) {\n acc[loc].addValue(lv._value);\n }\n else {\n acc[loc] = lv;\n }\n return acc;\n }, {});\n return new PropertyValue(Object.values(byLocale), defaultLocale);\n }\n else if (typeof rawVal === "string") {\n return new PropertyValue([new LocalizedValue(rawVal, undefined, defaultLocale)], defaultLocale);\n }\n else if (rawVal["@language"]) {\n // Single IIIF v2 property value\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else if (rawVal["@value"]) {\n // Single IIIF v2 property value without language\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else {\n // IIIF v3 property value\n return new PropertyValue(Object.keys(rawVal).map(function (locale) {\n var val = rawVal[locale];\n if (!Array.isArray(val)) {\n throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");\n }\n return new LocalizedValue(val, locale, defaultLocale);\n }), defaultLocale);\n }\n };\n /*** Try to find the available locale that best fit\'s the user\'s preferences. */\n PropertyValue.prototype.getSuitableLocale = function (locales) {\n // If any of the values have a language associated with them, the client\n // must display all of the values associated with the language that best\n // matches the language preference.\n if (locales.length == 0 && this._defaultLocale)\n locales.push(this._defaultLocale);\n // create an array of the language codes for all different LocalizedValue instances in this PropertyValue\n var allLocales = new Array();\n for (var _i = 0, _a = this; _i < _a.length; _i++) {\n var lv = _a[_i];\n if (lv._locale != undefined)\n allLocales.push(lv._locale);\n }\n var _loop_1 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return l === userLocale; });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // First, look for a precise match\n for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) {\n var userLocale = locales_1[_b];\n var state_1 = _loop_1(userLocale);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n var _loop_2 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return Utils_1.Utils.getInexactLocale(l) === Utils_1.Utils.getInexactLocale(userLocale); });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // Look for an inexact match\n for (var _c = 0, locales_2 = locales; _c < locales_2.length; _c++) {\n var userLocale = locales_2[_c];\n var state_2 = _loop_2(userLocale);\n if (typeof state_2 === "object")\n return state_2.value;\n }\n return undefined;\n };\n /**\n * Set the value(s) for a given locale.\n *\n * If there\'s an existing locale that matches the given locale, it will be updated.\n *\n * @param locale Locale to set the value for\n * @param value value to set\n */\n PropertyValue.prototype.setValue = function (value, locale) {\n var existing = undefined;\n if (!locale) {\n existing = this.find(function (lv) { return lv._locale === undefined; });\n }\n else {\n var bestLocale_1 = this.getSuitableLocale([locale]);\n if (bestLocale_1) {\n existing = this.find(function (lv) { return lv._locale === bestLocale_1; });\n }\n }\n if (existing) {\n // Mutate existing localized value\n existing._value = value;\n }\n else {\n // Create a new localized value\n this.push(new LocalizedValue(value, locale, this._defaultLocale));\n }\n };\n /**\n * Get a value in the most suitable locale.\n *\n * @param {string | string[] | undefined} locales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @param {string | undefined} joinWith String to join multiple available values by,\n * if undefined only the first available value will be returned\n * @returns the first value in the most suitable locale or null if none could be found\n */\n PropertyValue.prototype.getValue = function (locales, joinWith) {\n var vals = this.getValues(locales);\n if (vals.length === 0) {\n return null;\n }\n if (joinWith) {\n return vals.join(joinWith);\n }\n return vals[0];\n };\n /**\n * Get all values available in the most suitable locale.\n *\n * @param {string | string[]} userLocales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @returns the values for the most suitable locale, empty if none could be found\n */\n PropertyValue.prototype.getValues = function (userLocales) {\n if (!this.length) {\n return [];\n }\n var locales;\n if (!userLocales) {\n locales = [];\n }\n else if (!Array.isArray(userLocales)) {\n locales = [userLocales];\n }\n else {\n locales = userLocales;\n }\n // If none of the values have a language associated with them, the client\n // must display all of the values.\n if (this.length === 1 && this[0]._locale === undefined) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // Try to determine the available locale that best fits the user\'s preferences\n var matchingLocale = this.getSuitableLocale(locales);\n if (matchingLocale) {\n var val = this.find(function (lv) { return lv._locale === matchingLocale; })._value;\n return Array.isArray(val) ? val : [val];\n }\n // If all of the values have a language associated with them, and none match\n // the language preference, the client must select a language and display\n // all of the values associated with that language.\n var allHaveLang = !this.find(function (lv) { return lv._locale === undefined; });\n if (allHaveLang) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // If some of the values have a language associated with them, but none\n // match the language preference, the client must display all of the values\n // that do not have a language associated with them.\n var lv = this.find(function (lv) { return lv._locale === undefined; });\n if (lv) {\n return Array.isArray(lv._value) ? lv._value : [lv._value];\n }\n return [];\n };\n return PropertyValue;\n}(Array));\nexports.PropertyValue = PropertyValue;\n\n\n//# sourceURL=webpack://manifesto/./src/PropertyValue.ts?')},"./src/Range.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Range = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar Range = /** @class */ (function (_super) {\n __extends(Range, _super);\n function Range(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this._ranges = null;\n _this.canvases = null;\n _this.items = [];\n return _this;\n }\n Range.prototype.getCanvasIds = function () {\n if (this.__jsonld.canvases) {\n return this.__jsonld.canvases;\n }\n else if (this.canvases) {\n return this.canvases;\n }\n return [];\n };\n Range.prototype.getDuration = function () {\n // For this implementation, we want to catch SOME of the temporal cases - i.e. when there is a t=1,100\n if (this.canvases && this.canvases.length) {\n var startTimes = [];\n var endTimes = [];\n // When we loop through all of the canvases we store the recorded start and end times.\n // Then we choose the maximum and minimum values from this. This will give us a more accurate duration for the\n // Chosen range. However this is still not perfect and does not cover more complex ranges. These cases are out of\n // scope for this change.\n for (var _i = 0, _a = this.canvases; _i < _a.length; _i++) {\n var canvas = _a[_i];\n if (!canvas)\n continue;\n var _b = (canvas.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [undefined, canvas]), canvasId = _b[1], start_1 = _b[2], end_1 = _b[3];\n if (canvasId) {\n startTimes.push(parseFloat(start_1));\n endTimes.push(parseFloat(end_1));\n }\n }\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n else {\n // get child ranges and calculate the start and end based on them\n var childRanges = this.getRanges();\n var startTimes = [];\n var endTimes = [];\n // Once again, we use a max/min to get the ranges.\n for (var _c = 0, childRanges_1 = childRanges; _c < childRanges_1.length; _c++) {\n var childRange = childRanges_1[_c];\n var duration = childRange.getDuration();\n if (duration) {\n startTimes.push(duration.start);\n endTimes.push(duration.end);\n }\n }\n // And return the minimum as the start, and the maximum as the end.\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n var start;\n var end;\n // There are 2 paths for this implementation. Either we have a list of canvases, or a list of ranges\n // which may have a list of ranges.\n // This is one of the limitations of this implementation.\n if (this.canvases && this.canvases.length) {\n // When we loop through each of the canvases we are expecting to see a fragment or a link to the whole canvas.\n // For example - if we have http://example.org/canvas#t=1,100 it will extract 1 and 100 as the start and end.\n for (var i = 0; i < this.canvases.length; i++) {\n var canvas = this.canvases[i];\n var temporal = internal_1.Utils.getTemporalComponent(canvas);\n if (temporal && temporal.length > 1) {\n if (i === 0) {\n // Note: Cannot guarantee ranges are sequential (fixed above)\n start = Number(temporal[0]);\n }\n if (i === this.canvases.length - 1) {\n end = Number(temporal[1]); // Note: The end of this duration may be targeting a different canvas.\n }\n }\n }\n }\n else {\n // In this second case, where there are nested ranges, we recursively get the duration\n // from each of the child ranges (a start and end) and then choose the first and last for the bounds of this range.\n var childRanges = this.getRanges();\n for (var i = 0; i < childRanges.length; i++) {\n var childRange = childRanges[i];\n var duration = childRange.getDuration();\n if (duration) {\n if (i === 0) {\n start = duration.start;\n }\n if (i === childRanges.length - 1) {\n end = duration.end;\n }\n }\n }\n }\n if (start !== undefined && end !== undefined) {\n return new internal_1.Duration(start, end);\n }\n return undefined;\n };\n // getCanvases(): ICanvas[] {\n // if (this._canvases) {\n // return this._canvases;\n // }\n // return this._canvases = this.items.en().where(m => m.isCanvas()).toArray();\n // }\n Range.prototype.getRanges = function () {\n if (this._ranges) {\n return this._ranges;\n }\n return (this._ranges = this.items.filter(function (m) { return m.isRange(); }));\n };\n Range.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Range.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Range.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Range.prototype.getTree = function (treeRoot) {\n treeRoot.data = this;\n this.treeNode = treeRoot;\n var ranges = this.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var node = new internal_1.TreeNode();\n treeRoot.addNode(node);\n this._parseTreeNode(node, range);\n }\n }\n internal_1.Utils.generateTreeNodeIds(treeRoot);\n return treeRoot;\n };\n Range.prototype.spansTime = function (time) {\n var duration = this.getDuration();\n if (duration) {\n if (time >= duration.start && time <= duration.end) {\n return true;\n }\n }\n return false;\n };\n Range.prototype._parseTreeNode = function (node, range) {\n node.label = range.getLabel().getValue(this.options.locale);\n node.data = range;\n node.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n range.treeNode = node;\n var ranges = range.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var childRange = ranges[i];\n var behavior = childRange.getBehavior();\n if (behavior === dist_commonjs_1.Behavior.NO_NAV) {\n continue;\n }\n else {\n var childNode = new internal_1.TreeNode();\n node.addNode(childNode);\n this._parseTreeNode(childNode, childRange);\n }\n }\n }\n };\n return Range;\n}(internal_1.ManifestResource));\nexports.Range = Range;\n\n\n//# sourceURL=webpack://manifesto/./src/Range.ts?')},"./src/Rendering.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Rendering = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Rendering = /** @class */ (function (_super) {\n __extends(Rendering, _super);\n function Rendering(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Rendering.prototype.getFormat = function () {\n return this.getProperty("format");\n };\n return Rendering;\n}(internal_1.ManifestResource));\nexports.Rendering = Rendering;\n\n\n//# sourceURL=webpack://manifesto/./src/Rendering.ts?')},"./src/Resource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Resource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Resource = /** @class */ (function (_super) {\n __extends(Resource, _super);\n function Resource(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Resource.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return format.toLowerCase();\n }\n return null;\n };\n Resource.prototype.getResources = function () {\n var resources = [];\n if (!this.__jsonld.resources)\n return resources;\n for (var i = 0; i < this.__jsonld.resources.length; i++) {\n var a = this.__jsonld.resources[i];\n var annotation = new internal_1.Annotation(a, this.options);\n resources.push(annotation);\n }\n return resources;\n };\n Resource.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return internal_1.Utils.normaliseType(type);\n }\n return null;\n };\n Resource.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Resource.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Resource.prototype.getMaxWidth = function () {\n return this.getProperty("maxWidth");\n };\n Resource.prototype.getMaxHeight = function () {\n var maxHeight = this.getProperty("maxHeight");\n // if a maxHeight hasn\'t been specified, default to maxWidth.\n // maxWidth in essence becomes maxEdge\n if (!maxHeight) {\n return this.getMaxWidth();\n }\n return null;\n };\n return Resource;\n}(internal_1.ManifestResource));\nexports.Resource = Resource;\n\n\n//# sourceURL=webpack://manifesto/./src/Resource.ts?')},"./src/RotateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.RotateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar RotateTransform = /** @class */ (function (_super) {\n __extends(RotateTransform, _super);\n function RotateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isRotateTransform = true;\n return _this;\n }\n RotateTransform.prototype.getRotation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return RotateTransform;\n}(internal_1.Transform));\nexports.RotateTransform = RotateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/RotateTransform.ts?')},"./src/ScaleTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ScaleTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar ScaleTransform = /** @class */ (function (_super) {\n __extends(ScaleTransform, _super);\n function ScaleTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isScaleTransform = true;\n return _this;\n }\n ScaleTransform.prototype.getScale = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n // note that default scaling is 1.0\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 1.0;\n }\n return retVal;\n };\n return ScaleTransform;\n}(internal_1.Transform));\nexports.ScaleTransform = ScaleTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/ScaleTransform.ts?')},"./src/Scene.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Scene = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Scene = /** @class */ (function (_super) {\n __extends(Scene, _super);\n function Scene(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // Presentation API 3.0\n Scene.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n ;\n return content;\n };\n ;\n Object.defineProperty(Scene.prototype, "Content", {\n // 3D extension\n get: function () { return this.getContent(); },\n enumerable: false,\n configurable: true\n });\n Scene.prototype.getAnnotationById = function (searchId) {\n for (var _i = 0, _a = this.Content; _i < _a.length; _i++) {\n var anno = _a[_i];\n if (anno.id === searchId)\n return anno;\n }\n return null;\n };\n Scene.prototype.getBackgroundColor = function () {\n // regular expression intended to match strings like\n // "#FF00FF" -- interpreted as three hexadecimal values\n // in range 0-255 . Not that the \\w escape matches digits,\n // upper and lower case latin characters, and underscore\n // currently only supports the form for CSS\n // https://www.w3.org/wiki/CSS/Properties/color/RGB\n // with 6 hexadecimal digits\n var bgc = this.getProperty("backgroundColor");\n if (bgc)\n return internal_1.Color.fromCSS(bgc);\n else\n return null;\n };\n ;\n return Scene;\n}(internal_1.ManifestResource));\nexports.Scene = Scene;\n\n\n//# sourceURL=webpack://manifesto/./src/Scene.ts?')},"./src/Sequence.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Sequence = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Sequence = /** @class */ (function (_super) {\n __extends(Sequence, _super);\n function Sequence(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._thumbnails = null;\n return _this;\n }\n Sequence.prototype.getCanvases = function () {\n if (this.items.length) {\n return this.items;\n }\n var items = this.__jsonld.canvases || this.__jsonld.elements;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var c = items[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n else if (this.__jsonld) {\n for (var i = 0; i < this.__jsonld.length; i++) {\n var c = this.__jsonld[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n return this.items;\n };\n Sequence.prototype.getCanvasById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // normalise canvas id\n var canvasId = internal_1.Utils.normaliseUrl(canvas.id);\n if (internal_1.Utils.normaliseUrl(id) === canvasId) {\n return canvas;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasByIndex = function (canvasIndex) {\n return this.getCanvases()[canvasIndex];\n };\n Sequence.prototype.getCanvasIndexById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === id) {\n return i;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasIndexByLabel = function (label, foliated) {\n label = label.trim();\n if (!isNaN(label)) {\n // if the label is numeric\n label = parseInt(label, 10).toString(); // trim any preceding zeros.\n if (foliated)\n label += "r"; // default to recto\n }\n var doublePageRegExp = /(\\d*)\\D+(\\d*)/;\n var match, regExp, regStr, labelPart1, labelPart2;\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // check if there\'s a literal match\n if (canvas.getLabel().getValue(this.options.locale) === label) {\n return i;\n }\n // check if there\'s a match for double-page spreads e.g. 100-101, 100_101, 100 101\n match = doublePageRegExp.exec(label);\n if (!match)\n continue;\n labelPart1 = match[1];\n labelPart2 = match[2];\n if (!labelPart2)\n continue;\n regStr = "^" + labelPart1 + "\\\\D+" + labelPart2 + "$";\n regExp = new RegExp(regStr);\n if (regExp.test(canvas.getLabel().toString())) {\n return i;\n }\n }\n return -1;\n };\n Sequence.prototype.getLastCanvasLabel = function (alphanumeric) {\n for (var i = this.getTotalCanvases() - 1; i >= 0; i--) {\n var canvas = this.getCanvasByIndex(i);\n var label = (canvas.getLabel().getValue(this.options.locale));\n if (alphanumeric) {\n var regExp = /^[a-zA-Z0-9]*$/;\n if (regExp.test(label)) {\n return label;\n }\n }\n else if (label) {\n return label;\n }\n }\n return this.options.defaultLabel;\n };\n Sequence.prototype.getLastPageIndex = function () {\n return this.getTotalCanvases() - 1;\n };\n Sequence.prototype.getNextPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[0] + 1;\n }\n else {\n index = indices[indices.length - 1] + 1;\n }\n }\n else {\n index = canvasIndex + 1;\n }\n if (index > this.getLastPageIndex()) {\n return -1;\n }\n return index;\n };\n Sequence.prototype.getPagedIndices = function (canvasIndex, pagingEnabled) {\n var indices = [];\n if (!pagingEnabled) {\n indices.push(canvasIndex);\n }\n else {\n if (this.isFirstCanvas(canvasIndex) || this.isLastCanvas(canvasIndex)) {\n indices = [canvasIndex];\n }\n else if (canvasIndex % 2) {\n indices = [canvasIndex, canvasIndex + 1];\n }\n else {\n indices = [canvasIndex - 1, canvasIndex];\n }\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n indices = indices.reverse();\n }\n }\n return indices;\n };\n Sequence.prototype.getPrevPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[indices.length - 1] - 1;\n }\n else {\n index = indices[0] - 1;\n }\n }\n else {\n index = canvasIndex - 1;\n }\n return index;\n };\n /**\n * @returns Array of Scene instances in the Sequence\n **/\n Sequence.prototype.getScenes = function () {\n var returnVal = [];\n var low_items = this.__jsonld.elements || this.__jsonld;\n if (low_items) {\n for (var i = 0; i < low_items.length; ++i) {\n var c = low_items[i];\n if (c.type === \'Scene\') {\n var scene = new internal_1.Scene(c, this.options);\n //scene.index = i;\n returnVal.push(scene);\n }\n }\n }\n return returnVal;\n };\n Sequence.prototype.getStartCanvasIndex = function () {\n var startCanvas = this.getStartCanvas();\n if (startCanvas) {\n // if there\'s a startCanvas attribute, loop through the canvases and return the matching index.\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === startCanvas)\n return i;\n }\n }\n // default to first canvas.\n return 0;\n };\n // todo: deprecate\n Sequence.prototype.getThumbs = function (width, height) {\n //console.warn(\'getThumbs will be deprecated, use getThumbnails instead\');\n var thumbs = [];\n var totalCanvases = this.getTotalCanvases();\n for (var i = 0; i < totalCanvases; i++) {\n var canvas = this.getCanvasByIndex(i);\n var thumb = new internal_1.Thumb(width, canvas);\n thumbs.push(thumb);\n }\n return thumbs;\n };\n Sequence.prototype.getThumbnails = function () {\n if (this._thumbnails != null)\n return this._thumbnails;\n this._thumbnails = [];\n var canvases = this.getCanvases();\n for (var i = 0; i < canvases.length; i++) {\n var thumbnail = canvases[i].getThumbnail();\n if (thumbnail) {\n this._thumbnails.push(thumbnail);\n }\n }\n return this._thumbnails;\n };\n Sequence.prototype.getStartCanvas = function () {\n return this.getProperty("startCanvas");\n };\n Sequence.prototype.getTotalCanvases = function () {\n return this.getCanvases().length;\n };\n Sequence.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n else if (this.options.resource.getViewingDirection) {\n return this.options.resource.getViewingDirection();\n }\n return null;\n };\n Sequence.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Sequence.prototype.isCanvasIndexOutOfRange = function (canvasIndex) {\n return canvasIndex > this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isFirstCanvas = function (canvasIndex) {\n return canvasIndex === 0;\n };\n Sequence.prototype.isLastCanvas = function (canvasIndex) {\n return canvasIndex === this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isMultiCanvas = function () {\n return this.getTotalCanvases() > 1;\n };\n Sequence.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n return false;\n };\n // checks if the number of canvases is even - therefore has a front and back cover\n Sequence.prototype.isTotalCanvasesEven = function () {\n return this.getTotalCanvases() % 2 === 0;\n };\n return Sequence;\n}(internal_1.ManifestResource));\nexports.Sequence = Sequence;\n\n\n//# sourceURL=webpack://manifesto/./src/Sequence.ts?')},"./src/Serialisation.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Deserialiser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Deserialiser = /** @class */ (function () {\n function Deserialiser() {\n }\n Deserialiser.parse = function (manifest, options) {\n if (typeof manifest === "string") {\n manifest = JSON.parse(manifest);\n }\n return this.parseJson(manifest, options);\n };\n Deserialiser.parseJson = function (json, options) {\n var resource;\n // have options been passed for the manifest to inherit?\n if (options) {\n if (options.navDate && !isNaN(options.navDate.getTime())) {\n json.navDate = options.navDate.toString();\n }\n }\n if (json["@type"]) {\n switch (json["@type"]) {\n case "sc:Collection":\n resource = this.parseCollection(json, options);\n break;\n case "sc:Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n else {\n // presentation 3\n switch (json["type"]) {\n case "Collection":\n resource = this.parseCollection(json, options);\n break;\n case "Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n // Top-level resource was loaded from a URI, so flag it to prevent\n // unnecessary reload:\n resource.isLoaded = true;\n return resource;\n };\n Deserialiser.parseCollection = function (json, options) {\n var collection = new internal_1.Collection(json, options);\n if (options) {\n collection.index = options.index || 0;\n if (options.resource) {\n collection.parentCollection = options.resource.parentCollection;\n }\n }\n else {\n collection.index = 0;\n }\n this.parseCollections(collection, options);\n this.parseManifests(collection, options);\n this.parseItems(collection, options);\n return collection;\n };\n Deserialiser.parseCollections = function (collection, options) {\n var items;\n if (collection.__jsonld.collections) {\n items = collection.__jsonld.collections;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "collection"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (options) {\n options.index = i;\n }\n var item = this.parseCollection(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseManifest = function (json, options) {\n var manifest = new internal_1.Manifest(json, options);\n return manifest;\n };\n Deserialiser.parseManifests = function (collection, options) {\n var items;\n if (collection.__jsonld.manifests) {\n items = collection.__jsonld.manifests;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "manifest"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = this.parseManifest(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseItem = function (json, options) {\n if (json["@type"]) {\n if (json["@type"].toLowerCase() === "sc:manifest") {\n return this.parseManifest(json, options);\n }\n else if (json["@type"].toLowerCase() === "sc:collection") {\n return this.parseCollection(json, options);\n }\n }\n else if (json.type) {\n if (json.type.toLowerCase() === "manifest") {\n return this.parseManifest(json, options);\n }\n else if (json.type.toLowerCase() === "collection") {\n return this.parseCollection(json, options);\n }\n }\n return null;\n };\n Deserialiser.parseItems = function (collection, options) {\n var items = collection.__jsonld.members || collection.__jsonld.items;\n if (items) {\n var _loop_1 = function (i) {\n if (options) {\n options.index = i;\n }\n var item = this_1.parseItem(items[i], options);\n if (!item)\n return { value: void 0 };\n // only add to items if not already parsed from backwards-compatible collections/manifests arrays\n if (collection.items.filter(function (m) { return m.id === item.id; })[0]) {\n return "continue";\n }\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n };\n var this_1 = this;\n for (var i = 0; i < items.length; i++) {\n var state_1 = _loop_1(i);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n }\n };\n return Deserialiser;\n}());\nexports.Deserialiser = Deserialiser;\n\n\n//# sourceURL=webpack://manifesto/./src/Serialisation.ts?')},"./src/Service.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Service = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Service = /** @class */ (function (_super) {\n __extends(Service, _super);\n function Service(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Service.prototype.getProfile = function () {\n var profile = this.getProperty("profile");\n if (!profile) {\n profile = this.getProperty("dcterms:conformsTo");\n }\n if (Array.isArray(profile)) {\n return profile[0];\n }\n return profile;\n };\n Service.prototype.getConfirmLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale);\n };\n Service.prototype.getDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("description"), this.options.locale);\n };\n Service.prototype.getFailureDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale);\n };\n Service.prototype.getFailureHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale);\n };\n Service.prototype.getHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("header"), this.options.locale);\n };\n Service.prototype.getServiceLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("label"), this.options.locale);\n };\n Service.prototype.getInfoUri = function () {\n var infoUri = this.id;\n if (!infoUri.endsWith("/")) {\n infoUri += "/";\n }\n infoUri += "info.json";\n return infoUri;\n };\n return Service;\n}(internal_1.ManifestResource));\nexports.Service = Service;\n\n\n//# sourceURL=webpack://manifesto/./src/Service.ts?')},"./src/Size.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Size = void 0;\nvar Size = /** @class */ (function () {\n function Size(width, height) {\n this.width = width;\n this.height = height;\n }\n return Size;\n}());\nexports.Size = Size;\n\n\n//# sourceURL=webpack://manifesto/./src/Size.ts?')},"./src/SpecificResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.SpecificResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n Developer note: This implementation does not strictly adhere\n to the description of SpecificResource in the Web Annotation Model\n document https://www.w3.org/TR/annotation-model/\n section 4 : https://www.w3.org/TR/annotation-model/#specific-resources\n \n The getTransform() method returning an Array of 3D Transfom resources, is\n an extension of SpecificResource beyond the web annotation model.\n*/\nvar SpecificResource = /** @class */ (function (_super) {\n __extends(SpecificResource, _super);\n function SpecificResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = false;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = true;\n _this.isSpecificResource = true;\n return _this;\n }\n ;\n SpecificResource.prototype.getSource = function () {\n var raw = this.getPropertyAsObject("source");\n if (raw.isIRI)\n return raw;\n /*\n this logic gets a little convoluted, because we have to preserve\n the cases where the raw json is an array for the sources of a\n SpecificResource applied to an annotation body, while for a target\n of an Annotation we just want a single object\n */\n // case of a source of a SpecificResource which is an Annotation target\n if (raw) {\n var containerTypes = ["Scene", "Canvas"];\n var singleItem = ([].concat(raw))[0];\n if (containerTypes.includes(singleItem["type"]))\n return singleItem;\n }\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n return internal_1.AnnotationBodyParser.BuildFromJson(item, this.options);\n }\n }\n throw new Error("cannot resolve Source " + JSON.stringify(raw));\n };\n Object.defineProperty(SpecificResource.prototype, "Source", {\n get: function () { return this.getSource(); },\n enumerable: false,\n configurable: true\n });\n SpecificResource.prototype.getSelector = function () {\n var raw = this.getProperty("selector");\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n if (item["type"] === "PointSelector")\n return new internal_1.PointSelector(item);\n }\n throw new Error("unable to resolve SpecificResource selector " + JSON.stringify(this.__jsonld));\n }\n return null;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Selector", {\n get: function () { return this.getSelector(); },\n enumerable: false,\n configurable: true\n });\n SpecificResource.prototype.getTransform = function () {\n var retVal = [];\n var transformItems = this.getProperty("transform");\n for (var i = 0; i < transformItems.length; ++i) {\n var transformItem = transformItems[i];\n retVal.push(internal_1.TransformParser.BuildFromJson(transformItem));\n }\n return retVal;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Transform", {\n get: function () { return this.getTransform(); },\n enumerable: false,\n configurable: true\n });\n return SpecificResource;\n}(internal_1.ManifestResource));\nexports.SpecificResource = SpecificResource;\n\n\n//# sourceURL=webpack://manifesto/./src/SpecificResource.ts?')},"./src/StatusCode.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.StatusCode = void 0;\nvar StatusCode;\n(function (StatusCode) {\n StatusCode[StatusCode["AUTHORIZATION_FAILED"] = 1] = "AUTHORIZATION_FAILED";\n StatusCode[StatusCode["FORBIDDEN"] = 2] = "FORBIDDEN";\n StatusCode[StatusCode["INTERNAL_SERVER_ERROR"] = 3] = "INTERNAL_SERVER_ERROR";\n StatusCode[StatusCode["RESTRICTED"] = 4] = "RESTRICTED";\n})(StatusCode || (exports.StatusCode = StatusCode = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/StatusCode.ts?')},"./src/Thumb.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumb = void 0;\n// todo: deprecate\n// this is used by Sequence.getThumbs\nvar Thumb = /** @class */ (function () {\n function Thumb(width, canvas) {\n this.data = canvas;\n this.index = canvas.index;\n this.width = width;\n var heightRatio = canvas.getHeight() / canvas.getWidth();\n if (heightRatio) {\n this.height = Math.floor(this.width * heightRatio);\n }\n else {\n this.height = width;\n }\n this.uri = canvas.getCanonicalImageUri(width);\n this.label = canvas.getLabel().getValue(); // todo: pass locale?\n this.viewingHint = canvas.getViewingHint();\n }\n return Thumb;\n}());\nexports.Thumb = Thumb;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumb.ts?')},"./src/Thumbnail.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumbnail = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Thumbnail = /** @class */ (function (_super) {\n __extends(Thumbnail, _super);\n function Thumbnail(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n return Thumbnail;\n}(internal_1.Resource));\nexports.Thumbnail = Thumbnail;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumbnail.ts?')},"./src/Transform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Transform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Transform = /** @class */ (function (_super) {\n __extends(Transform, _super);\n function Transform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTransform = true;\n _this.isTransform = true;\n return _this;\n }\n return Transform;\n}(internal_1.JSONLDResource));\nexports.Transform = Transform;\n\n\n//# sourceURL=webpack://manifesto/./src/Transform.ts?')},"./src/TransformParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TransformParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TransformParser = /** @class */ (function () {\n function TransformParser() {\n }\n TransformParser.BuildFromJson = function (jsonld) {\n if (jsonld.type === "TranslateTransform")\n return new internal_1.TranslateTransform(jsonld);\n else if (jsonld.type === "RotateTransform")\n return new internal_1.RotateTransform(jsonld);\n else if (jsonld.type === "ScaleTransform")\n return new internal_1.ScaleTransform(jsonld);\n else\n throw new Error("Unknown transform type " + jsonld.type);\n };\n return TransformParser;\n}());\nexports.TransformParser = TransformParser;\n\n\n//# sourceURL=webpack://manifesto/./src/TransformParser.ts?')},"./src/TranslateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TranslateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TranslateTransform = /** @class */ (function (_super) {\n __extends(TranslateTransform, _super);\n function TranslateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTranslateTransform = true;\n return _this;\n }\n TranslateTransform.prototype.getTranslation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return TranslateTransform;\n}(internal_1.Transform));\nexports.TranslateTransform = TranslateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/TranslateTransform.ts?')},"./src/TreeNode.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNode = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TreeNode = /** @class */ (function () {\n function TreeNode(label, data) {\n this.label = label;\n this.data = data || {};\n this.nodes = [];\n }\n TreeNode.prototype.addNode = function (node) {\n this.nodes.push(node);\n node.parentNode = this;\n };\n TreeNode.prototype.isCollection = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n };\n TreeNode.prototype.isManifest = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n };\n TreeNode.prototype.isRange = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n };\n return TreeNode;\n}());\nexports.TreeNode = TreeNode;\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNode.ts?')},"./src/TreeNodeType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNodeType = void 0;\nvar TreeNodeType;\n(function (TreeNodeType) {\n TreeNodeType["COLLECTION"] = "collection";\n TreeNodeType["MANIFEST"] = "manifest";\n TreeNodeType["RANGE"] = "range";\n})(TreeNodeType || (exports.TreeNodeType = TreeNodeType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNodeType.ts?')},"./src/Utils.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Utils = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar dist_commonjs_2 = __webpack_require__(/*! @edsilv/http-status-codes/dist-commonjs */ "./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js");\n__webpack_require__(/*! isomorphic-unfetch */ "./node_modules/isomorphic-unfetch/index.js");\nvar Utils = /** @class */ (function () {\n function Utils() {\n }\n Utils.getMediaType = function (type) {\n type = type.toLowerCase();\n type = type.split(";")[0];\n return type.trim();\n };\n Utils.getImageQuality = function (profile) {\n if (profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) {\n return "native";\n }\n return "default";\n };\n Utils.getInexactLocale = function (locale) {\n if (locale.indexOf("-") !== -1) {\n return locale.substr(0, locale.indexOf("-"));\n }\n return locale;\n };\n Utils.getLocalisedValue = function (resource, locale) {\n // if the resource is not an array of translations, return the string.\n if (!Array.isArray(resource)) {\n return resource;\n }\n // test for exact match\n for (var i = 0; i < resource.length; i++) {\n var value_1 = resource[i];\n var language_1 = value_1["@language"];\n if (locale === language_1) {\n return value_1["@value"];\n }\n }\n // test for inexact match\n var match = locale.substr(0, locale.indexOf("-"));\n for (var i = 0; i < resource.length; i++) {\n var value = resource[i];\n var language = value["@language"];\n if (language === match) {\n return value["@value"];\n }\n }\n return null;\n };\n Utils.generateTreeNodeIds = function (treeNode, index) {\n if (index === void 0) { index = 0; }\n var id;\n if (!treeNode.parentNode) {\n id = "0";\n }\n else {\n id = treeNode.parentNode.id + "-" + index;\n }\n treeNode.id = id;\n for (var i = 0; i < treeNode.nodes.length; i++) {\n var n = treeNode.nodes[i];\n Utils.generateTreeNodeIds(n, i);\n }\n };\n Utils.normaliseType = function (type) {\n type = (type || "").toLowerCase();\n if (type.indexOf(":") !== -1) {\n var split = type.split(":");\n return split[1];\n }\n return type;\n };\n Utils.normaliseUrl = function (url) {\n url = url.substr(url.indexOf("://"));\n if (url.indexOf("#") !== -1) {\n url = url.split("#")[0];\n }\n return url;\n };\n Utils.normalisedUrlsMatch = function (url1, url2) {\n return Utils.normaliseUrl(url1) === Utils.normaliseUrl(url2);\n };\n Utils.isImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.isImageServiceType = function (type) {\n return ((type !== null &&\n type.toLowerCase() === dist_commonjs_1.ServiceType.IMAGE_SERVICE_2.toLowerCase()) ||\n type === dist_commonjs_1.ServiceType.IMAGE_SERVICE_3.toLowerCase());\n };\n Utils.isLevel0ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) {\n return true;\n }\n return false;\n };\n Utils.isLevel1ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) {\n return true;\n }\n return false;\n };\n Utils.isLevel2ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.parseManifest = function (manifest, options) {\n return internal_1.Deserialiser.parse(manifest, options);\n };\n Utils.checkStatus = function (response) {\n if (response.ok) {\n return response;\n }\n else {\n var error = new Error(response.statusText);\n error.response = response;\n return Promise.reject(error);\n }\n };\n Utils.loadManifest = function (url) {\n return new Promise(function (resolve, reject) {\n fetch(url)\n .then(Utils.checkStatus)\n .then(function (r) { return r.json(); })\n .then(function (data) {\n resolve(data);\n })\n .catch(function (err) {\n reject();\n });\n });\n };\n Utils.loadExternalResourcesAuth1 = function (resources, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth1(resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n Utils.loadExternalResourceAuth1 = function (resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var storedAccessToken;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, getStoredAccessToken(resource)];\n case 1:\n storedAccessToken = _a.sent();\n if (!storedAccessToken) return [3 /*break*/, 6];\n return [4 /*yield*/, resource.getData(storedAccessToken)];\n case 2:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.OK)) return [3 /*break*/, 3];\n return [2 /*return*/, resource];\n case 3: \n // the stored token is no good for this resource\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 4:\n // the stored token is no good for this resource\n _a.sent();\n _a.label = 5;\n case 5:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n case 6: return [4 /*yield*/, resource.getData()];\n case 7:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.MOVED_TEMPORARILY ||\n resource.status === dist_commonjs_2.UNAUTHORIZED)) return [3 /*break*/, 9];\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 8:\n _a.sent();\n _a.label = 9;\n case 9:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n }\n });\n });\n };\n Utils.doAuthChain = function (resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var externalService, kioskService, clickThroughService, loginService, serviceToTry, lastAttempted, kioskInteraction, contentProviderInteraction, contentProviderInteraction;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // This function enters the flowchart at the < External? > junction\n // http://iiif.io/api/auth/1.0/#workflow-from-the-browser-client-perspective\n if (!resource.isAccessControlled()) {\n return [2 /*return*/, resource]; // no services found\n }\n externalService = resource.externalService;\n if (externalService) {\n externalService.options = resource.options;\n }\n kioskService = resource.kioskService;\n if (kioskService) {\n kioskService.options = resource.options;\n }\n clickThroughService = resource.clickThroughService;\n if (clickThroughService) {\n clickThroughService.options = resource.options;\n }\n loginService = resource.loginService;\n if (loginService) {\n loginService.options = resource.options;\n }\n if (!(!resource.isResponseHandled && resource.status === dist_commonjs_2.MOVED_TEMPORARILY)) return [3 /*break*/, 2];\n return [4 /*yield*/, handleMovedTemporarily(resource)];\n case 1:\n _a.sent();\n return [2 /*return*/, resource];\n case 2:\n serviceToTry = null;\n lastAttempted = null;\n // repetition of logic is left in these steps for clarity:\n // Looking for external pattern\n serviceToTry = externalService;\n if (!serviceToTry) return [3 /*break*/, 4];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 3:\n _a.sent();\n return [2 /*return*/, resource];\n case 4:\n // Looking for kiosk pattern\n serviceToTry = kioskService;\n if (!serviceToTry) return [3 /*break*/, 7];\n lastAttempted = serviceToTry;\n kioskInteraction = openContentProviderInteraction(serviceToTry);\n if (!kioskInteraction) return [3 /*break*/, 7];\n return [4 /*yield*/, userInteractedWithContentProvider(kioskInteraction)];\n case 5:\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 6:\n _a.sent();\n return [2 /*return*/, resource];\n case 7:\n // The code for the next two patterns is identical (other than the profile name).\n // The difference is in the expected behaviour of\n //\n // await userInteractedWithContentProvider(contentProviderInteraction);\n //\n // For clickthrough the opened window should close immediately having established\n // a session, whereas for login the user might spend some time entering credentials etc.\n // Looking for clickthrough pattern\n serviceToTry = clickThroughService;\n if (!serviceToTry) return [3 /*break*/, 11];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 8:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 11];\n // should close immediately\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 9:\n // should close immediately\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 10:\n _a.sent();\n return [2 /*return*/, resource];\n case 11:\n // Looking for login pattern\n serviceToTry = loginService;\n if (!serviceToTry) return [3 /*break*/, 15];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 12:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 15];\n // we expect the user to spend some time interacting\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 13:\n // we expect the user to spend some time interacting\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 14:\n _a.sent();\n return [2 /*return*/, resource];\n case 15:\n // nothing worked! Use the most recently tried service as the source of\n // messages to show to the user.\n if (lastAttempted) {\n showOutOfOptionsMessages(resource, lastAttempted);\n }\n return [2 /*return*/];\n }\n });\n });\n };\n Utils.attemptResourceWithToken = function (resource, openTokenService, authService) {\n return __awaiter(this, void 0, void 0, function () {\n var tokenService, tokenMessage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n tokenService = authService.getService(dist_commonjs_1.ServiceProfile.AUTH_1_TOKEN);\n if (!tokenService) return [3 /*break*/, 3];\n return [4 /*yield*/, openTokenService(resource, tokenService)];\n case 1:\n tokenMessage = _a.sent();\n if (!(tokenMessage && tokenMessage.accessToken)) return [3 /*break*/, 3];\n return [4 /*yield*/, resource.getData(tokenMessage)];\n case 2:\n _a.sent();\n return [2 /*return*/, resource];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n Utils.loadExternalResourcesAuth09 = function (resources, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth09(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n // IIIF auth api pre v1.0\n // Keeping this around for now until the auth 1.0 implementation is stable\n Utils.loadExternalResourceAuth09 = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n if (options && options.pessimisticAccessControl) {\n // pessimistic: access control cookies may have been deleted.\n // always request the access token for every access controlled info.json request\n // returned access tokens are not stored, therefore the login window flashes for every request.\n resource\n .getData()\n .then(function () {\n if (resource.isAccessControlled()) {\n // if the resource has a click through service, use that.\n if (resource.clickThroughService) {\n resolve(clickThrough(resource));\n //} else if(resource.restrictedService) {\n resolve(restricted(resource));\n }\n else {\n login(resource)\n .then(function () {\n getAccessToken(resource, true)\n .then(function (token) {\n resource\n .getData(token)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n }\n else {\n // this info.json isn\'t access controlled, therefore no need to request an access token.\n resolve(resource);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // optimistic: access control cookies may not have been deleted.\n // store access tokens to avoid login window flashes.\n // if cookies are deleted a page refresh is required.\n // try loading the resource using an access token that matches the info.json domain.\n // if an access token is found, request the resource using it regardless of whether it is access controlled.\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n // if the info.json loaded using the stored access token\n if (resource.status === dist_commonjs_2.OK) {\n resolve(handleResourceResponse(resource));\n }\n else {\n // otherwise, load the resource data to determine the correct access control services.\n // if access controlled, do login.\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n // if (resource.restrictedService){\n // reject(Utils.createRestrictedError());\n // } else {\n reject(Utils.createAuthorizationFailedError());\n //}\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n else {\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n });\n };\n Utils.createError = function (name, message) {\n var error = new Error();\n error.message = message;\n error.name = String(name);\n return error;\n };\n Utils.createAuthorizationFailedError = function () {\n return Utils.createError(internal_1.StatusCode.AUTHORIZATION_FAILED, "Authorization failed");\n };\n Utils.createRestrictedError = function () {\n return Utils.createError(internal_1.StatusCode.RESTRICTED, "Restricted");\n };\n Utils.createInternalServerError = function (message) {\n return Utils.createError(internal_1.StatusCode.INTERNAL_SERVER_ERROR, message);\n };\n Utils.authorize = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) {\n return new Promise(function (resolve, reject) {\n resource.getData().then(function () {\n if (resource.isAccessControlled()) {\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource); // happy path ended\n }\n else {\n // the stored token is no good for this resource\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // There was no stored token, but the user might have a cookie that will grant a token\n getAccessToken(resource, false).then(function (accessToken) {\n if (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n // try using the fresh access token\n resource\n .getData(accessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource);\n }\n else {\n // User has a token, but it\'s not good enough\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n // not able to store access token\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // The user did not have a cookie that granted a token\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n });\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // this info.json isn\'t access controlled, therefore there\'s no need to request an access token\n resolve(resource);\n }\n });\n });\n };\n Utils.showAuthInteraction = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject) {\n if (resource.status === dist_commonjs_2.MOVED_TEMPORARILY && !resource.isResponseHandled) {\n // if the resource was redirected to a degraded version\n // and the response hasn\'t been handled yet.\n // if the client wishes to trigger a login, set resource.isResponseHandled to true\n // and call loadExternalResources() again passing the resource.\n resolve(resource);\n // } else if (resource.restrictedService) {\n // resolve(restricted(resource));\n // // TODO: move to next etc\n }\n else if (resource.clickThroughService && !resource.isResponseHandled) {\n // if the resource has a click through service, use that.\n clickThrough(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n else {\n // get an access token\n login(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n };\n Utils.getService = function (resource, profile) {\n var services = this.getServices(resource);\n for (var i = 0; i < services.length; i++) {\n var service = services[i];\n if (service.getProfile() === profile) {\n return service;\n }\n }\n return null;\n };\n Utils.getResourceById = function (parentResource, id) {\n return (Utils.traverseAndFind(parentResource.__jsonld, "@id", id));\n };\n /**\n * Does a depth first traversal of an Object, returning an Object that\n * matches provided k and v arguments\n * @example Utils.traverseAndFind({foo: \'bar\'}, \'foo\', \'bar\')\n */\n Utils.traverseAndFind = function (object, k, v) {\n if (object.hasOwnProperty(k) && object[k] === v) {\n return object;\n }\n for (var i = 0; i < Object.keys(object).length; i++) {\n if (typeof object[Object.keys(object)[i]] === "object") {\n var o = Utils.traverseAndFind(object[Object.keys(object)[i]], k, v);\n if (o != null) {\n return o;\n }\n }\n }\n return undefined;\n };\n Utils.getServices = function (resource, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.onlyService, onlyService = _c === void 0 ? false : _c, _d = _b.onlyServices, onlyServices = _d === void 0 ? false : _d, _e = _b.skipParentResources, skipParentResources = _e === void 0 ? false : _e;\n var services = [];\n // Resources can reference "services" on the manifest. This is a bit of a hack to just get the services from the manifest\n // too. What would be better is if this was used as a "Map" of full services.\n // So when you come across { id: \'...\' } without any data, you can "lookup" services from the manifest.\n // I would have implemented this if I was confident that it was reliable. Instead, I opted for the safest option that\n // should not break any existing services.\n if (!skipParentResources &&\n resource &&\n resource.options &&\n resource.options.resource &&\n resource.options.resource !== resource) {\n services.push.apply(services, Utils.getServices(resource.options.resource, { onlyServices: true }));\n }\n var service = !onlyServices\n ? (resource.__jsonld || resource).service || []\n : [];\n // coerce to array\n if (!Array.isArray(service)) {\n service = [service];\n }\n if (!onlyService) {\n // Some resources also have a `.services` property.\n // https://iiif.io/api/presentation/3.0/#services\n service.push.apply(service, ((resource.__jsonld || resource).services || []));\n }\n if (service.length === 0) {\n return services;\n }\n for (var i = 0; i < service.length; i++) {\n var s = service[i];\n if (typeof s === "string") {\n var r = this.getResourceById(resource.options.resource, s);\n if (r) {\n services.push(new internal_1.Service(r.__jsonld || r, resource.options));\n }\n }\n else {\n services.push(new internal_1.Service(s, resource.options));\n }\n }\n return services;\n };\n Utils.getTemporalComponent = function (target) {\n var temporal = /t=([^&]+)/g.exec(target);\n var t = null;\n if (temporal && temporal[1]) {\n t = temporal[1].split(",");\n }\n return t;\n };\n return Utils;\n}());\nexports.Utils = Utils;\n\n\n//# sourceURL=webpack://manifesto/./src/Utils.ts?')},"./src/index.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.parseManifest = exports.loadManifest = void 0;\n__exportStar(__webpack_require__(/*! ./internal */ "./src/internal.ts"), exports);\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/**\nInitiates downloading an IIIF manifest json file from URL. Returns a Promise\nto allow subsequent processing on a successful fetch.\n\n@param url string containing the URL to Fetch\n@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text.\n**/\nvar loadManifest = function (url) {\n return Utils_1.Utils.loadManifest(url);\n};\nexports.loadManifest = loadManifest;\n/**\nParses IIIF manifest file to return a manifesto Manifest instance\n\n@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file.\n@param options? TODO Not yet documented\n@returns instance of Manifest class.\n**/\nvar parseManifest = function (manifest, options) {\n return Utils_1.Utils.parseManifest(manifest, options);\n};\nexports.parseManifest = parseManifest;\n\n\n//# sourceURL=webpack://manifesto/./src/index.ts?')},"./src/internal.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./JSONLDResource */ "./src/JSONLDResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestResource */ "./src/ManifestResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Resource */ "./src/Resource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IIIFResource */ "./src/IIIFResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./SpecificResource */ "./src/SpecificResource.ts"), exports);\n//export * from "./SpecificResourceForTarget";\n//export * from "./SpecificResourceForBody";\n__exportStar(__webpack_require__(/*! ./AnnotationBody */ "./src/AnnotationBody.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Light */ "./src/Light.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Camera */ "./src/Camera.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationBodyParser */ "./src/AnnotationBodyParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Annotation */ "./src/Annotation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationList */ "./src/AnnotationList.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationPage */ "./src/AnnotationPage.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Canvas */ "./src/Canvas.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Collection */ "./src/Collection.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Duration */ "./src/Duration.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IAccessToken */ "./src/IAccessToken.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalImageResourceData */ "./src/IExternalImageResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResource */ "./src/IExternalResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceData */ "./src/IExternalResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceOptions */ "./src/IExternalResourceOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IManifestoOptions */ "./src/IManifestoOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LabelValuePair */ "./src/LabelValuePair.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Language */ "./src/Language.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LanguageMap */ "./src/LanguageMap.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PropertyValue */ "./src/PropertyValue.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Manifest */ "./src/Manifest.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestType */ "./src/ManifestType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PointSelector */ "./src/PointSelector.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Range */ "./src/Range.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Rendering */ "./src/Rendering.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Scene */ "./src/Scene.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Sequence */ "./src/Sequence.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Serialisation */ "./src/Serialisation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Service */ "./src/Service.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Size */ "./src/Size.ts"), exports);\n__exportStar(__webpack_require__(/*! ./StatusCode */ "./src/StatusCode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumb */ "./src/Thumb.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumbnail */ "./src/Thumbnail.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TransformParser */ "./src/TransformParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNode */ "./src/TreeNode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNodeType */ "./src/TreeNodeType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Utils */ "./src/Utils.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./RotateTransform */ "./src/RotateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ScaleTransform */ "./src/ScaleTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Color */ "./src/Color.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Geometry3d */ "./src/Geometry3d.ts"), exports);\n\n\n//# sourceURL=webpack://manifesto/./src/internal.ts?')},"./node_modules/unfetch/dist/unfetch.module.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},s.onerror=r,s.withCredentials="include"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})}\n//# sourceMappingURL=unfetch.module.js.map\n\n\n//# sourceURL=webpack://manifesto/./node_modules/unfetch/dist/unfetch.module.js?')},"node-fetch":t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE_node_fetch__},"./node_modules/threejs-math/build/threejs-math.cjs":(__unused_webpack_module,exports)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nconst REVISION = '144dev';\nconst MOUSE = {\n\tLEFT: 0,\n\tMIDDLE: 1,\n\tRIGHT: 2,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2\n};\nconst TOUCH = {\n\tROTATE: 0,\n\tPAN: 1,\n\tDOLLY_PAN: 2,\n\tDOLLY_ROTATE: 3\n};\nconst CullFaceNone = 0;\nconst CullFaceBack = 1;\nconst CullFaceFront = 2;\nconst CullFaceFrontBack = 3;\nconst BasicShadowMap = 0;\nconst PCFShadowMap = 1;\nconst PCFSoftShadowMap = 2;\nconst VSMShadowMap = 3;\nconst FrontSide = 0;\nconst BackSide = 1;\nconst DoubleSide = 2;\nconst NoBlending = 0;\nconst NormalBlending = 1;\nconst AdditiveBlending = 2;\nconst SubtractiveBlending = 3;\nconst MultiplyBlending = 4;\nconst CustomBlending = 5;\nconst AddEquation = 100;\nconst SubtractEquation = 101;\nconst ReverseSubtractEquation = 102;\nconst MinEquation = 103;\nconst MaxEquation = 104;\nconst ZeroFactor = 200;\nconst OneFactor = 201;\nconst SrcColorFactor = 202;\nconst OneMinusSrcColorFactor = 203;\nconst SrcAlphaFactor = 204;\nconst OneMinusSrcAlphaFactor = 205;\nconst DstAlphaFactor = 206;\nconst OneMinusDstAlphaFactor = 207;\nconst DstColorFactor = 208;\nconst OneMinusDstColorFactor = 209;\nconst SrcAlphaSaturateFactor = 210;\nconst NeverDepth = 0;\nconst AlwaysDepth = 1;\nconst LessDepth = 2;\nconst LessEqualDepth = 3;\nconst EqualDepth = 4;\nconst GreaterEqualDepth = 5;\nconst GreaterDepth = 6;\nconst NotEqualDepth = 7;\nconst MultiplyOperation = 0;\nconst MixOperation = 1;\nconst AddOperation = 2;\nconst NoToneMapping = 0;\nconst LinearToneMapping = 1;\nconst ReinhardToneMapping = 2;\nconst CineonToneMapping = 3;\nconst ACESFilmicToneMapping = 4;\nconst CustomToneMapping = 5;\nconst UVMapping = 300;\nconst CubeReflectionMapping = 301;\nconst CubeRefractionMapping = 302;\nconst EquirectangularReflectionMapping = 303;\nconst EquirectangularRefractionMapping = 304;\nconst CubeUVReflectionMapping = 306;\nconst RepeatWrapping = 1000;\nconst ClampToEdgeWrapping = 1001;\nconst MirroredRepeatWrapping = 1002;\nconst NearestFilter = 1003;\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004;\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005;\nconst LinearFilter = 1006;\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007;\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008;\nconst UnsignedByteType = 1009;\nconst ByteType = 1010;\nconst ShortType = 1011;\nconst UnsignedShortType = 1012;\nconst IntType = 1013;\nconst UnsignedIntType = 1014;\nconst FloatType = 1015;\nconst HalfFloatType = 1016;\nconst UnsignedShort4444Type = 1017;\nconst UnsignedShort5551Type = 1018;\nconst UnsignedInt248Type = 1020;\nconst AlphaFormat = 1021;\nconst RGBFormat = 1022; // @deprecated since r137\n\nconst RGBAFormat = 1023;\nconst LuminanceFormat = 1024;\nconst LuminanceAlphaFormat = 1025;\nconst DepthFormat = 1026;\nconst DepthStencilFormat = 1027;\nconst RedFormat = 1028;\nconst RedIntegerFormat = 1029;\nconst RGFormat = 1030;\nconst RGIntegerFormat = 1031;\nconst RGBAIntegerFormat = 1033;\nconst RGB_S3TC_DXT1_Format = 33776;\nconst RGBA_S3TC_DXT1_Format = 33777;\nconst RGBA_S3TC_DXT3_Format = 33778;\nconst RGBA_S3TC_DXT5_Format = 33779;\nconst RGB_PVRTC_4BPPV1_Format = 35840;\nconst RGB_PVRTC_2BPPV1_Format = 35841;\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\nconst RGB_ETC1_Format = 36196;\nconst RGB_ETC2_Format = 37492;\nconst RGBA_ETC2_EAC_Format = 37496;\nconst RGBA_ASTC_4x4_Format = 37808;\nconst RGBA_ASTC_5x4_Format = 37809;\nconst RGBA_ASTC_5x5_Format = 37810;\nconst RGBA_ASTC_6x5_Format = 37811;\nconst RGBA_ASTC_6x6_Format = 37812;\nconst RGBA_ASTC_8x5_Format = 37813;\nconst RGBA_ASTC_8x6_Format = 37814;\nconst RGBA_ASTC_8x8_Format = 37815;\nconst RGBA_ASTC_10x5_Format = 37816;\nconst RGBA_ASTC_10x6_Format = 37817;\nconst RGBA_ASTC_10x8_Format = 37818;\nconst RGBA_ASTC_10x10_Format = 37819;\nconst RGBA_ASTC_12x10_Format = 37820;\nconst RGBA_ASTC_12x12_Format = 37821;\nconst RGBA_BPTC_Format = 36492;\nconst LoopOnce = 2200;\nconst LoopRepeat = 2201;\nconst LoopPingPong = 2202;\nconst InterpolateDiscrete = 2300;\nconst InterpolateLinear = 2301;\nconst InterpolateSmooth = 2302;\nconst ZeroCurvatureEnding = 2400;\nconst ZeroSlopeEnding = 2401;\nconst WrapAroundEnding = 2402;\nconst NormalAnimationBlendMode = 2500;\nconst AdditiveAnimationBlendMode = 2501;\nconst TrianglesDrawMode = 0;\nconst TriangleStripDrawMode = 1;\nconst TriangleFanDrawMode = 2;\nconst LinearEncoding = 3000;\nconst sRGBEncoding = 3001;\nconst BasicDepthPacking = 3200;\nconst RGBADepthPacking = 3201;\nconst TangentSpaceNormalMap = 0;\nconst ObjectSpaceNormalMap = 1; // Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\n\nconst NoColorSpace = '';\nconst SRGBColorSpace = 'srgb';\nconst LinearSRGBColorSpace = 'srgb-linear';\nconst ZeroStencilOp = 0;\nconst KeepStencilOp = 7680;\nconst ReplaceStencilOp = 7681;\nconst IncrementStencilOp = 7682;\nconst DecrementStencilOp = 7683;\nconst IncrementWrapStencilOp = 34055;\nconst DecrementWrapStencilOp = 34056;\nconst InvertStencilOp = 5386;\nconst NeverStencilFunc = 512;\nconst LessStencilFunc = 513;\nconst EqualStencilFunc = 514;\nconst LessEqualStencilFunc = 515;\nconst GreaterStencilFunc = 516;\nconst NotEqualStencilFunc = 517;\nconst GreaterEqualStencilFunc = 518;\nconst AlwaysStencilFunc = 519;\nconst StaticDrawUsage = 35044;\nconst DynamicDrawUsage = 35048;\nconst StreamDrawUsage = 35040;\nconst StaticReadUsage = 35045;\nconst DynamicReadUsage = 35049;\nconst StreamReadUsage = 35041;\nconst StaticCopyUsage = 35046;\nconst DynamicCopyUsage = 35050;\nconst StreamCopyUsage = 35042;\nconst GLSL1 = '100';\nconst GLSL3 = '300 es';\nconst _SRGBAFormat = 1035; // fallback for WebGL 1\n\nclass Vector2 {\n\tconstructor(x = 0, y = 0) {\n\t\tVector2.prototype.isVector2 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tget width() {\n\t\treturn this.x;\n\t}\n\n\tset width(value) {\n\t\tthis.x = value;\n\t}\n\n\tget height() {\n\t\treturn this.y;\n\t}\n\n\tset height(value) {\n\t\tthis.y = value;\n\t}\n\n\tset(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\treturn this;\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6];\n\t\tthis.y = e[1] * x + e[4] * y + e[7];\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y;\n\t}\n\n\tcross(v) {\n\t\treturn this.x * v.y - this.y * v.x;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tangle() {\n\t\t// computes the angle in radians with respect to the positive x-axis\n\t\tconst angle = Math.atan2(-this.y, -this.x) + Math.PI;\n\t\treturn angle;\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \treturn this;\n\t// }\n\n\n\trotateAround(center, angle) {\n\t\tconst c = Math.cos(angle),\n\t\t\t\t\ts = Math.sin(angle);\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\t\treturn this;\n\t}\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t}\n\n}\n\nconst _lut = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff'];\nlet _seed = 1234567;\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI; // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\nfunction generateUUID() {\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[d0 & 0xff] + _lut[d0 >> 8 & 0xff] + _lut[d0 >> 16 & 0xff] + _lut[d0 >> 24 & 0xff] + '-' + _lut[d1 & 0xff] + _lut[d1 >> 8 & 0xff] + '-' + _lut[d1 >> 16 & 0x0f | 0x40] + _lut[d1 >> 24 & 0xff] + '-' + _lut[d2 & 0x3f | 0x80] + _lut[d2 >> 8 & 0xff] + '-' + _lut[d2 >> 16 & 0xff] + _lut[d2 >> 24 & 0xff] + _lut[d3 & 0xff] + _lut[d3 >> 8 & 0xff] + _lut[d3 >> 16 & 0xff] + _lut[d3 >> 24 & 0xff]; // .toLowerCase() here flattens concatenated strings to save heap memory space.\n\n\treturn uuid.toLowerCase();\n}\n\nfunction clamp(value, min, max) {\n\treturn Math.max(min, Math.min(max, value));\n} // compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\n\n\nfunction euclideanModulo(n, m) {\n\treturn (n % m + m) % m;\n} // Linear mapping from range to range \n\n\nfunction mapLinear(x, a1, a2, b1, b2) {\n\treturn b1 + (x - a1) * (b2 - b1) / (a2 - a1);\n} // https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\nfunction inverseLerp(x, y, value) {\n\tif (x !== y) {\n\t\treturn (value - x) / (y - x);\n\t} else {\n\t\treturn 0;\n\t}\n} // https://en.wikipedia.org/wiki/Linear_interpolation\n\n\nfunction lerp(x, y, t) {\n\treturn (1 - t) * x + t * y;\n} // http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\n\n\nfunction damp(x, y, lambda, dt) {\n\treturn lerp(x, y, 1 - Math.exp(-lambda * dt));\n} // https://www.desmos.com/calculator/vcsjnyz7x4\n\n\nfunction pingpong(x, length = 1) {\n\treturn length - Math.abs(euclideanModulo(x, length * 2) - length);\n} // http://en.wikipedia.org/wiki/Smoothstep\n\n\nfunction smoothstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * (3 - 2 * x);\n}\n\nfunction smootherstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * x * (x * (x * 6 - 15) + 10);\n} // Random integer from interval\n\n\nfunction randInt(low, high) {\n\treturn low + Math.floor(Math.random() * (high - low + 1));\n} // Random float from interval\n\n\nfunction randFloat(low, high) {\n\treturn low + Math.random() * (high - low);\n} // Random float from <-range/2, range/2> interval\n\n\nfunction randFloatSpread(range) {\n\treturn range * (0.5 - Math.random());\n} // Deterministic pseudo-random float in the interval [ 0, 1 ]\n\n\nfunction seededRandom(s) {\n\tif (s !== undefined) _seed = s; // Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\tt = Math.imul(t ^ t >>> 15, t | 1);\n\tt ^= t + Math.imul(t ^ t >>> 7, t | 61);\n\treturn ((t ^ t >>> 14) >>> 0) / 4294967296;\n}\n\nfunction degToRad(degrees) {\n\treturn degrees * DEG2RAD;\n}\n\nfunction radToDeg(radians) {\n\treturn radians * RAD2DEG;\n}\n\nfunction isPowerOfTwo(value) {\n\treturn (value & value - 1) === 0 && value !== 0;\n}\n\nfunction ceilPowerOfTwo(value) {\n\treturn Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n}\n\nfunction floorPowerOfTwo(value) {\n\treturn Math.pow(2, Math.floor(Math.log(value) / Math.LN2));\n}\n\nfunction setQuaternionFromProperEuler(q, a, b, c, order) {\n\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\t// rotations are applied to the axes in the order specified by 'order'\n\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t// angles are in radians\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\tconst c2 = cos(b / 2);\n\tconst s2 = sin(b / 2);\n\tconst c13 = cos((a + c) / 2);\n\tconst s13 = sin((a + c) / 2);\n\tconst c1_3 = cos((a - c) / 2);\n\tconst s1_3 = sin((a - c) / 2);\n\tconst c3_1 = cos((c - a) / 2);\n\tconst s3_1 = sin((c - a) / 2);\n\n\tswitch (order) {\n\t\tcase 'XYX':\n\t\t\tq.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order);\n\t}\n}\n\nfunction denormalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\t\t\treturn value / 255.0;\n\n\t\tcase Int16Array:\n\t\t\treturn Math.max(value / 32767.0, -1.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.max(value / 127.0, -1.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nfunction normalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn Math.round(value * 65535.0);\n\n\t\tcase Uint8Array:\n\t\t\treturn Math.round(value * 255.0);\n\n\t\tcase Int16Array:\n\t\t\treturn Math.round(value * 32767.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.round(value * 127.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nvar MathUtils = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\tgenerateUUID: generateUUID,\n\tclamp: clamp,\n\teuclideanModulo: euclideanModulo,\n\tmapLinear: mapLinear,\n\tinverseLerp: inverseLerp,\n\tlerp: lerp,\n\tdamp: damp,\n\tpingpong: pingpong,\n\tsmoothstep: smoothstep,\n\tsmootherstep: smootherstep,\n\trandInt: randInt,\n\trandFloat: randFloat,\n\trandFloatSpread: randFloatSpread,\n\tseededRandom: seededRandom,\n\tdegToRad: degToRad,\n\tradToDeg: radToDeg,\n\tisPowerOfTwo: isPowerOfTwo,\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\tnormalize: normalize,\n\tdenormalize: denormalize\n});\n\nclass Quaternion {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tthis.isQuaternion = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\t}\n\n\tstatic slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) {\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\t\tlet x0 = src0[srcOffset0 + 0],\n\t\t\t\ty0 = src0[srcOffset0 + 1],\n\t\t\t\tz0 = src0[srcOffset0 + 2],\n\t\t\t\tw0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1 + 0],\n\t\t\t\t\ty1 = src1[srcOffset1 + 1],\n\t\t\t\t\tz1 = src1[srcOffset1 + 2],\n\t\t\t\t\tw1 = src1[srcOffset1 + 3];\n\n\t\tif (t === 0) {\n\t\t\tdst[dstOffset + 0] = x0;\n\t\t\tdst[dstOffset + 1] = y0;\n\t\t\tdst[dstOffset + 2] = z0;\n\t\t\tdst[dstOffset + 3] = w0;\n\t\t\treturn;\n\t\t}\n\n\t\tif (t === 1) {\n\t\t\tdst[dstOffset + 0] = x1;\n\t\t\tdst[dstOffset + 1] = y1;\n\t\t\tdst[dstOffset + 2] = z1;\n\t\t\tdst[dstOffset + 3] = w1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\t\t\tdir = cos >= 0 ? 1 : -1,\n\t\t\t\t\t\tsqrSin = 1 - cos * cos; // Skip the Slerp for tiny steps to avoid numeric problems:\n\n\t\t\tif (sqrSin > Number.EPSILON) {\n\t\t\t\tconst sin = Math.sqrt(sqrSin),\n\t\t\t\t\t\t\tlen = Math.atan2(sin, cos * dir);\n\t\t\t\ts = Math.sin(s * len) / sin;\n\t\t\t\tt = Math.sin(t * len) / sin;\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir; // Normalize in case we just did a lerp:\n\n\t\t\tif (s === 1 - t) {\n\t\t\t\tconst f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\t\t\t}\n\t\t}\n\n\t\tdst[dstOffset] = x0;\n\t\tdst[dstOffset + 1] = y0;\n\t\tdst[dstOffset + 2] = z0;\n\t\tdst[dstOffset + 3] = w0;\n\t}\n\n\tstatic multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {\n\t\tconst x0 = src0[srcOffset0];\n\t\tconst y0 = src0[srcOffset0 + 1];\n\t\tconst z0 = src0[srcOffset0 + 2];\n\t\tconst w0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1];\n\t\tconst y1 = src1[srcOffset1 + 1];\n\t\tconst z1 = src1[srcOffset1 + 2];\n\t\tconst w1 = src1[srcOffset1 + 3];\n\t\tdst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\t\treturn dst;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget w() {\n\t\treturn this._w;\n\t}\n\n\tset w(value) {\n\t\tthis._w = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._w);\n\t}\n\n\tcopy(quaternion) {\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromEuler(euler, update) {\n\t\tconst x = euler._x,\n\t\t\t\t\ty = euler._y,\n\t\t\t\t\tz = euler._z,\n\t\t\t\t\torder = euler._order; // http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\t\tconst c1 = cos(x / 2);\n\t\tconst c2 = cos(y / 2);\n\t\tconst c3 = cos(z / 2);\n\t\tconst s1 = sin(x / 2);\n\t\tconst s2 = sin(y / 2);\n\t\tconst s3 = sin(z / 2);\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tif (update !== false) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromAxisAngle(axis, angle) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\t\t// assumes axis is normalized\n\t\tconst halfAngle = angle / 2,\n\t\t\t\t\ts = Math.sin(halfAngle);\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos(halfAngle);\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10],\n\t\t\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif (trace > 0) {\n\t\t\tconst s = 0.5 / Math.sqrt(trace + 1.0);\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = (m32 - m23) * s;\n\t\t\tthis._y = (m13 - m31) * s;\n\t\t\tthis._z = (m21 - m12) * s;\n\t\t} else if (m11 > m22 && m11 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\t\t\tthis._w = (m32 - m23) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = (m12 + m21) / s;\n\t\t\tthis._z = (m13 + m31) / s;\n\t\t} else if (m22 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\t\t\tthis._w = (m13 - m31) / s;\n\t\t\tthis._x = (m12 + m21) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = (m23 + m32) / s;\n\t\t} else {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\t\t\tthis._w = (m21 - m12) / s;\n\t\t\tthis._x = (m13 + m31) / s;\n\t\t\tthis._y = (m23 + m32) / s;\n\t\t\tthis._z = 0.25 * s;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromUnitVectors(vFrom, vTo) {\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\t\tlet r = vFrom.dot(vTo) + 1;\n\n\t\tif (r < Number.EPSILON) {\n\t\t\t// vFrom and vTo point in opposite directions\n\t\t\tr = 0;\n\n\t\t\tif (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n\t\t\t\tthis._x = -vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\t\t\t} else {\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = -vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\t\t\t}\n\t\t} else {\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\t\t}\n\n\t\treturn this.normalize();\n\t}\n\n\tangleTo(q) {\n\t\treturn 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));\n\t}\n\n\trotateTowards(q, step) {\n\t\tconst angle = this.angleTo(q);\n\t\tif (angle === 0) return this;\n\t\tconst t = Math.min(1, step / angle);\n\t\tthis.slerp(q, t);\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\treturn this.set(0, 0, 0, 1);\n\t}\n\n\tinvert() {\n\t\t// quaternion is assumed to have unit length\n\t\treturn this.conjugate();\n\t}\n\n\tconjugate() {\n\t\tthis._x *= -1;\n\t\tthis._y *= -1;\n\t\tthis._z *= -1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\t}\n\n\tlengthSq() {\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n\t}\n\n\tnormalize() {\n\t\tlet l = this.length();\n\n\t\tif (l === 0) {\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\t\t} else {\n\t\t\tl = 1 / l;\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tmultiply(q) {\n\t\treturn this.multiplyQuaternions(this, q);\n\t}\n\n\tpremultiply(q) {\n\t\treturn this.multiplyQuaternions(q, this);\n\t}\n\n\tmultiplyQuaternions(a, b) {\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\t\tconst qax = a._x,\n\t\t\t\t\tqay = a._y,\n\t\t\t\t\tqaz = a._z,\n\t\t\t\t\tqaw = a._w;\n\t\tconst qbx = b._x,\n\t\t\t\t\tqby = b._y,\n\t\t\t\t\tqbz = b._z,\n\t\t\t\t\tqbw = b._w;\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerp(qb, t) {\n\t\tif (t === 0) return this;\n\t\tif (t === 1) return this.copy(qb);\n\t\tconst x = this._x,\n\t\t\t\t\ty = this._y,\n\t\t\t\t\tz = this._z,\n\t\t\t\t\tw = this._w; // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif (cosHalfTheta < 0) {\n\t\t\tthis._w = -qb._w;\n\t\t\tthis._x = -qb._x;\n\t\t\tthis._y = -qb._y;\n\t\t\tthis._z = -qb._z;\n\t\t\tcosHalfTheta = -cosHalfTheta;\n\t\t} else {\n\t\t\tthis.copy(qb);\n\t\t}\n\n\t\tif (cosHalfTheta >= 1.0) {\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif (sqrSinHalfTheta <= Number.EPSILON) {\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\t\t\tthis.normalize();\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt(sqrSinHalfTheta);\n\t\tconst halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);\n\t\tconst ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n\t\t\t\t\tratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n\t\tthis._w = w * ratioA + this._w * ratioB;\n\t\tthis._x = x * ratioA + this._x * ratioB;\n\t\tthis._y = y * ratioA + this._y * ratioB;\n\t\tthis._z = z * ratioA + this._z * ratioB;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerpQuaternions(qa, qb, t) {\n\t\treturn this.copy(qa).slerp(qb, t);\n\t}\n\n\trandom() {\n\t\t// Derived from http://planning.cs.uiuc.edu/node198.html\n\t\t// Note, this source uses w, x, y, z ordering,\n\t\t// so we swap the order below.\n\t\tconst u1 = Math.random();\n\t\tconst sqrt1u1 = Math.sqrt(1 - u1);\n\t\tconst sqrtu1 = Math.sqrt(u1);\n\t\tconst u2 = 2 * Math.PI * Math.random();\n\t\tconst u3 = 2 * Math.PI * Math.random();\n\t\treturn this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2));\n\t}\n\n\tequals(quaternion) {\n\t\treturn quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis._x = array[offset];\n\t\tthis._y = array[offset + 1];\n\t\tthis._z = array[offset + 2];\n\t\tthis._w = array[offset + 3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis._x = attribute.getX( index );\n\t// \tthis._y = attribute.getY( index );\n\t// \tthis._z = attribute.getZ( index );\n\t// \tthis._w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\t}\n\n}\n\nclass Vector3 {\n\tconstructor(x = 0, y = 0, z = 0) {\n\t\tVector3.prototype.isVector3 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}\n\n\tset(x, y, z) {\n\t\tif (z === undefined) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\treturn this;\n\t}\n\n\tmultiplyVectors(a, b) {\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\t\treturn this;\n\t}\n\n\tapplyEuler(euler) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromEuler(euler));\n\t}\n\n\tapplyAxisAngle(axis, angle) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromAxisAngle(axis, angle));\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6] * z;\n\t\tthis.y = e[1] * x + e[4] * y + e[7] * z;\n\t\tthis.z = e[2] * x + e[5] * y + e[8] * z;\n\t\treturn this;\n\t}\n\n\tapplyNormalMatrix(m) {\n\t\treturn this.applyMatrix3(m).normalize();\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\tthis.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w;\n\t\tthis.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w;\n\t\tthis.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w;\n\t\treturn this;\n\t}\n\n\tapplyQuaternion(q) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst qx = q.x,\n\t\t\t\t\tqy = q.y,\n\t\t\t\t\tqz = q.z,\n\t\t\t\t\tqw = q.w; // calculate quat * vector\n\n\t\tconst ix = qw * x + qy * z - qz * y;\n\t\tconst iy = qw * y + qz * x - qx * z;\n\t\tconst iz = qw * z + qx * y - qy * x;\n\t\tconst iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n\t\tthis.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t\tthis.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t\tthis.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t\treturn this;\n\t} // project( camera ) {\n\t// \treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\t// }\n\t// unproject( camera ) {\n\t// \treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\t// }\n\n\n\ttransformDirection(m) {\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z;\n\t\treturn this.normalize();\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t} // TODO lengthSquared?\n\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\treturn this;\n\t}\n\n\tcross(v) {\n\t\treturn this.crossVectors(this, v);\n\t}\n\n\tcrossVectors(a, b) {\n\t\tconst ax = a.x,\n\t\t\t\t\tay = a.y,\n\t\t\t\t\taz = a.z;\n\t\tconst bx = b.x,\n\t\t\t\t\tby = b.y,\n\t\t\t\t\tbz = b.z;\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\t\treturn this;\n\t}\n\n\tprojectOnVector(v) {\n\t\tconst denominator = v.lengthSq();\n\t\tif (denominator === 0) return this.set(0, 0, 0);\n\t\tconst scalar = v.dot(this) / denominator;\n\t\treturn this.copy(v).multiplyScalar(scalar);\n\t}\n\n\tprojectOnPlane(planeNormal) {\n\t\t_vector$3.copy(this).projectOnVector(planeNormal);\n\n\t\treturn this.sub(_vector$3);\n\t}\n\n\treflect(normal) {\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\t\treturn this.sub(_vector$3.copy(normal).multiplyScalar(2 * this.dot(normal)));\n\t}\n\n\tangleTo(v) {\n\t\tconst denominator = Math.sqrt(this.lengthSq() * v.lengthSq());\n\t\tif (denominator === 0) return Math.PI / 2;\n\t\tconst theta = this.dot(v) / denominator; // clamp, to handle numerical problems\n\n\t\treturn Math.acos(clamp(theta, -1, 1));\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y,\n\t\t\t\t\tdz = this.z - v.z;\n\t\treturn dx * dx + dy * dy + dz * dz;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);\n\t}\n\n\tsetFromSpherical(s) {\n\t\treturn this.setFromSphericalCoords(s.radius, s.phi, s.theta);\n\t}\n\n\tsetFromSphericalCoords(radius, phi, theta) {\n\t\tconst sinPhiRadius = Math.sin(phi) * radius;\n\t\tthis.x = sinPhiRadius * Math.sin(theta);\n\t\tthis.y = Math.cos(phi) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromCylindrical(c) {\n\t\treturn this.setFromCylindricalCoords(c.radius, c.theta, c.y);\n\t}\n\n\tsetFromCylindricalCoords(radius, theta, y) {\n\t\tthis.x = radius * Math.sin(theta);\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromMatrixPosition(m) {\n\t\tconst e = m.elements;\n\t\tthis.x = e[12];\n\t\tthis.y = e[13];\n\t\tthis.z = e[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrixScale(m) {\n\t\tconst sx = this.setFromMatrixColumn(m, 0).length();\n\t\tconst sy = this.setFromMatrixColumn(m, 1).length();\n\t\tconst sz = this.setFromMatrixColumn(m, 2).length();\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\t\treturn this;\n\t}\n\n\tsetFromMatrixColumn(m, index) {\n\t\treturn this.fromArray(m.elements, index * 4);\n\t}\n\n\tsetFromMatrix3Column(m, index) {\n\t\treturn this.fromArray(m.elements, index * 3);\n\t}\n\n\tsetFromEuler(e) {\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\treturn this;\n\t}\n\n\trandomDirection() {\n\t\t// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\n\t\tconst u = (Math.random() - 0.5) * 2;\n\t\tconst t = Math.random() * Math.PI * 2;\n\t\tconst f = Math.sqrt(1 - u ** 2);\n\t\tthis.x = f * Math.cos(t);\n\t\tthis.y = f * Math.sin(t);\n\t\tthis.z = u;\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/new Vector3();\n\nconst _quaternion$1 = /*@__PURE__*/new Quaternion();\n\nconst _vector$2 = /*@__PURE__*/new Vector2();\n\nclass Box2 {\n\tconstructor(min = new Vector2(+Infinity, +Infinity), max = new Vector2(-Infinity, -Infinity)) {\n\t\tthis.isBox2 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$2.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = +Infinity;\n\t\tthis.max.x = this.max.y = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y;\n\t}\n\n\tgetCenter(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 4 splitting planes to rule out intersections\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$2.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max);\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nclass Box3 {\n\tconstructor(min = new Vector3(+Infinity, +Infinity, +Infinity), max = new Vector3(-Infinity, -Infinity, -Infinity)) {\n\t\tthis.isBox3 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromArray(array) {\n\t\tlet minX = +Infinity;\n\t\tlet minY = +Infinity;\n\t\tlet minZ = +Infinity;\n\t\tlet maxX = -Infinity;\n\t\tlet maxY = -Infinity;\n\t\tlet maxZ = -Infinity;\n\n\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\tconst x = array[i];\n\t\t\tconst y = array[i + 1];\n\t\t\tconst z = array[i + 2];\n\t\t\tif (x < minX) minX = x;\n\t\t\tif (y < minY) minY = y;\n\t\t\tif (z < minZ) minZ = z;\n\t\t\tif (x > maxX) maxX = x;\n\t\t\tif (y > maxY) maxY = y;\n\t\t\tif (z > maxZ) maxZ = z;\n\t\t}\n\n\t\tthis.min.set(minX, minY, minZ);\n\t\tthis.max.set(maxX, maxY, maxZ);\n\t\treturn this;\n\t} // setFromBufferAttribute( attribute ) {\n\t// \tlet minX = + Infinity;\n\t// \tlet minY = + Infinity;\n\t// \tlet minZ = + Infinity;\n\t// \tlet maxX = - Infinity;\n\t// \tlet maxY = - Infinity;\n\t// \tlet maxZ = - Infinity;\n\t// \tfor ( let i = 0, l = attribute.count; i < l; i ++ ) {\n\t// \t\tconst x = attribute.getX( i );\n\t// \t\tconst y = attribute.getY( i );\n\t// \t\tconst z = attribute.getZ( i );\n\t// \t\tif ( x < minX ) minX = x;\n\t// \t\tif ( y < minY ) minY = y;\n\t// \t\tif ( z < minZ ) minZ = z;\n\t// \t\tif ( x > maxX ) maxX = x;\n\t// \t\tif ( y > maxY ) maxY = y;\n\t// \t\tif ( z > maxZ ) maxZ = z;\n\t// \t}\n\t// \tthis.min.set( minX, minY, minZ );\n\t// \tthis.max.set( maxX, maxY, maxZ );\n\t// \treturn this;\n\t// }\n\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$1.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tsetFromObject(object, precise = false) {\n\t\tthis.makeEmpty();\n\t\treturn this.expandByObject(object, precise);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = this.min.z = +Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n\t}\n\n\tgetCenter(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t} // expandByObject( object, precise = false ) {\n\t// \t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t// \t// accounting for both the object's, and children's, world transforms\n\t// \tobject.updateWorldMatrix( false, false );\n\t// \tconst geometry = object.geometry;\n\t// \tif ( geometry !== undefined ) {\n\t// \t\tif ( precise && geometry.attributes != undefined && geometry.attributes.position !== undefined ) {\n\t// \t\t\tconst position = geometry.attributes.position;\n\t// \t\t\tfor ( let i = 0, l = position.count; i < l; i ++ ) {\n\t// \t\t\t\t_vector.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );\n\t// \t\t\t\tthis.expandByPoint( _vector );\n\t// \t\t\t}\n\t// \t\t} else {\n\t// \t\t\tif ( geometry.boundingBox === null ) {\n\t// \t\t\t\tgeometry.computeBoundingBox();\n\t// \t\t\t}\n\t// \t\t\t_box.copy( geometry.boundingBox );\n\t// \t\t\t_box.applyMatrix4( object.matrixWorld );\n\t// \t\t\tthis.union( _box );\n\t// \t\t}\n\t// \t}\n\t// \tconst children = object.children;\n\t// \tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\t// \t\tthis.expandByObject( children[ i ], precise );\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint(sphere.center, _vector$1); // If that point is inside the sphere, the AABB and sphere intersect.\n\n\t\treturn _vector$1.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\t\tlet min, max;\n\n\t\tif (plane.normal.x > 0) {\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\t\t} else {\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\t\t}\n\n\t\tif (plane.normal.y > 0) {\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\t\t} else {\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\t\t}\n\n\t\tif (plane.normal.z > 0) {\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\t\t} else {\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\t\t}\n\n\t\treturn min <= -plane.constant && max >= -plane.constant;\n\t}\n\n\tintersectsTriangle(triangle) {\n\t\tif (this.isEmpty()) {\n\t\t\treturn false;\n\t\t} // compute box center and extents\n\n\n\t\tthis.getCenter(_center);\n\n\t\t_extents.subVectors(this.max, _center); // translate triangle to aabb origin\n\n\n\t\t_v0$1.subVectors(triangle.a, _center);\n\n\t\t_v1$3.subVectors(triangle.b, _center);\n\n\t\t_v2$1.subVectors(triangle.c, _center); // compute edge vectors for triangle\n\n\n\t\t_f0.subVectors(_v1$3, _v0$1);\n\n\t\t_f1.subVectors(_v2$1, _v1$3);\n\n\t\t_f2.subVectors(_v0$1, _v2$1); // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\n\n\t\tlet axes = [0, -_f0.z, _f0.y, 0, -_f1.z, _f1.y, 0, -_f2.z, _f2.y, _f0.z, 0, -_f0.x, _f1.z, 0, -_f1.x, _f2.z, 0, -_f2.x, -_f0.y, _f0.x, 0, -_f1.y, _f1.x, 0, -_f2.y, _f2.x, 0];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // test 3 face normals from the aabb\n\n\n\t\taxes = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\n\n\t\t_triangleNormal.crossVectors(_f0, _f1);\n\n\t\taxes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];\n\t\treturn satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents);\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$1.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tgetBoundingSphere(target) {\n\t\tthis.getCenter(target.center);\n\t\ttarget.radius = this.getSize(_vector$1).length() * 0.5;\n\t\treturn target;\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max); // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\n\t\tif (this.isEmpty()) this.makeEmpty();\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\t// transform of empty box is an empty box.\n\t\tif (this.isEmpty()) return this; // NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\n\t\t_points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); // 000\n\n\n\t\t_points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); // 001\n\n\n\t\t_points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); // 010\n\n\n\t\t_points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); // 011\n\n\n\t\t_points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); // 100\n\n\n\t\t_points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); // 101\n\n\n\t\t_points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); // 110\n\n\n\t\t_points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); // 111\n\n\n\t\tthis.setFromPoints(_points);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nconst _points = [/*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3()];\n\nconst _vector$1 = /*@__PURE__*/new Vector3();\n\nconst _box$1 = /*@__PURE__*/new Box3(); // triangle centered vertices\n\n\nconst _v0$1 = /*@__PURE__*/new Vector3();\n\nconst _v1$3 = /*@__PURE__*/new Vector3();\n\nconst _v2$1 = /*@__PURE__*/new Vector3(); // triangle edge vectors\n\n\nconst _f0 = /*@__PURE__*/new Vector3();\n\nconst _f1 = /*@__PURE__*/new Vector3();\n\nconst _f2 = /*@__PURE__*/new Vector3();\n\nconst _center = /*@__PURE__*/new Vector3();\n\nconst _extents = /*@__PURE__*/new Vector3();\n\nconst _triangleNormal = /*@__PURE__*/new Vector3();\n\nconst _testAxis = /*@__PURE__*/new Vector3();\n\nfunction satForAxes(axes, v0, v1, v2, extents) {\n\tfor (let i = 0, j = axes.length - 3; i <= j; i += 3) {\n\t\t_testAxis.fromArray(axes, i); // project the aabb onto the separating axis\n\n\n\t\tconst r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); // project all 3 vertices of the triangle onto the separating axis\n\n\t\tconst p0 = v0.dot(_testAxis);\n\t\tconst p1 = v1.dot(_testAxis);\n\t\tconst p2 = v2.dot(_testAxis); // actual test, basically see if either of the most extreme of the triangle points intersects r\n\n\t\tif (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) {\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nfunction SRGBToLinear(c) {\n\treturn c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);\n}\nfunction LinearToSRGB(c) {\n\treturn c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;\n} // JavaScript RGB-to-RGB transforms, defined as\n// FN[InputColorSpace][OutputColorSpace] callback functions.\n\nconst FN = {\n\t[SRGBColorSpace]: {\n\t\t[LinearSRGBColorSpace]: SRGBToLinear\n\t},\n\t[LinearSRGBColorSpace]: {\n\t\t[SRGBColorSpace]: LinearToSRGB\n\t}\n};\nconst ColorManagement = {\n\tlegacyMode: true,\n\n\tget workingColorSpace() {\n\t\treturn LinearSRGBColorSpace;\n\t},\n\n\tset workingColorSpace(colorSpace) {\n\t\tconsole.warn('THREE.ColorManagement: .workingColorSpace is readonly.');\n\t},\n\n\tconvert: function (color, sourceColorSpace, targetColorSpace) {\n\t\tif (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {\n\t\t\treturn color;\n\t\t}\n\n\t\tif (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== undefined) {\n\t\t\tconst fn = FN[sourceColorSpace][targetColorSpace];\n\t\t\tcolor.r = fn(color.r);\n\t\t\tcolor.g = fn(color.g);\n\t\t\tcolor.b = fn(color.b);\n\t\t\treturn color;\n\t\t}\n\n\t\tthrow new Error('Unsupported color space conversion.');\n\t},\n\tfromWorkingColorSpace: function (color, targetColorSpace) {\n\t\treturn this.convert(color, this.workingColorSpace, targetColorSpace);\n\t},\n\ttoWorkingColorSpace: function (color, sourceColorSpace) {\n\t\treturn this.convert(color, sourceColorSpace, this.workingColorSpace);\n\t}\n};\n\nconst _colorKeywords = {\n\t'aliceblue': 0xF0F8FF,\n\t'antiquewhite': 0xFAEBD7,\n\t'aqua': 0x00FFFF,\n\t'aquamarine': 0x7FFFD4,\n\t'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC,\n\t'bisque': 0xFFE4C4,\n\t'black': 0x000000,\n\t'blanchedalmond': 0xFFEBCD,\n\t'blue': 0x0000FF,\n\t'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A,\n\t'burlywood': 0xDEB887,\n\t'cadetblue': 0x5F9EA0,\n\t'chartreuse': 0x7FFF00,\n\t'chocolate': 0xD2691E,\n\t'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED,\n\t'cornsilk': 0xFFF8DC,\n\t'crimson': 0xDC143C,\n\t'cyan': 0x00FFFF,\n\t'darkblue': 0x00008B,\n\t'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B,\n\t'darkgray': 0xA9A9A9,\n\t'darkgreen': 0x006400,\n\t'darkgrey': 0xA9A9A9,\n\t'darkkhaki': 0xBDB76B,\n\t'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F,\n\t'darkorange': 0xFF8C00,\n\t'darkorchid': 0x9932CC,\n\t'darkred': 0x8B0000,\n\t'darksalmon': 0xE9967A,\n\t'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B,\n\t'darkslategray': 0x2F4F4F,\n\t'darkslategrey': 0x2F4F4F,\n\t'darkturquoise': 0x00CED1,\n\t'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493,\n\t'deepskyblue': 0x00BFFF,\n\t'dimgray': 0x696969,\n\t'dimgrey': 0x696969,\n\t'dodgerblue': 0x1E90FF,\n\t'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0,\n\t'forestgreen': 0x228B22,\n\t'fuchsia': 0xFF00FF,\n\t'gainsboro': 0xDCDCDC,\n\t'ghostwhite': 0xF8F8FF,\n\t'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520,\n\t'gray': 0x808080,\n\t'green': 0x008000,\n\t'greenyellow': 0xADFF2F,\n\t'grey': 0x808080,\n\t'honeydew': 0xF0FFF0,\n\t'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C,\n\t'indigo': 0x4B0082,\n\t'ivory': 0xFFFFF0,\n\t'khaki': 0xF0E68C,\n\t'lavender': 0xE6E6FA,\n\t'lavenderblush': 0xFFF0F5,\n\t'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD,\n\t'lightblue': 0xADD8E6,\n\t'lightcoral': 0xF08080,\n\t'lightcyan': 0xE0FFFF,\n\t'lightgoldenrodyellow': 0xFAFAD2,\n\t'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90,\n\t'lightgrey': 0xD3D3D3,\n\t'lightpink': 0xFFB6C1,\n\t'lightsalmon': 0xFFA07A,\n\t'lightseagreen': 0x20B2AA,\n\t'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899,\n\t'lightslategrey': 0x778899,\n\t'lightsteelblue': 0xB0C4DE,\n\t'lightyellow': 0xFFFFE0,\n\t'lime': 0x00FF00,\n\t'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6,\n\t'magenta': 0xFF00FF,\n\t'maroon': 0x800000,\n\t'mediumaquamarine': 0x66CDAA,\n\t'mediumblue': 0x0000CD,\n\t'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB,\n\t'mediumseagreen': 0x3CB371,\n\t'mediumslateblue': 0x7B68EE,\n\t'mediumspringgreen': 0x00FA9A,\n\t'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585,\n\t'midnightblue': 0x191970,\n\t'mintcream': 0xF5FFFA,\n\t'mistyrose': 0xFFE4E1,\n\t'moccasin': 0xFFE4B5,\n\t'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080,\n\t'oldlace': 0xFDF5E6,\n\t'olive': 0x808000,\n\t'olivedrab': 0x6B8E23,\n\t'orange': 0xFFA500,\n\t'orangered': 0xFF4500,\n\t'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA,\n\t'palegreen': 0x98FB98,\n\t'paleturquoise': 0xAFEEEE,\n\t'palevioletred': 0xDB7093,\n\t'papayawhip': 0xFFEFD5,\n\t'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F,\n\t'pink': 0xFFC0CB,\n\t'plum': 0xDDA0DD,\n\t'powderblue': 0xB0E0E6,\n\t'purple': 0x800080,\n\t'rebeccapurple': 0x663399,\n\t'red': 0xFF0000,\n\t'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1,\n\t'saddlebrown': 0x8B4513,\n\t'salmon': 0xFA8072,\n\t'sandybrown': 0xF4A460,\n\t'seagreen': 0x2E8B57,\n\t'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D,\n\t'silver': 0xC0C0C0,\n\t'skyblue': 0x87CEEB,\n\t'slateblue': 0x6A5ACD,\n\t'slategray': 0x708090,\n\t'slategrey': 0x708090,\n\t'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F,\n\t'steelblue': 0x4682B4,\n\t'tan': 0xD2B48C,\n\t'teal': 0x008080,\n\t'thistle': 0xD8BFD8,\n\t'tomato': 0xFF6347,\n\t'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE,\n\t'wheat': 0xF5DEB3,\n\t'white': 0xFFFFFF,\n\t'whitesmoke': 0xF5F5F5,\n\t'yellow': 0xFFFF00,\n\t'yellowgreen': 0x9ACD32\n};\nconst _rgb = {\n\tr: 0,\n\tg: 0,\n\tb: 0\n};\nconst _hslA = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\nconst _hslB = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\n\nfunction hue2rgb(p, q, t) {\n\tif (t < 0) t += 1;\n\tif (t > 1) t -= 1;\n\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\tif (t < 1 / 2) return q;\n\tif (t < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t);\n\treturn p;\n}\n\nfunction toComponents(source, target) {\n\ttarget.r = source.r;\n\ttarget.g = source.g;\n\ttarget.b = source.b;\n\treturn target;\n}\n\nclass Color {\n\tconstructor(r, g, b) {\n\t\tthis.isColor = true;\n\t\tthis.r = 1;\n\t\tthis.g = 1;\n\t\tthis.b = 1;\n\n\t\tif (g === undefined && b === undefined) {\n\t\t\t// r is THREE.Color, hex or string\n\t\t\treturn this.set(r);\n\t\t}\n\n\t\treturn this.setRGB(r, g, b);\n\t}\n\n\tset(value) {\n\t\tif (value && value.isColor) {\n\t\t\tthis.copy(value);\n\t\t} else if (typeof value === 'number') {\n\t\t\tthis.setHex(value);\n\t\t} else if (typeof value === 'string') {\n\t\t\tthis.setStyle(value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\t\treturn this;\n\t}\n\n\tsetHex(hex, colorSpace = SRGBColorSpace) {\n\t\thex = Math.floor(hex);\n\t\tthis.r = (hex >> 16 & 255) / 255;\n\t\tthis.g = (hex >> 8 & 255) / 255;\n\t\tthis.b = (hex & 255) / 255;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetRGB(r, g, b, colorSpace = ColorManagement.workingColorSpace) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetHSL(h, s, l, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo(h, 1);\n\t\ts = clamp(s, 0, 1);\n\t\tl = clamp(l, 0, 1);\n\n\t\tif (s === 0) {\n\t\t\tthis.r = this.g = this.b = l;\n\t\t} else {\n\t\t\tconst p = l <= 0.5 ? l * (1 + s) : l + s - l * s;\n\t\t\tconst q = 2 * l - p;\n\t\t\tthis.r = hue2rgb(q, p, h + 1 / 3);\n\t\t\tthis.g = hue2rgb(q, p, h);\n\t\t\tthis.b = hue2rgb(q, p, h - 1 / 3);\n\t\t}\n\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetStyle(style, colorSpace = SRGBColorSpace) {\n\t\tfunction handleAlpha(string) {\n\t\t\tif (string === undefined) return;\n\n\t\t\tif (parseFloat(string) < 1) {\n\t\t\t\tconsole.warn('THREE.Color: Alpha component of ' + style + ' will be ignored.');\n\t\t\t}\n\t\t}\n\n\t\tlet m;\n\n\t\tif (m = /^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(style)) {\n\t\t\t// rgb / hsl\n\t\t\tlet color;\n\t\t\tconst name = m[1];\n\t\t\tconst components = m[2];\n\n\t\t\tswitch (name) {\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\tthis.r = Math.min(255, parseInt(color[1], 10)) / 255;\n\t\t\t\t\t\tthis.g = Math.min(255, parseInt(color[2], 10)) / 255;\n\t\t\t\t\t\tthis.b = Math.min(255, parseInt(color[3], 10)) / 255;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\tthis.r = Math.min(100, parseInt(color[1], 10)) / 100;\n\t\t\t\t\t\tthis.g = Math.min(100, parseInt(color[2], 10)) / 100;\n\t\t\t\t\t\tthis.b = Math.min(100, parseInt(color[3], 10)) / 100;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\t\t\t\t\tif (color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\tconst h = parseFloat(color[1]) / 360;\n\t\t\t\t\t\tconst s = parseFloat(color[2]) / 100;\n\t\t\t\t\t\tconst l = parseFloat(color[3]) / 100;\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this.setHSL(h, s, l, colorSpace);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (m = /^\\#([A-Fa-f\\d]+)$/.exec(style)) {\n\t\t\t// hex color\n\t\t\tconst hex = m[1];\n\t\t\tconst size = hex.length;\n\n\t\t\tif (size === 3) {\n\t\t\t\t// #ff0\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t} else if (size === 6) {\n\t\t\t\t// #ff0000\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tif (style && style.length > 0) {\n\t\t\treturn this.setColorName(style, colorSpace);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetColorName(style, colorSpace = SRGBColorSpace) {\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[style.toLowerCase()];\n\n\t\tif (hex !== undefined) {\n\t\t\t// red\n\t\t\tthis.setHex(hex, colorSpace);\n\t\t} else {\n\t\t\t// unknown color\n\t\t\tconsole.warn('THREE.Color: Unknown color ' + style);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.r, this.g, this.b);\n\t}\n\n\tcopy(color) {\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\t\treturn this;\n\t}\n\n\tcopySRGBToLinear(color) {\n\t\tthis.r = SRGBToLinear(color.r);\n\t\tthis.g = SRGBToLinear(color.g);\n\t\tthis.b = SRGBToLinear(color.b);\n\t\treturn this;\n\t}\n\n\tcopyLinearToSRGB(color) {\n\t\tthis.r = LinearToSRGB(color.r);\n\t\tthis.g = LinearToSRGB(color.g);\n\t\tthis.b = LinearToSRGB(color.b);\n\t\treturn this;\n\t}\n\n\tconvertSRGBToLinear() {\n\t\tthis.copySRGBToLinear(this);\n\t\treturn this;\n\t}\n\n\tconvertLinearToSRGB() {\n\t\tthis.copyLinearToSRGB(this);\n\t\treturn this;\n\t}\n\n\tgetHex(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\treturn clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0;\n\t}\n\n\tgetHexString(colorSpace = SRGBColorSpace) {\n\t\treturn ('000000' + this.getHex(colorSpace).toString(16)).slice(-6);\n\t}\n\n\tgetHSL(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\tconst r = _rgb.r,\n\t\t\t\t\tg = _rgb.g,\n\t\t\t\t\tb = _rgb.b;\n\t\tconst max = Math.max(r, g, b);\n\t\tconst min = Math.min(r, g, b);\n\t\tlet hue, saturation;\n\t\tconst lightness = (min + max) / 2.0;\n\n\t\tif (min === max) {\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\t\t} else {\n\t\t\tconst delta = max - min;\n\t\t\tsaturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\n\n\t\t\tswitch (max) {\n\t\t\t\tcase r:\n\t\t\t\t\thue = (g - b) / delta + (g < b ? 6 : 0);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase g:\n\t\t\t\t\thue = (b - r) / delta + 2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase b:\n\t\t\t\t\thue = (r - g) / delta + 4;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\thue /= 6;\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\t\treturn target;\n\t}\n\n\tgetRGB(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\ttarget.r = _rgb.r;\n\t\ttarget.g = _rgb.g;\n\t\ttarget.b = _rgb.b;\n\t\treturn target;\n\t}\n\n\tgetStyle(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\n\t\tif (colorSpace !== SRGBColorSpace) {\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;\n\t\t}\n\n\t\treturn `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`;\n\t}\n\n\toffsetHSL(h, s, l) {\n\t\tthis.getHSL(_hslA);\n\t\t_hslA.h += h;\n\t\t_hslA.s += s;\n\t\t_hslA.l += l;\n\t\tthis.setHSL(_hslA.h, _hslA.s, _hslA.l);\n\t\treturn this;\n\t}\n\n\tadd(color) {\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\t\treturn this;\n\t}\n\n\taddColors(color1, color2) {\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\t\treturn this;\n\t}\n\n\tsub(color) {\n\t\tthis.r = Math.max(0, this.r - color.r);\n\t\tthis.g = Math.max(0, this.g - color.g);\n\t\tthis.b = Math.max(0, this.b - color.b);\n\t\treturn this;\n\t}\n\n\tmultiply(color) {\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\t\treturn this;\n\t}\n\n\tlerp(color, alpha) {\n\t\tthis.r += (color.r - this.r) * alpha;\n\t\tthis.g += (color.g - this.g) * alpha;\n\t\tthis.b += (color.b - this.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpColors(color1, color2, alpha) {\n\t\tthis.r = color1.r + (color2.r - color1.r) * alpha;\n\t\tthis.g = color1.g + (color2.g - color1.g) * alpha;\n\t\tthis.b = color1.b + (color2.b - color1.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpHSL(color, alpha) {\n\t\tthis.getHSL(_hslA);\n\t\tcolor.getHSL(_hslB);\n\t\tconst h = lerp(_hslA.h, _hslB.h, alpha);\n\t\tconst s = lerp(_hslA.s, _hslB.s, alpha);\n\t\tconst l = lerp(_hslA.l, _hslB.l, alpha);\n\t\tthis.setHSL(h, s, l);\n\t\treturn this;\n\t}\n\n\tequals(c) {\n\t\treturn c.r === this.r && c.g === this.g && c.b === this.b;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.r = array[offset];\n\t\tthis.g = array[offset + 1];\n\t\tthis.b = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.r;\n\t\tarray[offset + 1] = this.g;\n\t\tarray[offset + 2] = this.b;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.r = attribute.getX( index );\n\t// \tthis.g = attribute.getY( index );\n\t// \tthis.b = attribute.getZ( index );\n\t// \tif ( attribute.normalized === true ) {\n\t// \t\t// assuming Uint8Array\n\t// \t\tthis.r /= 255;\n\t// \t\tthis.g /= 255;\n\t// \t\tthis.b /= 255;\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\ttoJSON() {\n\t\treturn this.getHex();\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\t}\n\n}\n\nColor.NAMES = _colorKeywords;\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\r\n */\nclass Cylindrical {\n\tconstructor(radius = 1, theta = 0, y = 0) {\n\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\n\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\n\t\tthis.y = y; // height above the x-z plane\n\n\t\treturn this;\n\t}\n\n\tset(radius, theta, y) {\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + z * z);\n\t\tthis.theta = Math.atan2(x, z);\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix4 {\n\tconstructor() {\n\t\tMatrix4.prototype.isMatrix4 = true;\n\t\tthis.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[4] = n12;\n\t\tte[8] = n13;\n\t\tte[12] = n14;\n\t\tte[1] = n21;\n\t\tte[5] = n22;\n\t\tte[9] = n23;\n\t\tte[13] = n24;\n\t\tte[2] = n31;\n\t\tte[6] = n32;\n\t\tte[10] = n33;\n\t\tte[14] = n34;\n\t\tte[3] = n41;\n\t\tte[7] = n42;\n\t\tte[11] = n43;\n\t\tte[15] = n44;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Matrix4().fromArray(this.elements);\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\tte[9] = me[9];\n\t\tte[10] = me[10];\n\t\tte[11] = me[11];\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\tte[15] = me[15];\n\t\treturn this;\n\t}\n\n\tcopyPosition(m) {\n\t\tconst te = this.elements,\n\t\t\t\t\tme = m.elements;\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrix3(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[3], me[6], 0, me[1], me[4], me[7], 0, me[2], me[5], me[8], 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrixColumn(this, 0);\n\t\tyAxis.setFromMatrixColumn(this, 1);\n\t\tzAxis.setFromMatrixColumn(this, 2);\n\t\treturn this;\n\t}\n\n\tmakeBasis(xAxis, yAxis, zAxis) {\n\t\tthis.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractRotation(m) {\n\t\t// this method does not support reflection matrices\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$2.setFromMatrixColumn(m, 0).length();\n\n\t\tconst scaleY = 1 / _v1$2.setFromMatrixColumn(m, 1).length();\n\n\t\tconst scaleZ = 1 / _v1$2.setFromMatrixColumn(m, 2).length();\n\n\t\tte[0] = me[0] * scaleX;\n\t\tte[1] = me[1] * scaleX;\n\t\tte[2] = me[2] * scaleX;\n\t\tte[3] = 0;\n\t\tte[4] = me[4] * scaleY;\n\t\tte[5] = me[5] * scaleY;\n\t\tte[6] = me[6] * scaleY;\n\t\tte[7] = 0;\n\t\tte[8] = me[8] * scaleZ;\n\t\tte[9] = me[9] * scaleZ;\n\t\tte[10] = me[10] * scaleZ;\n\t\tte[11] = 0;\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromEuler(euler) {\n\t\tconst te = this.elements;\n\t\tconst x = euler.x,\n\t\t\t\t\ty = euler.y,\n\t\t\t\t\tz = euler.z;\n\t\tconst a = Math.cos(x),\n\t\t\t\t\tb = Math.sin(x);\n\t\tconst c = Math.cos(y),\n\t\t\t\t\td = Math.sin(y);\n\t\tconst e = Math.cos(z),\n\t\t\t\t\tf = Math.sin(z);\n\n\t\tif (euler.order === 'XYZ') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -c * f;\n\t\t\tte[8] = d;\n\t\t\tte[1] = af + be * d;\n\t\t\tte[5] = ae - bf * d;\n\t\t\tte[9] = -b * c;\n\t\t\tte[2] = bf - ae * d;\n\t\t\tte[6] = be + af * d;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YXZ') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce + df * b;\n\t\t\tte[4] = de * b - cf;\n\t\t\tte[8] = a * d;\n\t\t\tte[1] = a * f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b;\n\t\t\tte[2] = cf * b - de;\n\t\t\tte[6] = df + ce * b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZXY') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce - df * b;\n\t\t\tte[4] = -a * f;\n\t\t\tte[8] = de + cf * b;\n\t\t\tte[1] = cf + de * b;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = df - ce * b;\n\t\t\tte[2] = -a * d;\n\t\t\tte[6] = b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZYX') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = be * d - af;\n\t\t\tte[8] = ae * d + bf;\n\t\t\tte[1] = c * f;\n\t\t\tte[5] = bf * d + ae;\n\t\t\tte[9] = af * d - be;\n\t\t\tte[2] = -d;\n\t\t\tte[6] = b * c;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YZX') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = bd - ac * f;\n\t\t\tte[8] = bc * f + ad;\n\t\t\tte[1] = f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b * e;\n\t\t\tte[2] = -d * e;\n\t\t\tte[6] = ad * f + bc;\n\t\t\tte[10] = ac - bd * f;\n\t\t} else if (euler.order === 'XZY') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -f;\n\t\t\tte[8] = d * e;\n\t\t\tte[1] = ac * f + bd;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = ad * f - bc;\n\t\t\tte[2] = bc * f - ad;\n\t\t\tte[6] = b * e;\n\t\t\tte[10] = bd * f + ac;\n\t\t} // bottom row\n\n\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0; // last column\n\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromQuaternion(q) {\n\t\treturn this.compose(_zero, q, _one);\n\t}\n\n\tlookAt(eye, target, up) {\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors(eye, target);\n\n\t\tif (_z.lengthSq() === 0) {\n\t\t\t// eye and target are in the same position\n\t\t\t_z.z = 1;\n\t\t}\n\n\t\t_z.normalize();\n\n\t\t_x.crossVectors(up, _z);\n\n\t\tif (_x.lengthSq() === 0) {\n\t\t\t// up and z are parallel\n\t\t\tif (Math.abs(up.z) === 1) {\n\t\t\t\t_z.x += 0.0001;\n\t\t\t} else {\n\t\t\t\t_z.z += 0.0001;\n\t\t\t}\n\n\t\t\t_z.normalize();\n\n\t\t\t_x.crossVectors(up, _z);\n\t\t}\n\n\t\t_x.normalize();\n\n\t\t_y.crossVectors(_z, _x);\n\n\t\tte[0] = _x.x;\n\t\tte[4] = _y.x;\n\t\tte[8] = _z.x;\n\t\tte[1] = _x.y;\n\t\tte[5] = _y.y;\n\t\tte[9] = _z.y;\n\t\tte[2] = _x.z;\n\t\tte[6] = _y.z;\n\t\tte[10] = _z.z;\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[4],\n\t\t\t\t\ta13 = ae[8],\n\t\t\t\t\ta14 = ae[12];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[5],\n\t\t\t\t\ta23 = ae[9],\n\t\t\t\t\ta24 = ae[13];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[6],\n\t\t\t\t\ta33 = ae[10],\n\t\t\t\t\ta34 = ae[14];\n\t\tconst a41 = ae[3],\n\t\t\t\t\ta42 = ae[7],\n\t\t\t\t\ta43 = ae[11],\n\t\t\t\t\ta44 = ae[15];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[4],\n\t\t\t\t\tb13 = be[8],\n\t\t\t\t\tb14 = be[12];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[5],\n\t\t\t\t\tb23 = be[9],\n\t\t\t\t\tb24 = be[13];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[6],\n\t\t\t\t\tb33 = be[10],\n\t\t\t\t\tb34 = be[14];\n\t\tconst b41 = be[3],\n\t\t\t\t\tb42 = be[7],\n\t\t\t\t\tb43 = be[11],\n\t\t\t\t\tb44 = be[15];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\t\tte[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[4] *= s;\n\t\tte[8] *= s;\n\t\tte[12] *= s;\n\t\tte[1] *= s;\n\t\tte[5] *= s;\n\t\tte[9] *= s;\n\t\tte[13] *= s;\n\t\tte[2] *= s;\n\t\tte[6] *= s;\n\t\tte[10] *= s;\n\t\tte[14] *= s;\n\t\tte[3] *= s;\n\t\tte[7] *= s;\n\t\tte[11] *= s;\n\t\tte[15] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst n11 = te[0],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn14 = te[12];\n\t\tconst n21 = te[1],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn24 = te[13];\n\t\tconst n31 = te[2],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn34 = te[14];\n\t\tconst n41 = te[3],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn44 = te[15]; //TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);\n\t}\n\n\ttranspose() {\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\t\ttmp = te[1];\n\t\tte[1] = te[4];\n\t\tte[4] = tmp;\n\t\ttmp = te[2];\n\t\tte[2] = te[8];\n\t\tte[8] = tmp;\n\t\ttmp = te[6];\n\t\tte[6] = te[9];\n\t\tte[9] = tmp;\n\t\ttmp = te[3];\n\t\tte[3] = te[12];\n\t\tte[12] = tmp;\n\t\ttmp = te[7];\n\t\tte[7] = te[13];\n\t\tte[13] = tmp;\n\t\ttmp = te[11];\n\t\tte[11] = te[14];\n\t\tte[14] = tmp;\n\t\treturn this;\n\t}\n\n\tsetPosition(x, y, z) {\n\t\tconst te = this.elements;\n\n\t\tif (x.isVector3) {\n\t\t\tte[12] = x.x;\n\t\t\tte[13] = x.y;\n\t\t\tte[14] = x.z;\n\t\t} else {\n\t\t\tte[12] = x;\n\t\t\tte[13] = y;\n\t\t\tte[14] = z;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tinvert() {\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn41 = te[3],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn14 = te[12],\n\t\t\t\t\tn24 = te[13],\n\t\t\t\t\tn34 = te[14],\n\t\t\t\t\tn44 = te[15],\n\t\t\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;\n\t\tte[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;\n\t\tte[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;\n\t\tte[4] = t12 * detInv;\n\t\tte[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;\n\t\tte[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;\n\t\tte[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;\n\t\tte[8] = t13 * detInv;\n\t\tte[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;\n\t\tte[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;\n\t\tte[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;\n\t\tte[12] = t14 * detInv;\n\t\tte[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;\n\t\tte[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;\n\t\tte[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;\n\t\treturn this;\n\t}\n\n\tscale(v) {\n\t\tconst te = this.elements;\n\t\tconst x = v.x,\n\t\t\t\t\ty = v.y,\n\t\t\t\t\tz = v.z;\n\t\tte[0] *= x;\n\t\tte[4] *= y;\n\t\tte[8] *= z;\n\t\tte[1] *= x;\n\t\tte[5] *= y;\n\t\tte[9] *= z;\n\t\tte[2] *= x;\n\t\tte[6] *= y;\n\t\tte[10] *= z;\n\t\tte[3] *= x;\n\t\tte[7] *= y;\n\t\tte[11] *= z;\n\t\treturn this;\n\t}\n\n\tgetMaxScaleOnAxis() {\n\t\tconst te = this.elements;\n\t\tconst scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];\n\t\tconst scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];\n\t\tconst scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];\n\t\treturn Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));\n\t}\n\n\tmakeTranslation(x, y, z) {\n\t\tthis.set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationX(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationY(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationZ(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationAxis(axis, angle) {\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\t\tconst c = Math.cos(angle);\n\t\tconst s = Math.sin(angle);\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x,\n\t\t\t\t\ty = axis.y,\n\t\t\t\t\tz = axis.z;\n\t\tconst tx = t * x,\n\t\t\t\t\tty = t * y;\n\t\tthis.set(tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y, z) {\n\t\tthis.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeShear(xy, xz, yx, yz, zx, zy) {\n\t\tthis.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\t\tconst x = quaternion._x,\n\t\t\t\t\ty = quaternion._y,\n\t\t\t\t\tz = quaternion._z,\n\t\t\t\t\tw = quaternion._w;\n\t\tconst x2 = x + x,\n\t\t\t\t\ty2 = y + y,\n\t\t\t\t\tz2 = z + z;\n\t\tconst xx = x * x2,\n\t\t\t\t\txy = x * y2,\n\t\t\t\t\txz = x * z2;\n\t\tconst yy = y * y2,\n\t\t\t\t\tyz = y * z2,\n\t\t\t\t\tzz = z * z2;\n\t\tconst wx = w * x2,\n\t\t\t\t\twy = w * y2,\n\t\t\t\t\twz = w * z2;\n\t\tconst sx = scale.x,\n\t\t\t\t\tsy = scale.y,\n\t\t\t\t\tsz = scale.z;\n\t\tte[0] = (1 - (yy + zz)) * sx;\n\t\tte[1] = (xy + wz) * sx;\n\t\tte[2] = (xz - wy) * sx;\n\t\tte[3] = 0;\n\t\tte[4] = (xy - wz) * sy;\n\t\tte[5] = (1 - (xx + zz)) * sy;\n\t\tte[6] = (yz + wx) * sy;\n\t\tte[7] = 0;\n\t\tte[8] = (xz + wy) * sz;\n\t\tte[9] = (yz - wx) * sz;\n\t\tte[10] = (1 - (xx + yy)) * sz;\n\t\tte[11] = 0;\n\t\tte[12] = position.x;\n\t\tte[13] = position.y;\n\t\tte[14] = position.z;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tdecompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$2.set(te[0], te[1], te[2]).length();\n\n\t\tconst sy = _v1$2.set(te[4], te[5], te[6]).length();\n\n\t\tconst sz = _v1$2.set(te[8], te[9], te[10]).length(); // if determine is negative, we need to invert one scale\n\n\n\t\tconst det = this.determinant();\n\t\tif (det < 0) sx = -sx;\n\t\tposition.x = te[12];\n\t\tposition.y = te[13];\n\t\tposition.z = te[14]; // scale the rotation part\n\n\t\t_m1.copy(this);\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\t\t_m1.elements[0] *= invSX;\n\t\t_m1.elements[1] *= invSX;\n\t\t_m1.elements[2] *= invSX;\n\t\t_m1.elements[4] *= invSY;\n\t\t_m1.elements[5] *= invSY;\n\t\t_m1.elements[6] *= invSY;\n\t\t_m1.elements[8] *= invSZ;\n\t\t_m1.elements[9] *= invSZ;\n\t\t_m1.elements[10] *= invSZ;\n\t\tquaternion.setFromRotationMatrix(_m1);\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\t\treturn this;\n\t}\n\n\tmakePerspective(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst x = 2 * near / (right - left);\n\t\tconst y = 2 * near / (top - bottom);\n\t\tconst a = (right + left) / (right - left);\n\t\tconst b = (top + bottom) / (top - bottom);\n\t\tconst c = -(far + near) / (far - near);\n\t\tconst d = -2 * far * near / (far - near);\n\t\tte[0] = x;\n\t\tte[4] = 0;\n\t\tte[8] = a;\n\t\tte[12] = 0;\n\t\tte[1] = 0;\n\t\tte[5] = y;\n\t\tte[9] = b;\n\t\tte[13] = 0;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = c;\n\t\tte[14] = d;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = -1;\n\t\tte[15] = 0;\n\t\treturn this;\n\t}\n\n\tmakeOrthographic(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst w = 1.0 / (right - left);\n\t\tconst h = 1.0 / (top - bottom);\n\t\tconst p = 1.0 / (far - near);\n\t\tconst x = (right + left) * w;\n\t\tconst y = (top + bottom) * h;\n\t\tconst z = (far + near) * p;\n\t\tte[0] = 2 * w;\n\t\tte[4] = 0;\n\t\tte[8] = 0;\n\t\tte[12] = -x;\n\t\tte[1] = 0;\n\t\tte[5] = 2 * h;\n\t\tte[9] = 0;\n\t\tte[13] = -y;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = -2 * p;\n\t\tte[14] = -z;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\tarray[offset + 9] = te[9];\n\t\tarray[offset + 10] = te[10];\n\t\tarray[offset + 11] = te[11];\n\t\tarray[offset + 12] = te[12];\n\t\tarray[offset + 13] = te[13];\n\t\tarray[offset + 14] = te[14];\n\t\tarray[offset + 15] = te[15];\n\t\treturn array;\n\t}\n\n}\n\nconst _v1$2 = /*@__PURE__*/new Vector3();\n\nconst _m1 = /*@__PURE__*/new Matrix4();\n\nconst _zero = /*@__PURE__*/new Vector3(0, 0, 0);\n\nconst _one = /*@__PURE__*/new Vector3(1, 1, 1);\n\nconst _x = /*@__PURE__*/new Vector3();\n\nconst _y = /*@__PURE__*/new Vector3();\n\nconst _z = /*@__PURE__*/new Vector3();\n\nconst _matrix = /*@__PURE__*/new Matrix4();\n\nconst _quaternion = /*@__PURE__*/new Quaternion();\n\nclass Euler {\n\tconstructor(x = 0, y = 0, z = 0, order = Euler.DefaultOrder) {\n\t\tthis.isEuler = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget order() {\n\t\treturn this._order;\n\t}\n\n\tset order(value) {\n\t\tthis._order = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, order = this._order) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._order);\n\t}\n\n\tcopy(euler) {\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m, order = this._order, update = true) {\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements;\n\t\tconst m11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8];\n\t\tconst m21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9];\n\t\tconst m31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._y = Math.asin(clamp(m13, -1, 1));\n\n\t\t\t\tif (Math.abs(m13) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = Math.asin(-clamp(m23, -1, 1));\n\n\t\t\t\tif (Math.abs(m23) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = Math.asin(clamp(m32, -1, 1));\n\n\t\t\t\tif (Math.abs(m32) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._y = Math.asin(-clamp(m31, -1, 1));\n\n\t\t\t\tif (Math.abs(m31) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._z = Math.asin(clamp(m21, -1, 1));\n\n\t\t\t\tif (Math.abs(m21) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m22);\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._z = Math.asin(-clamp(m12, -1, 1));\n\n\t\t\t\tif (Math.abs(m12) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._y = Math.atan2(m13, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tthis._order = order;\n\t\tif (update === true) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromQuaternion(q, order, update) {\n\t\t_matrix.makeRotationFromQuaternion(q);\n\n\t\treturn this.setFromRotationMatrix(_matrix, order, update);\n\t}\n\n\tsetFromVector3(v, order = this._order) {\n\t\treturn this.set(v.x, v.y, v.z, order);\n\t}\n\n\treorder(newOrder) {\n\t\t// WARNING: this discards revolution information -bhouston\n\t\t_quaternion.setFromEuler(this);\n\n\t\treturn this.setFromQuaternion(_quaternion, newOrder);\n\t}\n\n\tequals(euler) {\n\t\treturn euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;\n\t}\n\n\tfromArray(array) {\n\t\tthis._x = array[0];\n\t\tthis._y = array[1];\n\t\tthis._z = array[2];\n\t\tif (array[3] !== undefined) this._order = array[3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._order;\n\t\treturn array;\n\t}\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\t} // @deprecated since r138, 02cf0df1cb4575d5842fef9c85bb5a89fe020d53\n\n\n\ttoVector3() {\n\t\tconsole.error('THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead');\n\t}\n\n}\n\nEuler.DefaultOrder = 'XYZ';\nEuler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX'];\n\n/**\r\n * Abstract base class of interpolants over parametric samples.\r\n *\r\n * The parameter domain is one dimensional, typically the time or a path\r\n * along a curve defined by the data.\r\n *\r\n * The sample values can have any dimensionality and derived classes may\r\n * apply special interpretations to the data.\r\n *\r\n * This class provides the interval seek in a Template Method, deferring\r\n * the actual interpolation to derived classes.\r\n *\r\n * Time complexity is O(1) for linear access crossing at most two points\r\n * and O(log N) for random access, where N is the number of positions.\r\n *\r\n * References:\r\n *\r\n * \t\thttp://www.oodesign.com/template-method-pattern.html\r\n *\r\n */\nclass Interpolant {\n\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor(sampleSize);\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\t\tthis.settings = null;\n\t\tthis.DefaultSettings_ = {};\n\t}\n\n\tevaluate(t) {\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\t\tt1 = pp[i1],\n\t\t\t\tt0 = pp[i1 - 1];\n\n\t\tvalidate_interval: {\n\t\t\tseek: {\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if (!(t < t1)) {\n\t\t\t\t\t\tfor (let giveUpAt = i1 + 2;;) {\n\t\t\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\t\t\tif (t < t0) break forward_scan; // after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[++i1];\n\n\t\t\t\t\t\t\tif (t < t1) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the right side of the index\n\n\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} //- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\n\n\t\t\t\t\tif (!(t >= t0)) {\n\t\t\t\t\t\t// looping?\n\t\t\t\t\t\tconst t1global = pp[1];\n\n\t\t\t\t\t\tif (t < t1global) {\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\n\t\t\t\t\t\t\tt0 = t1global;\n\t\t\t\t\t\t} // linear reverse scan\n\n\n\t\t\t\t\t\tfor (let giveUpAt = i1 - 2;;) {\n\t\t\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\t\t\t// before start\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[--i1 - 1];\n\n\t\t\t\t\t\t\tif (t >= t0) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the left side of the index\n\n\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} // the interval is valid\n\n\n\t\t\t\t\tbreak validate_interval;\n\t\t\t\t} // linear scan\n\t\t\t\t// binary search\n\n\n\t\t\t\twhile (i1 < right) {\n\t\t\t\t\tconst mid = i1 + right >>> 1;\n\n\t\t\t\t\tif (t < pp[mid]) {\n\t\t\t\t\t\tright = mid;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti1 = mid + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[i1];\n\t\t\t\tt0 = pp[i1 - 1]; // check boundary cases, again\n\n\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t}\n\n\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t}\n\t\t\t} // seek\n\n\n\t\t\tthis._cachedIndex = i1;\n\t\t\tthis.intervalChanged_(i1, t0, t1);\n\t\t} // validate_interval\n\n\n\t\treturn this.interpolate_(i1, t0, t, t1);\n\t}\n\n\tgetSettings_() {\n\t\treturn this.settings || this.DefaultSettings_;\n\t}\n\n\tcopySampleValue_(index) {\n\t\t// copies a sample value to the result buffer\n\t\tconst result = this.resultBuffer,\n\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\toffset = index * stride;\n\n\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\tresult[i] = values[offset + i];\n\t\t}\n\n\t\treturn result;\n\t} // Template methods for derived classes:\n\n\n\tinterpolate_() {\n\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t}\n\n\tintervalChanged_() {// empty\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/new Vector3();\n\nconst _startEnd = /*@__PURE__*/new Vector3();\n\nclass Line3 {\n\tconstructor(start = new Vector3(), end = new Vector3()) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t}\n\n\tset(start, end) {\n\t\tthis.start.copy(start);\n\t\tthis.end.copy(end);\n\t\treturn this;\n\t}\n\n\tcopy(line) {\n\t\tthis.start.copy(line.start);\n\t\tthis.end.copy(line.end);\n\t\treturn this;\n\t}\n\n\tgetCenter(target) {\n\t\treturn target.addVectors(this.start, this.end).multiplyScalar(0.5);\n\t}\n\n\tdelta(target) {\n\t\treturn target.subVectors(this.end, this.start);\n\t}\n\n\tdistanceSq() {\n\t\treturn this.start.distanceToSquared(this.end);\n\t}\n\n\tdistance() {\n\t\treturn this.start.distanceTo(this.end);\n\t}\n\n\tat(t, target) {\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tclosestPointToPointParameter(point, clampToLine) {\n\t\t_startP.subVectors(point, this.start);\n\n\t\t_startEnd.subVectors(this.end, this.start);\n\n\t\tconst startEnd2 = _startEnd.dot(_startEnd);\n\n\t\tconst startEnd_startP = _startEnd.dot(_startP);\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif (clampToLine) {\n\t\t\tt = clamp(t, 0, 1);\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tclosestPointToPoint(point, clampToLine, target) {\n\t\tconst t = this.closestPointToPointParameter(point, clampToLine);\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.start.applyMatrix4(matrix);\n\t\tthis.end.applyMatrix4(matrix);\n\t\treturn this;\n\t}\n\n\tequals(line) {\n\t\treturn line.start.equals(this.start) && line.end.equals(this.end);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix3 {\n\tconstructor() {\n\t\tMatrix3.prototype.isMatrix3 = true;\n\t\tthis.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n21, n22, n23, n31, n32, n33) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[1] = n21;\n\t\tte[2] = n31;\n\t\tte[3] = n12;\n\t\tte[4] = n22;\n\t\tte[5] = n32;\n\t\tte[6] = n13;\n\t\tte[7] = n23;\n\t\tte[8] = n33;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 1, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrix3Column(this, 0);\n\t\tyAxis.setFromMatrix3Column(this, 1);\n\t\tzAxis.setFromMatrix3Column(this, 2);\n\t\treturn this;\n\t}\n\n\tsetFromMatrix4(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10]);\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[3],\n\t\t\t\t\ta13 = ae[6];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[4],\n\t\t\t\t\ta23 = ae[7];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[5],\n\t\t\t\t\ta33 = ae[8];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[3],\n\t\t\t\t\tb13 = be[6];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[4],\n\t\t\t\t\tb23 = be[7];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[5],\n\t\t\t\t\tb33 = be[8];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[3] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[4] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[5] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[3] *= s;\n\t\tte[6] *= s;\n\t\tte[1] *= s;\n\t\tte[4] *= s;\n\t\tte[7] *= s;\n\t\tte[2] *= s;\n\t\tte[5] *= s;\n\t\tte[8] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst a = te[0],\n\t\t\t\t\tb = te[1],\n\t\t\t\t\tc = te[2],\n\t\t\t\t\td = te[3],\n\t\t\t\t\te = te[4],\n\t\t\t\t\tf = te[5],\n\t\t\t\t\tg = te[6],\n\t\t\t\t\th = te[7],\n\t\t\t\t\ti = te[8];\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\t}\n\n\tinvert() {\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn12 = te[3],\n\t\t\t\t\tn22 = te[4],\n\t\t\t\t\tn32 = te[5],\n\t\t\t\t\tn13 = te[6],\n\t\t\t\t\tn23 = te[7],\n\t\t\t\t\tn33 = te[8],\n\t\t\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\t\t\tt13 = n23 * n12 - n22 * n13,\n\t\t\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n31 * n23 - n33 * n21) * detInv;\n\t\tte[2] = (n32 * n21 - n31 * n22) * detInv;\n\t\tte[3] = t12 * detInv;\n\t\tte[4] = (n33 * n11 - n31 * n13) * detInv;\n\t\tte[5] = (n31 * n12 - n32 * n11) * detInv;\n\t\tte[6] = t13 * detInv;\n\t\tte[7] = (n21 * n13 - n23 * n11) * detInv;\n\t\tte[8] = (n22 * n11 - n21 * n12) * detInv;\n\t\treturn this;\n\t}\n\n\ttranspose() {\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\t\ttmp = m[1];\n\t\tm[1] = m[3];\n\t\tm[3] = tmp;\n\t\ttmp = m[2];\n\t\tm[2] = m[6];\n\t\tm[6] = tmp;\n\t\ttmp = m[5];\n\t\tm[5] = m[7];\n\t\tm[7] = tmp;\n\t\treturn this;\n\t}\n\n\tgetNormalMatrix(matrix4) {\n\t\treturn this.setFromMatrix4(matrix4).invert().transpose();\n\t}\n\n\ttransposeIntoArray(r) {\n\t\tconst m = this.elements;\n\t\tr[0] = m[0];\n\t\tr[1] = m[3];\n\t\tr[2] = m[6];\n\t\tr[3] = m[1];\n\t\tr[4] = m[4];\n\t\tr[5] = m[7];\n\t\tr[6] = m[2];\n\t\tr[7] = m[5];\n\t\tr[8] = m[8];\n\t\treturn this;\n\t}\n\n\tsetUvTransform(tx, ty, sx, sy, rotation, cx, cy) {\n\t\tconst c = Math.cos(rotation);\n\t\tconst s = Math.sin(rotation);\n\t\tthis.set(sx * c, sx * s, -sx * (c * cx + s * cy) + cx + tx, -sy * s, sy * c, -sy * (-s * cx + c * cy) + cy + ty, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tscale(sx, sy) {\n\t\tthis.premultiply(_m3.makeScale(sx, sy));\n\t\treturn this;\n\t}\n\n\trotate(theta) {\n\t\tthis.premultiply(_m3.makeRotation(-theta));\n\t\treturn this;\n\t}\n\n\ttranslate(tx, ty) {\n\t\tthis.premultiply(_m3.makeTranslation(tx, ty));\n\t\treturn this;\n\t} // for 2D Transforms\n\n\n\tmakeTranslation(x, y) {\n\t\tthis.set(1, 0, x, 0, 1, y, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotation(theta) {\n\t\t// counterclockwise\n\t\tconst c = Math.cos(theta);\n\t\tconst s = Math.sin(theta);\n\t\tthis.set(c, -s, 0, s, c, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y) {\n\t\tthis.set(x, 0, 0, 0, y, 0, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\treturn array;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().fromArray(this.elements);\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/new Matrix3();\n\nconst _vector1 = /*@__PURE__*/new Vector3();\n\nconst _vector2 = /*@__PURE__*/new Vector3();\n\nconst _normalMatrix = /*@__PURE__*/new Matrix3();\n\nclass Plane {\n\tconstructor(normal = new Vector3(1, 0, 0), constant = 0) {\n\t\tthis.isPlane = true; // normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\t}\n\n\tset(normal, constant) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = constant;\n\t\treturn this;\n\t}\n\n\tsetComponents(x, y, z, w) {\n\t\tthis.normal.set(x, y, z);\n\t\tthis.constant = w;\n\t\treturn this;\n\t}\n\n\tsetFromNormalAndCoplanarPoint(normal, point) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = -point.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tsetFromCoplanarPoints(a, b, c) {\n\t\tconst normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize(); // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\n\t\tthis.setFromNormalAndCoplanarPoint(normal, a);\n\t\treturn this;\n\t}\n\n\tcopy(plane) {\n\t\tthis.normal.copy(plane.normal);\n\t\tthis.constant = plane.constant;\n\t\treturn this;\n\t}\n\n\tnormalize() {\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar(inverseNormalLength);\n\t\tthis.constant *= inverseNormalLength;\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.constant *= -1;\n\t\tthis.normal.negate();\n\t\treturn this;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn this.normal.dot(point) + this.constant;\n\t}\n\n\tdistanceToSphere(sphere) {\n\t\treturn this.distanceToPoint(sphere.center) - sphere.radius;\n\t}\n\n\tprojectPoint(point, target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);\n\t}\n\n\tintersectLine(line, target) {\n\t\tconst direction = line.delta(_vector1);\n\t\tconst denominator = this.normal.dot(direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (this.distanceToPoint(line.start) === 0) {\n\t\t\t\treturn target.copy(line.start);\n\t\t\t} // Unsure if this is the correct method to handle this case.\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(line.start.dot(this.normal) + this.constant) / denominator;\n\n\t\tif (t < 0 || t > 1) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn target.copy(direction).multiplyScalar(t).add(line.start);\n\t}\n\n\tintersectsLine(line) {\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\t\tconst startSign = this.distanceToPoint(line.start);\n\t\tconst endSign = this.distanceToPoint(line.end);\n\t\treturn startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsPlane(this);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn sphere.intersectsPlane(this);\n\t}\n\n\tcoplanarPoint(target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.constant);\n\t}\n\n\tapplyMatrix4(matrix, optionalNormalMatrix) {\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);\n\n\t\tconst referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);\n\t\tconst normal = this.normal.applyMatrix3(normalMatrix).normalize();\n\t\tthis.constant = -referencePoint.dot(normal);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.constant -= offset.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tequals(plane) {\n\t\treturn plane.normal.equals(this.normal) && plane.constant === this.constant;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/new Vector3();\n\nconst _segCenter = /*@__PURE__*/new Vector3();\n\nconst _segDir = /*@__PURE__*/new Vector3();\n\nconst _diff = /*@__PURE__*/new Vector3();\n\nconst _edge1 = /*@__PURE__*/new Vector3();\n\nconst _edge2 = /*@__PURE__*/new Vector3();\n\nconst _normal = /*@__PURE__*/new Vector3();\n\nclass Ray {\n\tconstructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\t}\n\n\tset(origin, direction) {\n\t\tthis.origin.copy(origin);\n\t\tthis.direction.copy(direction);\n\t\treturn this;\n\t}\n\n\tcopy(ray) {\n\t\tthis.origin.copy(ray.origin);\n\t\tthis.direction.copy(ray.direction);\n\t\treturn this;\n\t}\n\n\tat(t, target = new Vector3()) {\n\t\treturn target.copy(this.direction).multiplyScalar(t).add(this.origin);\n\t}\n\n\tlookAt(v) {\n\t\tthis.direction.copy(v).sub(this.origin).normalize();\n\t\treturn this;\n\t}\n\n\trecast(t) {\n\t\tthis.origin.copy(this.at(t, _vector));\n\t\treturn this;\n\t}\n\n\tclosestPointToPoint(point, target = new Vector3()) {\n\t\ttarget.subVectors(point, this.origin);\n\t\tconst directionDistance = target.dot(this.direction);\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn target.copy(this.origin);\n\t\t}\n\n\t\treturn target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn Math.sqrt(this.distanceSqToPoint(point));\n\t}\n\n\tdistanceSqToPoint(point) {\n\t\tconst directionDistance = _vector.subVectors(point, this.origin).dot(this.direction); // point behind the ray\n\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn this.origin.distanceToSquared(point);\n\t\t}\n\n\t\t_vector.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\n\t\treturn _vector.distanceToSquared(point);\n\t}\n\n\tdistanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\t\t_segCenter.copy(v0).add(v1).multiplyScalar(0.5);\n\n\t\t_segDir.copy(v1).sub(v0).normalize();\n\n\t\t_diff.copy(this.origin).sub(_segCenter);\n\n\t\tconst segExtent = v0.distanceTo(v1) * 0.5;\n\t\tconst a01 = -this.direction.dot(_segDir);\n\n\t\tconst b0 = _diff.dot(this.direction);\n\n\t\tconst b1 = -_diff.dot(_segDir);\n\n\t\tconst c = _diff.lengthSq();\n\n\t\tconst det = Math.abs(1 - a01 * a01);\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif (det > 0) {\n\t\t\t// The ray and segment are not parallel.\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif (s0 >= 0) {\n\t\t\t\tif (s1 >= -extDet) {\n\t\t\t\t\tif (s1 <= extDet) {\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 1\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// region 5\n\t\t\t\t\ts1 = -segExtent;\n\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s1 <= -extDet) {\n\t\t\t\t\t// region 4\n\t\t\t\t\ts0 = Math.max(0, -(-a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else if (s1 <= extDet) {\n\t\t\t\t\t// region 3\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else {\n\t\t\t\t\t// region 2\n\t\t\t\t\ts0 = Math.max(0, -(a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Ray and segment are parallel.\n\t\t\ts1 = a01 > 0 ? -segExtent : segExtent;\n\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t}\n\n\t\tif (optionalPointOnRay) {\n\t\t\toptionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);\n\t\t}\n\n\t\tif (optionalPointOnSegment) {\n\t\t\toptionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);\n\t\t}\n\n\t\treturn sqrDist;\n\t}\n\n\tintersectSphere(sphere, target = new Vector3()) {\n\t\t_vector.subVectors(sphere.center, this.origin);\n\n\t\tconst tca = _vector.dot(this.direction);\n\n\t\tconst d2 = _vector.dot(_vector) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\t\tif (d2 > radius2) return null;\n\t\tconst thc = Math.sqrt(radius2 - d2); // t0 = first intersect point - entrance on front of sphere\n\n\t\tconst t0 = tca - thc; // t1 = second intersect point - exit point on back of sphere\n\n\t\tconst t1 = tca + thc; // test to see if both t0 and t1 are behind the ray - if so, return null\n\n\t\tif (t0 < 0 && t1 < 0) return null; // test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\n\t\tif (t0 < 0) return this.at(t1, target); // else t0 is in front of the ray, so return the first collision point scaled by t0\n\n\t\treturn this.at(t0, target);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tdistanceToPlane(plane) {\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (plane.distanceToPoint(this.origin) === 0) {\n\t\t\t\treturn 0;\n\t\t\t} // Null is preferable to undefined since undefined means.... it is undefined\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(this.origin.dot(plane.normal) + plane.constant) / denominator; // Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\t}\n\n\tintersectPlane(plane, target) {\n\t\tconst t = this.distanceToPlane(plane);\n\n\t\tif (t === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.at(t, target);\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// check if the ray lies on the plane first\n\t\tconst distToPoint = plane.distanceToPoint(this.origin);\n\n\t\tif (distToPoint === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator * distToPoint < 0) {\n\t\t\treturn true;\n\t\t} // ray origin is behind the plane (and is pointing behind it)\n\n\n\t\treturn false;\n\t}\n\n\tintersectBox(box, target) {\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\t\t\tinvdirz = 1 / this.direction.z;\n\t\tconst origin = this.origin;\n\n\t\tif (invdirx >= 0) {\n\t\t\ttmin = (box.min.x - origin.x) * invdirx;\n\t\t\ttmax = (box.max.x - origin.x) * invdirx;\n\t\t} else {\n\t\t\ttmin = (box.max.x - origin.x) * invdirx;\n\t\t\ttmax = (box.min.x - origin.x) * invdirx;\n\t\t}\n\n\t\tif (invdiry >= 0) {\n\t\t\ttymin = (box.min.y - origin.y) * invdiry;\n\t\t\ttymax = (box.max.y - origin.y) * invdiry;\n\t\t} else {\n\t\t\ttymin = (box.max.y - origin.y) * invdiry;\n\t\t\ttymax = (box.min.y - origin.y) * invdiry;\n\t\t}\n\n\t\tif (tmin > tymax || tymin > tmax) return null; // These lines also handle the case where tmin or tmax is NaN\n\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\tif (tymin > tmin || tmin !== tmin) tmin = tymin;\n\t\tif (tymax < tmax || tmax !== tmax) tmax = tymax;\n\n\t\tif (invdirz >= 0) {\n\t\t\ttzmin = (box.min.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.max.z - origin.z) * invdirz;\n\t\t} else {\n\t\t\ttzmin = (box.max.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.min.z - origin.z) * invdirz;\n\t\t}\n\n\t\tif (tmin > tzmax || tzmin > tmax) return null;\n\t\tif (tzmin > tmin || tmin !== tmin) tmin = tzmin;\n\t\tif (tzmax < tmax || tmax !== tmax) tmax = tzmax; //return point closest to the ray (positive side)\n\n\t\tif (tmax < 0) return null;\n\t\treturn this.at(tmin >= 0 ? tmin : tmax, target);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn this.intersectBox(box, _vector) !== null;\n\t}\n\n\tintersectTriangle(a, b, c, backfaceCulling, target) {\n\t\t// Compute the offset origin, edges, and normal.\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\t\t_edge1.subVectors(b, a);\n\n\t\t_edge2.subVectors(c, a);\n\n\t\t_normal.crossVectors(_edge1, _edge2); // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t//\t |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t//\t |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t//\t |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\n\n\t\tlet DdN = this.direction.dot(_normal);\n\t\tlet sign;\n\n\t\tif (DdN > 0) {\n\t\t\tif (backfaceCulling) return null;\n\t\t\tsign = 1;\n\t\t} else if (DdN < 0) {\n\t\t\tsign = -1;\n\t\t\tDdN = -DdN;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\n\t\t_diff.subVectors(this.origin, a);\n\n\t\tconst DdQxE2 = sign * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); // b1 < 0, no intersection\n\n\t\tif (DdQxE2 < 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot(_edge1.cross(_diff)); // b2 < 0, no intersection\n\n\t\tif (DdE1xQ < 0) {\n\t\t\treturn null;\n\t\t} // b1+b2 > 1, no intersection\n\n\n\t\tif (DdQxE2 + DdE1xQ > DdN) {\n\t\t\treturn null;\n\t\t} // Line intersects triangle, check if ray does.\n\n\n\t\tconst QdN = -sign * _diff.dot(_normal); // t < 0, no intersection\n\n\n\t\tif (QdN < 0) {\n\t\t\treturn null;\n\t\t} // Ray intersects triangle.\n\n\n\t\treturn this.at(QdN / DdN, target);\n\t}\n\n\tapplyMatrix4(matrix4) {\n\t\tthis.origin.applyMatrix4(matrix4);\n\t\tthis.direction.transformDirection(matrix4);\n\t\treturn this;\n\t}\n\n\tequals(ray) {\n\t\treturn ray.origin.equals(this.origin) && ray.direction.equals(this.direction);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _box = /*@__PURE__*/new Box3();\n\nconst _v1$1 = /*@__PURE__*/new Vector3();\n\nconst _toFarthestPoint = /*@__PURE__*/new Vector3();\n\nconst _toPoint = /*@__PURE__*/new Vector3();\n\nclass Sphere {\n\tconstructor(center = new Vector3(), radius = -1) {\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\t}\n\n\tset(center, radius) {\n\t\tthis.center.copy(center);\n\t\tthis.radius = radius;\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points, optionalCenter) {\n\t\tconst center = this.center;\n\n\t\tif (optionalCenter !== undefined) {\n\t\t\tcenter.copy(optionalCenter);\n\t\t} else {\n\t\t\t_box.setFromPoints(points).getCenter(center);\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));\n\t\t}\n\n\t\tthis.radius = Math.sqrt(maxRadiusSq);\n\t\treturn this;\n\t}\n\n\tcopy(sphere) {\n\t\tthis.center.copy(sphere.center);\n\t\tthis.radius = sphere.radius;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\treturn this.radius < 0;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.center.set(0, 0, 0);\n\t\tthis.radius = -1;\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.distanceToSquared(this.center) <= this.radius * this.radius;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn point.distanceTo(this.center) - this.radius;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\tconst radiusSum = this.radius + sphere.radius;\n\t\treturn sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsSphere(this);\n\t}\n\n\tintersectsPlane(plane) {\n\t\treturn Math.abs(plane.distanceToPoint(this.center)) <= this.radius;\n\t}\n\n\tclampPoint(point, target) {\n\t\tconst deltaLengthSq = this.center.distanceToSquared(point);\n\t\ttarget.copy(point);\n\n\t\tif (deltaLengthSq > this.radius * this.radius) {\n\t\t\ttarget.sub(this.center).normalize();\n\t\t\ttarget.multiplyScalar(this.radius).add(this.center);\n\t\t}\n\n\t\treturn target;\n\t}\n\n\tgetBoundingBox(target) {\n\t\tif (this.isEmpty()) {\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\t\t}\n\n\t\ttarget.set(this.center, this.center);\n\t\ttarget.expandByScalar(this.radius);\n\t\treturn target;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.center.applyMatrix4(matrix);\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.center.add(offset);\n\t\treturn this;\n\t}\n\n\texpandByPoint(point) {\n\t\tif (this.isEmpty()) {\n\t\t\tthis.center.copy(point);\n\t\t\tthis.radius = 0;\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671\n\n\n\t\t_toPoint.subVectors(point, this.center);\n\n\t\tconst lengthSq = _toPoint.lengthSq();\n\n\t\tif (lengthSq > this.radius * this.radius) {\n\t\t\tconst length = Math.sqrt(lengthSq);\n\t\t\tconst missingRadiusHalf = (length - this.radius) * 0.5; // Nudge this sphere towards the target point. Add half the missing distance to radius,\n\t\t\t// and the other half to position. This gives a tighter enclosure, instead of if\n\t\t\t// the whole missing distance were just added to radius.\n\n\t\t\tthis.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length));\n\t\t\tthis.radius += missingRadiusHalf;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tunion(sphere) {\n\t\t// handle empty sphere cases\n\t\tif (sphere.isEmpty()) {\n\t\t\treturn;\n\t\t} else if (this.isEmpty()) {\n\t\t\tthis.copy(sphere);\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769\n\t\t// To enclose another sphere into this sphere, we only need to enclose two points:\n\t\t// 1) Enclose the farthest point on the other sphere into this sphere.\n\t\t// 2) Enclose the opposite point of the farthest point into this sphere.\n\n\n\t\tif (this.center.equals(sphere.center) === true) {\n\t\t\t_toFarthestPoint.set(0, 0, 1).multiplyScalar(sphere.radius);\n\t\t} else {\n\t\t\t_toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);\n\t\t}\n\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).add(_toFarthestPoint));\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).sub(_toFarthestPoint));\n\t\treturn this;\n\t}\n\n\tequals(sphere) {\n\t\treturn sphere.center.equals(this.center) && sphere.radius === this.radius;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\r\n *\r\n * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\r\n * The azimuthal angle (theta) is measured from the positive z-axis.\r\n */\n\nclass Spherical {\n\tconstructor(radius = 1, phi = 0, theta = 0) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi; // polar angle\n\n\t\tthis.theta = theta; // azimuthal angle\n\n\t\treturn this;\n\t}\n\n\tset(radius, phi, theta) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\t\treturn this;\n\t} // restrict phi to be between EPS and PI-EPS\n\n\n\tmakeSafe() {\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi));\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + y * y + z * z);\n\n\t\tif (this.radius === 0) {\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\t\t} else {\n\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\tthis.phi = Math.acos(clamp(y / this.radius, -1, 1));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/new Vector3();\n\nconst _v1 = /*@__PURE__*/new Vector3();\n\nconst _v2 = /*@__PURE__*/new Vector3();\n\nconst _v3 = /*@__PURE__*/new Vector3();\n\nconst _vab = /*@__PURE__*/new Vector3();\n\nconst _vac = /*@__PURE__*/new Vector3();\n\nconst _vbc = /*@__PURE__*/new Vector3();\n\nconst _vap = /*@__PURE__*/new Vector3();\n\nconst _vbp = /*@__PURE__*/new Vector3();\n\nconst _vcp = /*@__PURE__*/new Vector3();\n\nclass Triangle {\n\tconstructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\t}\n\n\tstatic getNormal(a, b, c, target) {\n\t\ttarget.subVectors(c, b);\n\n\t\t_v0.subVectors(a, b);\n\n\t\ttarget.cross(_v0);\n\t\tconst targetLengthSq = target.lengthSq();\n\n\t\tif (targetLengthSq > 0) {\n\t\t\treturn target.multiplyScalar(1 / Math.sqrt(targetLengthSq));\n\t\t}\n\n\t\treturn target.set(0, 0, 0);\n\t} // static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\n\tstatic getBarycoord(point, a, b, c, target) {\n\t\t_v0.subVectors(c, a);\n\n\t\t_v1.subVectors(b, a);\n\n\t\t_v2.subVectors(point, a);\n\n\t\tconst dot00 = _v0.dot(_v0);\n\n\t\tconst dot01 = _v0.dot(_v1);\n\n\t\tconst dot02 = _v0.dot(_v2);\n\n\t\tconst dot11 = _v1.dot(_v1);\n\n\t\tconst dot12 = _v1.dot(_v2);\n\n\t\tconst denom = dot00 * dot11 - dot01 * dot01; // collinear or singular triangle\n\n\t\tif (denom === 0) {\n\t\t\t// arbitrary location outside of triangle?\n\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\treturn target.set(-2, -1, -1);\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n\t\tconst v = (dot00 * dot12 - dot01 * dot02) * invDenom; // barycentric coordinates must always sum to 1\n\n\t\treturn target.set(1 - u - v, v, u);\n\t}\n\n\tstatic containsPoint(point, a, b, c) {\n\t\tthis.getBarycoord(point, a, b, c, _v3);\n\t\treturn _v3.x >= 0 && _v3.y >= 0 && _v3.x + _v3.y <= 1;\n\t}\n\n\tstatic getUV(point, p1, p2, p3, uv1, uv2, uv3, target) {\n\t\tthis.getBarycoord(point, p1, p2, p3, _v3);\n\t\ttarget.set(0, 0);\n\t\ttarget.addScaledVector(uv1, _v3.x);\n\t\ttarget.addScaledVector(uv2, _v3.y);\n\t\ttarget.addScaledVector(uv3, _v3.z);\n\t\treturn target;\n\t}\n\n\tstatic isFrontFacing(a, b, c, direction) {\n\t\t_v0.subVectors(c, b);\n\n\t\t_v1.subVectors(a, b); // strictly front facing\n\n\n\t\treturn _v0.cross(_v1).dot(direction) < 0 ? true : false;\n\t}\n\n\tset(a, b, c) {\n\t\tthis.a.copy(a);\n\t\tthis.b.copy(b);\n\t\tthis.c.copy(c);\n\t\treturn this;\n\t}\n\n\tsetFromPointsAndIndices(points, i0, i1, i2) {\n\t\tthis.a.copy(points[i0]);\n\t\tthis.b.copy(points[i1]);\n\t\tthis.c.copy(points[i2]);\n\t\treturn this;\n\t} // setFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\t// \tthis.a.fromBufferAttribute( attribute, i0 );\n\t// \tthis.b.fromBufferAttribute( attribute, i1 );\n\t// \tthis.c.fromBufferAttribute( attribute, i2 );\n\t// \treturn this;\n\t// }\n\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(triangle) {\n\t\tthis.a.copy(triangle.a);\n\t\tthis.b.copy(triangle.b);\n\t\tthis.c.copy(triangle.c);\n\t\treturn this;\n\t}\n\n\tgetArea() {\n\t\t_v0.subVectors(this.c, this.b);\n\n\t\t_v1.subVectors(this.a, this.b);\n\n\t\treturn _v0.cross(_v1).length() * 0.5;\n\t}\n\n\tgetMidpoint(target) {\n\t\treturn target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n\t}\n\n\tgetNormal(target) {\n\t\treturn Triangle.getNormal(this.a, this.b, this.c, target);\n\t}\n\n\tgetPlane(target) {\n\t\treturn target.setFromCoplanarPoints(this.a, this.b, this.c);\n\t}\n\n\tgetBarycoord(point, target) {\n\t\treturn Triangle.getBarycoord(point, this.a, this.b, this.c, target);\n\t}\n\n\tgetUV(point, uv1, uv2, uv3, target) {\n\t\treturn Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target);\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn Triangle.containsPoint(point, this.a, this.b, this.c);\n\t}\n\n\tisFrontFacing(direction) {\n\t\treturn Triangle.isFrontFacing(this.a, this.b, this.c, direction);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsTriangle(this);\n\t}\n\n\tclosestPointToPoint(p, target) {\n\t\tconst a = this.a,\n\t\t\t\t\tb = this.b,\n\t\t\t\t\tc = this.c;\n\t\tlet v, w; // algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors(b, a);\n\n\t\t_vac.subVectors(c, a);\n\n\t\t_vap.subVectors(p, a);\n\n\t\tconst d1 = _vab.dot(_vap);\n\n\t\tconst d2 = _vac.dot(_vap);\n\n\t\tif (d1 <= 0 && d2 <= 0) {\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy(a);\n\t\t}\n\n\t\t_vbp.subVectors(p, b);\n\n\t\tconst d3 = _vab.dot(_vbp);\n\n\t\tconst d4 = _vac.dot(_vbp);\n\n\t\tif (d3 >= 0 && d4 <= d3) {\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy(b);\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\n\t\tif (vc <= 0 && d1 >= 0 && d3 <= 0) {\n\t\t\tv = d1 / (d1 - d3); // edge region of AB; barycentric coords (1-v, v, 0)\n\n\t\t\treturn target.copy(a).addScaledVector(_vab, v);\n\t\t}\n\n\t\t_vcp.subVectors(p, c);\n\n\t\tconst d5 = _vab.dot(_vcp);\n\n\t\tconst d6 = _vac.dot(_vcp);\n\n\t\tif (d6 >= 0 && d5 <= d6) {\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy(c);\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\n\t\tif (vb <= 0 && d2 >= 0 && d6 <= 0) {\n\t\t\tw = d2 / (d2 - d6); // edge region of AC; barycentric coords (1-w, 0, w)\n\n\t\t\treturn target.copy(a).addScaledVector(_vac, w);\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\n\t\tif (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {\n\t\t\t_vbc.subVectors(c, b);\n\n\t\t\tw = (d4 - d3) / (d4 - d3 + (d5 - d6)); // edge region of BC; barycentric coords (0, 1-w, w)\n\n\t\t\treturn target.copy(b).addScaledVector(_vbc, w); // edge region of BC\n\t\t} // face region\n\n\n\t\tconst denom = 1 / (va + vb + vc); // u = va * denom\n\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\t\treturn target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w);\n\t}\n\n\tequals(triangle) {\n\t\treturn triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);\n\t}\n\n}\n\nclass Vector4 {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tVector4.prototype.isVector4 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t}\n\n\tget width() {\n\t\treturn this.z;\n\t}\n\n\tset width(value) {\n\t\tthis.z = value;\n\t}\n\n\tget height() {\n\t\treturn this.w;\n\t}\n\n\tset height(value) {\n\t\tthis.w = value;\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetW(w) {\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tthis.w = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tcase 3:\n\t\t\t\treturn this.w;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z, this.w);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = v.w !== undefined ? v.w : 1;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z,\n\t\t\t\t\tw = this.w;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w;\n\t\tthis.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tsetAxisAngleFromQuaternion(q) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\t\t// q is assumed to be normalized\n\t\tthis.w = 2 * Math.acos(q.w);\n\t\tconst s = Math.sqrt(1 - q.w * q.w);\n\n\t\tif (s < 0.0001) {\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\t\t} else {\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetAxisAngleFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tlet angle, x, y, z; // variables for result\n\n\t\tconst epsilon = 0.01,\n\t\t\t\t\t// margin to allow for rounding errors\n\t\tepsilon2 = 0.1,\n\t\t\t\t\t// margin to distinguish between 0 and 180 degrees\n\t\tte = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tif (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\t\t\tif (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\t\t\t\tthis.set(1, 0, 0, 0);\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\t\t\t} // otherwise this singularity is angle = 180\n\n\n\t\t\tangle = Math.PI;\n\t\t\tconst xx = (m11 + 1) / 2;\n\t\t\tconst yy = (m22 + 1) / 2;\n\t\t\tconst zz = (m33 + 1) / 2;\n\t\t\tconst xy = (m12 + m21) / 4;\n\t\t\tconst xz = (m13 + m31) / 4;\n\t\t\tconst yz = (m23 + m32) / 4;\n\n\t\t\tif (xx > yy && xx > zz) {\n\t\t\t\t// m11 is the largest diagonal term\n\t\t\t\tif (xx < epsilon) {\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\tx = Math.sqrt(xx);\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\t\t\t\t}\n\t\t\t} else if (yy > zz) {\n\t\t\t\t// m22 is the largest diagonal term\n\t\t\t\tif (yy < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\ty = Math.sqrt(yy);\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\t\t\t\tif (zz < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\t\t\t\t} else {\n\t\t\t\t\tz = Math.sqrt(zz);\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.set(x, y, z, angle);\n\t\t\treturn this; // return 180 deg rotation\n\t\t} // as we have reached here there are no singularities so we can handle normally\n\n\n\t\tlet s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); // used to normalize\n\n\t\tif (Math.abs(s) < 0.001) s = 1; // prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = (m32 - m23) / s;\n\t\tthis.y = (m13 - m31) / s;\n\t\tthis.z = (m21 - m12) / s;\n\t\tthis.w = Math.acos((m11 + m22 + m33 - 1) / 2);\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\tthis.w = Math.min(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\tthis.w = Math.max(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\tthis.w = Math.max(min.w, Math.min(max.w, this.w));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\tthis.w = Math.max(minVal, Math.min(maxVal, this.w));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\tthis.w = Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\tthis.w = Math.ceil(this.w);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\tthis.w = Math.round(this.w);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\tthis.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\tthis.w = -this.w;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\tthis.w += (v.w - this.w) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\tthis.w = v1.w + (v2.w - v1.w) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\tthis.w = array[offset + 3];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\tarray[offset + 3] = this.w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \tthis.w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\t}\n\n}\n\nexports.ACESFilmicToneMapping = ACESFilmicToneMapping;\nexports.AddEquation = AddEquation;\nexports.AddOperation = AddOperation;\nexports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;\nexports.AdditiveBlending = AdditiveBlending;\nexports.AlphaFormat = AlphaFormat;\nexports.AlwaysDepth = AlwaysDepth;\nexports.AlwaysStencilFunc = AlwaysStencilFunc;\nexports.BackSide = BackSide;\nexports.BasicDepthPacking = BasicDepthPacking;\nexports.BasicShadowMap = BasicShadowMap;\nexports.Box2 = Box2;\nexports.Box3 = Box3;\nexports.ByteType = ByteType;\nexports.CineonToneMapping = CineonToneMapping;\nexports.ClampToEdgeWrapping = ClampToEdgeWrapping;\nexports.Color = Color;\nexports.ColorManagement = ColorManagement;\nexports.CubeReflectionMapping = CubeReflectionMapping;\nexports.CubeRefractionMapping = CubeRefractionMapping;\nexports.CubeUVReflectionMapping = CubeUVReflectionMapping;\nexports.CullFaceBack = CullFaceBack;\nexports.CullFaceFront = CullFaceFront;\nexports.CullFaceFrontBack = CullFaceFrontBack;\nexports.CullFaceNone = CullFaceNone;\nexports.CustomBlending = CustomBlending;\nexports.CustomToneMapping = CustomToneMapping;\nexports.Cylindrical = Cylindrical;\nexports.DecrementStencilOp = DecrementStencilOp;\nexports.DecrementWrapStencilOp = DecrementWrapStencilOp;\nexports.DepthFormat = DepthFormat;\nexports.DepthStencilFormat = DepthStencilFormat;\nexports.DoubleSide = DoubleSide;\nexports.DstAlphaFactor = DstAlphaFactor;\nexports.DstColorFactor = DstColorFactor;\nexports.DynamicCopyUsage = DynamicCopyUsage;\nexports.DynamicDrawUsage = DynamicDrawUsage;\nexports.DynamicReadUsage = DynamicReadUsage;\nexports.EqualDepth = EqualDepth;\nexports.EqualStencilFunc = EqualStencilFunc;\nexports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;\nexports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;\nexports.Euler = Euler;\nexports.FloatType = FloatType;\nexports.FrontSide = FrontSide;\nexports.GLSL1 = GLSL1;\nexports.GLSL3 = GLSL3;\nexports.GreaterDepth = GreaterDepth;\nexports.GreaterEqualDepth = GreaterEqualDepth;\nexports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;\nexports.GreaterStencilFunc = GreaterStencilFunc;\nexports.HalfFloatType = HalfFloatType;\nexports.IncrementStencilOp = IncrementStencilOp;\nexports.IncrementWrapStencilOp = IncrementWrapStencilOp;\nexports.IntType = IntType;\nexports.Interpolant = Interpolant;\nexports.InterpolateDiscrete = InterpolateDiscrete;\nexports.InterpolateLinear = InterpolateLinear;\nexports.InterpolateSmooth = InterpolateSmooth;\nexports.InvertStencilOp = InvertStencilOp;\nexports.KeepStencilOp = KeepStencilOp;\nexports.LessDepth = LessDepth;\nexports.LessEqualDepth = LessEqualDepth;\nexports.LessEqualStencilFunc = LessEqualStencilFunc;\nexports.LessStencilFunc = LessStencilFunc;\nexports.Line3 = Line3;\nexports.LinearEncoding = LinearEncoding;\nexports.LinearFilter = LinearFilter;\nexports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;\nexports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;\nexports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;\nexports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;\nexports.LinearSRGBColorSpace = LinearSRGBColorSpace;\nexports.LinearToSRGB = LinearToSRGB;\nexports.LinearToneMapping = LinearToneMapping;\nexports.LoopOnce = LoopOnce;\nexports.LoopPingPong = LoopPingPong;\nexports.LoopRepeat = LoopRepeat;\nexports.LuminanceAlphaFormat = LuminanceAlphaFormat;\nexports.LuminanceFormat = LuminanceFormat;\nexports.MOUSE = MOUSE;\nexports.MathUtils = MathUtils;\nexports.Matrix3 = Matrix3;\nexports.Matrix4 = Matrix4;\nexports.MaxEquation = MaxEquation;\nexports.MinEquation = MinEquation;\nexports.MirroredRepeatWrapping = MirroredRepeatWrapping;\nexports.MixOperation = MixOperation;\nexports.MultiplyBlending = MultiplyBlending;\nexports.MultiplyOperation = MultiplyOperation;\nexports.NearestFilter = NearestFilter;\nexports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;\nexports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;\nexports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;\nexports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;\nexports.NeverDepth = NeverDepth;\nexports.NeverStencilFunc = NeverStencilFunc;\nexports.NoBlending = NoBlending;\nexports.NoColorSpace = NoColorSpace;\nexports.NoToneMapping = NoToneMapping;\nexports.NormalAnimationBlendMode = NormalAnimationBlendMode;\nexports.NormalBlending = NormalBlending;\nexports.NotEqualDepth = NotEqualDepth;\nexports.NotEqualStencilFunc = NotEqualStencilFunc;\nexports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;\nexports.OneFactor = OneFactor;\nexports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;\nexports.OneMinusDstColorFactor = OneMinusDstColorFactor;\nexports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;\nexports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;\nexports.PCFShadowMap = PCFShadowMap;\nexports.PCFSoftShadowMap = PCFSoftShadowMap;\nexports.Plane = Plane;\nexports.Quaternion = Quaternion;\nexports.REVISION = REVISION;\nexports.RGBADepthPacking = RGBADepthPacking;\nexports.RGBAFormat = RGBAFormat;\nexports.RGBAIntegerFormat = RGBAIntegerFormat;\nexports.RGBA_ASTC_10x10_Format = RGBA_ASTC_10x10_Format;\nexports.RGBA_ASTC_10x5_Format = RGBA_ASTC_10x5_Format;\nexports.RGBA_ASTC_10x6_Format = RGBA_ASTC_10x6_Format;\nexports.RGBA_ASTC_10x8_Format = RGBA_ASTC_10x8_Format;\nexports.RGBA_ASTC_12x10_Format = RGBA_ASTC_12x10_Format;\nexports.RGBA_ASTC_12x12_Format = RGBA_ASTC_12x12_Format;\nexports.RGBA_ASTC_4x4_Format = RGBA_ASTC_4x4_Format;\nexports.RGBA_ASTC_5x4_Format = RGBA_ASTC_5x4_Format;\nexports.RGBA_ASTC_5x5_Format = RGBA_ASTC_5x5_Format;\nexports.RGBA_ASTC_6x5_Format = RGBA_ASTC_6x5_Format;\nexports.RGBA_ASTC_6x6_Format = RGBA_ASTC_6x6_Format;\nexports.RGBA_ASTC_8x5_Format = RGBA_ASTC_8x5_Format;\nexports.RGBA_ASTC_8x6_Format = RGBA_ASTC_8x6_Format;\nexports.RGBA_ASTC_8x8_Format = RGBA_ASTC_8x8_Format;\nexports.RGBA_BPTC_Format = RGBA_BPTC_Format;\nexports.RGBA_ETC2_EAC_Format = RGBA_ETC2_EAC_Format;\nexports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format;\nexports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format;\nexports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;\nexports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;\nexports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;\nexports.RGBFormat = RGBFormat;\nexports.RGB_ETC1_Format = RGB_ETC1_Format;\nexports.RGB_ETC2_Format = RGB_ETC2_Format;\nexports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;\nexports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format;\nexports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format;\nexports.RGFormat = RGFormat;\nexports.RGIntegerFormat = RGIntegerFormat;\nexports.Ray = Ray;\nexports.RedFormat = RedFormat;\nexports.RedIntegerFormat = RedIntegerFormat;\nexports.ReinhardToneMapping = ReinhardToneMapping;\nexports.RepeatWrapping = RepeatWrapping;\nexports.ReplaceStencilOp = ReplaceStencilOp;\nexports.ReverseSubtractEquation = ReverseSubtractEquation;\nexports.SRGBColorSpace = SRGBColorSpace;\nexports.SRGBToLinear = SRGBToLinear;\nexports.ShortType = ShortType;\nexports.Sphere = Sphere;\nexports.Spherical = Spherical;\nexports.SrcAlphaFactor = SrcAlphaFactor;\nexports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;\nexports.SrcColorFactor = SrcColorFactor;\nexports.StaticCopyUsage = StaticCopyUsage;\nexports.StaticDrawUsage = StaticDrawUsage;\nexports.StaticReadUsage = StaticReadUsage;\nexports.StreamCopyUsage = StreamCopyUsage;\nexports.StreamDrawUsage = StreamDrawUsage;\nexports.StreamReadUsage = StreamReadUsage;\nexports.SubtractEquation = SubtractEquation;\nexports.SubtractiveBlending = SubtractiveBlending;\nexports.TOUCH = TOUCH;\nexports.TangentSpaceNormalMap = TangentSpaceNormalMap;\nexports.Triangle = Triangle;\nexports.TriangleFanDrawMode = TriangleFanDrawMode;\nexports.TriangleStripDrawMode = TriangleStripDrawMode;\nexports.TrianglesDrawMode = TrianglesDrawMode;\nexports.UVMapping = UVMapping;\nexports.UnsignedByteType = UnsignedByteType;\nexports.UnsignedInt248Type = UnsignedInt248Type;\nexports.UnsignedIntType = UnsignedIntType;\nexports.UnsignedShort4444Type = UnsignedShort4444Type;\nexports.UnsignedShort5551Type = UnsignedShort5551Type;\nexports.UnsignedShortType = UnsignedShortType;\nexports.VSMShadowMap = VSMShadowMap;\nexports.Vector2 = Vector2;\nexports.Vector3 = Vector3;\nexports.Vector4 = Vector4;\nexports.WrapAroundEnding = WrapAroundEnding;\nexports.ZeroCurvatureEnding = ZeroCurvatureEnding;\nexports.ZeroFactor = ZeroFactor;\nexports.ZeroSlopeEnding = ZeroSlopeEnding;\nexports.ZeroStencilOp = ZeroStencilOp;\nexports._SRGBAFormat = _SRGBAFormat;\nexports.sRGBEncoding = sRGBEncoding;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/threejs-math/build/threejs-math.cjs?")}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(t){var n=__webpack_module_cache__[t];if(void 0!==n)return n.exports;var e=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(e.exports,e,e.exports,__webpack_require__),e.exports}getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var e=Object.create(null);__webpack_require__.r(e);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&n&&t;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((n=>r[n]=()=>t[n]));return r.default=()=>t,__webpack_require__.d(e,r),e},__webpack_require__.d=(t,n)=>{for(var e in n)__webpack_require__.o(n,e)&&!__webpack_require__.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/index.ts");return __webpack_exports__})())); \ No newline at end of file diff --git a/dist-umd/manifesto.js.LICENSE.txt b/dist-umd/manifesto.js.LICENSE.txt new file mode 100644 index 00000000..f7149e81 --- /dev/null +++ b/dist-umd/manifesto.js.LICENSE.txt @@ -0,0 +1,299 @@ +/*!*********************!*\ + !*** ./src/Size.ts ***! + \*********************/ + +/*!**********************!*\ + !*** ./src/Color.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Light.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Range.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Scene.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Thumb.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Utils.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/index.ts ***! + \**********************/ + +/*!***********************!*\ + !*** ./src/Camera.ts ***! + \***********************/ + +/*!***********************!*\ + !*** ./src/Canvas.ts ***! + \***********************/ + +/*!************************!*\ + !*** ./src/Service.ts ***! + \************************/ + +/*!*************************!*\ + !*** ./src/Duration.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/Language.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/Manifest.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/Resource.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/Sequence.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/TreeNode.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/internal.ts ***! + \*************************/ + +/*!**************************!*\ + !*** ./src/Rendering.ts ***! + \**************************/ + +/*!**************************!*\ + !*** ./src/Thumbnail.ts ***! + \**************************/ + +/*!**************************!*\ + !*** ./src/Transform.ts ***! + \**************************/ + +/*!***************************!*\ + !*** ./src/Annotation.ts ***! + \***************************/ + +/*!***************************!*\ + !*** ./src/Collection.ts ***! + \***************************/ + +/*!***************************!*\ + !*** ./src/Geometry3d.ts ***! + \***************************/ + +/*!***************************!*\ + !*** ./src/StatusCode.ts ***! + \***************************/ + +/*!****************************!*\ + !*** ./src/LanguageMap.ts ***! + \****************************/ + +/*!*****************************!*\ + !*** ./src/IAccessToken.ts ***! + \*****************************/ + +/*!*****************************!*\ + !*** ./src/IIIFResource.ts ***! + \*****************************/ + +/*!*****************************!*\ + !*** ./src/ManifestType.ts ***! + \*****************************/ + +/*!*****************************!*\ + !*** ./src/TreeNodeType.ts ***! + \*****************************/ + +/*!*****************************!*\ + !*** external "node-fetch" ***! + \*****************************/ + +/*!******************************!*\ + !*** ./src/PointSelector.ts ***! + \******************************/ + +/*!******************************!*\ + !*** ./src/PropertyValue.ts ***! + \******************************/ + +/*!******************************!*\ + !*** ./src/Serialisation.ts ***! + \******************************/ + +/*!*******************************!*\ + !*** ./src/AnnotationBody.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/AnnotationList.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/AnnotationPage.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/JSONLDResource.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/LabelValuePair.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/ScaleTransform.ts ***! + \*******************************/ + +/*!********************************!*\ + !*** ./src/RotateTransform.ts ***! + \********************************/ + +/*!********************************!*\ + !*** ./src/TransformParser.ts ***! + \********************************/ + +/*!*********************************!*\ + !*** ./src/ManifestResource.ts ***! + \*********************************/ + +/*!*********************************!*\ + !*** ./src/SpecificResource.ts ***! + \*********************************/ + +/*!**********************************!*\ + !*** ./src/IExternalResource.ts ***! + \**********************************/ + +/*!**********************************!*\ + !*** ./src/IManifestoOptions.ts ***! + \**********************************/ + +/*!***********************************!*\ + !*** ./src/TranslateTransform.ts ***! + \***********************************/ + +/*!*************************************!*\ + !*** ./src/AnnotationBodyParser.ts ***! + \*************************************/ + +/*!**************************************!*\ + !*** ./node_modules/lodash/_root.js ***! + \**************************************/ + +/*!**************************************!*\ + !*** ./src/IExternalResourceData.ts ***! + \**************************************/ + +/*!****************************************!*\ + !*** ./node_modules/lodash/_Symbol.js ***! + \****************************************/ + +/*!****************************************!*\ + !*** ./node_modules/lodash/flatten.js ***! + \****************************************/ + +/*!****************************************!*\ + !*** ./node_modules/lodash/isArray.js ***! + \****************************************/ + +/*!*****************************************!*\ + !*** ./src/IExternalResourceOptions.ts ***! + \*****************************************/ + +/*!******************************************!*\ + !*** ./node_modules/color-name/index.js ***! + \******************************************/ + +/*!*******************************************!*\ + !*** ./node_modules/is-arrayish/index.js ***! + \*******************************************/ + +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayPush.js ***! + \*******************************************/ + +/*!*******************************************!*\ + !*** ./node_modules/lodash/_getRawTag.js ***! + \*******************************************/ + +/*!*******************************************!*\ + !*** ./src/IExternalImageResourceData.ts ***! + \*******************************************/ + +/*!********************************************!*\ + !*** ./node_modules/color-string/index.js ***! + \********************************************/ + +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseGetTag.js ***! + \********************************************/ + +/*!********************************************!*\ + !*** ./node_modules/lodash/_freeGlobal.js ***! + \********************************************/ + +/*!********************************************!*\ + !*** ./node_modules/lodash/flattenDeep.js ***! + \********************************************/ + +/*!********************************************!*\ + !*** ./node_modules/lodash/isArguments.js ***! + \********************************************/ + +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseFlatten.js ***! + \*********************************************/ + +/*!*********************************************!*\ + !*** ./node_modules/lodash/isObjectLike.js ***! + \*********************************************/ + +/*!**********************************************!*\ + !*** ./node_modules/simple-swizzle/index.js ***! + \**********************************************/ + +/*!***********************************************!*\ + !*** ./node_modules/lodash/_isFlattenable.js ***! + \***********************************************/ + +/*!************************************************!*\ + !*** ./node_modules/lodash/_objectToString.js ***! + \************************************************/ + +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsArguments.js ***! + \*************************************************/ + +/*!**************************************************!*\ + !*** ./node_modules/isomorphic-unfetch/index.js ***! + \**************************************************/ + +/*!*****************************************************!*\ + !*** ./node_modules/unfetch/dist/unfetch.module.js ***! + \*****************************************************/ + +/*!**********************************************************!*\ + !*** ./node_modules/threejs-math/build/threejs-math.cjs ***! + \**********************************************************/ + +/*!**************************************************************!*\ + !*** ./node_modules/@iiif/vocabulary/dist-commonjs/index.js ***! + \**************************************************************/ + +/*!***********************************************************************!*\ + !*** ./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js ***! + \***********************************************************************/ diff --git a/dist-var/manifesto.js b/dist-var/manifesto.js new file mode 100644 index 00000000..679e6795 --- /dev/null +++ b/dist-var/manifesto.js @@ -0,0 +1,2 @@ +/*! For license information please see manifesto.js.LICENSE.txt */ +var manifesto;(()=>{var __webpack_modules__={"./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\r\nObject.defineProperty(exports, "__esModule", ({ value: true }));\r\nexports.CONTINUE = 100;\r\nexports.SWITCHING_PROTOCOLS = 101;\r\nexports.PROCESSING = 102;\r\nexports.OK = 200;\r\nexports.CREATED = 201;\r\nexports.ACCEPTED = 202;\r\nexports.NON_AUTHORITATIVE_INFORMATION = 203;\r\nexports.NO_CONTENT = 204;\r\nexports.RESET_CONTENT = 205;\r\nexports.PARTIAL_CONTENT = 206;\r\nexports.MULTI_STATUS = 207;\r\nexports.MULTIPLE_CHOICES = 300;\r\nexports.MOVED_PERMANENTLY = 301;\r\nexports.MOVED_TEMPORARILY = 302;\r\nexports.SEE_OTHER = 303;\r\nexports.NOT_MODIFIED = 304;\r\nexports.USE_PROXY = 305;\r\nexports.TEMPORARY_REDIRECT = 307;\r\nexports.BAD_REQUEST = 400;\r\nexports.UNAUTHORIZED = 401;\r\nexports.PAYMENT_REQUIRED = 402;\r\nexports.FORBIDDEN = 403;\r\nexports.NOT_FOUND = 404;\r\nexports.METHOD_NOT_ALLOWED = 405;\r\nexports.NOT_ACCEPTABLE = 406;\r\nexports.PROXY_AUTHENTICATION_REQUIRED = 407;\r\nexports.REQUEST_TIME_OUT = 408;\r\nexports.CONFLICT = 409;\r\nexports.GONE = 410;\r\nexports.LENGTH_REQUIRED = 411;\r\nexports.PRECONDITION_FAILED = 412;\r\nexports.REQUEST_ENTITY_TOO_LARGE = 413;\r\nexports.REQUEST_URI_TOO_LARGE = 414;\r\nexports.UNSUPPORTED_MEDIA_TYPE = 415;\r\nexports.REQUESTED_RANGE_NOT_SATISFIABLE = 416;\r\nexports.EXPECTATION_FAILED = 417;\r\nexports.IM_A_TEAPOT = 418;\r\nexports.UNPROCESSABLE_ENTITY = 422;\r\nexports.LOCKED = 423;\r\nexports.FAILED_DEPENDENCY = 424;\r\nexports.UNORDERED_COLLECTION = 425;\r\nexports.UPGRADE_REQUIRED = 426;\r\nexports.PRECONDITION_REQUIRED = 428;\r\nexports.TOO_MANY_REQUESTS = 429;\r\nexports.REQUEST_HEADER_FIELDS_TOO_LARGE = 431;\r\nexports.INTERNAL_SERVER_ERROR = 500;\r\nexports.NOT_IMPLEMENTED = 501;\r\nexports.BAD_GATEWAY = 502;\r\nexports.SERVICE_UNAVAILABLE = 503;\r\nexports.GATEWAY_TIME_OUT = 504;\r\nexports.HTTP_VERSION_NOT_SUPPORTED = 505;\r\nexports.VARIANT_ALSO_NEGOTIATES = 506;\r\nexports.INSUFFICIENT_STORAGE = 507;\r\nexports.BANDWIDTH_LIMIT_EXCEEDED = 509;\r\nexports.NOT_EXTENDED = 510;\r\nexports.NETWORK_AUTHENTICATION_REQUIRED = 511;\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js?')},"./node_modules/@iiif/vocabulary/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar AnnotationMotivation;\n(function (AnnotationMotivation) {\n AnnotationMotivation["BOOKMARKING"] = "oa:bookmarking";\n AnnotationMotivation["CLASSIFYING"] = "oa:classifying";\n AnnotationMotivation["COMMENTING"] = "oa:commenting";\n AnnotationMotivation["DESCRIBING"] = "oa:describing";\n AnnotationMotivation["EDITING"] = "oa:editing";\n AnnotationMotivation["HIGHLIGHTING"] = "oa:highlighting";\n AnnotationMotivation["IDENTIFYING"] = "oa:identifying";\n AnnotationMotivation["LINKING"] = "oa:linking";\n AnnotationMotivation["MODERATING"] = "oa:moderating";\n AnnotationMotivation["PAINTING"] = "sc:painting";\n AnnotationMotivation["QUESTIONING"] = "oa:questioning";\n AnnotationMotivation["REPLYING"] = "oa:replying";\n AnnotationMotivation["TAGGING"] = "oa:tagging";\n AnnotationMotivation["TRANSCRIBING"] = "oad:transcribing";\n})(AnnotationMotivation = exports.AnnotationMotivation || (exports.AnnotationMotivation = {}));\nvar Behavior;\n(function (Behavior) {\n Behavior["AUTO_ADVANCE"] = "auto-advance";\n Behavior["CONTINUOUS"] = "continuous";\n Behavior["FACING_PAGES"] = "facing-pages";\n Behavior["HIDDEN"] = "hidden";\n Behavior["INDIVIDUALS"] = "individuals";\n Behavior["MULTI_PART"] = "multi-part";\n Behavior["NO_NAV"] = "no-nav";\n Behavior["NON_PAGED"] = "non-paged";\n Behavior["PAGED"] = "paged";\n Behavior["REPEAT"] = "repeat";\n Behavior["SEQUENCE"] = "sequence";\n Behavior["THUMBNAIL_NAV"] = "thumbnail-nav";\n Behavior["TOGETHER"] = "together";\n Behavior["UNORDERED"] = "unordered";\n})(Behavior = exports.Behavior || (exports.Behavior = {}));\nvar ExternalResourceType;\n(function (ExternalResourceType) {\n ExternalResourceType["CANVAS"] = "canvas";\n ExternalResourceType["CHOICE"] = "choice";\n ExternalResourceType["OA_CHOICE"] = "oa:choice";\n ExternalResourceType["CONTENT_AS_TEXT"] = "contentastext";\n ExternalResourceType["DATASET"] = "dataset";\n ExternalResourceType["DOCUMENT"] = "document";\n ExternalResourceType["IMAGE"] = "image";\n ExternalResourceType["MODEL"] = "model";\n ExternalResourceType["MOVING_IMAGE"] = "movingimage";\n ExternalResourceType["PDF"] = "pdf";\n ExternalResourceType["PHYSICAL_OBJECT"] = "physicalobject";\n ExternalResourceType["SOUND"] = "sound";\n ExternalResourceType["TEXT"] = "text";\n ExternalResourceType["TEXTUALBODY"] = "textualbody";\n ExternalResourceType["VIDEO"] = "video";\n})(ExternalResourceType = exports.ExternalResourceType || (exports.ExternalResourceType = {}));\nvar IIIFResourceType;\n(function (IIIFResourceType) {\n IIIFResourceType["ANNOTATION"] = "annotation";\n IIIFResourceType["CANVAS"] = "canvas";\n IIIFResourceType["COLLECTION"] = "collection";\n IIIFResourceType["MANIFEST"] = "manifest";\n IIIFResourceType["RANGE"] = "range";\n IIIFResourceType["SEQUENCE"] = "sequence";\n})(IIIFResourceType = exports.IIIFResourceType || (exports.IIIFResourceType = {}));\nvar MediaType;\n(function (MediaType) {\n MediaType["AUDIO_MP4"] = "audio/mp4";\n MediaType["CORTO"] = "application/corto";\n MediaType["DICOM"] = "application/dicom";\n MediaType["DRACO"] = "application/draco";\n MediaType["EPUB"] = "application/epub+zip";\n MediaType["GIRDER"] = "image/vnd.kitware.girder";\n MediaType["GLB"] = "model/gltf-binary";\n MediaType["GLTF"] = "model/gltf+json";\n MediaType["IIIF_PRESENTATION_2"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/2/context.json\\"";\n MediaType["IIIF_PRESENTATION_3"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/3/context.json\\"";\n MediaType["JPG"] = "image/jpeg";\n MediaType["M3U8"] = "application/vnd.apple.mpegurl";\n MediaType["MP3"] = "audio/mp3";\n MediaType["MPEG_DASH"] = "application/dash+xml";\n MediaType["OBJ"] = "text/plain";\n MediaType["OPF"] = "application/oebps-package+xml";\n MediaType["PDF"] = "application/pdf";\n MediaType["PLY"] = "application/ply";\n MediaType["THREEJS"] = "application/vnd.threejs+json";\n MediaType["USDZ"] = "model/vnd.usd+zip";\n MediaType["VIDEO_MP4"] = "video/mp4";\n MediaType["WAV"] = "audio/wav";\n MediaType["WEBM"] = "video/webm";\n})(MediaType = exports.MediaType || (exports.MediaType = {}));\nvar RenderingFormat;\n(function (RenderingFormat) {\n RenderingFormat["DOC"] = "application/msword";\n RenderingFormat["DOCX"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";\n RenderingFormat["PDF"] = "application/pdf";\n})(RenderingFormat = exports.RenderingFormat || (exports.RenderingFormat = {}));\nvar ServiceProfile;\n(function (ServiceProfile) {\n // image api\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level0";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level1";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level2";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level0";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level1";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level2";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2";\n ServiceProfile["IMAGE_1_LEVEL_0"] = "http://iiif.io/api/image/1/level0.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/1/profiles/level0.json";\n ServiceProfile["IMAGE_1_LEVEL_1"] = "http://iiif.io/api/image/1/level1.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/1/profiles/level1.json";\n ServiceProfile["IMAGE_1_LEVEL_2"] = "http://iiif.io/api/image/1/level2.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/1/profiles/level2.json";\n ServiceProfile["IMAGE_2_LEVEL_0"] = "http://iiif.io/api/image/2/level0.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/2/profiles/level0.json";\n ServiceProfile["IMAGE_2_LEVEL_1"] = "http://iiif.io/api/image/2/level1.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/2/profiles/level1.json";\n ServiceProfile["IMAGE_2_LEVEL_2"] = "http://iiif.io/api/image/2/level2.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/2/profiles/level2.json";\n // auth api\n ServiceProfile["AUTH_0_CLICK_THROUGH"] = "http://iiif.io/api/auth/0/login/clickthrough";\n ServiceProfile["AUTH_0_LOGIN"] = "http://iiif.io/api/auth/0/login";\n ServiceProfile["AUTH_0_LOGOUT"] = "http://iiif.io/api/auth/0/logout";\n ServiceProfile["AUTH_0_RESTRICTED"] = "http://iiif.io/api/auth/0/login/restricted";\n ServiceProfile["AUTH_0_TOKEN"] = "http://iiif.io/api/auth/0/token";\n ServiceProfile["AUTH_1_CLICK_THROUGH"] = "http://iiif.io/api/auth/1/clickthrough";\n ServiceProfile["AUTH_1_EXTERNAL"] = "http://iiif.io/api/auth/1/external";\n ServiceProfile["AUTH_1_KIOSK"] = "http://iiif.io/api/auth/1/kiosk";\n ServiceProfile["AUTH_1_LOGIN"] = "http://iiif.io/api/auth/1/login";\n ServiceProfile["AUTH_1_LOGOUT"] = "http://iiif.io/api/auth/1/logout";\n ServiceProfile["AUTH_1_PROBE"] = "http://iiif.io/api/auth/1/probe";\n ServiceProfile["AUTH_1_TOKEN"] = "http://iiif.io/api/auth/1/token";\n // search api\n ServiceProfile["SEARCH_0"] = "http://iiif.io/api/search/0/search";\n ServiceProfile["SEARCH_0_AUTO_COMPLETE"] = "http://iiif.io/api/search/0/autocomplete";\n ServiceProfile["SEARCH_1"] = "http://iiif.io/api/search/1/search";\n ServiceProfile["SEARCH_1_AUTO_COMPLETE"] = "http://iiif.io/api/search/1/autocomplete";\n // extensions\n ServiceProfile["TRACKING_EXTENSIONS"] = "http://universalviewer.io/tracking-extensions-profile";\n ServiceProfile["UI_EXTENSIONS"] = "http://universalviewer.io/ui-extensions-profile";\n ServiceProfile["PRINT_EXTENSIONS"] = "http://universalviewer.io/print-extensions-profile";\n ServiceProfile["SHARE_EXTENSIONS"] = "http://universalviewer.io/share-extensions-profile";\n ServiceProfile["DOWNLOAD_EXTENSIONS"] = "http://universalviewer.io/download-extensions-profile";\n // other\n ServiceProfile["OTHER_MANIFESTATIONS"] = "http://iiif.io/api/otherManifestations.json";\n ServiceProfile["IXIF"] = "http://wellcomelibrary.org/ld/ixif/0/alpha.json";\n})(ServiceProfile = exports.ServiceProfile || (exports.ServiceProfile = {}));\nvar ServiceType;\n(function (ServiceType) {\n ServiceType["IMAGE_SERVICE_2"] = "ImageService2";\n ServiceType["IMAGE_SERVICE_3"] = "ImageService3";\n})(ServiceType = exports.ServiceType || (exports.ServiceType = {}));\nvar ViewingDirection;\n(function (ViewingDirection) {\n ViewingDirection["BOTTOM_TO_TOP"] = "bottom-to-top";\n ViewingDirection["LEFT_TO_RIGHT"] = "left-to-right";\n ViewingDirection["RIGHT_TO_LEFT"] = "right-to-left";\n ViewingDirection["TOP_TO_BOTTOM"] = "top-to-bottom";\n})(ViewingDirection = exports.ViewingDirection || (exports.ViewingDirection = {}));\nvar ViewingHint;\n(function (ViewingHint) {\n ViewingHint["CONTINUOUS"] = "continuous";\n ViewingHint["INDIVIDUALS"] = "individuals";\n ViewingHint["NON_PAGED"] = "non-paged";\n ViewingHint["PAGED"] = "paged";\n ViewingHint["TOP"] = "top";\n})(ViewingHint = exports.ViewingHint || (exports.ViewingHint = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@iiif/vocabulary/dist-commonjs/index.js?')},"./node_modules/color-name/index.js":module=>{"use strict";eval('\r\n\r\nmodule.exports = {\r\n\t"aliceblue": [240, 248, 255],\r\n\t"antiquewhite": [250, 235, 215],\r\n\t"aqua": [0, 255, 255],\r\n\t"aquamarine": [127, 255, 212],\r\n\t"azure": [240, 255, 255],\r\n\t"beige": [245, 245, 220],\r\n\t"bisque": [255, 228, 196],\r\n\t"black": [0, 0, 0],\r\n\t"blanchedalmond": [255, 235, 205],\r\n\t"blue": [0, 0, 255],\r\n\t"blueviolet": [138, 43, 226],\r\n\t"brown": [165, 42, 42],\r\n\t"burlywood": [222, 184, 135],\r\n\t"cadetblue": [95, 158, 160],\r\n\t"chartreuse": [127, 255, 0],\r\n\t"chocolate": [210, 105, 30],\r\n\t"coral": [255, 127, 80],\r\n\t"cornflowerblue": [100, 149, 237],\r\n\t"cornsilk": [255, 248, 220],\r\n\t"crimson": [220, 20, 60],\r\n\t"cyan": [0, 255, 255],\r\n\t"darkblue": [0, 0, 139],\r\n\t"darkcyan": [0, 139, 139],\r\n\t"darkgoldenrod": [184, 134, 11],\r\n\t"darkgray": [169, 169, 169],\r\n\t"darkgreen": [0, 100, 0],\r\n\t"darkgrey": [169, 169, 169],\r\n\t"darkkhaki": [189, 183, 107],\r\n\t"darkmagenta": [139, 0, 139],\r\n\t"darkolivegreen": [85, 107, 47],\r\n\t"darkorange": [255, 140, 0],\r\n\t"darkorchid": [153, 50, 204],\r\n\t"darkred": [139, 0, 0],\r\n\t"darksalmon": [233, 150, 122],\r\n\t"darkseagreen": [143, 188, 143],\r\n\t"darkslateblue": [72, 61, 139],\r\n\t"darkslategray": [47, 79, 79],\r\n\t"darkslategrey": [47, 79, 79],\r\n\t"darkturquoise": [0, 206, 209],\r\n\t"darkviolet": [148, 0, 211],\r\n\t"deeppink": [255, 20, 147],\r\n\t"deepskyblue": [0, 191, 255],\r\n\t"dimgray": [105, 105, 105],\r\n\t"dimgrey": [105, 105, 105],\r\n\t"dodgerblue": [30, 144, 255],\r\n\t"firebrick": [178, 34, 34],\r\n\t"floralwhite": [255, 250, 240],\r\n\t"forestgreen": [34, 139, 34],\r\n\t"fuchsia": [255, 0, 255],\r\n\t"gainsboro": [220, 220, 220],\r\n\t"ghostwhite": [248, 248, 255],\r\n\t"gold": [255, 215, 0],\r\n\t"goldenrod": [218, 165, 32],\r\n\t"gray": [128, 128, 128],\r\n\t"green": [0, 128, 0],\r\n\t"greenyellow": [173, 255, 47],\r\n\t"grey": [128, 128, 128],\r\n\t"honeydew": [240, 255, 240],\r\n\t"hotpink": [255, 105, 180],\r\n\t"indianred": [205, 92, 92],\r\n\t"indigo": [75, 0, 130],\r\n\t"ivory": [255, 255, 240],\r\n\t"khaki": [240, 230, 140],\r\n\t"lavender": [230, 230, 250],\r\n\t"lavenderblush": [255, 240, 245],\r\n\t"lawngreen": [124, 252, 0],\r\n\t"lemonchiffon": [255, 250, 205],\r\n\t"lightblue": [173, 216, 230],\r\n\t"lightcoral": [240, 128, 128],\r\n\t"lightcyan": [224, 255, 255],\r\n\t"lightgoldenrodyellow": [250, 250, 210],\r\n\t"lightgray": [211, 211, 211],\r\n\t"lightgreen": [144, 238, 144],\r\n\t"lightgrey": [211, 211, 211],\r\n\t"lightpink": [255, 182, 193],\r\n\t"lightsalmon": [255, 160, 122],\r\n\t"lightseagreen": [32, 178, 170],\r\n\t"lightskyblue": [135, 206, 250],\r\n\t"lightslategray": [119, 136, 153],\r\n\t"lightslategrey": [119, 136, 153],\r\n\t"lightsteelblue": [176, 196, 222],\r\n\t"lightyellow": [255, 255, 224],\r\n\t"lime": [0, 255, 0],\r\n\t"limegreen": [50, 205, 50],\r\n\t"linen": [250, 240, 230],\r\n\t"magenta": [255, 0, 255],\r\n\t"maroon": [128, 0, 0],\r\n\t"mediumaquamarine": [102, 205, 170],\r\n\t"mediumblue": [0, 0, 205],\r\n\t"mediumorchid": [186, 85, 211],\r\n\t"mediumpurple": [147, 112, 219],\r\n\t"mediumseagreen": [60, 179, 113],\r\n\t"mediumslateblue": [123, 104, 238],\r\n\t"mediumspringgreen": [0, 250, 154],\r\n\t"mediumturquoise": [72, 209, 204],\r\n\t"mediumvioletred": [199, 21, 133],\r\n\t"midnightblue": [25, 25, 112],\r\n\t"mintcream": [245, 255, 250],\r\n\t"mistyrose": [255, 228, 225],\r\n\t"moccasin": [255, 228, 181],\r\n\t"navajowhite": [255, 222, 173],\r\n\t"navy": [0, 0, 128],\r\n\t"oldlace": [253, 245, 230],\r\n\t"olive": [128, 128, 0],\r\n\t"olivedrab": [107, 142, 35],\r\n\t"orange": [255, 165, 0],\r\n\t"orangered": [255, 69, 0],\r\n\t"orchid": [218, 112, 214],\r\n\t"palegoldenrod": [238, 232, 170],\r\n\t"palegreen": [152, 251, 152],\r\n\t"paleturquoise": [175, 238, 238],\r\n\t"palevioletred": [219, 112, 147],\r\n\t"papayawhip": [255, 239, 213],\r\n\t"peachpuff": [255, 218, 185],\r\n\t"peru": [205, 133, 63],\r\n\t"pink": [255, 192, 203],\r\n\t"plum": [221, 160, 221],\r\n\t"powderblue": [176, 224, 230],\r\n\t"purple": [128, 0, 128],\r\n\t"rebeccapurple": [102, 51, 153],\r\n\t"red": [255, 0, 0],\r\n\t"rosybrown": [188, 143, 143],\r\n\t"royalblue": [65, 105, 225],\r\n\t"saddlebrown": [139, 69, 19],\r\n\t"salmon": [250, 128, 114],\r\n\t"sandybrown": [244, 164, 96],\r\n\t"seagreen": [46, 139, 87],\r\n\t"seashell": [255, 245, 238],\r\n\t"sienna": [160, 82, 45],\r\n\t"silver": [192, 192, 192],\r\n\t"skyblue": [135, 206, 235],\r\n\t"slateblue": [106, 90, 205],\r\n\t"slategray": [112, 128, 144],\r\n\t"slategrey": [112, 128, 144],\r\n\t"snow": [255, 250, 250],\r\n\t"springgreen": [0, 255, 127],\r\n\t"steelblue": [70, 130, 180],\r\n\t"tan": [210, 180, 140],\r\n\t"teal": [0, 128, 128],\r\n\t"thistle": [216, 191, 216],\r\n\t"tomato": [255, 99, 71],\r\n\t"turquoise": [64, 224, 208],\r\n\t"violet": [238, 130, 238],\r\n\t"wheat": [245, 222, 179],\r\n\t"white": [255, 255, 255],\r\n\t"whitesmoke": [245, 245, 245],\r\n\t"yellow": [255, 255, 0],\r\n\t"yellowgreen": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-name/index.js?')},"./node_modules/color-string/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\nvar swizzle = __webpack_require__(/*! simple-swizzle */ \"./node_modules/simple-swizzle/index.js\");\nvar hasOwnProperty = Object.hasOwnProperty;\n\nvar reverseNames = Object.create(null);\n\n// create a list of reverse color names\nfor (var name in colorNames) {\n\tif (hasOwnProperty.call(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nvar cs = module.exports = {\n\tto: {},\n\tget: {}\n};\n\ncs.get = function (string) {\n\tvar prefix = string.substring(0, 3).toLowerCase();\n\tvar val;\n\tvar model;\n\tswitch (prefix) {\n\t\tcase 'hsl':\n\t\t\tval = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\tcase 'hwb':\n\t\t\tval = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tval = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t}\n\n\tif (!val) {\n\t\treturn null;\n\t}\n\n\treturn {model: model, value: val};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar abbr = /^#([a-f0-9]{3,4})$/i;\n\tvar hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;\n\tvar rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar keyword = /^(\\w+)$/;\n\n\tvar rgb = [0, 0, 0, 1];\n\tvar match;\n\tvar i;\n\tvar hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tvar i2 = i * 2;\n\t\t\trgb[i] = parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i + 1], 0);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!hasOwnProperty.call(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hsl = /^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hsl);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar s = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar l = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hwb = /^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hwb);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar w = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar b = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function () {\n\tvar rgba = swizzle(arguments);\n\n\tvar r = Math.round(rgba[0] / 255 * 100);\n\tvar g = Math.round(rgba[1] / 255 * 100);\n\tvar b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function () {\n\tvar hsla = swizzle(arguments);\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function () {\n\tvar hwba = swizzle(arguments);\n\n\tvar a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// helpers\nfunction clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n\tvar str = Math.round(num).toString(16).toUpperCase();\n\treturn (str.length < 2) ? '0' + str : str;\n}\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-string/index.js?")},"./node_modules/is-arrayish/index.js":module=>{eval("module.exports = function isArrayish(obj) {\n\tif (!obj || typeof obj === 'string') {\n\t\treturn false;\n\t}\n\n\treturn obj instanceof Array || Array.isArray(obj) ||\n\t\t(obj.length >= 0 && (obj.splice instanceof Function ||\n\t\t\t(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/is-arrayish/index.js?")},"./node_modules/isomorphic-unfetch/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('function r(m) {\n\treturn (m && m.default) || m;\n}\nmodule.exports = __webpack_require__.g.fetch =\n\t__webpack_require__.g.fetch ||\n\t(typeof process == "undefined"\n\t\t? r(__webpack_require__(/*! unfetch */ "./node_modules/unfetch/dist/unfetch.module.js"))\n\t\t: function (url, opts) {\n\t\t\t\tif (typeof url === "string" || url instanceof URL) {\n\t\t\t\t\turl = String(url).replace(/^\\/\\//g, "https://");\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! node-fetch */ "node-fetch", 23)).then((m) => r(m)(url, opts));\n\t\t });\n\n\n//# sourceURL=webpack://manifesto/./node_modules/isomorphic-unfetch/index.js?')},"./node_modules/lodash/_Symbol.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_Symbol.js?')},"./node_modules/lodash/_arrayPush.js":module=>{eval("/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_arrayPush.js?")},"./node_modules/lodash/_baseFlatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"),\n isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js");\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseFlatten.js?')},"./node_modules/lodash/_baseGetTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),\n objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");\n\n/** `Object#toString` result references. */\nvar nullTag = \'[object Null]\',\n undefinedTag = \'[object Undefined]\';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseGetTag.js?')},"./node_modules/lodash/_baseIsArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");\n\n/** `Object#toString` result references. */\nvar argsTag = \'[object Arguments]\';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseIsArguments.js?')},"./node_modules/lodash/_freeGlobal.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\nmodule.exports = freeGlobal;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_freeGlobal.js?")},"./node_modules/lodash/_getRawTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_getRawTag.js?')},"./node_modules/lodash/_isFlattenable.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"),\n isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js");\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_isFlattenable.js?')},"./node_modules/lodash/_objectToString.js":module=>{eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_objectToString.js?")},"./node_modules/lodash/_root.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_root.js?")},"./node_modules/lodash/flatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flatten.js?')},"./node_modules/lodash/flattenDeep.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flattenDeep.js?')},"./node_modules/lodash/isArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ \"./node_modules/lodash/_baseIsArguments.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArguments.js?")},"./node_modules/lodash/isArray.js":module=>{eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArray.js?")},"./node_modules/lodash/isObjectLike.js":module=>{eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isObjectLike.js?")},"./node_modules/simple-swizzle/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar isArrayish = __webpack_require__(/*! is-arrayish */ "./node_modules/is-arrayish/index.js");\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\nvar swizzle = module.exports = function swizzle(args) {\n\tvar results = [];\n\n\tfor (var i = 0, len = args.length; i < len; i++) {\n\t\tvar arg = args[i];\n\n\t\tif (isArrayish(arg)) {\n\t\t\t// http://jsperf.com/javascript-array-concat-vs-push/98\n\t\t\tresults = concat.call(results, slice.call(arg));\n\t\t} else {\n\t\t\tresults.push(arg);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nswizzle.wrap = function (fn) {\n\treturn function () {\n\t\treturn fn(swizzle(arguments));\n\t};\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/simple-swizzle/index.js?')},"./src/Annotation.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Annotation = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar Annotation = /** @class */ (function (_super) {\n __extends(Annotation, _super);\n function Annotation(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n /**\n In spite of its name, this method returns an array of objects, each of which\n represents a potential body annotations\n \n @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ }\n **/\n Annotation.prototype.getBody = function () {\n var bodies = [];\n var body = this.getProperty("body");\n // the following is intended to handle the following cases for\n /// the raw json of the body property of __jsonld\n // -- body is an array, each element of which is parsed\n // == body is an object with property items, each item is parsed\n // -- body is parsed\n if (body) {\n for (var _i = 0, _a = [].concat(body); _i < _a.length; _i++) {\n var bd = _a[_i];\n var items = bd.items;\n if (items)\n bodies = bodies.concat(this.parseBodiesFromItemsList(items));\n else\n bodies.push(this.parseSingletonBody(bd));\n }\n }\n return bodies;\n };\n Object.defineProperty(Annotation.prototype, "Body", {\n get: function () { return this.getBody(); },\n enumerable: false,\n configurable: true\n });\n /**\n auxiliary function to getBody; intended to hande an object that has an element items\n which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/\n seems to be the use case for this\n **/\n Annotation.prototype.parseBodiesFromItemsList = function (rawbodies) {\n var retVal = [];\n for (var _i = 0, _a = [].concat(rawbodies); _i < _a.length; _i++) {\n var bd = _a[_i];\n retVal.push(this.parseSingletonBody(bd));\n }\n return retVal;\n };\n /**\n auxiliary function to parseBodiesFromItemsList and getBody, this is the last\n step on recursively going through collections of bodies.\n **/\n Annotation.prototype.parseSingletonBody = function (rawbody) {\n if (rawbody.type === "SpecificResource") {\n return new internal_1.SpecificResource(rawbody, this.options);\n }\n else {\n return internal_1.AnnotationBodyParser.BuildFromJson(rawbody, this.options);\n }\n };\n /**\n Developer Note: 8 April 2024\n getBody3D function was developed in the early stages of the 3D API Feb-March 2024\n as alternative to the existing Annotation getBody function, but the signature for\n getBody3D was chosen to be a single object instance, not an array.\n \n At this stage, the merging of the 2D API anf the draft 3D API has been completed, so\n 3D applications can use the getBody() function to retrieve the body of an Annotation intended\n to target a scene. For compatibily the return value of the function is still an\n array.\n \n 3D clients using getBody are responsible for choosing the appropriate instance from the\n returned array. In most cases this will be the sole 0th element.\n **/\n Annotation.prototype.getBody3D = function () {\n console.warn("Annotation.getBody3D is deprecated: replace with getBody3D() with getBody()[0]");\n return this.getBody()[0];\n };\n Annotation.prototype.getMotivation = function () {\n var motivation = this.getProperty("motivation");\n if (motivation) {\n //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation);\n return motivation;\n }\n return null;\n };\n // open annotation\n Annotation.prototype.getOn = function () {\n return this.getProperty("on");\n };\n Annotation.prototype.getTarget = function () {\n var rawTarget = this.getPropertyAsObject("target");\n if (rawTarget.isIRI)\n return rawTarget;\n if (rawTarget.type && rawTarget.type == "SpecificResource") {\n return new internal_1.SpecificResource(rawTarget, this.options);\n }\n else {\n throw new Error("unknown target specified");\n }\n };\n Object.defineProperty(Annotation.prototype, "Target", {\n get: function () { return this.getTarget(); },\n enumerable: false,\n configurable: true\n });\n Annotation.prototype.getResource = function () {\n return new internal_1.Resource(this.getProperty("resource"), this.options);\n };\n Object.defineProperty(Annotation.prototype, "LookAtLocation", {\n /**\n * A 3D point coordinate object for the location of an Annotation\n * to satisfy the requirements of the lookAt property of camera and\n * spotlight resources, according to the draft v4 API as of April 1 2024\n *\n * Is the position of the point for a target which is a SpecificResource with\n * a PointSelector\n * Otherwise, for example when the annotation target is an entire Scene, the\n * location for lookAt is the origin (0,0,0)\n **/\n get: function () {\n var _a;\n var target = this.getTarget();\n if (target.isSpecificResource && ((_a = target.getSelector()) === null || _a === void 0 ? void 0 : _a.isPointSelector))\n return target.getSelector().getLocation();\n else\n return new threejs_math_1.Vector3(0.0, 0.0, 0.0);\n },\n enumerable: false,\n configurable: true\n });\n return Annotation;\n}(internal_1.ManifestResource));\nexports.Annotation = Annotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Annotation.ts?')},"./src/AnnotationBody.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBody = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\nWith the 3D extensions to the IIIF Presentation API the name of this\nclass is misleading, but for now is being retained for the sake backward\ncompatibility with earlier manifesto code and tests.\n\nThe 3D extensions allow that the body property of an annotation can be\na light, camera, or model, or a SpecificResource object wrapping a light, camera,\nor model.\n**/\nvar AnnotationBody = /** @class */ (function (_super) {\n __extends(AnnotationBody, _super);\n function AnnotationBody(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = true;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = false;\n // following class members were added to support 3D and mixed 2D/3D content\n // these boolean switches will be appropriately set when the manifest json is parsed\n _this.isModel = true;\n _this.isLight = false;\n _this.isCamera = false;\n return _this;\n }\n // Format, Type, Width, and Height are the body properties supported\n // in the code that supports Presentation 3\n AnnotationBody.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return internal_1.Utils.getMediaType(format);\n }\n return null;\n };\n AnnotationBody.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return (internal_1.Utils.normaliseType(this.getProperty("type")));\n }\n return null;\n };\n AnnotationBody.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n AnnotationBody.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n return AnnotationBody;\n}(internal_1.ManifestResource));\nexports.AnnotationBody = AnnotationBody;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBody.ts?')},"./src/AnnotationBodyParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBodyParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LightTypes = ["AmbientLight", "DirectionalLight", "SpotLight"];\nvar CameraTypes = ["PerspectiveCamera", "OrthographicCamera"];\nvar DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"];\nvar AnnotationBodyParser = /** @class */ (function () {\n function AnnotationBodyParser() {\n }\n AnnotationBodyParser.BuildFromJson = function (jsonld, options) {\n if (DisplayedTypes.includes(jsonld.type))\n return new internal_1.AnnotationBody(jsonld, options);\n else if (LightTypes.includes(jsonld.type))\n return new internal_1.Light(jsonld, options);\n else if (CameraTypes.includes(jsonld.type))\n return new internal_1.Camera(jsonld, options);\n else\n throw new Error("unimplemented type for AnnotationBody: " + jsonld.type);\n };\n return AnnotationBodyParser;\n}());\nexports.AnnotationBodyParser = AnnotationBodyParser;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBodyParser.ts?')},"./src/AnnotationList.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationList = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationList = /** @class */ (function (_super) {\n __extends(AnnotationList, _super);\n function AnnotationList(label, jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.label = label;\n _this.options = options;\n return _this;\n }\n AnnotationList.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n AnnotationList.prototype.getLabel = function () {\n return this.label;\n };\n AnnotationList.prototype.getResources = function () {\n var _this = this;\n var resources = this.getProperty("resources");\n return resources.map(function (resource) { return new internal_1.Annotation(resource, _this.options); });\n };\n AnnotationList.prototype.load = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.isLoaded) {\n resolve(_this);\n }\n else {\n var id = _this.__jsonld.id;\n if (!id) {\n id = _this.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id)\n .then(function (data) {\n _this.__jsonld = data;\n _this.context = _this.getProperty("context");\n _this.id = _this.getProperty("id");\n _this.isLoaded = true;\n resolve(_this);\n })\n .catch(reject);\n }\n });\n };\n return AnnotationList;\n}(internal_1.JSONLDResource));\nexports.AnnotationList = AnnotationList;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationList.ts?')},"./src/AnnotationPage.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationPage = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationPage = /** @class */ (function (_super) {\n __extends(AnnotationPage, _super);\n function AnnotationPage(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n AnnotationPage.prototype.getItems = function () {\n return this.getProperty("items");\n };\n return AnnotationPage;\n}(internal_1.ManifestResource));\nexports.AnnotationPage = AnnotationPage;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationPage.ts?')},"./src/Camera.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Camera = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Camera = /** @class */ (function (_super) {\n __extends(Camera, _super);\n function Camera(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isModel = false;\n _this.isLight = false;\n _this.isCamera = true;\n return _this;\n }\n Object.defineProperty(Camera.prototype, "isPerspectiveCamera", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "perspectivecamera");\n },\n enumerable: false,\n configurable: true\n });\n /**\n @returns full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n Camera.prototype.getFieldOfView = function () {\n if (this.isPerspectiveCamera) {\n var value = this.getProperty("fieldOfView");\n if (value)\n return value;\n else\n return 45.0;\n }\n else\n return undefined;\n };\n Object.defineProperty(Camera.prototype, "FieldOfView", {\n /**\n Full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n get: function () { return this.getFieldOfView(); },\n enumerable: false,\n configurable: true\n });\n /**\n * @return : if not null, is either a PointSelector, or an object\n * with an id matching the id of an Annotation instance.\n **/\n Camera.prototype.getLookAt = function () {\n var rawObj = this.getPropertyAsObject("lookAt");\n var rawType = (rawObj["type"] || rawObj["@type"]);\n if (rawType == "Annotation") {\n return rawObj;\n }\n if (rawType == "PointSelector") {\n return new internal_1.PointSelector(rawObj);\n }\n throw new Error(\'unidentified value of lookAt ${rawType}\');\n };\n Object.defineProperty(Camera.prototype, "LookAt", {\n get: function () { return this.getLookAt(); },\n enumerable: false,\n configurable: true\n });\n return Camera;\n}(internal_1.AnnotationBody));\nexports.Camera = Camera;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/Camera.ts?')},"./src/Canvas.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Canvas = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n// @ts-ignore\nvar flatten_1 = __importDefault(__webpack_require__(/*! lodash/flatten */ "./node_modules/lodash/flatten.js"));\n// @ts-ignore\nvar flattenDeep_1 = __importDefault(__webpack_require__(/*! lodash/flattenDeep */ "./node_modules/lodash/flattenDeep.js"));\nvar Canvas = /** @class */ (function (_super) {\n __extends(Canvas, _super);\n function Canvas(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // http://iiif.io/api/image/2.1/#canonical-uri-syntax\n Canvas.prototype.getCanonicalImageUri = function (w) {\n var id = null;\n var region = "full";\n var rotation = 0;\n var quality = "default";\n var width = w;\n var size;\n // if an info.json has been loaded\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data["@id"]) {\n id = this.externalResource.data["@id"];\n if (!width) {\n width = this.externalResource.data.width;\n }\n if (this.externalResource.data["@context"]) {\n if (this.externalResource.data["@context"].indexOf("/1.0/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1.1/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1/context.json") > -1) {\n quality = "native";\n }\n }\n }\n else {\n // info.json hasn\'t been loaded yet\n var images = void 0;\n // presentation 2.0\n images = this.getImages();\n if (images && images.length) {\n var firstImage = images[0];\n var resource = firstImage.getResource();\n var services = resource.getServices();\n if (!width) {\n width = resource.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return (internal_1.Utils.isImageProfile(service.getProfile()) ||\n internal_1.Utils.isImageServiceType(service.getIIIFResourceType()));\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === resource.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return resource.id;\n }\n }\n // presentation 3.0\n images = this.getContent();\n if (images && images.length) {\n var firstImage = images[0];\n // Developer note: Since Canvas in Presentation 3 doesn\'t use\n // SpecificResource resources in the body, force a cast\n var body = firstImage.getBody();\n var anno = body[0];\n var services = anno.getServices();\n if (!width) {\n width = anno.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return internal_1.Utils.isImageServiceType(service.getIIIFResourceType());\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === anno.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return anno.id;\n }\n }\n // todo: should this be moved to getThumbUri?\n if (!id) {\n var thumbnail = this.getProperty("thumbnail");\n if (thumbnail) {\n if (typeof thumbnail === "string") {\n return thumbnail;\n }\n else {\n if (thumbnail["@id"]) {\n return thumbnail["@id"];\n }\n else if (thumbnail.length) {\n return thumbnail[0].id;\n }\n }\n }\n }\n }\n size = width + ",";\n // trim off trailing \'/\'\n if (id && id.endsWith("/")) {\n id = id.substr(0, id.length - 1);\n }\n var uri = [id, region, size, rotation, quality + ".jpg"].join("/");\n return uri;\n };\n Canvas.prototype.getMaxDimensions = function () {\n var maxDimensions = null;\n var profile;\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data.profile) {\n profile = this.externalResource.data.profile;\n if (Array.isArray(profile)) {\n profile = profile.filter(function (p) { return p["maxWidth" || 0]; })[0];\n if (profile) {\n maxDimensions = new internal_1.Size(profile.maxWidth, profile.maxHeight ? profile.maxHeight : profile.maxWidth);\n }\n }\n }\n return maxDimensions;\n };\n // Presentation API 3.0\n Canvas.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n return content;\n };\n Canvas.prototype.getDuration = function () {\n return this.getProperty("duration");\n };\n // presentation 2.0\n Canvas.prototype.getImages = function () {\n var images = [];\n if (!this.__jsonld.images)\n return images;\n for (var i = 0; i < this.__jsonld.images.length; i++) {\n var a = this.__jsonld.images[i];\n var annotation = new internal_1.Annotation(a, this.options);\n images.push(annotation);\n }\n return images;\n };\n Canvas.prototype.getIndex = function () {\n return this.getProperty("index");\n };\n Canvas.prototype.getOtherContent = function () {\n var _this = this;\n var otherContent = Array.isArray(this.getProperty("otherContent"))\n ? this.getProperty("otherContent")\n : [this.getProperty("otherContent")];\n var canonicalComparison = function (typeA, typeB) {\n if (typeof typeA !== "string" || typeof typeB !== "string") {\n return false;\n }\n return typeA.toLowerCase() === typeA.toLowerCase();\n };\n var otherPromises = otherContent\n .filter(function (otherContent) {\n return otherContent &&\n canonicalComparison(otherContent["@type"], "sc:AnnotationList");\n })\n .map(function (annotationList, i) {\n return new internal_1.AnnotationList(annotationList["label"] || "Annotation list ".concat(i), annotationList, _this.options);\n })\n .map(function (annotationList) { return annotationList.load(); });\n return Promise.all(otherPromises);\n };\n // Prefer thumbnail service to image service if supplied and if\n // the thumbnail service can provide a satisfactory size +/- x pixels.\n // this is used to get thumb URIs *before* the info.json has been requested\n // and populate thumbnails in a viewer.\n // the publisher may also provide pre-computed fixed-size thumbs for better performance.\n //getThumbUri(width: number): string {\n //\n // var uri;\n // var images: IAnnotation[] = this.getImages();\n //\n // if (images && images.length) {\n // var firstImage = images[0];\n // var resource: IResource = firstImage.getResource();\n // var services: IService[] = resource.getServices();\n //\n // for (let i = 0; i < services.length; i++) {\n // var service: IService = services[i];\n // var id = service.id;\n //\n // if (!_endsWith(id, \'/\')) {\n // id += \'/\';\n // }\n //\n // uri = id + \'full/\' + width + \',/0/\' + Utils.getImageQuality(service.getProfile()) + \'.jpg\';\n // }\n // }\n //\n // return uri;\n //}\n //getType(): CanvasType {\n // return new CanvasType(this.getProperty(\'@type\').toLowerCase());\n //}\n Canvas.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Canvas.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Canvas.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Canvas.prototype, "imageResources", {\n get: function () {\n var _this = this;\n var resources = (0, flattenDeep_1.default)([\n this.getImages().map(function (i) { return i.getResource(); }),\n this.getContent().map(function (i) { return i.getBody(); })\n ]);\n return (0, flatten_1.default)(resources.map(function (resource) {\n switch (resource.getProperty("type").toLowerCase()) {\n case dist_commonjs_1.ExternalResourceType.CHOICE:\n case dist_commonjs_1.ExternalResourceType.OA_CHOICE:\n return new Canvas({\n images: (0, flatten_1.default)([\n resource.getProperty("default"),\n resource.getProperty("item")\n ]).map(function (r) { return ({ resource: r }); })\n }, _this.options)\n .getImages()\n .map(function (i) { return i.getResource(); });\n default:\n return resource;\n }\n }));\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "resourceAnnotations", {\n get: function () {\n return (0, flattenDeep_1.default)([this.getImages(), this.getContent()]);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns a given resource Annotation, based on a contained resource or body\n * id\n */\n Canvas.prototype.resourceAnnotation = function (id) {\n return this.resourceAnnotations.find(function (anno) {\n return anno.getResource().id === id ||\n (0, flatten_1.default)(new Array(anno.getBody())).some(function (body) { return body.id === id; });\n });\n };\n /**\n * Returns the fragment placement values if a resourceAnnotation is placed on\n * a canvas somewhere besides the full extent\n */\n Canvas.prototype.onFragment = function (id) {\n var resourceAnnotation = this.resourceAnnotation(id);\n if (!resourceAnnotation)\n return undefined;\n // IIIF v2\n var on = resourceAnnotation.getProperty("on");\n // IIIF v3\n var target = resourceAnnotation.getProperty("target");\n if (!on || !target) {\n return undefined;\n }\n var fragmentMatch = (on || target).match(/xywh=(.*)$/);\n if (!fragmentMatch)\n return undefined;\n return fragmentMatch[1].split(",").map(function (str) { return parseInt(str, 10); });\n };\n Object.defineProperty(Canvas.prototype, "iiifImageResources", {\n get: function () {\n return this.imageResources.filter(function (r) { return r && r.getServices()[0] && r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "imageServiceIds", {\n get: function () {\n return this.iiifImageResources.map(function (r) { return r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "aspectRatio", {\n get: function () {\n return this.getWidth() / this.getHeight();\n },\n enumerable: false,\n configurable: true\n });\n return Canvas;\n}(internal_1.Resource));\nexports.Canvas = Canvas;\n\n\n//# sourceURL=webpack://manifesto/./src/Canvas.ts?')},"./src/Collection.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Collection = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Collection = /** @class */ (function (_super) {\n __extends(Collection, _super);\n function Collection(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._collections = null;\n _this._manifests = null;\n jsonld.__collection = _this;\n return _this;\n }\n Collection.prototype.getCollections = function () {\n if (this._collections) {\n return this._collections;\n }\n return (this._collections = (this.items.filter(function (m) { return m.isCollection(); })));\n };\n Collection.prototype.getManifests = function () {\n if (this._manifests) {\n return this._manifests;\n }\n return (this._manifests = (this.items.filter(function (m) { return m.isManifest(); })));\n };\n Collection.prototype.getCollectionByIndex = function (collectionIndex) {\n var collections = this.getCollections();\n var collection;\n for (var i = 0; i < collections.length; i++) {\n var c = collections[i];\n if (c.index === collectionIndex) {\n collection = c;\n }\n }\n if (collection) {\n collection.options.index = collectionIndex;\n // id for collection MUST be dereferenceable\n return collection.load();\n }\n else {\n throw new Error("Collection index not found");\n }\n };\n Collection.prototype.getManifestByIndex = function (manifestIndex) {\n var manifests = this.getManifests();\n var manifest;\n for (var i = 0; i < manifests.length; i++) {\n var m = manifests[i];\n if (m.index === manifestIndex) {\n manifest = m;\n }\n }\n if (manifest) {\n manifest.options.index = manifestIndex;\n return manifest.load();\n }\n else {\n throw new Error("Manifest index not found");\n }\n };\n Collection.prototype.getTotalCollections = function () {\n return this.getCollections().length;\n };\n Collection.prototype.getTotalManifests = function () {\n return this.getManifests().length;\n };\n Collection.prototype.getTotalItems = function () {\n return this.items.length;\n };\n Collection.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n return dist_commonjs_1.ViewingDirection.LEFT_TO_RIGHT;\n };\n /**\n * Note: this only will return the first behavior as per the manifesto convention\n * IIIF v3 supports multiple behaviors\n */\n Collection.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Collection.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n /**\n * Get a tree of sub collections and manifests, using each child manifest\'s first \'top\' range.\n */\n Collection.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n //console.log("get default tree for ", this.id);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n this._parseManifests(this);\n this._parseCollections(this);\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Collection.prototype._parseManifests = function (parentCollection) {\n if (parentCollection.getManifests() &&\n parentCollection.getManifests().length) {\n for (var i = 0; i < parentCollection.getManifests().length; i++) {\n var manifest = parentCollection.getManifests()[i];\n var tree = manifest.getDefaultTree();\n tree.label =\n manifest.parentLabel ||\n manifest.getLabel().getValue(this.options.locale) ||\n "manifest " + (i + 1);\n tree.navDate = manifest.getNavDate();\n tree.data.id = manifest.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n Collection.prototype._parseCollections = function (parentCollection) {\n //console.log("parse collections for ", parentCollection.id);\n if (parentCollection.getCollections() &&\n parentCollection.getCollections().length) {\n for (var i = 0; i < parentCollection.getCollections().length; i++) {\n var collection = parentCollection.getCollections()[i];\n var tree = collection.getDefaultTree();\n tree.label =\n collection.parentLabel ||\n collection.getLabel().getValue(this.options.locale) ||\n "collection " + (i + 1);\n tree.navDate = collection.getNavDate();\n tree.data.id = collection.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n return Collection;\n}(internal_1.IIIFResource));\nexports.Collection = Collection;\n\n\n//# sourceURL=webpack://manifesto/./src/Collection.ts?')},"./src/Color.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n//import { colorString } from "color-string"\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Color = void 0;\nvar colorString = __webpack_require__(/*! color-string */ "./node_modules/color-string/index.js");\n/**\n * class structure with red, green, blue values in 0-255 range\n * Uses the {@link https://www.npmjs.com/package.color-string | color-string }\n * library for conversion from and to string representations of color.\n**/\nvar Color = /** @class */ (function () {\n /**\n * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red\n **/\n function Color(rgbValue) {\n this.value = rgbValue;\n }\n /**\n * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red\n * @returns Color instance.\n **/\n Color.fromCSS = function (cssTerm) {\n var rv = colorString.get(cssTerm);\n if (rv.model !== \'rgb\')\n throw new Error("unsupported color string: " + cssTerm);\n return new Color([rv.value[0], rv.value[1], rv.value[2]]);\n };\n Object.defineProperty(Color.prototype, "red", {\n /**\n * @return 0 to 255 value of red color component\n **/\n get: function () { return this.value[0]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "green", {\n /**\n * @return 0 to 255 value of green color component\n **/\n get: function () { return this.value[1]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "blue", {\n /**\n * @return 0 to 255 value of blue color component\n **/\n get: function () { return this.value[2]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "CSS", {\n /**\n * @returns hex string (as for CSS ) representation of r,g,b components\n **/\n get: function () { return colorString.to.hex(this.value); },\n enumerable: false,\n configurable: true\n });\n return Color;\n}());\nexports.Color = Color;\n\n\n//# sourceURL=webpack://manifesto/./src/Color.ts?')},"./src/Duration.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Duration = void 0;\nvar Duration = /** @class */ (function () {\n function Duration(start, end) {\n this.start = start;\n this.end = end;\n }\n Duration.prototype.getLength = function () {\n return this.end - this.start;\n };\n return Duration;\n}());\nexports.Duration = Duration;\n\n\n//# sourceURL=webpack://manifesto/./src/Duration.ts?')},"./src/Geometry3d.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.lightRelativeRotation = exports.cameraRelativeRotation = void 0;\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\n// https://ros2jsguy.github.io/threejs-math/index.html\n/**\n* performs the calculation required for the lookAt\n* property of a camera resource. Determines the\n* required angles of two rotations, the first about\n* the x axis and the second about the y axis, which will\n* rotate the default camera direction (0,0,-1) into the\n* direction of the input arguments\n*\n* Result of calculation is returned as a instance of EulerAngle from the\n* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The\n* three-js library uses body-fixed axes to represent EulerAngles, which reverse\n* the ordering of the "relative rotation" algorithm described in the\n* draft 3d api.\n\n* @param direction A vector interpreted as a direction. Client code\n* responsible for not passing a 0-length vector, else a\n\n*\n* @returns threejs-math.EulerAngle instance\n**/\nfunction cameraRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n // projDirection is the direction projected onto the xz plane\n var projDirection = direction.clone().setComponent(1, 0.0);\n var projLength = projDirection.length();\n // handle the edge case, desired viewing direction is either straight up\n // or straight down\n if (projLength == 0.0) {\n if (direction.y > 0.0) {\n // looking straight up fro below\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(+90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n else {\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(-90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n }\n var yAngleRad = Math.atan2(-projDirection.x, -projDirection.z);\n var xAngleRad = Math.atan2(direction.y, projLength);\n return new threejs_math_1.Euler(xAngleRad, yAngleRad, 0.0, "YXZ");\n}\nexports.cameraRelativeRotation = cameraRelativeRotation;\n;\nfunction lightRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n var unit_direction = direction.clone().divideScalar(direction.length());\n // negative y axis is initial direction of DirectionalLight, SpotLight\n // in draft 3D API\n var ny_axis = new threejs_math_1.Vector3(0.0, -1.0, 0.0);\n var quat = new threejs_math_1.Quaternion().setFromUnitVectors(ny_axis, unit_direction);\n var tmp = new threejs_math_1.Euler().setFromQuaternion(quat, "ZXY");\n // standard be setting the final intrinsic Y rotation, which is\n // along desired direction, to 0\n return new threejs_math_1.Euler(tmp.x, 0.0, tmp.z, "ZXY");\n}\nexports.lightRelativeRotation = lightRelativeRotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Geometry3d.ts?')},"./src/IAccessToken.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IAccessToken.ts?')},"./src/IExternalImageResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalImageResourceData.ts?')},"./src/IExternalResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResource.ts?')},"./src/IExternalResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceData.ts?')},"./src/IExternalResourceOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceOptions.ts?')},"./src/IIIFResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.IIIFResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar IIIFResource = /** @class */ (function (_super) {\n __extends(IIIFResource, _super);\n function IIIFResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = -1;\n _this.isLoaded = false;\n var defaultOptions = {\n defaultLabel: "-",\n locale: "en-GB",\n resource: _this,\n pessimisticAccessControl: false\n };\n _this.options = Object.assign(defaultOptions, options);\n return _this;\n }\n /**\n * @deprecated\n */\n IIIFResource.prototype.getAttribution = function () {\n //console.warn(\'getAttribution will be deprecated, use getRequiredStatement instead.\');\n var attribution = this.getProperty("attribution");\n if (attribution) {\n return internal_1.PropertyValue.parse(attribution, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getDescription = function () {\n var description = this.getProperty("description");\n if (description) {\n return internal_1.PropertyValue.parse(description, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getHomepage = function () {\n var homepage = this.getProperty("homepage");\n if (!homepage)\n return null;\n if (typeof homepage == "string")\n return homepage;\n if (Array.isArray(homepage) && homepage.length) {\n homepage = homepage[0];\n }\n return homepage["@id"] || homepage.id;\n };\n IIIFResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n IIIFResource.prototype.getLogo = function () {\n var logo = this.getProperty("logo");\n // Presentation 3.\n // The logo is exclusive to the "provider" property, which is of type "Agent".\n // In order to fulfil `manifest.getLogo()` we should check\n // When P3 is fully supported, the following should work.\n // return this.getProvider()?.getLogo();\n if (!logo) {\n var provider = this.getProperty("provider");\n if (!provider) {\n return null;\n }\n logo = provider.logo;\n }\n if (!logo)\n return null;\n if (typeof logo === "string")\n return logo;\n if (Array.isArray(logo) && logo.length) {\n logo = logo[0];\n }\n return logo["@id"] || logo.id;\n };\n IIIFResource.prototype.getLicense = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("license"), this.options.locale);\n };\n IIIFResource.prototype.getNavDate = function () {\n return new Date(this.getProperty("navDate"));\n };\n IIIFResource.prototype.getRelated = function () {\n return this.getProperty("related");\n };\n IIIFResource.prototype.getSeeAlso = function () {\n return this.getProperty("seeAlso");\n };\n IIIFResource.prototype.getTrackingLabel = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.TRACKING_EXTENSIONS));\n if (service) {\n return service.getProperty("trackingLabel");\n }\n return "";\n };\n IIIFResource.prototype.getDefaultTree = function () {\n this.defaultTree = new internal_1.TreeNode("root");\n this.defaultTree.data = this;\n return this.defaultTree;\n };\n IIIFResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n else {\n // fall back to attribution (if it exists)\n var attribution = this.getAttribution();\n if (attribution) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.value = attribution;\n }\n }\n return requiredStatement;\n };\n IIIFResource.prototype.isCollection = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.isManifest = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.load = function () {\n var that = this;\n return new Promise(function (resolve) {\n if (that.isLoaded) {\n resolve(that);\n }\n else {\n var options_1 = that.options;\n options_1.navDate = that.getNavDate();\n var id = that.__jsonld.id;\n if (!id) {\n id = that.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id).then(function (data) {\n that.parentLabel = that.getLabel().getValue(options_1.locale);\n var parsed = internal_1.Deserialiser.parse(data, options_1);\n that = Object.assign(that, parsed);\n //that.parentCollection = options.resource.parentCollection;\n that.index = options_1.index;\n resolve(that);\n });\n }\n });\n };\n return IIIFResource;\n}(internal_1.ManifestResource));\nexports.IIIFResource = IIIFResource;\n\n\n//# sourceURL=webpack://manifesto/./src/IIIFResource.ts?')},"./src/IManifestoOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IManifestoOptions.ts?')},"./src/JSONLDResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.JSONLDResource = void 0;\nvar JSONLDResource = /** @class */ (function () {\n function JSONLDResource(jsonld) {\n this.__jsonld = jsonld;\n this.context = this.getProperty("context");\n this.id = this.getProperty("id");\n }\n JSONLDResource.prototype.getProperty = function (name) {\n var prop = null;\n if (this.__jsonld) {\n prop = this.__jsonld[name];\n if (!prop) {\n // property may have a prepended \'@\'\n prop = this.__jsonld["@" + name];\n }\n }\n return prop;\n };\n /**\n A function that wraps the getProperty function, which client\n code can use if it is needed to identify when the json value of\n a property is an IRI -- Internationalized Resource Identifier\n \n If the value of the json value is a bare string, then it will be\n wrapped in a json object with the string in the property \'id\',\n additionally that property will have a property \'isIRI\' which will\n be true for the literal string case, otherwise false meaning the\n returned getProperty should be parsed as before.\n \n **/\n JSONLDResource.prototype.getPropertyAsObject = function (name) {\n var prop = this.getProperty(name);\n if (prop === null)\n return prop;\n else if (typeof (prop) === \'string\')\n return { "id": prop,\n "isIRI": true\n };\n else if (prop === Object(prop))\n return prop;\n else {\n throw new Error("cannot resolve prop as object: " + prop);\n }\n };\n return JSONLDResource;\n}());\nexports.JSONLDResource = JSONLDResource;\n\n\n//# sourceURL=webpack://manifesto/./src/JSONLDResource.ts?')},"./src/LabelValuePair.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LabelValuePair = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LabelValuePair = /** @class */ (function () {\n function LabelValuePair(defaultLocale) {\n this.defaultLocale = defaultLocale;\n }\n LabelValuePair.prototype.parse = function (resource) {\n this.resource = resource;\n this.label = internal_1.PropertyValue.parse(this.resource.label, this.defaultLocale);\n this.value = internal_1.PropertyValue.parse(this.resource.value, this.defaultLocale);\n };\n // shortcuts to get/set values based on user or default locale\n LabelValuePair.prototype.getLabel = function (locale) {\n if (this.label === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.label.getValue(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setLabel = function (value) {\n if (this.label === null) {\n this.label = new internal_1.PropertyValue([]);\n }\n this.label.setValue(value, this.defaultLocale);\n };\n LabelValuePair.prototype.getValue = function (locale, joinWith) {\n if (joinWith === void 0) { joinWith = "
"; }\n if (this.value === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValue(locale || this.defaultLocale, joinWith);\n };\n LabelValuePair.prototype.getValues = function (locale) {\n if (this.value === null) {\n return [];\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValues(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setValue = function (value) {\n if (this.value === null) {\n this.value = new internal_1.PropertyValue([]);\n }\n this.value.setValue(value, this.defaultLocale);\n };\n return LabelValuePair;\n}());\nexports.LabelValuePair = LabelValuePair;\n\n\n//# sourceURL=webpack://manifesto/./src/LabelValuePair.ts?')},"./src/Language.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/Language.ts?')},"./src/LanguageMap.ts":function(__unused_webpack_module,exports){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LanguageMap = void 0;\n/** @deprecated Use PropertyValue instead */\nvar LanguageMap = /** @class */ (function (_super) {\n __extends(LanguageMap, _super);\n function LanguageMap() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /** @deprecated Use the `PropertyValue#getValue` instance method instead */\n LanguageMap.getValue = function (languageCollection, locale) {\n return languageCollection.getValue(locale, "
");\n };\n /** @deprecated Use the `PropertyValue#getValues` instance method instead */\n LanguageMap.getValues = function (languageCollection, locale) {\n return languageCollection.getValues(locale);\n };\n return LanguageMap;\n}(Array));\nexports.LanguageMap = LanguageMap;\n\n\n//# sourceURL=webpack://manifesto/./src/LanguageMap.ts?')},"./src/Light.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Light = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Light = /** @class */ (function (_super) {\n __extends(Light, _super);\n function Light(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isLight = true;\n _this.isModel = false;\n return _this;\n }\n Object.defineProperty(Light.prototype, "isAmbientLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "ambientlight");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Light.prototype, "isDirectionalLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "directionallight");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Light.prototype, "isSpotLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "spotlight");\n },\n enumerable: false,\n configurable: true\n });\n Light.prototype.getColor = function () {\n var hexColor = this.getProperty("color");\n if (hexColor)\n return internal_1.Color.fromCSS(hexColor);\n else\n return new internal_1.Color([255, 255, 255]); // white light\n };\n Object.defineProperty(Light.prototype, "Color", {\n get: function () { return this.getColor(); },\n enumerable: false,\n configurable: true\n });\n /**\n * The implementation of the intensity is based on\n * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md }\n * and the example 3D manifests\n * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights }\n * on 24 Mar 2024. The intensity property in the manifest is an object\n * with declared type \'Value\', a numeric property named \'value\' and a\n * property named unit . This implementation will only work with a unit == \'relative\'\n * and it will be assumed that a relative unit value of 1.0 corresponds to the\n * brightest light source a rendering engine supports.\n *\n * This code will implement a default intensity of 1.0\n **/\n Light.prototype.getIntensity = function () {\n var intObject = this.getProperty("intensity");\n if (intObject) {\n try {\n if (!(intObject.type === "Value" && intObject.unit === "relative"))\n throw new Error();\n return intObject.value;\n }\n catch (err) {\n throw new Error("unable to interpret raw intensity object " + JSON.stringify(intObject));\n }\n }\n else\n return 1.0;\n };\n Object.defineProperty(Light.prototype, "Intensity", {\n get: function () { return this.getIntensity(); },\n enumerable: false,\n configurable: true\n });\n /**\n * As defined in the temp-draft-4.md (\n * https://github.com/IIIF/3d/blob/main/temp-draft-4.md#lights ; 12 May 2024)\n * this quantity is the half-angle of the cone of the spotlight.\n *\n * The inconsistency between this definition of the angle and the definition of\n * fieldOfView for PerspectiveCamera (where the property value defines the full angle) has\n * already been noted: https://github.com/IIIF/api/issues/2284\n *\n * provisional decision is to return undefined in case that this property\n * is accessed in a light that is not a spotlight\n *\n *\n * @returns number\n \n **/\n Light.prototype.getAngle = function () {\n if (this.isSpotLight) {\n return Number(this.getProperty("angle"));\n }\n else {\n return undefined;\n }\n };\n Object.defineProperty(Light.prototype, "Angle", {\n get: function () { return this.getAngle(); },\n enumerable: false,\n configurable: true\n });\n /**\n * @return : if not null, is either a PointSelector, or an object\n * with an id matching the id of an Annotation instance.\n **/\n Light.prototype.getLookAt = function () {\n var rawObj = this.getPropertyAsObject("lookAt");\n var rawType = (rawObj["type"] || rawObj["@type"]);\n if (rawType == "Annotation") {\n return rawObj;\n }\n if (rawType == "PointSelector") {\n return new internal_1.PointSelector(rawObj);\n }\n throw new Error(\'unidentified value of lookAt ${rawType}\');\n };\n Object.defineProperty(Light.prototype, "LookAt", {\n get: function () { return this.getLookAt(); },\n enumerable: false,\n configurable: true\n });\n return Light;\n}(internal_1.AnnotationBody));\nexports.Light = Light;\n\n\n//# sourceURL=webpack://manifesto/./src/Light.ts?')},"./src/Manifest.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Manifest = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n* @remarks Scenes are conveniently retrieved from a Manifest by iterating through\n* Sequence in the Manifest, inner loop the Scenes in each sequence\n* @see {@link Sequence }\n*\n* @example\n* var manifest: Manifest;\n* function doSomethingWithScene(scene:Scene)...\n* ...\n* foreach(var seq:Sequence of manifest.getSequences()\n* foreach(var scene : Scene of seq.getScenes()\n* doSomethingWithScene(scene);\n**/\nvar Manifest = /** @class */ (function (_super) {\n __extends(Manifest, _super);\n function Manifest(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = 0;\n _this._allRanges = null;\n _this.items = [];\n _this._topRanges = [];\n if (_this.__jsonld.structures && _this.__jsonld.structures.length) {\n var topRanges = _this._getTopRanges();\n for (var i = 0; i < topRanges.length; i++) {\n var range = topRanges[i];\n _this._parseRanges(range, String(i));\n }\n }\n // initialization the cached _annotationIdMap to null\n // it will be populated if and only if client calls make a request\n // to the getter annotationIdMap\n _this._annotationIdMap = null;\n return _this;\n }\n /** @deprecated Use getAccompanyingCanvas instead */\n Manifest.prototype.getPosterCanvas = function () {\n var posterCanvas = this.getProperty("posterCanvas");\n if (posterCanvas) {\n posterCanvas = new internal_1.Canvas(posterCanvas, this.options);\n }\n return posterCanvas;\n };\n Manifest.prototype.getAccompanyingCanvas = function () {\n var accompanyingCanvas = this.getProperty("accompanyingCanvas");\n if (accompanyingCanvas) {\n accompanyingCanvas = new internal_1.Canvas(accompanyingCanvas, this.options);\n }\n return accompanyingCanvas;\n };\n Manifest.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Manifest.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n if (!this.isLoaded) {\n return this.defaultTree;\n }\n var topRanges = this.getTopRanges();\n // if there are any ranges in the manifest, default to the first \'top\' range or generated placeholder\n if (topRanges.length) {\n topRanges[0].getTree(this.defaultTree);\n }\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Manifest.prototype._getTopRanges = function () {\n var topRanges = [];\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var json = this.__jsonld.structures[i];\n if (json.viewingHint === dist_commonjs_1.ViewingHint.TOP) {\n topRanges.push(json);\n }\n }\n // if no viewingHint="top" range was found, create a default one\n if (!topRanges.length) {\n var range = {};\n range.ranges = this.__jsonld.structures;\n topRanges.push(range);\n }\n }\n return topRanges;\n };\n Manifest.prototype.getTopRanges = function () {\n return this._topRanges;\n };\n Manifest.prototype._getRangeById = function (id) {\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var r = this.__jsonld.structures[i];\n if (r["@id"] === id || r.id === id) {\n return r;\n }\n }\n }\n return null;\n };\n //private _parseRangeCanvas(json: any, range: Range): void {\n // todo: currently this isn\'t needed\n //var canvas: IJSONLDResource = new JSONLDResource(json);\n //range.items.push(canvas);\n //}\n Manifest.prototype._parseRanges = function (r, path, parentRange) {\n var range;\n var id = null;\n if (typeof r === "string") {\n id = r;\n r = this._getRangeById(id);\n }\n if (!r) {\n console.warn("Range:", id, "does not exist");\n return;\n }\n range = new internal_1.Range(r, this.options);\n range.parentRange = parentRange;\n range.path = path;\n if (!parentRange) {\n this._topRanges.push(range);\n }\n else {\n parentRange.items.push(range);\n }\n var items = r.items || r.members;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n // todo: use an ItemType constant?\n if ((item["@type"] && item["@type"].toLowerCase() === "sc:range") ||\n (item["type"] && item["type"].toLowerCase() === "range")) {\n this._parseRanges(item, path + "/" + i, range);\n }\n else if ((item["@type"] && item["@type"].toLowerCase() === "sc:canvas") ||\n (item["type"] && item["type"].toLowerCase() === "canvas")) {\n // store the ids on the __jsonld object to be used by Range.getCanvasIds()\n if (!range.canvases) {\n range.canvases = [];\n }\n var id_1 = item.id || item["@id"];\n range.canvases.push(id_1);\n }\n }\n }\n else if (r.ranges) {\n for (var i = 0; i < r.ranges.length; i++) {\n this._parseRanges(r.ranges[i], path + "/" + i, range);\n }\n }\n };\n Manifest.prototype.getAllRanges = function () {\n if (this._allRanges != null)\n return this._allRanges;\n this._allRanges = [];\n var topRanges = this.getTopRanges();\n var _loop_1 = function (i) {\n var topRange = topRanges[i];\n if (topRange.id) {\n this_1._allRanges.push(topRange); // it might be a placeholder root range\n }\n var reducer = function (acc, next) {\n acc.add(next);\n var nextRanges = next.getRanges();\n if (nextRanges.length) {\n return nextRanges.reduce(reducer, acc);\n }\n return acc;\n };\n var subRanges = Array.from(topRange.getRanges().reduce(reducer, new Set()));\n this_1._allRanges = this_1._allRanges.concat(subRanges);\n };\n var this_1 = this;\n for (var i = 0; i < topRanges.length; i++) {\n _loop_1(i);\n }\n return this._allRanges;\n };\n Manifest.prototype.getRangeById = function (id) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.id === id) {\n return range;\n }\n }\n return null;\n };\n Manifest.prototype.getRangeByPath = function (path) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.path === path) {\n return range;\n }\n }\n return null;\n };\n /**\n * @returns Array of Sequence instances\n **/\n Manifest.prototype.getSequences = function () {\n if (this.items.length) {\n return this.items;\n }\n // IxIF mediaSequences overrode sequences, so need to be checked first.\n // deprecate this when presentation 3 ships\n var items = this.__jsonld.mediaSequences || this.__jsonld.sequences;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var s = items[i];\n var sequence = new internal_1.Sequence(s, this.options);\n this.items.push(sequence);\n }\n }\n else if (this.__jsonld.items) {\n var sequence = new internal_1.Sequence(this.__jsonld.items, this.options);\n this.items.push(sequence);\n }\n return this.items;\n };\n Manifest.prototype.getSequenceByIndex = function (sequenceIndex) {\n return this.getSequences()[sequenceIndex];\n };\n Manifest.prototype.getTotalSequences = function () {\n return this.getSequences().length;\n };\n Manifest.prototype.getManifestType = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.UI_EXTENSIONS));\n if (service) {\n return service.getProperty("manifestType");\n }\n return internal_1.ManifestType.EMPTY;\n };\n Manifest.prototype.isMultiSequence = function () {\n return this.getTotalSequences() > 1;\n };\n Manifest.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n var behavior = this.getBehavior();\n if (behavior) {\n return behavior === dist_commonjs_1.Behavior.PAGED;\n }\n return false;\n };\n Manifest.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Manifest.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Manifest.prototype, "annotationIdMap", {\n /**\n * Developer Note: The concept of the "id map" appear in the\n * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map\n * This functionality may be available as well in the \'nodeMap\' code of the\n * digitalbazaar/jsonld library\n *\n * this very simplified version just returns a mao of id -> Annotation nodes\n * in manifest\n *\n * THe annotationIdMap is a Javascript object whose property names are\n * IRI (id values) and property values are instances of the Annotation class\n **/\n get: function () {\n if (this._annotationIdMap == null) {\n this._annotationIdMap = {};\n for (var _i = 0, _a = this.getSequences(); _i < _a.length; _i++) {\n var seq = _a[_i];\n for (var _b = 0, _c = seq.getScenes(); _b < _c.length; _b++) {\n var scene = _c[_b];\n for (var _d = 0, _e = scene.getContent(); _d < _e.length; _d++) {\n var anno = _e[_d];\n this._annotationIdMap[anno.id] = anno;\n }\n }\n }\n }\n return this._annotationIdMap;\n },\n enumerable: false,\n configurable: true\n });\n return Manifest;\n}(internal_1.IIIFResource));\nexports.Manifest = Manifest;\n\n\n//# sourceURL=webpack://manifesto/./src/Manifest.ts?')},"./src/ManifestResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar ManifestResource = /** @class */ (function (_super) {\n __extends(ManifestResource, _super);\n function ManifestResource(jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.options = options;\n return _this;\n }\n ManifestResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n ManifestResource.prototype.getLabel = function () {\n var label = this.getProperty("label");\n if (label) {\n return internal_1.PropertyValue.parse(label, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n ManifestResource.prototype.getDefaultLabel = function () {\n return this.getLabel().getValue(this.options.locale);\n };\n ManifestResource.prototype.getMetadata = function () {\n var _metadata = this.getProperty("metadata");\n var metadata = [];\n if (!_metadata)\n return metadata;\n for (var i = 0; i < _metadata.length; i++) {\n var item = _metadata[i];\n var metadataItem = new internal_1.LabelValuePair(this.options.locale);\n metadataItem.parse(item);\n metadata.push(metadataItem);\n }\n return metadata;\n };\n ManifestResource.prototype.getRendering = function (format) {\n var renderings = this.getRenderings();\n for (var i = 0; i < renderings.length; i++) {\n var rendering = renderings[i];\n if (rendering.getFormat() === format) {\n return rendering;\n }\n }\n return null;\n };\n ManifestResource.prototype.getRenderings = function () {\n var rendering;\n // if passing a manifesto-parsed object, use the __jsonld.rendering property,\n // otherwise look for a rendering property\n if (this.__jsonld) {\n rendering = this.__jsonld.rendering;\n }\n else {\n rendering = this.rendering;\n }\n var renderings = [];\n if (!rendering)\n return renderings;\n // coerce to array\n if (!Array.isArray(rendering)) {\n rendering = [rendering];\n }\n for (var i = 0; i < rendering.length; i++) {\n var r = rendering[i];\n renderings.push(new internal_1.Rendering(r, this.options));\n }\n return renderings;\n };\n ManifestResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n return requiredStatement;\n };\n ManifestResource.prototype.getService = function (profile) {\n return internal_1.Utils.getService(this, profile);\n };\n ManifestResource.prototype.getServices = function () {\n return internal_1.Utils.getServices(this);\n };\n ManifestResource.prototype.getThumbnail = function () {\n var thumbnail = this.getProperty("thumbnail");\n if (Array.isArray(thumbnail)) {\n thumbnail = thumbnail[0];\n }\n if (thumbnail) {\n return new internal_1.Thumbnail(thumbnail, this.options);\n }\n return null;\n };\n ManifestResource.prototype.isAnnotation = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.ANNOTATION;\n };\n ManifestResource.prototype.isCanvas = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.CANVAS;\n };\n ManifestResource.prototype.isCollection = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION;\n };\n ManifestResource.prototype.isManifest = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST;\n };\n ManifestResource.prototype.isRange = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.RANGE;\n };\n // this different implementation is necessary until such time as the \n // SCENE is added to the @iiif/vocabulary package.\n ManifestResource.prototype.isScene = function () {\n return this.getIIIFResourceType() === internal_1.Utils.normaliseType(\'Scene\');\n };\n ManifestResource.prototype.isSequence = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.SEQUENCE;\n };\n return ManifestResource;\n}(internal_1.JSONLDResource));\nexports.ManifestResource = ManifestResource;\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestResource.ts?')},"./src/ManifestType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestType = void 0;\nvar ManifestType;\n(function (ManifestType) {\n ManifestType["EMPTY"] = "";\n ManifestType["MANUSCRIPT"] = "manuscript";\n ManifestType["MONOGRAPH"] = "monograph";\n})(ManifestType || (exports.ManifestType = ManifestType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestType.ts?')},"./src/PointSelector.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PointSelector = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar PointSelector = /** @class */ (function (_super) {\n __extends(PointSelector, _super);\n function PointSelector(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isPointSelector = true;\n return _this;\n }\n /**\n @returns the 3D coordinates of the point as a Vector3 instance.\n **/\n PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n };\n Object.defineProperty(PointSelector.prototype, "Location", {\n /**\n @returns the 3D coordinates of the point as a Vector3 instance.\n **/\n get: function () { return this.getLocation(); },\n enumerable: false,\n configurable: true\n });\n return PointSelector;\n}(internal_1.JSONLDResource));\nexports.PointSelector = PointSelector;\n\n\n//# sourceURL=webpack://manifesto/./src/PointSelector.ts?')},"./src/PropertyValue.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PropertyValue = exports.LocalizedValue = void 0;\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/** Utility class to hold one or more values with their associated (optional) locale */\nvar LocalizedValue = /** @class */ (function () {\n function LocalizedValue(value, locale, defaultLocale) {\n if (defaultLocale === void 0) { defaultLocale = "none"; }\n if (Array.isArray(value) && value.length === 1) {\n this._value = value[0];\n }\n else {\n this._value = value;\n }\n if (locale === "none" || locale === "@none") {\n locale = undefined;\n }\n this._locale = locale;\n this._defaultLocale = defaultLocale;\n }\n /** Parse a localized value from a IIIF v2 property value\n *\n * @param {string | string[] | object | object[]} rawVal value from IIIF resource\n * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value\n */\n LocalizedValue.parseV2Value = function (rawVal, defaultLocale) {\n if (typeof rawVal === "string") {\n return new LocalizedValue(rawVal, undefined, defaultLocale);\n }\n else if (rawVal["@value"]) {\n return new LocalizedValue(rawVal["@value"], rawVal["@language"], defaultLocale);\n }\n return null;\n };\n Object.defineProperty(LocalizedValue.prototype, "value", {\n /*** @deprecated Use PropertyValue#getValue instead */\n get: function () {\n if (Array.isArray(this._value)) {\n return this._value.join("
");\n }\n return this._value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizedValue.prototype, "locale", {\n /*** @deprecated Don\'t use, only used for backwards compatibility reasons */\n get: function () {\n if (this._locale === undefined) {\n return this._defaultLocale;\n }\n return this._locale;\n },\n enumerable: false,\n configurable: true\n });\n LocalizedValue.prototype.addValue = function (value) {\n if (!Array.isArray(this._value)) {\n this._value = [this._value];\n }\n if (Array.isArray(value)) {\n this._value = this._value.concat(value);\n }\n else {\n this._value.push(value);\n }\n };\n return LocalizedValue;\n}());\nexports.LocalizedValue = LocalizedValue;\n/***\n * Holds a collection of values and their (optional) languages and allows\n * language-based value retrieval as per the algorithm described in\n * https://iiif.io/api/presentation/2.1/#language-of-property-values\n */\nvar PropertyValue = /** @class */ (function (_super) {\n __extends(PropertyValue, _super);\n function PropertyValue(values, defaultLocale) {\n if (values === void 0) { values = []; }\n var _this = _super.apply(this, values) || this;\n // Needed for ES5 compatibility, see https://stackoverflow.com/a/40967939\n _this.__proto__ = PropertyValue.prototype;\n _this._defaultLocale = defaultLocale;\n return _this;\n }\n PropertyValue.parse = function (rawVal, defaultLocale) {\n if (!rawVal) {\n return new PropertyValue([], defaultLocale);\n }\n if (Array.isArray(rawVal)) {\n // Collection of IIIF v2 property values\n var parsed = rawVal\n .map(function (v) { return LocalizedValue.parseV2Value(v, defaultLocale); })\n .filter(function (v) { return v !== null; });\n var byLocale = parsed.reduce(function (acc, lv) {\n var loc = lv._locale;\n if (!loc) {\n // Cannot use undefined as an object key\n loc = "none";\n }\n if (acc[loc]) {\n acc[loc].addValue(lv._value);\n }\n else {\n acc[loc] = lv;\n }\n return acc;\n }, {});\n return new PropertyValue(Object.values(byLocale), defaultLocale);\n }\n else if (typeof rawVal === "string") {\n return new PropertyValue([new LocalizedValue(rawVal, undefined, defaultLocale)], defaultLocale);\n }\n else if (rawVal["@language"]) {\n // Single IIIF v2 property value\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else if (rawVal["@value"]) {\n // Single IIIF v2 property value without language\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else {\n // IIIF v3 property value\n return new PropertyValue(Object.keys(rawVal).map(function (locale) {\n var val = rawVal[locale];\n if (!Array.isArray(val)) {\n throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");\n }\n return new LocalizedValue(val, locale, defaultLocale);\n }), defaultLocale);\n }\n };\n /*** Try to find the available locale that best fit\'s the user\'s preferences. */\n PropertyValue.prototype.getSuitableLocale = function (locales) {\n // If any of the values have a language associated with them, the client\n // must display all of the values associated with the language that best\n // matches the language preference.\n if (locales.length == 0 && this._defaultLocale)\n locales.push(this._defaultLocale);\n // create an array of the language codes for all different LocalizedValue instances in this PropertyValue\n var allLocales = new Array();\n for (var _i = 0, _a = this; _i < _a.length; _i++) {\n var lv = _a[_i];\n if (lv._locale != undefined)\n allLocales.push(lv._locale);\n }\n var _loop_1 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return l === userLocale; });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // First, look for a precise match\n for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) {\n var userLocale = locales_1[_b];\n var state_1 = _loop_1(userLocale);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n var _loop_2 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return Utils_1.Utils.getInexactLocale(l) === Utils_1.Utils.getInexactLocale(userLocale); });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // Look for an inexact match\n for (var _c = 0, locales_2 = locales; _c < locales_2.length; _c++) {\n var userLocale = locales_2[_c];\n var state_2 = _loop_2(userLocale);\n if (typeof state_2 === "object")\n return state_2.value;\n }\n return undefined;\n };\n /**\n * Set the value(s) for a given locale.\n *\n * If there\'s an existing locale that matches the given locale, it will be updated.\n *\n * @param locale Locale to set the value for\n * @param value value to set\n */\n PropertyValue.prototype.setValue = function (value, locale) {\n var existing = undefined;\n if (!locale) {\n existing = this.find(function (lv) { return lv._locale === undefined; });\n }\n else {\n var bestLocale_1 = this.getSuitableLocale([locale]);\n if (bestLocale_1) {\n existing = this.find(function (lv) { return lv._locale === bestLocale_1; });\n }\n }\n if (existing) {\n // Mutate existing localized value\n existing._value = value;\n }\n else {\n // Create a new localized value\n this.push(new LocalizedValue(value, locale, this._defaultLocale));\n }\n };\n /**\n * Get a value in the most suitable locale.\n *\n * @param {string | string[] | undefined} locales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @param {string | undefined} joinWith String to join multiple available values by,\n * if undefined only the first available value will be returned\n * @returns the first value in the most suitable locale or null if none could be found\n */\n PropertyValue.prototype.getValue = function (locales, joinWith) {\n var vals = this.getValues(locales);\n if (vals.length === 0) {\n return null;\n }\n if (joinWith) {\n return vals.join(joinWith);\n }\n return vals[0];\n };\n /**\n * Get all values available in the most suitable locale.\n *\n * @param {string | string[]} userLocales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @returns the values for the most suitable locale, empty if none could be found\n */\n PropertyValue.prototype.getValues = function (userLocales) {\n if (!this.length) {\n return [];\n }\n var locales;\n if (!userLocales) {\n locales = [];\n }\n else if (!Array.isArray(userLocales)) {\n locales = [userLocales];\n }\n else {\n locales = userLocales;\n }\n // If none of the values have a language associated with them, the client\n // must display all of the values.\n if (this.length === 1 && this[0]._locale === undefined) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // Try to determine the available locale that best fits the user\'s preferences\n var matchingLocale = this.getSuitableLocale(locales);\n if (matchingLocale) {\n var val = this.find(function (lv) { return lv._locale === matchingLocale; })._value;\n return Array.isArray(val) ? val : [val];\n }\n // If all of the values have a language associated with them, and none match\n // the language preference, the client must select a language and display\n // all of the values associated with that language.\n var allHaveLang = !this.find(function (lv) { return lv._locale === undefined; });\n if (allHaveLang) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // If some of the values have a language associated with them, but none\n // match the language preference, the client must display all of the values\n // that do not have a language associated with them.\n var lv = this.find(function (lv) { return lv._locale === undefined; });\n if (lv) {\n return Array.isArray(lv._value) ? lv._value : [lv._value];\n }\n return [];\n };\n return PropertyValue;\n}(Array));\nexports.PropertyValue = PropertyValue;\n\n\n//# sourceURL=webpack://manifesto/./src/PropertyValue.ts?')},"./src/Range.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Range = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar Range = /** @class */ (function (_super) {\n __extends(Range, _super);\n function Range(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this._ranges = null;\n _this.canvases = null;\n _this.items = [];\n return _this;\n }\n Range.prototype.getCanvasIds = function () {\n if (this.__jsonld.canvases) {\n return this.__jsonld.canvases;\n }\n else if (this.canvases) {\n return this.canvases;\n }\n return [];\n };\n Range.prototype.getDuration = function () {\n // For this implementation, we want to catch SOME of the temporal cases - i.e. when there is a t=1,100\n if (this.canvases && this.canvases.length) {\n var startTimes = [];\n var endTimes = [];\n // When we loop through all of the canvases we store the recorded start and end times.\n // Then we choose the maximum and minimum values from this. This will give us a more accurate duration for the\n // Chosen range. However this is still not perfect and does not cover more complex ranges. These cases are out of\n // scope for this change.\n for (var _i = 0, _a = this.canvases; _i < _a.length; _i++) {\n var canvas = _a[_i];\n if (!canvas)\n continue;\n var _b = (canvas.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [undefined, canvas]), canvasId = _b[1], start_1 = _b[2], end_1 = _b[3];\n if (canvasId) {\n startTimes.push(parseFloat(start_1));\n endTimes.push(parseFloat(end_1));\n }\n }\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n else {\n // get child ranges and calculate the start and end based on them\n var childRanges = this.getRanges();\n var startTimes = [];\n var endTimes = [];\n // Once again, we use a max/min to get the ranges.\n for (var _c = 0, childRanges_1 = childRanges; _c < childRanges_1.length; _c++) {\n var childRange = childRanges_1[_c];\n var duration = childRange.getDuration();\n if (duration) {\n startTimes.push(duration.start);\n endTimes.push(duration.end);\n }\n }\n // And return the minimum as the start, and the maximum as the end.\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n var start;\n var end;\n // There are 2 paths for this implementation. Either we have a list of canvases, or a list of ranges\n // which may have a list of ranges.\n // This is one of the limitations of this implementation.\n if (this.canvases && this.canvases.length) {\n // When we loop through each of the canvases we are expecting to see a fragment or a link to the whole canvas.\n // For example - if we have http://example.org/canvas#t=1,100 it will extract 1 and 100 as the start and end.\n for (var i = 0; i < this.canvases.length; i++) {\n var canvas = this.canvases[i];\n var temporal = internal_1.Utils.getTemporalComponent(canvas);\n if (temporal && temporal.length > 1) {\n if (i === 0) {\n // Note: Cannot guarantee ranges are sequential (fixed above)\n start = Number(temporal[0]);\n }\n if (i === this.canvases.length - 1) {\n end = Number(temporal[1]); // Note: The end of this duration may be targeting a different canvas.\n }\n }\n }\n }\n else {\n // In this second case, where there are nested ranges, we recursively get the duration\n // from each of the child ranges (a start and end) and then choose the first and last for the bounds of this range.\n var childRanges = this.getRanges();\n for (var i = 0; i < childRanges.length; i++) {\n var childRange = childRanges[i];\n var duration = childRange.getDuration();\n if (duration) {\n if (i === 0) {\n start = duration.start;\n }\n if (i === childRanges.length - 1) {\n end = duration.end;\n }\n }\n }\n }\n if (start !== undefined && end !== undefined) {\n return new internal_1.Duration(start, end);\n }\n return undefined;\n };\n // getCanvases(): ICanvas[] {\n // if (this._canvases) {\n // return this._canvases;\n // }\n // return this._canvases = this.items.en().where(m => m.isCanvas()).toArray();\n // }\n Range.prototype.getRanges = function () {\n if (this._ranges) {\n return this._ranges;\n }\n return (this._ranges = this.items.filter(function (m) { return m.isRange(); }));\n };\n Range.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Range.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Range.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Range.prototype.getTree = function (treeRoot) {\n treeRoot.data = this;\n this.treeNode = treeRoot;\n var ranges = this.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var node = new internal_1.TreeNode();\n treeRoot.addNode(node);\n this._parseTreeNode(node, range);\n }\n }\n internal_1.Utils.generateTreeNodeIds(treeRoot);\n return treeRoot;\n };\n Range.prototype.spansTime = function (time) {\n var duration = this.getDuration();\n if (duration) {\n if (time >= duration.start && time <= duration.end) {\n return true;\n }\n }\n return false;\n };\n Range.prototype._parseTreeNode = function (node, range) {\n node.label = range.getLabel().getValue(this.options.locale);\n node.data = range;\n node.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n range.treeNode = node;\n var ranges = range.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var childRange = ranges[i];\n var behavior = childRange.getBehavior();\n if (behavior === dist_commonjs_1.Behavior.NO_NAV) {\n continue;\n }\n else {\n var childNode = new internal_1.TreeNode();\n node.addNode(childNode);\n this._parseTreeNode(childNode, childRange);\n }\n }\n }\n };\n return Range;\n}(internal_1.ManifestResource));\nexports.Range = Range;\n\n\n//# sourceURL=webpack://manifesto/./src/Range.ts?')},"./src/Rendering.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Rendering = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Rendering = /** @class */ (function (_super) {\n __extends(Rendering, _super);\n function Rendering(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Rendering.prototype.getFormat = function () {\n return this.getProperty("format");\n };\n return Rendering;\n}(internal_1.ManifestResource));\nexports.Rendering = Rendering;\n\n\n//# sourceURL=webpack://manifesto/./src/Rendering.ts?')},"./src/Resource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Resource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Resource = /** @class */ (function (_super) {\n __extends(Resource, _super);\n function Resource(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Resource.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return format.toLowerCase();\n }\n return null;\n };\n Resource.prototype.getResources = function () {\n var resources = [];\n if (!this.__jsonld.resources)\n return resources;\n for (var i = 0; i < this.__jsonld.resources.length; i++) {\n var a = this.__jsonld.resources[i];\n var annotation = new internal_1.Annotation(a, this.options);\n resources.push(annotation);\n }\n return resources;\n };\n Resource.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return internal_1.Utils.normaliseType(type);\n }\n return null;\n };\n Resource.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Resource.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Resource.prototype.getMaxWidth = function () {\n return this.getProperty("maxWidth");\n };\n Resource.prototype.getMaxHeight = function () {\n var maxHeight = this.getProperty("maxHeight");\n // if a maxHeight hasn\'t been specified, default to maxWidth.\n // maxWidth in essence becomes maxEdge\n if (!maxHeight) {\n return this.getMaxWidth();\n }\n return null;\n };\n return Resource;\n}(internal_1.ManifestResource));\nexports.Resource = Resource;\n\n\n//# sourceURL=webpack://manifesto/./src/Resource.ts?')},"./src/RotateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.RotateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar RotateTransform = /** @class */ (function (_super) {\n __extends(RotateTransform, _super);\n function RotateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isRotateTransform = true;\n return _this;\n }\n RotateTransform.prototype.getRotation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return RotateTransform;\n}(internal_1.Transform));\nexports.RotateTransform = RotateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/RotateTransform.ts?')},"./src/ScaleTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ScaleTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar ScaleTransform = /** @class */ (function (_super) {\n __extends(ScaleTransform, _super);\n function ScaleTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isScaleTransform = true;\n return _this;\n }\n ScaleTransform.prototype.getScale = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n // note that default scaling is 1.0\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 1.0;\n }\n return retVal;\n };\n return ScaleTransform;\n}(internal_1.Transform));\nexports.ScaleTransform = ScaleTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/ScaleTransform.ts?')},"./src/Scene.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Scene = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Scene = /** @class */ (function (_super) {\n __extends(Scene, _super);\n function Scene(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // Presentation API 3.0\n Scene.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n ;\n return content;\n };\n ;\n Object.defineProperty(Scene.prototype, "Content", {\n // 3D extension\n get: function () { return this.getContent(); },\n enumerable: false,\n configurable: true\n });\n Scene.prototype.getAnnotationById = function (searchId) {\n for (var _i = 0, _a = this.Content; _i < _a.length; _i++) {\n var anno = _a[_i];\n if (anno.id === searchId)\n return anno;\n }\n return null;\n };\n Scene.prototype.getBackgroundColor = function () {\n // regular expression intended to match strings like\n // "#FF00FF" -- interpreted as three hexadecimal values\n // in range 0-255 . Not that the \\w escape matches digits,\n // upper and lower case latin characters, and underscore\n // currently only supports the form for CSS\n // https://www.w3.org/wiki/CSS/Properties/color/RGB\n // with 6 hexadecimal digits\n var bgc = this.getProperty("backgroundColor");\n if (bgc)\n return internal_1.Color.fromCSS(bgc);\n else\n return null;\n };\n ;\n return Scene;\n}(internal_1.ManifestResource));\nexports.Scene = Scene;\n\n\n//# sourceURL=webpack://manifesto/./src/Scene.ts?')},"./src/Sequence.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Sequence = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Sequence = /** @class */ (function (_super) {\n __extends(Sequence, _super);\n function Sequence(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._thumbnails = null;\n return _this;\n }\n Sequence.prototype.getCanvases = function () {\n if (this.items.length) {\n return this.items;\n }\n var items = this.__jsonld.canvases || this.__jsonld.elements;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var c = items[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n else if (this.__jsonld) {\n for (var i = 0; i < this.__jsonld.length; i++) {\n var c = this.__jsonld[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n return this.items;\n };\n Sequence.prototype.getCanvasById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // normalise canvas id\n var canvasId = internal_1.Utils.normaliseUrl(canvas.id);\n if (internal_1.Utils.normaliseUrl(id) === canvasId) {\n return canvas;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasByIndex = function (canvasIndex) {\n return this.getCanvases()[canvasIndex];\n };\n Sequence.prototype.getCanvasIndexById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === id) {\n return i;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasIndexByLabel = function (label, foliated) {\n label = label.trim();\n if (!isNaN(label)) {\n // if the label is numeric\n label = parseInt(label, 10).toString(); // trim any preceding zeros.\n if (foliated)\n label += "r"; // default to recto\n }\n var doublePageRegExp = /(\\d*)\\D+(\\d*)/;\n var match, regExp, regStr, labelPart1, labelPart2;\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // check if there\'s a literal match\n if (canvas.getLabel().getValue(this.options.locale) === label) {\n return i;\n }\n // check if there\'s a match for double-page spreads e.g. 100-101, 100_101, 100 101\n match = doublePageRegExp.exec(label);\n if (!match)\n continue;\n labelPart1 = match[1];\n labelPart2 = match[2];\n if (!labelPart2)\n continue;\n regStr = "^" + labelPart1 + "\\\\D+" + labelPart2 + "$";\n regExp = new RegExp(regStr);\n if (regExp.test(canvas.getLabel().toString())) {\n return i;\n }\n }\n return -1;\n };\n Sequence.prototype.getLastCanvasLabel = function (alphanumeric) {\n for (var i = this.getTotalCanvases() - 1; i >= 0; i--) {\n var canvas = this.getCanvasByIndex(i);\n var label = (canvas.getLabel().getValue(this.options.locale));\n if (alphanumeric) {\n var regExp = /^[a-zA-Z0-9]*$/;\n if (regExp.test(label)) {\n return label;\n }\n }\n else if (label) {\n return label;\n }\n }\n return this.options.defaultLabel;\n };\n Sequence.prototype.getLastPageIndex = function () {\n return this.getTotalCanvases() - 1;\n };\n Sequence.prototype.getNextPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[0] + 1;\n }\n else {\n index = indices[indices.length - 1] + 1;\n }\n }\n else {\n index = canvasIndex + 1;\n }\n if (index > this.getLastPageIndex()) {\n return -1;\n }\n return index;\n };\n Sequence.prototype.getPagedIndices = function (canvasIndex, pagingEnabled) {\n var indices = [];\n if (!pagingEnabled) {\n indices.push(canvasIndex);\n }\n else {\n if (this.isFirstCanvas(canvasIndex) || this.isLastCanvas(canvasIndex)) {\n indices = [canvasIndex];\n }\n else if (canvasIndex % 2) {\n indices = [canvasIndex, canvasIndex + 1];\n }\n else {\n indices = [canvasIndex - 1, canvasIndex];\n }\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n indices = indices.reverse();\n }\n }\n return indices;\n };\n Sequence.prototype.getPrevPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[indices.length - 1] - 1;\n }\n else {\n index = indices[0] - 1;\n }\n }\n else {\n index = canvasIndex - 1;\n }\n return index;\n };\n /**\n * @returns Array of Scene instances in the Sequence\n **/\n Sequence.prototype.getScenes = function () {\n var returnVal = [];\n var low_items = this.__jsonld.elements || this.__jsonld;\n if (low_items) {\n for (var i = 0; i < low_items.length; ++i) {\n var c = low_items[i];\n if (c.type === \'Scene\') {\n var scene = new internal_1.Scene(c, this.options);\n //scene.index = i;\n returnVal.push(scene);\n }\n }\n }\n return returnVal;\n };\n Sequence.prototype.getStartCanvasIndex = function () {\n var startCanvas = this.getStartCanvas();\n if (startCanvas) {\n // if there\'s a startCanvas attribute, loop through the canvases and return the matching index.\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === startCanvas)\n return i;\n }\n }\n // default to first canvas.\n return 0;\n };\n // todo: deprecate\n Sequence.prototype.getThumbs = function (width, height) {\n //console.warn(\'getThumbs will be deprecated, use getThumbnails instead\');\n var thumbs = [];\n var totalCanvases = this.getTotalCanvases();\n for (var i = 0; i < totalCanvases; i++) {\n var canvas = this.getCanvasByIndex(i);\n var thumb = new internal_1.Thumb(width, canvas);\n thumbs.push(thumb);\n }\n return thumbs;\n };\n Sequence.prototype.getThumbnails = function () {\n if (this._thumbnails != null)\n return this._thumbnails;\n this._thumbnails = [];\n var canvases = this.getCanvases();\n for (var i = 0; i < canvases.length; i++) {\n var thumbnail = canvases[i].getThumbnail();\n if (thumbnail) {\n this._thumbnails.push(thumbnail);\n }\n }\n return this._thumbnails;\n };\n Sequence.prototype.getStartCanvas = function () {\n return this.getProperty("startCanvas");\n };\n Sequence.prototype.getTotalCanvases = function () {\n return this.getCanvases().length;\n };\n Sequence.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n else if (this.options.resource.getViewingDirection) {\n return this.options.resource.getViewingDirection();\n }\n return null;\n };\n Sequence.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Sequence.prototype.isCanvasIndexOutOfRange = function (canvasIndex) {\n return canvasIndex > this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isFirstCanvas = function (canvasIndex) {\n return canvasIndex === 0;\n };\n Sequence.prototype.isLastCanvas = function (canvasIndex) {\n return canvasIndex === this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isMultiCanvas = function () {\n return this.getTotalCanvases() > 1;\n };\n Sequence.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n return false;\n };\n // checks if the number of canvases is even - therefore has a front and back cover\n Sequence.prototype.isTotalCanvasesEven = function () {\n return this.getTotalCanvases() % 2 === 0;\n };\n return Sequence;\n}(internal_1.ManifestResource));\nexports.Sequence = Sequence;\n\n\n//# sourceURL=webpack://manifesto/./src/Sequence.ts?')},"./src/Serialisation.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Deserialiser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Deserialiser = /** @class */ (function () {\n function Deserialiser() {\n }\n Deserialiser.parse = function (manifest, options) {\n if (typeof manifest === "string") {\n manifest = JSON.parse(manifest);\n }\n return this.parseJson(manifest, options);\n };\n Deserialiser.parseJson = function (json, options) {\n var resource;\n // have options been passed for the manifest to inherit?\n if (options) {\n if (options.navDate && !isNaN(options.navDate.getTime())) {\n json.navDate = options.navDate.toString();\n }\n }\n if (json["@type"]) {\n switch (json["@type"]) {\n case "sc:Collection":\n resource = this.parseCollection(json, options);\n break;\n case "sc:Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n else {\n // presentation 3\n switch (json["type"]) {\n case "Collection":\n resource = this.parseCollection(json, options);\n break;\n case "Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n // Top-level resource was loaded from a URI, so flag it to prevent\n // unnecessary reload:\n resource.isLoaded = true;\n return resource;\n };\n Deserialiser.parseCollection = function (json, options) {\n var collection = new internal_1.Collection(json, options);\n if (options) {\n collection.index = options.index || 0;\n if (options.resource) {\n collection.parentCollection = options.resource.parentCollection;\n }\n }\n else {\n collection.index = 0;\n }\n this.parseCollections(collection, options);\n this.parseManifests(collection, options);\n this.parseItems(collection, options);\n return collection;\n };\n Deserialiser.parseCollections = function (collection, options) {\n var items;\n if (collection.__jsonld.collections) {\n items = collection.__jsonld.collections;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "collection"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (options) {\n options.index = i;\n }\n var item = this.parseCollection(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseManifest = function (json, options) {\n var manifest = new internal_1.Manifest(json, options);\n return manifest;\n };\n Deserialiser.parseManifests = function (collection, options) {\n var items;\n if (collection.__jsonld.manifests) {\n items = collection.__jsonld.manifests;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "manifest"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = this.parseManifest(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseItem = function (json, options) {\n if (json["@type"]) {\n if (json["@type"].toLowerCase() === "sc:manifest") {\n return this.parseManifest(json, options);\n }\n else if (json["@type"].toLowerCase() === "sc:collection") {\n return this.parseCollection(json, options);\n }\n }\n else if (json.type) {\n if (json.type.toLowerCase() === "manifest") {\n return this.parseManifest(json, options);\n }\n else if (json.type.toLowerCase() === "collection") {\n return this.parseCollection(json, options);\n }\n }\n return null;\n };\n Deserialiser.parseItems = function (collection, options) {\n var items = collection.__jsonld.members || collection.__jsonld.items;\n if (items) {\n var _loop_1 = function (i) {\n if (options) {\n options.index = i;\n }\n var item = this_1.parseItem(items[i], options);\n if (!item)\n return { value: void 0 };\n // only add to items if not already parsed from backwards-compatible collections/manifests arrays\n if (collection.items.filter(function (m) { return m.id === item.id; })[0]) {\n return "continue";\n }\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n };\n var this_1 = this;\n for (var i = 0; i < items.length; i++) {\n var state_1 = _loop_1(i);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n }\n };\n return Deserialiser;\n}());\nexports.Deserialiser = Deserialiser;\n\n\n//# sourceURL=webpack://manifesto/./src/Serialisation.ts?')},"./src/Service.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Service = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Service = /** @class */ (function (_super) {\n __extends(Service, _super);\n function Service(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Service.prototype.getProfile = function () {\n var profile = this.getProperty("profile");\n if (!profile) {\n profile = this.getProperty("dcterms:conformsTo");\n }\n if (Array.isArray(profile)) {\n return profile[0];\n }\n return profile;\n };\n Service.prototype.getConfirmLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale);\n };\n Service.prototype.getDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("description"), this.options.locale);\n };\n Service.prototype.getFailureDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale);\n };\n Service.prototype.getFailureHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale);\n };\n Service.prototype.getHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("header"), this.options.locale);\n };\n Service.prototype.getServiceLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("label"), this.options.locale);\n };\n Service.prototype.getInfoUri = function () {\n var infoUri = this.id;\n if (!infoUri.endsWith("/")) {\n infoUri += "/";\n }\n infoUri += "info.json";\n return infoUri;\n };\n return Service;\n}(internal_1.ManifestResource));\nexports.Service = Service;\n\n\n//# sourceURL=webpack://manifesto/./src/Service.ts?')},"./src/Size.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Size = void 0;\nvar Size = /** @class */ (function () {\n function Size(width, height) {\n this.width = width;\n this.height = height;\n }\n return Size;\n}());\nexports.Size = Size;\n\n\n//# sourceURL=webpack://manifesto/./src/Size.ts?')},"./src/SpecificResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.SpecificResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n Developer note: This implementation does not strictly adhere\n to the description of SpecificResource in the Web Annotation Model\n document https://www.w3.org/TR/annotation-model/\n section 4 : https://www.w3.org/TR/annotation-model/#specific-resources\n \n The getTransform() method returning an Array of 3D Transfom resources, is\n an extension of SpecificResource beyond the web annotation model.\n*/\nvar SpecificResource = /** @class */ (function (_super) {\n __extends(SpecificResource, _super);\n function SpecificResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = false;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = true;\n _this.isSpecificResource = true;\n return _this;\n }\n ;\n SpecificResource.prototype.getSource = function () {\n var raw = this.getPropertyAsObject("source");\n if (raw.isIRI)\n return raw;\n /*\n this logic gets a little convoluted, because we have to preserve\n the cases where the raw json is an array for the sources of a\n SpecificResource applied to an annotation body, while for a target\n of an Annotation we just want a single object\n */\n // case of a source of a SpecificResource which is an Annotation target\n if (raw) {\n var containerTypes = ["Scene", "Canvas"];\n var singleItem = ([].concat(raw))[0];\n if (containerTypes.includes(singleItem["type"]))\n return singleItem;\n }\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n return internal_1.AnnotationBodyParser.BuildFromJson(item, this.options);\n }\n }\n throw new Error("cannot resolve Source " + JSON.stringify(raw));\n };\n Object.defineProperty(SpecificResource.prototype, "Source", {\n get: function () { return this.getSource(); },\n enumerable: false,\n configurable: true\n });\n SpecificResource.prototype.getSelector = function () {\n var raw = this.getProperty("selector");\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n if (item["type"] === "PointSelector")\n return new internal_1.PointSelector(item);\n }\n throw new Error("unable to resolve SpecificResource selector " + JSON.stringify(this.__jsonld));\n }\n return null;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Selector", {\n get: function () { return this.getSelector(); },\n enumerable: false,\n configurable: true\n });\n SpecificResource.prototype.getTransform = function () {\n var retVal = [];\n var transformItems = this.getProperty("transform");\n for (var i = 0; i < transformItems.length; ++i) {\n var transformItem = transformItems[i];\n retVal.push(internal_1.TransformParser.BuildFromJson(transformItem));\n }\n return retVal;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Transform", {\n get: function () { return this.getTransform(); },\n enumerable: false,\n configurable: true\n });\n return SpecificResource;\n}(internal_1.ManifestResource));\nexports.SpecificResource = SpecificResource;\n\n\n//# sourceURL=webpack://manifesto/./src/SpecificResource.ts?')},"./src/StatusCode.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.StatusCode = void 0;\nvar StatusCode;\n(function (StatusCode) {\n StatusCode[StatusCode["AUTHORIZATION_FAILED"] = 1] = "AUTHORIZATION_FAILED";\n StatusCode[StatusCode["FORBIDDEN"] = 2] = "FORBIDDEN";\n StatusCode[StatusCode["INTERNAL_SERVER_ERROR"] = 3] = "INTERNAL_SERVER_ERROR";\n StatusCode[StatusCode["RESTRICTED"] = 4] = "RESTRICTED";\n})(StatusCode || (exports.StatusCode = StatusCode = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/StatusCode.ts?')},"./src/Thumb.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumb = void 0;\n// todo: deprecate\n// this is used by Sequence.getThumbs\nvar Thumb = /** @class */ (function () {\n function Thumb(width, canvas) {\n this.data = canvas;\n this.index = canvas.index;\n this.width = width;\n var heightRatio = canvas.getHeight() / canvas.getWidth();\n if (heightRatio) {\n this.height = Math.floor(this.width * heightRatio);\n }\n else {\n this.height = width;\n }\n this.uri = canvas.getCanonicalImageUri(width);\n this.label = canvas.getLabel().getValue(); // todo: pass locale?\n this.viewingHint = canvas.getViewingHint();\n }\n return Thumb;\n}());\nexports.Thumb = Thumb;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumb.ts?')},"./src/Thumbnail.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumbnail = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Thumbnail = /** @class */ (function (_super) {\n __extends(Thumbnail, _super);\n function Thumbnail(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n return Thumbnail;\n}(internal_1.Resource));\nexports.Thumbnail = Thumbnail;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumbnail.ts?')},"./src/Transform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Transform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Transform = /** @class */ (function (_super) {\n __extends(Transform, _super);\n function Transform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTransform = true;\n _this.isTransform = true;\n return _this;\n }\n return Transform;\n}(internal_1.JSONLDResource));\nexports.Transform = Transform;\n\n\n//# sourceURL=webpack://manifesto/./src/Transform.ts?')},"./src/TransformParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TransformParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TransformParser = /** @class */ (function () {\n function TransformParser() {\n }\n TransformParser.BuildFromJson = function (jsonld) {\n if (jsonld.type === "TranslateTransform")\n return new internal_1.TranslateTransform(jsonld);\n else if (jsonld.type === "RotateTransform")\n return new internal_1.RotateTransform(jsonld);\n else if (jsonld.type === "ScaleTransform")\n return new internal_1.ScaleTransform(jsonld);\n else\n throw new Error("Unknown transform type " + jsonld.type);\n };\n return TransformParser;\n}());\nexports.TransformParser = TransformParser;\n\n\n//# sourceURL=webpack://manifesto/./src/TransformParser.ts?')},"./src/TranslateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TranslateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TranslateTransform = /** @class */ (function (_super) {\n __extends(TranslateTransform, _super);\n function TranslateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTranslateTransform = true;\n return _this;\n }\n TranslateTransform.prototype.getTranslation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return TranslateTransform;\n}(internal_1.Transform));\nexports.TranslateTransform = TranslateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/TranslateTransform.ts?')},"./src/TreeNode.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNode = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TreeNode = /** @class */ (function () {\n function TreeNode(label, data) {\n this.label = label;\n this.data = data || {};\n this.nodes = [];\n }\n TreeNode.prototype.addNode = function (node) {\n this.nodes.push(node);\n node.parentNode = this;\n };\n TreeNode.prototype.isCollection = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n };\n TreeNode.prototype.isManifest = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n };\n TreeNode.prototype.isRange = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n };\n return TreeNode;\n}());\nexports.TreeNode = TreeNode;\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNode.ts?')},"./src/TreeNodeType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNodeType = void 0;\nvar TreeNodeType;\n(function (TreeNodeType) {\n TreeNodeType["COLLECTION"] = "collection";\n TreeNodeType["MANIFEST"] = "manifest";\n TreeNodeType["RANGE"] = "range";\n})(TreeNodeType || (exports.TreeNodeType = TreeNodeType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNodeType.ts?')},"./src/Utils.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Utils = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar dist_commonjs_2 = __webpack_require__(/*! @edsilv/http-status-codes/dist-commonjs */ "./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js");\n__webpack_require__(/*! isomorphic-unfetch */ "./node_modules/isomorphic-unfetch/index.js");\nvar Utils = /** @class */ (function () {\n function Utils() {\n }\n Utils.getMediaType = function (type) {\n type = type.toLowerCase();\n type = type.split(";")[0];\n return type.trim();\n };\n Utils.getImageQuality = function (profile) {\n if (profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) {\n return "native";\n }\n return "default";\n };\n Utils.getInexactLocale = function (locale) {\n if (locale.indexOf("-") !== -1) {\n return locale.substr(0, locale.indexOf("-"));\n }\n return locale;\n };\n Utils.getLocalisedValue = function (resource, locale) {\n // if the resource is not an array of translations, return the string.\n if (!Array.isArray(resource)) {\n return resource;\n }\n // test for exact match\n for (var i = 0; i < resource.length; i++) {\n var value_1 = resource[i];\n var language_1 = value_1["@language"];\n if (locale === language_1) {\n return value_1["@value"];\n }\n }\n // test for inexact match\n var match = locale.substr(0, locale.indexOf("-"));\n for (var i = 0; i < resource.length; i++) {\n var value = resource[i];\n var language = value["@language"];\n if (language === match) {\n return value["@value"];\n }\n }\n return null;\n };\n Utils.generateTreeNodeIds = function (treeNode, index) {\n if (index === void 0) { index = 0; }\n var id;\n if (!treeNode.parentNode) {\n id = "0";\n }\n else {\n id = treeNode.parentNode.id + "-" + index;\n }\n treeNode.id = id;\n for (var i = 0; i < treeNode.nodes.length; i++) {\n var n = treeNode.nodes[i];\n Utils.generateTreeNodeIds(n, i);\n }\n };\n Utils.normaliseType = function (type) {\n type = (type || "").toLowerCase();\n if (type.indexOf(":") !== -1) {\n var split = type.split(":");\n return split[1];\n }\n return type;\n };\n Utils.normaliseUrl = function (url) {\n url = url.substr(url.indexOf("://"));\n if (url.indexOf("#") !== -1) {\n url = url.split("#")[0];\n }\n return url;\n };\n Utils.normalisedUrlsMatch = function (url1, url2) {\n return Utils.normaliseUrl(url1) === Utils.normaliseUrl(url2);\n };\n Utils.isImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.isImageServiceType = function (type) {\n return ((type !== null &&\n type.toLowerCase() === dist_commonjs_1.ServiceType.IMAGE_SERVICE_2.toLowerCase()) ||\n type === dist_commonjs_1.ServiceType.IMAGE_SERVICE_3.toLowerCase());\n };\n Utils.isLevel0ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) {\n return true;\n }\n return false;\n };\n Utils.isLevel1ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) {\n return true;\n }\n return false;\n };\n Utils.isLevel2ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.parseManifest = function (manifest, options) {\n return internal_1.Deserialiser.parse(manifest, options);\n };\n Utils.checkStatus = function (response) {\n if (response.ok) {\n return response;\n }\n else {\n var error = new Error(response.statusText);\n error.response = response;\n return Promise.reject(error);\n }\n };\n Utils.loadManifest = function (url) {\n return new Promise(function (resolve, reject) {\n fetch(url)\n .then(Utils.checkStatus)\n .then(function (r) { return r.json(); })\n .then(function (data) {\n resolve(data);\n })\n .catch(function (err) {\n reject();\n });\n });\n };\n Utils.loadExternalResourcesAuth1 = function (resources, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth1(resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n Utils.loadExternalResourceAuth1 = function (resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var storedAccessToken;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, getStoredAccessToken(resource)];\n case 1:\n storedAccessToken = _a.sent();\n if (!storedAccessToken) return [3 /*break*/, 6];\n return [4 /*yield*/, resource.getData(storedAccessToken)];\n case 2:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.OK)) return [3 /*break*/, 3];\n return [2 /*return*/, resource];\n case 3: \n // the stored token is no good for this resource\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 4:\n // the stored token is no good for this resource\n _a.sent();\n _a.label = 5;\n case 5:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n case 6: return [4 /*yield*/, resource.getData()];\n case 7:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.MOVED_TEMPORARILY ||\n resource.status === dist_commonjs_2.UNAUTHORIZED)) return [3 /*break*/, 9];\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 8:\n _a.sent();\n _a.label = 9;\n case 9:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n }\n });\n });\n };\n Utils.doAuthChain = function (resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var externalService, kioskService, clickThroughService, loginService, serviceToTry, lastAttempted, kioskInteraction, contentProviderInteraction, contentProviderInteraction;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // This function enters the flowchart at the < External? > junction\n // http://iiif.io/api/auth/1.0/#workflow-from-the-browser-client-perspective\n if (!resource.isAccessControlled()) {\n return [2 /*return*/, resource]; // no services found\n }\n externalService = resource.externalService;\n if (externalService) {\n externalService.options = resource.options;\n }\n kioskService = resource.kioskService;\n if (kioskService) {\n kioskService.options = resource.options;\n }\n clickThroughService = resource.clickThroughService;\n if (clickThroughService) {\n clickThroughService.options = resource.options;\n }\n loginService = resource.loginService;\n if (loginService) {\n loginService.options = resource.options;\n }\n if (!(!resource.isResponseHandled && resource.status === dist_commonjs_2.MOVED_TEMPORARILY)) return [3 /*break*/, 2];\n return [4 /*yield*/, handleMovedTemporarily(resource)];\n case 1:\n _a.sent();\n return [2 /*return*/, resource];\n case 2:\n serviceToTry = null;\n lastAttempted = null;\n // repetition of logic is left in these steps for clarity:\n // Looking for external pattern\n serviceToTry = externalService;\n if (!serviceToTry) return [3 /*break*/, 4];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 3:\n _a.sent();\n return [2 /*return*/, resource];\n case 4:\n // Looking for kiosk pattern\n serviceToTry = kioskService;\n if (!serviceToTry) return [3 /*break*/, 7];\n lastAttempted = serviceToTry;\n kioskInteraction = openContentProviderInteraction(serviceToTry);\n if (!kioskInteraction) return [3 /*break*/, 7];\n return [4 /*yield*/, userInteractedWithContentProvider(kioskInteraction)];\n case 5:\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 6:\n _a.sent();\n return [2 /*return*/, resource];\n case 7:\n // The code for the next two patterns is identical (other than the profile name).\n // The difference is in the expected behaviour of\n //\n // await userInteractedWithContentProvider(contentProviderInteraction);\n //\n // For clickthrough the opened window should close immediately having established\n // a session, whereas for login the user might spend some time entering credentials etc.\n // Looking for clickthrough pattern\n serviceToTry = clickThroughService;\n if (!serviceToTry) return [3 /*break*/, 11];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 8:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 11];\n // should close immediately\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 9:\n // should close immediately\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 10:\n _a.sent();\n return [2 /*return*/, resource];\n case 11:\n // Looking for login pattern\n serviceToTry = loginService;\n if (!serviceToTry) return [3 /*break*/, 15];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 12:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 15];\n // we expect the user to spend some time interacting\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 13:\n // we expect the user to spend some time interacting\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 14:\n _a.sent();\n return [2 /*return*/, resource];\n case 15:\n // nothing worked! Use the most recently tried service as the source of\n // messages to show to the user.\n if (lastAttempted) {\n showOutOfOptionsMessages(resource, lastAttempted);\n }\n return [2 /*return*/];\n }\n });\n });\n };\n Utils.attemptResourceWithToken = function (resource, openTokenService, authService) {\n return __awaiter(this, void 0, void 0, function () {\n var tokenService, tokenMessage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n tokenService = authService.getService(dist_commonjs_1.ServiceProfile.AUTH_1_TOKEN);\n if (!tokenService) return [3 /*break*/, 3];\n return [4 /*yield*/, openTokenService(resource, tokenService)];\n case 1:\n tokenMessage = _a.sent();\n if (!(tokenMessage && tokenMessage.accessToken)) return [3 /*break*/, 3];\n return [4 /*yield*/, resource.getData(tokenMessage)];\n case 2:\n _a.sent();\n return [2 /*return*/, resource];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n Utils.loadExternalResourcesAuth09 = function (resources, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth09(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n // IIIF auth api pre v1.0\n // Keeping this around for now until the auth 1.0 implementation is stable\n Utils.loadExternalResourceAuth09 = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n if (options && options.pessimisticAccessControl) {\n // pessimistic: access control cookies may have been deleted.\n // always request the access token for every access controlled info.json request\n // returned access tokens are not stored, therefore the login window flashes for every request.\n resource\n .getData()\n .then(function () {\n if (resource.isAccessControlled()) {\n // if the resource has a click through service, use that.\n if (resource.clickThroughService) {\n resolve(clickThrough(resource));\n //} else if(resource.restrictedService) {\n resolve(restricted(resource));\n }\n else {\n login(resource)\n .then(function () {\n getAccessToken(resource, true)\n .then(function (token) {\n resource\n .getData(token)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n }\n else {\n // this info.json isn\'t access controlled, therefore no need to request an access token.\n resolve(resource);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // optimistic: access control cookies may not have been deleted.\n // store access tokens to avoid login window flashes.\n // if cookies are deleted a page refresh is required.\n // try loading the resource using an access token that matches the info.json domain.\n // if an access token is found, request the resource using it regardless of whether it is access controlled.\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n // if the info.json loaded using the stored access token\n if (resource.status === dist_commonjs_2.OK) {\n resolve(handleResourceResponse(resource));\n }\n else {\n // otherwise, load the resource data to determine the correct access control services.\n // if access controlled, do login.\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n // if (resource.restrictedService){\n // reject(Utils.createRestrictedError());\n // } else {\n reject(Utils.createAuthorizationFailedError());\n //}\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n else {\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n });\n };\n Utils.createError = function (name, message) {\n var error = new Error();\n error.message = message;\n error.name = String(name);\n return error;\n };\n Utils.createAuthorizationFailedError = function () {\n return Utils.createError(internal_1.StatusCode.AUTHORIZATION_FAILED, "Authorization failed");\n };\n Utils.createRestrictedError = function () {\n return Utils.createError(internal_1.StatusCode.RESTRICTED, "Restricted");\n };\n Utils.createInternalServerError = function (message) {\n return Utils.createError(internal_1.StatusCode.INTERNAL_SERVER_ERROR, message);\n };\n Utils.authorize = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) {\n return new Promise(function (resolve, reject) {\n resource.getData().then(function () {\n if (resource.isAccessControlled()) {\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource); // happy path ended\n }\n else {\n // the stored token is no good for this resource\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // There was no stored token, but the user might have a cookie that will grant a token\n getAccessToken(resource, false).then(function (accessToken) {\n if (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n // try using the fresh access token\n resource\n .getData(accessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource);\n }\n else {\n // User has a token, but it\'s not good enough\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n // not able to store access token\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // The user did not have a cookie that granted a token\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n });\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // this info.json isn\'t access controlled, therefore there\'s no need to request an access token\n resolve(resource);\n }\n });\n });\n };\n Utils.showAuthInteraction = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject) {\n if (resource.status === dist_commonjs_2.MOVED_TEMPORARILY && !resource.isResponseHandled) {\n // if the resource was redirected to a degraded version\n // and the response hasn\'t been handled yet.\n // if the client wishes to trigger a login, set resource.isResponseHandled to true\n // and call loadExternalResources() again passing the resource.\n resolve(resource);\n // } else if (resource.restrictedService) {\n // resolve(restricted(resource));\n // // TODO: move to next etc\n }\n else if (resource.clickThroughService && !resource.isResponseHandled) {\n // if the resource has a click through service, use that.\n clickThrough(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n else {\n // get an access token\n login(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n };\n Utils.getService = function (resource, profile) {\n var services = this.getServices(resource);\n for (var i = 0; i < services.length; i++) {\n var service = services[i];\n if (service.getProfile() === profile) {\n return service;\n }\n }\n return null;\n };\n Utils.getResourceById = function (parentResource, id) {\n return (Utils.traverseAndFind(parentResource.__jsonld, "@id", id));\n };\n /**\n * Does a depth first traversal of an Object, returning an Object that\n * matches provided k and v arguments\n * @example Utils.traverseAndFind({foo: \'bar\'}, \'foo\', \'bar\')\n */\n Utils.traverseAndFind = function (object, k, v) {\n if (object.hasOwnProperty(k) && object[k] === v) {\n return object;\n }\n for (var i = 0; i < Object.keys(object).length; i++) {\n if (typeof object[Object.keys(object)[i]] === "object") {\n var o = Utils.traverseAndFind(object[Object.keys(object)[i]], k, v);\n if (o != null) {\n return o;\n }\n }\n }\n return undefined;\n };\n Utils.getServices = function (resource, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.onlyService, onlyService = _c === void 0 ? false : _c, _d = _b.onlyServices, onlyServices = _d === void 0 ? false : _d, _e = _b.skipParentResources, skipParentResources = _e === void 0 ? false : _e;\n var services = [];\n // Resources can reference "services" on the manifest. This is a bit of a hack to just get the services from the manifest\n // too. What would be better is if this was used as a "Map" of full services.\n // So when you come across { id: \'...\' } without any data, you can "lookup" services from the manifest.\n // I would have implemented this if I was confident that it was reliable. Instead, I opted for the safest option that\n // should not break any existing services.\n if (!skipParentResources &&\n resource &&\n resource.options &&\n resource.options.resource &&\n resource.options.resource !== resource) {\n services.push.apply(services, Utils.getServices(resource.options.resource, { onlyServices: true }));\n }\n var service = !onlyServices\n ? (resource.__jsonld || resource).service || []\n : [];\n // coerce to array\n if (!Array.isArray(service)) {\n service = [service];\n }\n if (!onlyService) {\n // Some resources also have a `.services` property.\n // https://iiif.io/api/presentation/3.0/#services\n service.push.apply(service, ((resource.__jsonld || resource).services || []));\n }\n if (service.length === 0) {\n return services;\n }\n for (var i = 0; i < service.length; i++) {\n var s = service[i];\n if (typeof s === "string") {\n var r = this.getResourceById(resource.options.resource, s);\n if (r) {\n services.push(new internal_1.Service(r.__jsonld || r, resource.options));\n }\n }\n else {\n services.push(new internal_1.Service(s, resource.options));\n }\n }\n return services;\n };\n Utils.getTemporalComponent = function (target) {\n var temporal = /t=([^&]+)/g.exec(target);\n var t = null;\n if (temporal && temporal[1]) {\n t = temporal[1].split(",");\n }\n return t;\n };\n return Utils;\n}());\nexports.Utils = Utils;\n\n\n//# sourceURL=webpack://manifesto/./src/Utils.ts?')},"./src/index.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.parseManifest = exports.loadManifest = void 0;\n__exportStar(__webpack_require__(/*! ./internal */ "./src/internal.ts"), exports);\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/**\nInitiates downloading an IIIF manifest json file from URL. Returns a Promise\nto allow subsequent processing on a successful fetch.\n\n@param url string containing the URL to Fetch\n@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text.\n**/\nvar loadManifest = function (url) {\n return Utils_1.Utils.loadManifest(url);\n};\nexports.loadManifest = loadManifest;\n/**\nParses IIIF manifest file to return a manifesto Manifest instance\n\n@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file.\n@param options? TODO Not yet documented\n@returns instance of Manifest class.\n**/\nvar parseManifest = function (manifest, options) {\n return Utils_1.Utils.parseManifest(manifest, options);\n};\nexports.parseManifest = parseManifest;\n\n\n//# sourceURL=webpack://manifesto/./src/index.ts?')},"./src/internal.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./JSONLDResource */ "./src/JSONLDResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestResource */ "./src/ManifestResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Resource */ "./src/Resource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IIIFResource */ "./src/IIIFResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./SpecificResource */ "./src/SpecificResource.ts"), exports);\n//export * from "./SpecificResourceForTarget";\n//export * from "./SpecificResourceForBody";\n__exportStar(__webpack_require__(/*! ./AnnotationBody */ "./src/AnnotationBody.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Light */ "./src/Light.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Camera */ "./src/Camera.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationBodyParser */ "./src/AnnotationBodyParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Annotation */ "./src/Annotation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationList */ "./src/AnnotationList.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationPage */ "./src/AnnotationPage.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Canvas */ "./src/Canvas.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Collection */ "./src/Collection.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Duration */ "./src/Duration.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IAccessToken */ "./src/IAccessToken.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalImageResourceData */ "./src/IExternalImageResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResource */ "./src/IExternalResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceData */ "./src/IExternalResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceOptions */ "./src/IExternalResourceOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IManifestoOptions */ "./src/IManifestoOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LabelValuePair */ "./src/LabelValuePair.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Language */ "./src/Language.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LanguageMap */ "./src/LanguageMap.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PropertyValue */ "./src/PropertyValue.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Manifest */ "./src/Manifest.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestType */ "./src/ManifestType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PointSelector */ "./src/PointSelector.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Range */ "./src/Range.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Rendering */ "./src/Rendering.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Scene */ "./src/Scene.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Sequence */ "./src/Sequence.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Serialisation */ "./src/Serialisation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Service */ "./src/Service.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Size */ "./src/Size.ts"), exports);\n__exportStar(__webpack_require__(/*! ./StatusCode */ "./src/StatusCode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumb */ "./src/Thumb.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumbnail */ "./src/Thumbnail.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TransformParser */ "./src/TransformParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNode */ "./src/TreeNode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNodeType */ "./src/TreeNodeType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Utils */ "./src/Utils.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./RotateTransform */ "./src/RotateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ScaleTransform */ "./src/ScaleTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Color */ "./src/Color.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Geometry3d */ "./src/Geometry3d.ts"), exports);\n\n\n//# sourceURL=webpack://manifesto/./src/internal.ts?')},"./node_modules/unfetch/dist/unfetch.module.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},s.onerror=r,s.withCredentials="include"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})}\n//# sourceMappingURL=unfetch.module.js.map\n\n\n//# sourceURL=webpack://manifesto/./node_modules/unfetch/dist/unfetch.module.js?')},"node-fetch":t=>{"use strict";t.exports=node-fetch},"./node_modules/threejs-math/build/threejs-math.cjs":(__unused_webpack_module,exports)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nconst REVISION = '144dev';\nconst MOUSE = {\n\tLEFT: 0,\n\tMIDDLE: 1,\n\tRIGHT: 2,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2\n};\nconst TOUCH = {\n\tROTATE: 0,\n\tPAN: 1,\n\tDOLLY_PAN: 2,\n\tDOLLY_ROTATE: 3\n};\nconst CullFaceNone = 0;\nconst CullFaceBack = 1;\nconst CullFaceFront = 2;\nconst CullFaceFrontBack = 3;\nconst BasicShadowMap = 0;\nconst PCFShadowMap = 1;\nconst PCFSoftShadowMap = 2;\nconst VSMShadowMap = 3;\nconst FrontSide = 0;\nconst BackSide = 1;\nconst DoubleSide = 2;\nconst NoBlending = 0;\nconst NormalBlending = 1;\nconst AdditiveBlending = 2;\nconst SubtractiveBlending = 3;\nconst MultiplyBlending = 4;\nconst CustomBlending = 5;\nconst AddEquation = 100;\nconst SubtractEquation = 101;\nconst ReverseSubtractEquation = 102;\nconst MinEquation = 103;\nconst MaxEquation = 104;\nconst ZeroFactor = 200;\nconst OneFactor = 201;\nconst SrcColorFactor = 202;\nconst OneMinusSrcColorFactor = 203;\nconst SrcAlphaFactor = 204;\nconst OneMinusSrcAlphaFactor = 205;\nconst DstAlphaFactor = 206;\nconst OneMinusDstAlphaFactor = 207;\nconst DstColorFactor = 208;\nconst OneMinusDstColorFactor = 209;\nconst SrcAlphaSaturateFactor = 210;\nconst NeverDepth = 0;\nconst AlwaysDepth = 1;\nconst LessDepth = 2;\nconst LessEqualDepth = 3;\nconst EqualDepth = 4;\nconst GreaterEqualDepth = 5;\nconst GreaterDepth = 6;\nconst NotEqualDepth = 7;\nconst MultiplyOperation = 0;\nconst MixOperation = 1;\nconst AddOperation = 2;\nconst NoToneMapping = 0;\nconst LinearToneMapping = 1;\nconst ReinhardToneMapping = 2;\nconst CineonToneMapping = 3;\nconst ACESFilmicToneMapping = 4;\nconst CustomToneMapping = 5;\nconst UVMapping = 300;\nconst CubeReflectionMapping = 301;\nconst CubeRefractionMapping = 302;\nconst EquirectangularReflectionMapping = 303;\nconst EquirectangularRefractionMapping = 304;\nconst CubeUVReflectionMapping = 306;\nconst RepeatWrapping = 1000;\nconst ClampToEdgeWrapping = 1001;\nconst MirroredRepeatWrapping = 1002;\nconst NearestFilter = 1003;\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004;\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005;\nconst LinearFilter = 1006;\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007;\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008;\nconst UnsignedByteType = 1009;\nconst ByteType = 1010;\nconst ShortType = 1011;\nconst UnsignedShortType = 1012;\nconst IntType = 1013;\nconst UnsignedIntType = 1014;\nconst FloatType = 1015;\nconst HalfFloatType = 1016;\nconst UnsignedShort4444Type = 1017;\nconst UnsignedShort5551Type = 1018;\nconst UnsignedInt248Type = 1020;\nconst AlphaFormat = 1021;\nconst RGBFormat = 1022; // @deprecated since r137\n\nconst RGBAFormat = 1023;\nconst LuminanceFormat = 1024;\nconst LuminanceAlphaFormat = 1025;\nconst DepthFormat = 1026;\nconst DepthStencilFormat = 1027;\nconst RedFormat = 1028;\nconst RedIntegerFormat = 1029;\nconst RGFormat = 1030;\nconst RGIntegerFormat = 1031;\nconst RGBAIntegerFormat = 1033;\nconst RGB_S3TC_DXT1_Format = 33776;\nconst RGBA_S3TC_DXT1_Format = 33777;\nconst RGBA_S3TC_DXT3_Format = 33778;\nconst RGBA_S3TC_DXT5_Format = 33779;\nconst RGB_PVRTC_4BPPV1_Format = 35840;\nconst RGB_PVRTC_2BPPV1_Format = 35841;\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\nconst RGB_ETC1_Format = 36196;\nconst RGB_ETC2_Format = 37492;\nconst RGBA_ETC2_EAC_Format = 37496;\nconst RGBA_ASTC_4x4_Format = 37808;\nconst RGBA_ASTC_5x4_Format = 37809;\nconst RGBA_ASTC_5x5_Format = 37810;\nconst RGBA_ASTC_6x5_Format = 37811;\nconst RGBA_ASTC_6x6_Format = 37812;\nconst RGBA_ASTC_8x5_Format = 37813;\nconst RGBA_ASTC_8x6_Format = 37814;\nconst RGBA_ASTC_8x8_Format = 37815;\nconst RGBA_ASTC_10x5_Format = 37816;\nconst RGBA_ASTC_10x6_Format = 37817;\nconst RGBA_ASTC_10x8_Format = 37818;\nconst RGBA_ASTC_10x10_Format = 37819;\nconst RGBA_ASTC_12x10_Format = 37820;\nconst RGBA_ASTC_12x12_Format = 37821;\nconst RGBA_BPTC_Format = 36492;\nconst LoopOnce = 2200;\nconst LoopRepeat = 2201;\nconst LoopPingPong = 2202;\nconst InterpolateDiscrete = 2300;\nconst InterpolateLinear = 2301;\nconst InterpolateSmooth = 2302;\nconst ZeroCurvatureEnding = 2400;\nconst ZeroSlopeEnding = 2401;\nconst WrapAroundEnding = 2402;\nconst NormalAnimationBlendMode = 2500;\nconst AdditiveAnimationBlendMode = 2501;\nconst TrianglesDrawMode = 0;\nconst TriangleStripDrawMode = 1;\nconst TriangleFanDrawMode = 2;\nconst LinearEncoding = 3000;\nconst sRGBEncoding = 3001;\nconst BasicDepthPacking = 3200;\nconst RGBADepthPacking = 3201;\nconst TangentSpaceNormalMap = 0;\nconst ObjectSpaceNormalMap = 1; // Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\n\nconst NoColorSpace = '';\nconst SRGBColorSpace = 'srgb';\nconst LinearSRGBColorSpace = 'srgb-linear';\nconst ZeroStencilOp = 0;\nconst KeepStencilOp = 7680;\nconst ReplaceStencilOp = 7681;\nconst IncrementStencilOp = 7682;\nconst DecrementStencilOp = 7683;\nconst IncrementWrapStencilOp = 34055;\nconst DecrementWrapStencilOp = 34056;\nconst InvertStencilOp = 5386;\nconst NeverStencilFunc = 512;\nconst LessStencilFunc = 513;\nconst EqualStencilFunc = 514;\nconst LessEqualStencilFunc = 515;\nconst GreaterStencilFunc = 516;\nconst NotEqualStencilFunc = 517;\nconst GreaterEqualStencilFunc = 518;\nconst AlwaysStencilFunc = 519;\nconst StaticDrawUsage = 35044;\nconst DynamicDrawUsage = 35048;\nconst StreamDrawUsage = 35040;\nconst StaticReadUsage = 35045;\nconst DynamicReadUsage = 35049;\nconst StreamReadUsage = 35041;\nconst StaticCopyUsage = 35046;\nconst DynamicCopyUsage = 35050;\nconst StreamCopyUsage = 35042;\nconst GLSL1 = '100';\nconst GLSL3 = '300 es';\nconst _SRGBAFormat = 1035; // fallback for WebGL 1\n\nclass Vector2 {\n\tconstructor(x = 0, y = 0) {\n\t\tVector2.prototype.isVector2 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tget width() {\n\t\treturn this.x;\n\t}\n\n\tset width(value) {\n\t\tthis.x = value;\n\t}\n\n\tget height() {\n\t\treturn this.y;\n\t}\n\n\tset height(value) {\n\t\tthis.y = value;\n\t}\n\n\tset(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\treturn this;\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6];\n\t\tthis.y = e[1] * x + e[4] * y + e[7];\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y;\n\t}\n\n\tcross(v) {\n\t\treturn this.x * v.y - this.y * v.x;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tangle() {\n\t\t// computes the angle in radians with respect to the positive x-axis\n\t\tconst angle = Math.atan2(-this.y, -this.x) + Math.PI;\n\t\treturn angle;\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \treturn this;\n\t// }\n\n\n\trotateAround(center, angle) {\n\t\tconst c = Math.cos(angle),\n\t\t\t\t\ts = Math.sin(angle);\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\t\treturn this;\n\t}\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t}\n\n}\n\nconst _lut = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff'];\nlet _seed = 1234567;\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI; // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\nfunction generateUUID() {\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[d0 & 0xff] + _lut[d0 >> 8 & 0xff] + _lut[d0 >> 16 & 0xff] + _lut[d0 >> 24 & 0xff] + '-' + _lut[d1 & 0xff] + _lut[d1 >> 8 & 0xff] + '-' + _lut[d1 >> 16 & 0x0f | 0x40] + _lut[d1 >> 24 & 0xff] + '-' + _lut[d2 & 0x3f | 0x80] + _lut[d2 >> 8 & 0xff] + '-' + _lut[d2 >> 16 & 0xff] + _lut[d2 >> 24 & 0xff] + _lut[d3 & 0xff] + _lut[d3 >> 8 & 0xff] + _lut[d3 >> 16 & 0xff] + _lut[d3 >> 24 & 0xff]; // .toLowerCase() here flattens concatenated strings to save heap memory space.\n\n\treturn uuid.toLowerCase();\n}\n\nfunction clamp(value, min, max) {\n\treturn Math.max(min, Math.min(max, value));\n} // compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\n\n\nfunction euclideanModulo(n, m) {\n\treturn (n % m + m) % m;\n} // Linear mapping from range to range \n\n\nfunction mapLinear(x, a1, a2, b1, b2) {\n\treturn b1 + (x - a1) * (b2 - b1) / (a2 - a1);\n} // https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\nfunction inverseLerp(x, y, value) {\n\tif (x !== y) {\n\t\treturn (value - x) / (y - x);\n\t} else {\n\t\treturn 0;\n\t}\n} // https://en.wikipedia.org/wiki/Linear_interpolation\n\n\nfunction lerp(x, y, t) {\n\treturn (1 - t) * x + t * y;\n} // http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\n\n\nfunction damp(x, y, lambda, dt) {\n\treturn lerp(x, y, 1 - Math.exp(-lambda * dt));\n} // https://www.desmos.com/calculator/vcsjnyz7x4\n\n\nfunction pingpong(x, length = 1) {\n\treturn length - Math.abs(euclideanModulo(x, length * 2) - length);\n} // http://en.wikipedia.org/wiki/Smoothstep\n\n\nfunction smoothstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * (3 - 2 * x);\n}\n\nfunction smootherstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * x * (x * (x * 6 - 15) + 10);\n} // Random integer from interval\n\n\nfunction randInt(low, high) {\n\treturn low + Math.floor(Math.random() * (high - low + 1));\n} // Random float from interval\n\n\nfunction randFloat(low, high) {\n\treturn low + Math.random() * (high - low);\n} // Random float from <-range/2, range/2> interval\n\n\nfunction randFloatSpread(range) {\n\treturn range * (0.5 - Math.random());\n} // Deterministic pseudo-random float in the interval [ 0, 1 ]\n\n\nfunction seededRandom(s) {\n\tif (s !== undefined) _seed = s; // Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\tt = Math.imul(t ^ t >>> 15, t | 1);\n\tt ^= t + Math.imul(t ^ t >>> 7, t | 61);\n\treturn ((t ^ t >>> 14) >>> 0) / 4294967296;\n}\n\nfunction degToRad(degrees) {\n\treturn degrees * DEG2RAD;\n}\n\nfunction radToDeg(radians) {\n\treturn radians * RAD2DEG;\n}\n\nfunction isPowerOfTwo(value) {\n\treturn (value & value - 1) === 0 && value !== 0;\n}\n\nfunction ceilPowerOfTwo(value) {\n\treturn Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n}\n\nfunction floorPowerOfTwo(value) {\n\treturn Math.pow(2, Math.floor(Math.log(value) / Math.LN2));\n}\n\nfunction setQuaternionFromProperEuler(q, a, b, c, order) {\n\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\t// rotations are applied to the axes in the order specified by 'order'\n\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t// angles are in radians\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\tconst c2 = cos(b / 2);\n\tconst s2 = sin(b / 2);\n\tconst c13 = cos((a + c) / 2);\n\tconst s13 = sin((a + c) / 2);\n\tconst c1_3 = cos((a - c) / 2);\n\tconst s1_3 = sin((a - c) / 2);\n\tconst c3_1 = cos((c - a) / 2);\n\tconst s3_1 = sin((c - a) / 2);\n\n\tswitch (order) {\n\t\tcase 'XYX':\n\t\t\tq.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order);\n\t}\n}\n\nfunction denormalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\t\t\treturn value / 255.0;\n\n\t\tcase Int16Array:\n\t\t\treturn Math.max(value / 32767.0, -1.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.max(value / 127.0, -1.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nfunction normalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn Math.round(value * 65535.0);\n\n\t\tcase Uint8Array:\n\t\t\treturn Math.round(value * 255.0);\n\n\t\tcase Int16Array:\n\t\t\treturn Math.round(value * 32767.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.round(value * 127.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nvar MathUtils = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\tgenerateUUID: generateUUID,\n\tclamp: clamp,\n\teuclideanModulo: euclideanModulo,\n\tmapLinear: mapLinear,\n\tinverseLerp: inverseLerp,\n\tlerp: lerp,\n\tdamp: damp,\n\tpingpong: pingpong,\n\tsmoothstep: smoothstep,\n\tsmootherstep: smootherstep,\n\trandInt: randInt,\n\trandFloat: randFloat,\n\trandFloatSpread: randFloatSpread,\n\tseededRandom: seededRandom,\n\tdegToRad: degToRad,\n\tradToDeg: radToDeg,\n\tisPowerOfTwo: isPowerOfTwo,\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\tnormalize: normalize,\n\tdenormalize: denormalize\n});\n\nclass Quaternion {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tthis.isQuaternion = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\t}\n\n\tstatic slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) {\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\t\tlet x0 = src0[srcOffset0 + 0],\n\t\t\t\ty0 = src0[srcOffset0 + 1],\n\t\t\t\tz0 = src0[srcOffset0 + 2],\n\t\t\t\tw0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1 + 0],\n\t\t\t\t\ty1 = src1[srcOffset1 + 1],\n\t\t\t\t\tz1 = src1[srcOffset1 + 2],\n\t\t\t\t\tw1 = src1[srcOffset1 + 3];\n\n\t\tif (t === 0) {\n\t\t\tdst[dstOffset + 0] = x0;\n\t\t\tdst[dstOffset + 1] = y0;\n\t\t\tdst[dstOffset + 2] = z0;\n\t\t\tdst[dstOffset + 3] = w0;\n\t\t\treturn;\n\t\t}\n\n\t\tif (t === 1) {\n\t\t\tdst[dstOffset + 0] = x1;\n\t\t\tdst[dstOffset + 1] = y1;\n\t\t\tdst[dstOffset + 2] = z1;\n\t\t\tdst[dstOffset + 3] = w1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\t\t\tdir = cos >= 0 ? 1 : -1,\n\t\t\t\t\t\tsqrSin = 1 - cos * cos; // Skip the Slerp for tiny steps to avoid numeric problems:\n\n\t\t\tif (sqrSin > Number.EPSILON) {\n\t\t\t\tconst sin = Math.sqrt(sqrSin),\n\t\t\t\t\t\t\tlen = Math.atan2(sin, cos * dir);\n\t\t\t\ts = Math.sin(s * len) / sin;\n\t\t\t\tt = Math.sin(t * len) / sin;\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir; // Normalize in case we just did a lerp:\n\n\t\t\tif (s === 1 - t) {\n\t\t\t\tconst f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\t\t\t}\n\t\t}\n\n\t\tdst[dstOffset] = x0;\n\t\tdst[dstOffset + 1] = y0;\n\t\tdst[dstOffset + 2] = z0;\n\t\tdst[dstOffset + 3] = w0;\n\t}\n\n\tstatic multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {\n\t\tconst x0 = src0[srcOffset0];\n\t\tconst y0 = src0[srcOffset0 + 1];\n\t\tconst z0 = src0[srcOffset0 + 2];\n\t\tconst w0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1];\n\t\tconst y1 = src1[srcOffset1 + 1];\n\t\tconst z1 = src1[srcOffset1 + 2];\n\t\tconst w1 = src1[srcOffset1 + 3];\n\t\tdst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\t\treturn dst;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget w() {\n\t\treturn this._w;\n\t}\n\n\tset w(value) {\n\t\tthis._w = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._w);\n\t}\n\n\tcopy(quaternion) {\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromEuler(euler, update) {\n\t\tconst x = euler._x,\n\t\t\t\t\ty = euler._y,\n\t\t\t\t\tz = euler._z,\n\t\t\t\t\torder = euler._order; // http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\t\tconst c1 = cos(x / 2);\n\t\tconst c2 = cos(y / 2);\n\t\tconst c3 = cos(z / 2);\n\t\tconst s1 = sin(x / 2);\n\t\tconst s2 = sin(y / 2);\n\t\tconst s3 = sin(z / 2);\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tif (update !== false) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromAxisAngle(axis, angle) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\t\t// assumes axis is normalized\n\t\tconst halfAngle = angle / 2,\n\t\t\t\t\ts = Math.sin(halfAngle);\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos(halfAngle);\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10],\n\t\t\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif (trace > 0) {\n\t\t\tconst s = 0.5 / Math.sqrt(trace + 1.0);\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = (m32 - m23) * s;\n\t\t\tthis._y = (m13 - m31) * s;\n\t\t\tthis._z = (m21 - m12) * s;\n\t\t} else if (m11 > m22 && m11 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\t\t\tthis._w = (m32 - m23) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = (m12 + m21) / s;\n\t\t\tthis._z = (m13 + m31) / s;\n\t\t} else if (m22 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\t\t\tthis._w = (m13 - m31) / s;\n\t\t\tthis._x = (m12 + m21) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = (m23 + m32) / s;\n\t\t} else {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\t\t\tthis._w = (m21 - m12) / s;\n\t\t\tthis._x = (m13 + m31) / s;\n\t\t\tthis._y = (m23 + m32) / s;\n\t\t\tthis._z = 0.25 * s;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromUnitVectors(vFrom, vTo) {\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\t\tlet r = vFrom.dot(vTo) + 1;\n\n\t\tif (r < Number.EPSILON) {\n\t\t\t// vFrom and vTo point in opposite directions\n\t\t\tr = 0;\n\n\t\t\tif (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n\t\t\t\tthis._x = -vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\t\t\t} else {\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = -vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\t\t\t}\n\t\t} else {\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\t\t}\n\n\t\treturn this.normalize();\n\t}\n\n\tangleTo(q) {\n\t\treturn 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));\n\t}\n\n\trotateTowards(q, step) {\n\t\tconst angle = this.angleTo(q);\n\t\tif (angle === 0) return this;\n\t\tconst t = Math.min(1, step / angle);\n\t\tthis.slerp(q, t);\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\treturn this.set(0, 0, 0, 1);\n\t}\n\n\tinvert() {\n\t\t// quaternion is assumed to have unit length\n\t\treturn this.conjugate();\n\t}\n\n\tconjugate() {\n\t\tthis._x *= -1;\n\t\tthis._y *= -1;\n\t\tthis._z *= -1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\t}\n\n\tlengthSq() {\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n\t}\n\n\tnormalize() {\n\t\tlet l = this.length();\n\n\t\tif (l === 0) {\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\t\t} else {\n\t\t\tl = 1 / l;\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tmultiply(q) {\n\t\treturn this.multiplyQuaternions(this, q);\n\t}\n\n\tpremultiply(q) {\n\t\treturn this.multiplyQuaternions(q, this);\n\t}\n\n\tmultiplyQuaternions(a, b) {\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\t\tconst qax = a._x,\n\t\t\t\t\tqay = a._y,\n\t\t\t\t\tqaz = a._z,\n\t\t\t\t\tqaw = a._w;\n\t\tconst qbx = b._x,\n\t\t\t\t\tqby = b._y,\n\t\t\t\t\tqbz = b._z,\n\t\t\t\t\tqbw = b._w;\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerp(qb, t) {\n\t\tif (t === 0) return this;\n\t\tif (t === 1) return this.copy(qb);\n\t\tconst x = this._x,\n\t\t\t\t\ty = this._y,\n\t\t\t\t\tz = this._z,\n\t\t\t\t\tw = this._w; // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif (cosHalfTheta < 0) {\n\t\t\tthis._w = -qb._w;\n\t\t\tthis._x = -qb._x;\n\t\t\tthis._y = -qb._y;\n\t\t\tthis._z = -qb._z;\n\t\t\tcosHalfTheta = -cosHalfTheta;\n\t\t} else {\n\t\t\tthis.copy(qb);\n\t\t}\n\n\t\tif (cosHalfTheta >= 1.0) {\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif (sqrSinHalfTheta <= Number.EPSILON) {\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\t\t\tthis.normalize();\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt(sqrSinHalfTheta);\n\t\tconst halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);\n\t\tconst ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n\t\t\t\t\tratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n\t\tthis._w = w * ratioA + this._w * ratioB;\n\t\tthis._x = x * ratioA + this._x * ratioB;\n\t\tthis._y = y * ratioA + this._y * ratioB;\n\t\tthis._z = z * ratioA + this._z * ratioB;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerpQuaternions(qa, qb, t) {\n\t\treturn this.copy(qa).slerp(qb, t);\n\t}\n\n\trandom() {\n\t\t// Derived from http://planning.cs.uiuc.edu/node198.html\n\t\t// Note, this source uses w, x, y, z ordering,\n\t\t// so we swap the order below.\n\t\tconst u1 = Math.random();\n\t\tconst sqrt1u1 = Math.sqrt(1 - u1);\n\t\tconst sqrtu1 = Math.sqrt(u1);\n\t\tconst u2 = 2 * Math.PI * Math.random();\n\t\tconst u3 = 2 * Math.PI * Math.random();\n\t\treturn this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2));\n\t}\n\n\tequals(quaternion) {\n\t\treturn quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis._x = array[offset];\n\t\tthis._y = array[offset + 1];\n\t\tthis._z = array[offset + 2];\n\t\tthis._w = array[offset + 3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis._x = attribute.getX( index );\n\t// \tthis._y = attribute.getY( index );\n\t// \tthis._z = attribute.getZ( index );\n\t// \tthis._w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\t}\n\n}\n\nclass Vector3 {\n\tconstructor(x = 0, y = 0, z = 0) {\n\t\tVector3.prototype.isVector3 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}\n\n\tset(x, y, z) {\n\t\tif (z === undefined) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\treturn this;\n\t}\n\n\tmultiplyVectors(a, b) {\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\t\treturn this;\n\t}\n\n\tapplyEuler(euler) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromEuler(euler));\n\t}\n\n\tapplyAxisAngle(axis, angle) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromAxisAngle(axis, angle));\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6] * z;\n\t\tthis.y = e[1] * x + e[4] * y + e[7] * z;\n\t\tthis.z = e[2] * x + e[5] * y + e[8] * z;\n\t\treturn this;\n\t}\n\n\tapplyNormalMatrix(m) {\n\t\treturn this.applyMatrix3(m).normalize();\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\tthis.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w;\n\t\tthis.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w;\n\t\tthis.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w;\n\t\treturn this;\n\t}\n\n\tapplyQuaternion(q) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst qx = q.x,\n\t\t\t\t\tqy = q.y,\n\t\t\t\t\tqz = q.z,\n\t\t\t\t\tqw = q.w; // calculate quat * vector\n\n\t\tconst ix = qw * x + qy * z - qz * y;\n\t\tconst iy = qw * y + qz * x - qx * z;\n\t\tconst iz = qw * z + qx * y - qy * x;\n\t\tconst iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n\t\tthis.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t\tthis.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t\tthis.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t\treturn this;\n\t} // project( camera ) {\n\t// \treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\t// }\n\t// unproject( camera ) {\n\t// \treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\t// }\n\n\n\ttransformDirection(m) {\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z;\n\t\treturn this.normalize();\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t} // TODO lengthSquared?\n\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\treturn this;\n\t}\n\n\tcross(v) {\n\t\treturn this.crossVectors(this, v);\n\t}\n\n\tcrossVectors(a, b) {\n\t\tconst ax = a.x,\n\t\t\t\t\tay = a.y,\n\t\t\t\t\taz = a.z;\n\t\tconst bx = b.x,\n\t\t\t\t\tby = b.y,\n\t\t\t\t\tbz = b.z;\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\t\treturn this;\n\t}\n\n\tprojectOnVector(v) {\n\t\tconst denominator = v.lengthSq();\n\t\tif (denominator === 0) return this.set(0, 0, 0);\n\t\tconst scalar = v.dot(this) / denominator;\n\t\treturn this.copy(v).multiplyScalar(scalar);\n\t}\n\n\tprojectOnPlane(planeNormal) {\n\t\t_vector$3.copy(this).projectOnVector(planeNormal);\n\n\t\treturn this.sub(_vector$3);\n\t}\n\n\treflect(normal) {\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\t\treturn this.sub(_vector$3.copy(normal).multiplyScalar(2 * this.dot(normal)));\n\t}\n\n\tangleTo(v) {\n\t\tconst denominator = Math.sqrt(this.lengthSq() * v.lengthSq());\n\t\tif (denominator === 0) return Math.PI / 2;\n\t\tconst theta = this.dot(v) / denominator; // clamp, to handle numerical problems\n\n\t\treturn Math.acos(clamp(theta, -1, 1));\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y,\n\t\t\t\t\tdz = this.z - v.z;\n\t\treturn dx * dx + dy * dy + dz * dz;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);\n\t}\n\n\tsetFromSpherical(s) {\n\t\treturn this.setFromSphericalCoords(s.radius, s.phi, s.theta);\n\t}\n\n\tsetFromSphericalCoords(radius, phi, theta) {\n\t\tconst sinPhiRadius = Math.sin(phi) * radius;\n\t\tthis.x = sinPhiRadius * Math.sin(theta);\n\t\tthis.y = Math.cos(phi) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromCylindrical(c) {\n\t\treturn this.setFromCylindricalCoords(c.radius, c.theta, c.y);\n\t}\n\n\tsetFromCylindricalCoords(radius, theta, y) {\n\t\tthis.x = radius * Math.sin(theta);\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromMatrixPosition(m) {\n\t\tconst e = m.elements;\n\t\tthis.x = e[12];\n\t\tthis.y = e[13];\n\t\tthis.z = e[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrixScale(m) {\n\t\tconst sx = this.setFromMatrixColumn(m, 0).length();\n\t\tconst sy = this.setFromMatrixColumn(m, 1).length();\n\t\tconst sz = this.setFromMatrixColumn(m, 2).length();\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\t\treturn this;\n\t}\n\n\tsetFromMatrixColumn(m, index) {\n\t\treturn this.fromArray(m.elements, index * 4);\n\t}\n\n\tsetFromMatrix3Column(m, index) {\n\t\treturn this.fromArray(m.elements, index * 3);\n\t}\n\n\tsetFromEuler(e) {\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\treturn this;\n\t}\n\n\trandomDirection() {\n\t\t// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\n\t\tconst u = (Math.random() - 0.5) * 2;\n\t\tconst t = Math.random() * Math.PI * 2;\n\t\tconst f = Math.sqrt(1 - u ** 2);\n\t\tthis.x = f * Math.cos(t);\n\t\tthis.y = f * Math.sin(t);\n\t\tthis.z = u;\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/new Vector3();\n\nconst _quaternion$1 = /*@__PURE__*/new Quaternion();\n\nconst _vector$2 = /*@__PURE__*/new Vector2();\n\nclass Box2 {\n\tconstructor(min = new Vector2(+Infinity, +Infinity), max = new Vector2(-Infinity, -Infinity)) {\n\t\tthis.isBox2 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$2.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = +Infinity;\n\t\tthis.max.x = this.max.y = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y;\n\t}\n\n\tgetCenter(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 4 splitting planes to rule out intersections\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$2.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max);\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nclass Box3 {\n\tconstructor(min = new Vector3(+Infinity, +Infinity, +Infinity), max = new Vector3(-Infinity, -Infinity, -Infinity)) {\n\t\tthis.isBox3 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromArray(array) {\n\t\tlet minX = +Infinity;\n\t\tlet minY = +Infinity;\n\t\tlet minZ = +Infinity;\n\t\tlet maxX = -Infinity;\n\t\tlet maxY = -Infinity;\n\t\tlet maxZ = -Infinity;\n\n\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\tconst x = array[i];\n\t\t\tconst y = array[i + 1];\n\t\t\tconst z = array[i + 2];\n\t\t\tif (x < minX) minX = x;\n\t\t\tif (y < minY) minY = y;\n\t\t\tif (z < minZ) minZ = z;\n\t\t\tif (x > maxX) maxX = x;\n\t\t\tif (y > maxY) maxY = y;\n\t\t\tif (z > maxZ) maxZ = z;\n\t\t}\n\n\t\tthis.min.set(minX, minY, minZ);\n\t\tthis.max.set(maxX, maxY, maxZ);\n\t\treturn this;\n\t} // setFromBufferAttribute( attribute ) {\n\t// \tlet minX = + Infinity;\n\t// \tlet minY = + Infinity;\n\t// \tlet minZ = + Infinity;\n\t// \tlet maxX = - Infinity;\n\t// \tlet maxY = - Infinity;\n\t// \tlet maxZ = - Infinity;\n\t// \tfor ( let i = 0, l = attribute.count; i < l; i ++ ) {\n\t// \t\tconst x = attribute.getX( i );\n\t// \t\tconst y = attribute.getY( i );\n\t// \t\tconst z = attribute.getZ( i );\n\t// \t\tif ( x < minX ) minX = x;\n\t// \t\tif ( y < minY ) minY = y;\n\t// \t\tif ( z < minZ ) minZ = z;\n\t// \t\tif ( x > maxX ) maxX = x;\n\t// \t\tif ( y > maxY ) maxY = y;\n\t// \t\tif ( z > maxZ ) maxZ = z;\n\t// \t}\n\t// \tthis.min.set( minX, minY, minZ );\n\t// \tthis.max.set( maxX, maxY, maxZ );\n\t// \treturn this;\n\t// }\n\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$1.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tsetFromObject(object, precise = false) {\n\t\tthis.makeEmpty();\n\t\treturn this.expandByObject(object, precise);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = this.min.z = +Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n\t}\n\n\tgetCenter(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t} // expandByObject( object, precise = false ) {\n\t// \t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t// \t// accounting for both the object's, and children's, world transforms\n\t// \tobject.updateWorldMatrix( false, false );\n\t// \tconst geometry = object.geometry;\n\t// \tif ( geometry !== undefined ) {\n\t// \t\tif ( precise && geometry.attributes != undefined && geometry.attributes.position !== undefined ) {\n\t// \t\t\tconst position = geometry.attributes.position;\n\t// \t\t\tfor ( let i = 0, l = position.count; i < l; i ++ ) {\n\t// \t\t\t\t_vector.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );\n\t// \t\t\t\tthis.expandByPoint( _vector );\n\t// \t\t\t}\n\t// \t\t} else {\n\t// \t\t\tif ( geometry.boundingBox === null ) {\n\t// \t\t\t\tgeometry.computeBoundingBox();\n\t// \t\t\t}\n\t// \t\t\t_box.copy( geometry.boundingBox );\n\t// \t\t\t_box.applyMatrix4( object.matrixWorld );\n\t// \t\t\tthis.union( _box );\n\t// \t\t}\n\t// \t}\n\t// \tconst children = object.children;\n\t// \tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\t// \t\tthis.expandByObject( children[ i ], precise );\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint(sphere.center, _vector$1); // If that point is inside the sphere, the AABB and sphere intersect.\n\n\t\treturn _vector$1.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\t\tlet min, max;\n\n\t\tif (plane.normal.x > 0) {\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\t\t} else {\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\t\t}\n\n\t\tif (plane.normal.y > 0) {\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\t\t} else {\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\t\t}\n\n\t\tif (plane.normal.z > 0) {\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\t\t} else {\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\t\t}\n\n\t\treturn min <= -plane.constant && max >= -plane.constant;\n\t}\n\n\tintersectsTriangle(triangle) {\n\t\tif (this.isEmpty()) {\n\t\t\treturn false;\n\t\t} // compute box center and extents\n\n\n\t\tthis.getCenter(_center);\n\n\t\t_extents.subVectors(this.max, _center); // translate triangle to aabb origin\n\n\n\t\t_v0$1.subVectors(triangle.a, _center);\n\n\t\t_v1$3.subVectors(triangle.b, _center);\n\n\t\t_v2$1.subVectors(triangle.c, _center); // compute edge vectors for triangle\n\n\n\t\t_f0.subVectors(_v1$3, _v0$1);\n\n\t\t_f1.subVectors(_v2$1, _v1$3);\n\n\t\t_f2.subVectors(_v0$1, _v2$1); // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\n\n\t\tlet axes = [0, -_f0.z, _f0.y, 0, -_f1.z, _f1.y, 0, -_f2.z, _f2.y, _f0.z, 0, -_f0.x, _f1.z, 0, -_f1.x, _f2.z, 0, -_f2.x, -_f0.y, _f0.x, 0, -_f1.y, _f1.x, 0, -_f2.y, _f2.x, 0];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // test 3 face normals from the aabb\n\n\n\t\taxes = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\n\n\t\t_triangleNormal.crossVectors(_f0, _f1);\n\n\t\taxes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];\n\t\treturn satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents);\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$1.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tgetBoundingSphere(target) {\n\t\tthis.getCenter(target.center);\n\t\ttarget.radius = this.getSize(_vector$1).length() * 0.5;\n\t\treturn target;\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max); // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\n\t\tif (this.isEmpty()) this.makeEmpty();\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\t// transform of empty box is an empty box.\n\t\tif (this.isEmpty()) return this; // NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\n\t\t_points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); // 000\n\n\n\t\t_points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); // 001\n\n\n\t\t_points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); // 010\n\n\n\t\t_points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); // 011\n\n\n\t\t_points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); // 100\n\n\n\t\t_points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); // 101\n\n\n\t\t_points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); // 110\n\n\n\t\t_points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); // 111\n\n\n\t\tthis.setFromPoints(_points);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nconst _points = [/*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3()];\n\nconst _vector$1 = /*@__PURE__*/new Vector3();\n\nconst _box$1 = /*@__PURE__*/new Box3(); // triangle centered vertices\n\n\nconst _v0$1 = /*@__PURE__*/new Vector3();\n\nconst _v1$3 = /*@__PURE__*/new Vector3();\n\nconst _v2$1 = /*@__PURE__*/new Vector3(); // triangle edge vectors\n\n\nconst _f0 = /*@__PURE__*/new Vector3();\n\nconst _f1 = /*@__PURE__*/new Vector3();\n\nconst _f2 = /*@__PURE__*/new Vector3();\n\nconst _center = /*@__PURE__*/new Vector3();\n\nconst _extents = /*@__PURE__*/new Vector3();\n\nconst _triangleNormal = /*@__PURE__*/new Vector3();\n\nconst _testAxis = /*@__PURE__*/new Vector3();\n\nfunction satForAxes(axes, v0, v1, v2, extents) {\n\tfor (let i = 0, j = axes.length - 3; i <= j; i += 3) {\n\t\t_testAxis.fromArray(axes, i); // project the aabb onto the separating axis\n\n\n\t\tconst r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); // project all 3 vertices of the triangle onto the separating axis\n\n\t\tconst p0 = v0.dot(_testAxis);\n\t\tconst p1 = v1.dot(_testAxis);\n\t\tconst p2 = v2.dot(_testAxis); // actual test, basically see if either of the most extreme of the triangle points intersects r\n\n\t\tif (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) {\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nfunction SRGBToLinear(c) {\n\treturn c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);\n}\nfunction LinearToSRGB(c) {\n\treturn c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;\n} // JavaScript RGB-to-RGB transforms, defined as\n// FN[InputColorSpace][OutputColorSpace] callback functions.\n\nconst FN = {\n\t[SRGBColorSpace]: {\n\t\t[LinearSRGBColorSpace]: SRGBToLinear\n\t},\n\t[LinearSRGBColorSpace]: {\n\t\t[SRGBColorSpace]: LinearToSRGB\n\t}\n};\nconst ColorManagement = {\n\tlegacyMode: true,\n\n\tget workingColorSpace() {\n\t\treturn LinearSRGBColorSpace;\n\t},\n\n\tset workingColorSpace(colorSpace) {\n\t\tconsole.warn('THREE.ColorManagement: .workingColorSpace is readonly.');\n\t},\n\n\tconvert: function (color, sourceColorSpace, targetColorSpace) {\n\t\tif (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {\n\t\t\treturn color;\n\t\t}\n\n\t\tif (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== undefined) {\n\t\t\tconst fn = FN[sourceColorSpace][targetColorSpace];\n\t\t\tcolor.r = fn(color.r);\n\t\t\tcolor.g = fn(color.g);\n\t\t\tcolor.b = fn(color.b);\n\t\t\treturn color;\n\t\t}\n\n\t\tthrow new Error('Unsupported color space conversion.');\n\t},\n\tfromWorkingColorSpace: function (color, targetColorSpace) {\n\t\treturn this.convert(color, this.workingColorSpace, targetColorSpace);\n\t},\n\ttoWorkingColorSpace: function (color, sourceColorSpace) {\n\t\treturn this.convert(color, sourceColorSpace, this.workingColorSpace);\n\t}\n};\n\nconst _colorKeywords = {\n\t'aliceblue': 0xF0F8FF,\n\t'antiquewhite': 0xFAEBD7,\n\t'aqua': 0x00FFFF,\n\t'aquamarine': 0x7FFFD4,\n\t'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC,\n\t'bisque': 0xFFE4C4,\n\t'black': 0x000000,\n\t'blanchedalmond': 0xFFEBCD,\n\t'blue': 0x0000FF,\n\t'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A,\n\t'burlywood': 0xDEB887,\n\t'cadetblue': 0x5F9EA0,\n\t'chartreuse': 0x7FFF00,\n\t'chocolate': 0xD2691E,\n\t'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED,\n\t'cornsilk': 0xFFF8DC,\n\t'crimson': 0xDC143C,\n\t'cyan': 0x00FFFF,\n\t'darkblue': 0x00008B,\n\t'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B,\n\t'darkgray': 0xA9A9A9,\n\t'darkgreen': 0x006400,\n\t'darkgrey': 0xA9A9A9,\n\t'darkkhaki': 0xBDB76B,\n\t'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F,\n\t'darkorange': 0xFF8C00,\n\t'darkorchid': 0x9932CC,\n\t'darkred': 0x8B0000,\n\t'darksalmon': 0xE9967A,\n\t'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B,\n\t'darkslategray': 0x2F4F4F,\n\t'darkslategrey': 0x2F4F4F,\n\t'darkturquoise': 0x00CED1,\n\t'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493,\n\t'deepskyblue': 0x00BFFF,\n\t'dimgray': 0x696969,\n\t'dimgrey': 0x696969,\n\t'dodgerblue': 0x1E90FF,\n\t'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0,\n\t'forestgreen': 0x228B22,\n\t'fuchsia': 0xFF00FF,\n\t'gainsboro': 0xDCDCDC,\n\t'ghostwhite': 0xF8F8FF,\n\t'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520,\n\t'gray': 0x808080,\n\t'green': 0x008000,\n\t'greenyellow': 0xADFF2F,\n\t'grey': 0x808080,\n\t'honeydew': 0xF0FFF0,\n\t'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C,\n\t'indigo': 0x4B0082,\n\t'ivory': 0xFFFFF0,\n\t'khaki': 0xF0E68C,\n\t'lavender': 0xE6E6FA,\n\t'lavenderblush': 0xFFF0F5,\n\t'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD,\n\t'lightblue': 0xADD8E6,\n\t'lightcoral': 0xF08080,\n\t'lightcyan': 0xE0FFFF,\n\t'lightgoldenrodyellow': 0xFAFAD2,\n\t'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90,\n\t'lightgrey': 0xD3D3D3,\n\t'lightpink': 0xFFB6C1,\n\t'lightsalmon': 0xFFA07A,\n\t'lightseagreen': 0x20B2AA,\n\t'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899,\n\t'lightslategrey': 0x778899,\n\t'lightsteelblue': 0xB0C4DE,\n\t'lightyellow': 0xFFFFE0,\n\t'lime': 0x00FF00,\n\t'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6,\n\t'magenta': 0xFF00FF,\n\t'maroon': 0x800000,\n\t'mediumaquamarine': 0x66CDAA,\n\t'mediumblue': 0x0000CD,\n\t'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB,\n\t'mediumseagreen': 0x3CB371,\n\t'mediumslateblue': 0x7B68EE,\n\t'mediumspringgreen': 0x00FA9A,\n\t'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585,\n\t'midnightblue': 0x191970,\n\t'mintcream': 0xF5FFFA,\n\t'mistyrose': 0xFFE4E1,\n\t'moccasin': 0xFFE4B5,\n\t'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080,\n\t'oldlace': 0xFDF5E6,\n\t'olive': 0x808000,\n\t'olivedrab': 0x6B8E23,\n\t'orange': 0xFFA500,\n\t'orangered': 0xFF4500,\n\t'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA,\n\t'palegreen': 0x98FB98,\n\t'paleturquoise': 0xAFEEEE,\n\t'palevioletred': 0xDB7093,\n\t'papayawhip': 0xFFEFD5,\n\t'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F,\n\t'pink': 0xFFC0CB,\n\t'plum': 0xDDA0DD,\n\t'powderblue': 0xB0E0E6,\n\t'purple': 0x800080,\n\t'rebeccapurple': 0x663399,\n\t'red': 0xFF0000,\n\t'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1,\n\t'saddlebrown': 0x8B4513,\n\t'salmon': 0xFA8072,\n\t'sandybrown': 0xF4A460,\n\t'seagreen': 0x2E8B57,\n\t'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D,\n\t'silver': 0xC0C0C0,\n\t'skyblue': 0x87CEEB,\n\t'slateblue': 0x6A5ACD,\n\t'slategray': 0x708090,\n\t'slategrey': 0x708090,\n\t'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F,\n\t'steelblue': 0x4682B4,\n\t'tan': 0xD2B48C,\n\t'teal': 0x008080,\n\t'thistle': 0xD8BFD8,\n\t'tomato': 0xFF6347,\n\t'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE,\n\t'wheat': 0xF5DEB3,\n\t'white': 0xFFFFFF,\n\t'whitesmoke': 0xF5F5F5,\n\t'yellow': 0xFFFF00,\n\t'yellowgreen': 0x9ACD32\n};\nconst _rgb = {\n\tr: 0,\n\tg: 0,\n\tb: 0\n};\nconst _hslA = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\nconst _hslB = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\n\nfunction hue2rgb(p, q, t) {\n\tif (t < 0) t += 1;\n\tif (t > 1) t -= 1;\n\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\tif (t < 1 / 2) return q;\n\tif (t < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t);\n\treturn p;\n}\n\nfunction toComponents(source, target) {\n\ttarget.r = source.r;\n\ttarget.g = source.g;\n\ttarget.b = source.b;\n\treturn target;\n}\n\nclass Color {\n\tconstructor(r, g, b) {\n\t\tthis.isColor = true;\n\t\tthis.r = 1;\n\t\tthis.g = 1;\n\t\tthis.b = 1;\n\n\t\tif (g === undefined && b === undefined) {\n\t\t\t// r is THREE.Color, hex or string\n\t\t\treturn this.set(r);\n\t\t}\n\n\t\treturn this.setRGB(r, g, b);\n\t}\n\n\tset(value) {\n\t\tif (value && value.isColor) {\n\t\t\tthis.copy(value);\n\t\t} else if (typeof value === 'number') {\n\t\t\tthis.setHex(value);\n\t\t} else if (typeof value === 'string') {\n\t\t\tthis.setStyle(value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\t\treturn this;\n\t}\n\n\tsetHex(hex, colorSpace = SRGBColorSpace) {\n\t\thex = Math.floor(hex);\n\t\tthis.r = (hex >> 16 & 255) / 255;\n\t\tthis.g = (hex >> 8 & 255) / 255;\n\t\tthis.b = (hex & 255) / 255;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetRGB(r, g, b, colorSpace = ColorManagement.workingColorSpace) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetHSL(h, s, l, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo(h, 1);\n\t\ts = clamp(s, 0, 1);\n\t\tl = clamp(l, 0, 1);\n\n\t\tif (s === 0) {\n\t\t\tthis.r = this.g = this.b = l;\n\t\t} else {\n\t\t\tconst p = l <= 0.5 ? l * (1 + s) : l + s - l * s;\n\t\t\tconst q = 2 * l - p;\n\t\t\tthis.r = hue2rgb(q, p, h + 1 / 3);\n\t\t\tthis.g = hue2rgb(q, p, h);\n\t\t\tthis.b = hue2rgb(q, p, h - 1 / 3);\n\t\t}\n\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetStyle(style, colorSpace = SRGBColorSpace) {\n\t\tfunction handleAlpha(string) {\n\t\t\tif (string === undefined) return;\n\n\t\t\tif (parseFloat(string) < 1) {\n\t\t\t\tconsole.warn('THREE.Color: Alpha component of ' + style + ' will be ignored.');\n\t\t\t}\n\t\t}\n\n\t\tlet m;\n\n\t\tif (m = /^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(style)) {\n\t\t\t// rgb / hsl\n\t\t\tlet color;\n\t\t\tconst name = m[1];\n\t\t\tconst components = m[2];\n\n\t\t\tswitch (name) {\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\tthis.r = Math.min(255, parseInt(color[1], 10)) / 255;\n\t\t\t\t\t\tthis.g = Math.min(255, parseInt(color[2], 10)) / 255;\n\t\t\t\t\t\tthis.b = Math.min(255, parseInt(color[3], 10)) / 255;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\tthis.r = Math.min(100, parseInt(color[1], 10)) / 100;\n\t\t\t\t\t\tthis.g = Math.min(100, parseInt(color[2], 10)) / 100;\n\t\t\t\t\t\tthis.b = Math.min(100, parseInt(color[3], 10)) / 100;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\t\t\t\t\tif (color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\tconst h = parseFloat(color[1]) / 360;\n\t\t\t\t\t\tconst s = parseFloat(color[2]) / 100;\n\t\t\t\t\t\tconst l = parseFloat(color[3]) / 100;\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this.setHSL(h, s, l, colorSpace);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (m = /^\\#([A-Fa-f\\d]+)$/.exec(style)) {\n\t\t\t// hex color\n\t\t\tconst hex = m[1];\n\t\t\tconst size = hex.length;\n\n\t\t\tif (size === 3) {\n\t\t\t\t// #ff0\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t} else if (size === 6) {\n\t\t\t\t// #ff0000\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tif (style && style.length > 0) {\n\t\t\treturn this.setColorName(style, colorSpace);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetColorName(style, colorSpace = SRGBColorSpace) {\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[style.toLowerCase()];\n\n\t\tif (hex !== undefined) {\n\t\t\t// red\n\t\t\tthis.setHex(hex, colorSpace);\n\t\t} else {\n\t\t\t// unknown color\n\t\t\tconsole.warn('THREE.Color: Unknown color ' + style);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.r, this.g, this.b);\n\t}\n\n\tcopy(color) {\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\t\treturn this;\n\t}\n\n\tcopySRGBToLinear(color) {\n\t\tthis.r = SRGBToLinear(color.r);\n\t\tthis.g = SRGBToLinear(color.g);\n\t\tthis.b = SRGBToLinear(color.b);\n\t\treturn this;\n\t}\n\n\tcopyLinearToSRGB(color) {\n\t\tthis.r = LinearToSRGB(color.r);\n\t\tthis.g = LinearToSRGB(color.g);\n\t\tthis.b = LinearToSRGB(color.b);\n\t\treturn this;\n\t}\n\n\tconvertSRGBToLinear() {\n\t\tthis.copySRGBToLinear(this);\n\t\treturn this;\n\t}\n\n\tconvertLinearToSRGB() {\n\t\tthis.copyLinearToSRGB(this);\n\t\treturn this;\n\t}\n\n\tgetHex(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\treturn clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0;\n\t}\n\n\tgetHexString(colorSpace = SRGBColorSpace) {\n\t\treturn ('000000' + this.getHex(colorSpace).toString(16)).slice(-6);\n\t}\n\n\tgetHSL(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\tconst r = _rgb.r,\n\t\t\t\t\tg = _rgb.g,\n\t\t\t\t\tb = _rgb.b;\n\t\tconst max = Math.max(r, g, b);\n\t\tconst min = Math.min(r, g, b);\n\t\tlet hue, saturation;\n\t\tconst lightness = (min + max) / 2.0;\n\n\t\tif (min === max) {\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\t\t} else {\n\t\t\tconst delta = max - min;\n\t\t\tsaturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\n\n\t\t\tswitch (max) {\n\t\t\t\tcase r:\n\t\t\t\t\thue = (g - b) / delta + (g < b ? 6 : 0);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase g:\n\t\t\t\t\thue = (b - r) / delta + 2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase b:\n\t\t\t\t\thue = (r - g) / delta + 4;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\thue /= 6;\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\t\treturn target;\n\t}\n\n\tgetRGB(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\ttarget.r = _rgb.r;\n\t\ttarget.g = _rgb.g;\n\t\ttarget.b = _rgb.b;\n\t\treturn target;\n\t}\n\n\tgetStyle(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\n\t\tif (colorSpace !== SRGBColorSpace) {\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;\n\t\t}\n\n\t\treturn `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`;\n\t}\n\n\toffsetHSL(h, s, l) {\n\t\tthis.getHSL(_hslA);\n\t\t_hslA.h += h;\n\t\t_hslA.s += s;\n\t\t_hslA.l += l;\n\t\tthis.setHSL(_hslA.h, _hslA.s, _hslA.l);\n\t\treturn this;\n\t}\n\n\tadd(color) {\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\t\treturn this;\n\t}\n\n\taddColors(color1, color2) {\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\t\treturn this;\n\t}\n\n\tsub(color) {\n\t\tthis.r = Math.max(0, this.r - color.r);\n\t\tthis.g = Math.max(0, this.g - color.g);\n\t\tthis.b = Math.max(0, this.b - color.b);\n\t\treturn this;\n\t}\n\n\tmultiply(color) {\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\t\treturn this;\n\t}\n\n\tlerp(color, alpha) {\n\t\tthis.r += (color.r - this.r) * alpha;\n\t\tthis.g += (color.g - this.g) * alpha;\n\t\tthis.b += (color.b - this.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpColors(color1, color2, alpha) {\n\t\tthis.r = color1.r + (color2.r - color1.r) * alpha;\n\t\tthis.g = color1.g + (color2.g - color1.g) * alpha;\n\t\tthis.b = color1.b + (color2.b - color1.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpHSL(color, alpha) {\n\t\tthis.getHSL(_hslA);\n\t\tcolor.getHSL(_hslB);\n\t\tconst h = lerp(_hslA.h, _hslB.h, alpha);\n\t\tconst s = lerp(_hslA.s, _hslB.s, alpha);\n\t\tconst l = lerp(_hslA.l, _hslB.l, alpha);\n\t\tthis.setHSL(h, s, l);\n\t\treturn this;\n\t}\n\n\tequals(c) {\n\t\treturn c.r === this.r && c.g === this.g && c.b === this.b;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.r = array[offset];\n\t\tthis.g = array[offset + 1];\n\t\tthis.b = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.r;\n\t\tarray[offset + 1] = this.g;\n\t\tarray[offset + 2] = this.b;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.r = attribute.getX( index );\n\t// \tthis.g = attribute.getY( index );\n\t// \tthis.b = attribute.getZ( index );\n\t// \tif ( attribute.normalized === true ) {\n\t// \t\t// assuming Uint8Array\n\t// \t\tthis.r /= 255;\n\t// \t\tthis.g /= 255;\n\t// \t\tthis.b /= 255;\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\ttoJSON() {\n\t\treturn this.getHex();\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\t}\n\n}\n\nColor.NAMES = _colorKeywords;\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\r\n */\nclass Cylindrical {\n\tconstructor(radius = 1, theta = 0, y = 0) {\n\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\n\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\n\t\tthis.y = y; // height above the x-z plane\n\n\t\treturn this;\n\t}\n\n\tset(radius, theta, y) {\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + z * z);\n\t\tthis.theta = Math.atan2(x, z);\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix4 {\n\tconstructor() {\n\t\tMatrix4.prototype.isMatrix4 = true;\n\t\tthis.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[4] = n12;\n\t\tte[8] = n13;\n\t\tte[12] = n14;\n\t\tte[1] = n21;\n\t\tte[5] = n22;\n\t\tte[9] = n23;\n\t\tte[13] = n24;\n\t\tte[2] = n31;\n\t\tte[6] = n32;\n\t\tte[10] = n33;\n\t\tte[14] = n34;\n\t\tte[3] = n41;\n\t\tte[7] = n42;\n\t\tte[11] = n43;\n\t\tte[15] = n44;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Matrix4().fromArray(this.elements);\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\tte[9] = me[9];\n\t\tte[10] = me[10];\n\t\tte[11] = me[11];\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\tte[15] = me[15];\n\t\treturn this;\n\t}\n\n\tcopyPosition(m) {\n\t\tconst te = this.elements,\n\t\t\t\t\tme = m.elements;\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrix3(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[3], me[6], 0, me[1], me[4], me[7], 0, me[2], me[5], me[8], 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrixColumn(this, 0);\n\t\tyAxis.setFromMatrixColumn(this, 1);\n\t\tzAxis.setFromMatrixColumn(this, 2);\n\t\treturn this;\n\t}\n\n\tmakeBasis(xAxis, yAxis, zAxis) {\n\t\tthis.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractRotation(m) {\n\t\t// this method does not support reflection matrices\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$2.setFromMatrixColumn(m, 0).length();\n\n\t\tconst scaleY = 1 / _v1$2.setFromMatrixColumn(m, 1).length();\n\n\t\tconst scaleZ = 1 / _v1$2.setFromMatrixColumn(m, 2).length();\n\n\t\tte[0] = me[0] * scaleX;\n\t\tte[1] = me[1] * scaleX;\n\t\tte[2] = me[2] * scaleX;\n\t\tte[3] = 0;\n\t\tte[4] = me[4] * scaleY;\n\t\tte[5] = me[5] * scaleY;\n\t\tte[6] = me[6] * scaleY;\n\t\tte[7] = 0;\n\t\tte[8] = me[8] * scaleZ;\n\t\tte[9] = me[9] * scaleZ;\n\t\tte[10] = me[10] * scaleZ;\n\t\tte[11] = 0;\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromEuler(euler) {\n\t\tconst te = this.elements;\n\t\tconst x = euler.x,\n\t\t\t\t\ty = euler.y,\n\t\t\t\t\tz = euler.z;\n\t\tconst a = Math.cos(x),\n\t\t\t\t\tb = Math.sin(x);\n\t\tconst c = Math.cos(y),\n\t\t\t\t\td = Math.sin(y);\n\t\tconst e = Math.cos(z),\n\t\t\t\t\tf = Math.sin(z);\n\n\t\tif (euler.order === 'XYZ') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -c * f;\n\t\t\tte[8] = d;\n\t\t\tte[1] = af + be * d;\n\t\t\tte[5] = ae - bf * d;\n\t\t\tte[9] = -b * c;\n\t\t\tte[2] = bf - ae * d;\n\t\t\tte[6] = be + af * d;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YXZ') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce + df * b;\n\t\t\tte[4] = de * b - cf;\n\t\t\tte[8] = a * d;\n\t\t\tte[1] = a * f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b;\n\t\t\tte[2] = cf * b - de;\n\t\t\tte[6] = df + ce * b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZXY') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce - df * b;\n\t\t\tte[4] = -a * f;\n\t\t\tte[8] = de + cf * b;\n\t\t\tte[1] = cf + de * b;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = df - ce * b;\n\t\t\tte[2] = -a * d;\n\t\t\tte[6] = b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZYX') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = be * d - af;\n\t\t\tte[8] = ae * d + bf;\n\t\t\tte[1] = c * f;\n\t\t\tte[5] = bf * d + ae;\n\t\t\tte[9] = af * d - be;\n\t\t\tte[2] = -d;\n\t\t\tte[6] = b * c;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YZX') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = bd - ac * f;\n\t\t\tte[8] = bc * f + ad;\n\t\t\tte[1] = f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b * e;\n\t\t\tte[2] = -d * e;\n\t\t\tte[6] = ad * f + bc;\n\t\t\tte[10] = ac - bd * f;\n\t\t} else if (euler.order === 'XZY') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -f;\n\t\t\tte[8] = d * e;\n\t\t\tte[1] = ac * f + bd;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = ad * f - bc;\n\t\t\tte[2] = bc * f - ad;\n\t\t\tte[6] = b * e;\n\t\t\tte[10] = bd * f + ac;\n\t\t} // bottom row\n\n\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0; // last column\n\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromQuaternion(q) {\n\t\treturn this.compose(_zero, q, _one);\n\t}\n\n\tlookAt(eye, target, up) {\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors(eye, target);\n\n\t\tif (_z.lengthSq() === 0) {\n\t\t\t// eye and target are in the same position\n\t\t\t_z.z = 1;\n\t\t}\n\n\t\t_z.normalize();\n\n\t\t_x.crossVectors(up, _z);\n\n\t\tif (_x.lengthSq() === 0) {\n\t\t\t// up and z are parallel\n\t\t\tif (Math.abs(up.z) === 1) {\n\t\t\t\t_z.x += 0.0001;\n\t\t\t} else {\n\t\t\t\t_z.z += 0.0001;\n\t\t\t}\n\n\t\t\t_z.normalize();\n\n\t\t\t_x.crossVectors(up, _z);\n\t\t}\n\n\t\t_x.normalize();\n\n\t\t_y.crossVectors(_z, _x);\n\n\t\tte[0] = _x.x;\n\t\tte[4] = _y.x;\n\t\tte[8] = _z.x;\n\t\tte[1] = _x.y;\n\t\tte[5] = _y.y;\n\t\tte[9] = _z.y;\n\t\tte[2] = _x.z;\n\t\tte[6] = _y.z;\n\t\tte[10] = _z.z;\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[4],\n\t\t\t\t\ta13 = ae[8],\n\t\t\t\t\ta14 = ae[12];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[5],\n\t\t\t\t\ta23 = ae[9],\n\t\t\t\t\ta24 = ae[13];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[6],\n\t\t\t\t\ta33 = ae[10],\n\t\t\t\t\ta34 = ae[14];\n\t\tconst a41 = ae[3],\n\t\t\t\t\ta42 = ae[7],\n\t\t\t\t\ta43 = ae[11],\n\t\t\t\t\ta44 = ae[15];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[4],\n\t\t\t\t\tb13 = be[8],\n\t\t\t\t\tb14 = be[12];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[5],\n\t\t\t\t\tb23 = be[9],\n\t\t\t\t\tb24 = be[13];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[6],\n\t\t\t\t\tb33 = be[10],\n\t\t\t\t\tb34 = be[14];\n\t\tconst b41 = be[3],\n\t\t\t\t\tb42 = be[7],\n\t\t\t\t\tb43 = be[11],\n\t\t\t\t\tb44 = be[15];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\t\tte[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[4] *= s;\n\t\tte[8] *= s;\n\t\tte[12] *= s;\n\t\tte[1] *= s;\n\t\tte[5] *= s;\n\t\tte[9] *= s;\n\t\tte[13] *= s;\n\t\tte[2] *= s;\n\t\tte[6] *= s;\n\t\tte[10] *= s;\n\t\tte[14] *= s;\n\t\tte[3] *= s;\n\t\tte[7] *= s;\n\t\tte[11] *= s;\n\t\tte[15] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst n11 = te[0],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn14 = te[12];\n\t\tconst n21 = te[1],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn24 = te[13];\n\t\tconst n31 = te[2],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn34 = te[14];\n\t\tconst n41 = te[3],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn44 = te[15]; //TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);\n\t}\n\n\ttranspose() {\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\t\ttmp = te[1];\n\t\tte[1] = te[4];\n\t\tte[4] = tmp;\n\t\ttmp = te[2];\n\t\tte[2] = te[8];\n\t\tte[8] = tmp;\n\t\ttmp = te[6];\n\t\tte[6] = te[9];\n\t\tte[9] = tmp;\n\t\ttmp = te[3];\n\t\tte[3] = te[12];\n\t\tte[12] = tmp;\n\t\ttmp = te[7];\n\t\tte[7] = te[13];\n\t\tte[13] = tmp;\n\t\ttmp = te[11];\n\t\tte[11] = te[14];\n\t\tte[14] = tmp;\n\t\treturn this;\n\t}\n\n\tsetPosition(x, y, z) {\n\t\tconst te = this.elements;\n\n\t\tif (x.isVector3) {\n\t\t\tte[12] = x.x;\n\t\t\tte[13] = x.y;\n\t\t\tte[14] = x.z;\n\t\t} else {\n\t\t\tte[12] = x;\n\t\t\tte[13] = y;\n\t\t\tte[14] = z;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tinvert() {\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn41 = te[3],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn14 = te[12],\n\t\t\t\t\tn24 = te[13],\n\t\t\t\t\tn34 = te[14],\n\t\t\t\t\tn44 = te[15],\n\t\t\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;\n\t\tte[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;\n\t\tte[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;\n\t\tte[4] = t12 * detInv;\n\t\tte[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;\n\t\tte[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;\n\t\tte[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;\n\t\tte[8] = t13 * detInv;\n\t\tte[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;\n\t\tte[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;\n\t\tte[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;\n\t\tte[12] = t14 * detInv;\n\t\tte[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;\n\t\tte[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;\n\t\tte[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;\n\t\treturn this;\n\t}\n\n\tscale(v) {\n\t\tconst te = this.elements;\n\t\tconst x = v.x,\n\t\t\t\t\ty = v.y,\n\t\t\t\t\tz = v.z;\n\t\tte[0] *= x;\n\t\tte[4] *= y;\n\t\tte[8] *= z;\n\t\tte[1] *= x;\n\t\tte[5] *= y;\n\t\tte[9] *= z;\n\t\tte[2] *= x;\n\t\tte[6] *= y;\n\t\tte[10] *= z;\n\t\tte[3] *= x;\n\t\tte[7] *= y;\n\t\tte[11] *= z;\n\t\treturn this;\n\t}\n\n\tgetMaxScaleOnAxis() {\n\t\tconst te = this.elements;\n\t\tconst scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];\n\t\tconst scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];\n\t\tconst scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];\n\t\treturn Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));\n\t}\n\n\tmakeTranslation(x, y, z) {\n\t\tthis.set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationX(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationY(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationZ(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationAxis(axis, angle) {\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\t\tconst c = Math.cos(angle);\n\t\tconst s = Math.sin(angle);\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x,\n\t\t\t\t\ty = axis.y,\n\t\t\t\t\tz = axis.z;\n\t\tconst tx = t * x,\n\t\t\t\t\tty = t * y;\n\t\tthis.set(tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y, z) {\n\t\tthis.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeShear(xy, xz, yx, yz, zx, zy) {\n\t\tthis.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\t\tconst x = quaternion._x,\n\t\t\t\t\ty = quaternion._y,\n\t\t\t\t\tz = quaternion._z,\n\t\t\t\t\tw = quaternion._w;\n\t\tconst x2 = x + x,\n\t\t\t\t\ty2 = y + y,\n\t\t\t\t\tz2 = z + z;\n\t\tconst xx = x * x2,\n\t\t\t\t\txy = x * y2,\n\t\t\t\t\txz = x * z2;\n\t\tconst yy = y * y2,\n\t\t\t\t\tyz = y * z2,\n\t\t\t\t\tzz = z * z2;\n\t\tconst wx = w * x2,\n\t\t\t\t\twy = w * y2,\n\t\t\t\t\twz = w * z2;\n\t\tconst sx = scale.x,\n\t\t\t\t\tsy = scale.y,\n\t\t\t\t\tsz = scale.z;\n\t\tte[0] = (1 - (yy + zz)) * sx;\n\t\tte[1] = (xy + wz) * sx;\n\t\tte[2] = (xz - wy) * sx;\n\t\tte[3] = 0;\n\t\tte[4] = (xy - wz) * sy;\n\t\tte[5] = (1 - (xx + zz)) * sy;\n\t\tte[6] = (yz + wx) * sy;\n\t\tte[7] = 0;\n\t\tte[8] = (xz + wy) * sz;\n\t\tte[9] = (yz - wx) * sz;\n\t\tte[10] = (1 - (xx + yy)) * sz;\n\t\tte[11] = 0;\n\t\tte[12] = position.x;\n\t\tte[13] = position.y;\n\t\tte[14] = position.z;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tdecompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$2.set(te[0], te[1], te[2]).length();\n\n\t\tconst sy = _v1$2.set(te[4], te[5], te[6]).length();\n\n\t\tconst sz = _v1$2.set(te[8], te[9], te[10]).length(); // if determine is negative, we need to invert one scale\n\n\n\t\tconst det = this.determinant();\n\t\tif (det < 0) sx = -sx;\n\t\tposition.x = te[12];\n\t\tposition.y = te[13];\n\t\tposition.z = te[14]; // scale the rotation part\n\n\t\t_m1.copy(this);\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\t\t_m1.elements[0] *= invSX;\n\t\t_m1.elements[1] *= invSX;\n\t\t_m1.elements[2] *= invSX;\n\t\t_m1.elements[4] *= invSY;\n\t\t_m1.elements[5] *= invSY;\n\t\t_m1.elements[6] *= invSY;\n\t\t_m1.elements[8] *= invSZ;\n\t\t_m1.elements[9] *= invSZ;\n\t\t_m1.elements[10] *= invSZ;\n\t\tquaternion.setFromRotationMatrix(_m1);\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\t\treturn this;\n\t}\n\n\tmakePerspective(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst x = 2 * near / (right - left);\n\t\tconst y = 2 * near / (top - bottom);\n\t\tconst a = (right + left) / (right - left);\n\t\tconst b = (top + bottom) / (top - bottom);\n\t\tconst c = -(far + near) / (far - near);\n\t\tconst d = -2 * far * near / (far - near);\n\t\tte[0] = x;\n\t\tte[4] = 0;\n\t\tte[8] = a;\n\t\tte[12] = 0;\n\t\tte[1] = 0;\n\t\tte[5] = y;\n\t\tte[9] = b;\n\t\tte[13] = 0;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = c;\n\t\tte[14] = d;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = -1;\n\t\tte[15] = 0;\n\t\treturn this;\n\t}\n\n\tmakeOrthographic(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst w = 1.0 / (right - left);\n\t\tconst h = 1.0 / (top - bottom);\n\t\tconst p = 1.0 / (far - near);\n\t\tconst x = (right + left) * w;\n\t\tconst y = (top + bottom) * h;\n\t\tconst z = (far + near) * p;\n\t\tte[0] = 2 * w;\n\t\tte[4] = 0;\n\t\tte[8] = 0;\n\t\tte[12] = -x;\n\t\tte[1] = 0;\n\t\tte[5] = 2 * h;\n\t\tte[9] = 0;\n\t\tte[13] = -y;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = -2 * p;\n\t\tte[14] = -z;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\tarray[offset + 9] = te[9];\n\t\tarray[offset + 10] = te[10];\n\t\tarray[offset + 11] = te[11];\n\t\tarray[offset + 12] = te[12];\n\t\tarray[offset + 13] = te[13];\n\t\tarray[offset + 14] = te[14];\n\t\tarray[offset + 15] = te[15];\n\t\treturn array;\n\t}\n\n}\n\nconst _v1$2 = /*@__PURE__*/new Vector3();\n\nconst _m1 = /*@__PURE__*/new Matrix4();\n\nconst _zero = /*@__PURE__*/new Vector3(0, 0, 0);\n\nconst _one = /*@__PURE__*/new Vector3(1, 1, 1);\n\nconst _x = /*@__PURE__*/new Vector3();\n\nconst _y = /*@__PURE__*/new Vector3();\n\nconst _z = /*@__PURE__*/new Vector3();\n\nconst _matrix = /*@__PURE__*/new Matrix4();\n\nconst _quaternion = /*@__PURE__*/new Quaternion();\n\nclass Euler {\n\tconstructor(x = 0, y = 0, z = 0, order = Euler.DefaultOrder) {\n\t\tthis.isEuler = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget order() {\n\t\treturn this._order;\n\t}\n\n\tset order(value) {\n\t\tthis._order = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, order = this._order) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._order);\n\t}\n\n\tcopy(euler) {\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m, order = this._order, update = true) {\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements;\n\t\tconst m11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8];\n\t\tconst m21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9];\n\t\tconst m31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._y = Math.asin(clamp(m13, -1, 1));\n\n\t\t\t\tif (Math.abs(m13) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = Math.asin(-clamp(m23, -1, 1));\n\n\t\t\t\tif (Math.abs(m23) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = Math.asin(clamp(m32, -1, 1));\n\n\t\t\t\tif (Math.abs(m32) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._y = Math.asin(-clamp(m31, -1, 1));\n\n\t\t\t\tif (Math.abs(m31) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._z = Math.asin(clamp(m21, -1, 1));\n\n\t\t\t\tif (Math.abs(m21) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m22);\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._z = Math.asin(-clamp(m12, -1, 1));\n\n\t\t\t\tif (Math.abs(m12) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._y = Math.atan2(m13, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tthis._order = order;\n\t\tif (update === true) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromQuaternion(q, order, update) {\n\t\t_matrix.makeRotationFromQuaternion(q);\n\n\t\treturn this.setFromRotationMatrix(_matrix, order, update);\n\t}\n\n\tsetFromVector3(v, order = this._order) {\n\t\treturn this.set(v.x, v.y, v.z, order);\n\t}\n\n\treorder(newOrder) {\n\t\t// WARNING: this discards revolution information -bhouston\n\t\t_quaternion.setFromEuler(this);\n\n\t\treturn this.setFromQuaternion(_quaternion, newOrder);\n\t}\n\n\tequals(euler) {\n\t\treturn euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;\n\t}\n\n\tfromArray(array) {\n\t\tthis._x = array[0];\n\t\tthis._y = array[1];\n\t\tthis._z = array[2];\n\t\tif (array[3] !== undefined) this._order = array[3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._order;\n\t\treturn array;\n\t}\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\t} // @deprecated since r138, 02cf0df1cb4575d5842fef9c85bb5a89fe020d53\n\n\n\ttoVector3() {\n\t\tconsole.error('THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead');\n\t}\n\n}\n\nEuler.DefaultOrder = 'XYZ';\nEuler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX'];\n\n/**\r\n * Abstract base class of interpolants over parametric samples.\r\n *\r\n * The parameter domain is one dimensional, typically the time or a path\r\n * along a curve defined by the data.\r\n *\r\n * The sample values can have any dimensionality and derived classes may\r\n * apply special interpretations to the data.\r\n *\r\n * This class provides the interval seek in a Template Method, deferring\r\n * the actual interpolation to derived classes.\r\n *\r\n * Time complexity is O(1) for linear access crossing at most two points\r\n * and O(log N) for random access, where N is the number of positions.\r\n *\r\n * References:\r\n *\r\n * \t\thttp://www.oodesign.com/template-method-pattern.html\r\n *\r\n */\nclass Interpolant {\n\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor(sampleSize);\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\t\tthis.settings = null;\n\t\tthis.DefaultSettings_ = {};\n\t}\n\n\tevaluate(t) {\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\t\tt1 = pp[i1],\n\t\t\t\tt0 = pp[i1 - 1];\n\n\t\tvalidate_interval: {\n\t\t\tseek: {\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if (!(t < t1)) {\n\t\t\t\t\t\tfor (let giveUpAt = i1 + 2;;) {\n\t\t\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\t\t\tif (t < t0) break forward_scan; // after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[++i1];\n\n\t\t\t\t\t\t\tif (t < t1) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the right side of the index\n\n\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} //- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\n\n\t\t\t\t\tif (!(t >= t0)) {\n\t\t\t\t\t\t// looping?\n\t\t\t\t\t\tconst t1global = pp[1];\n\n\t\t\t\t\t\tif (t < t1global) {\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\n\t\t\t\t\t\t\tt0 = t1global;\n\t\t\t\t\t\t} // linear reverse scan\n\n\n\t\t\t\t\t\tfor (let giveUpAt = i1 - 2;;) {\n\t\t\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\t\t\t// before start\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[--i1 - 1];\n\n\t\t\t\t\t\t\tif (t >= t0) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the left side of the index\n\n\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} // the interval is valid\n\n\n\t\t\t\t\tbreak validate_interval;\n\t\t\t\t} // linear scan\n\t\t\t\t// binary search\n\n\n\t\t\t\twhile (i1 < right) {\n\t\t\t\t\tconst mid = i1 + right >>> 1;\n\n\t\t\t\t\tif (t < pp[mid]) {\n\t\t\t\t\t\tright = mid;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti1 = mid + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[i1];\n\t\t\t\tt0 = pp[i1 - 1]; // check boundary cases, again\n\n\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t}\n\n\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t}\n\t\t\t} // seek\n\n\n\t\t\tthis._cachedIndex = i1;\n\t\t\tthis.intervalChanged_(i1, t0, t1);\n\t\t} // validate_interval\n\n\n\t\treturn this.interpolate_(i1, t0, t, t1);\n\t}\n\n\tgetSettings_() {\n\t\treturn this.settings || this.DefaultSettings_;\n\t}\n\n\tcopySampleValue_(index) {\n\t\t// copies a sample value to the result buffer\n\t\tconst result = this.resultBuffer,\n\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\toffset = index * stride;\n\n\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\tresult[i] = values[offset + i];\n\t\t}\n\n\t\treturn result;\n\t} // Template methods for derived classes:\n\n\n\tinterpolate_() {\n\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t}\n\n\tintervalChanged_() {// empty\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/new Vector3();\n\nconst _startEnd = /*@__PURE__*/new Vector3();\n\nclass Line3 {\n\tconstructor(start = new Vector3(), end = new Vector3()) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t}\n\n\tset(start, end) {\n\t\tthis.start.copy(start);\n\t\tthis.end.copy(end);\n\t\treturn this;\n\t}\n\n\tcopy(line) {\n\t\tthis.start.copy(line.start);\n\t\tthis.end.copy(line.end);\n\t\treturn this;\n\t}\n\n\tgetCenter(target) {\n\t\treturn target.addVectors(this.start, this.end).multiplyScalar(0.5);\n\t}\n\n\tdelta(target) {\n\t\treturn target.subVectors(this.end, this.start);\n\t}\n\n\tdistanceSq() {\n\t\treturn this.start.distanceToSquared(this.end);\n\t}\n\n\tdistance() {\n\t\treturn this.start.distanceTo(this.end);\n\t}\n\n\tat(t, target) {\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tclosestPointToPointParameter(point, clampToLine) {\n\t\t_startP.subVectors(point, this.start);\n\n\t\t_startEnd.subVectors(this.end, this.start);\n\n\t\tconst startEnd2 = _startEnd.dot(_startEnd);\n\n\t\tconst startEnd_startP = _startEnd.dot(_startP);\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif (clampToLine) {\n\t\t\tt = clamp(t, 0, 1);\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tclosestPointToPoint(point, clampToLine, target) {\n\t\tconst t = this.closestPointToPointParameter(point, clampToLine);\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.start.applyMatrix4(matrix);\n\t\tthis.end.applyMatrix4(matrix);\n\t\treturn this;\n\t}\n\n\tequals(line) {\n\t\treturn line.start.equals(this.start) && line.end.equals(this.end);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix3 {\n\tconstructor() {\n\t\tMatrix3.prototype.isMatrix3 = true;\n\t\tthis.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n21, n22, n23, n31, n32, n33) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[1] = n21;\n\t\tte[2] = n31;\n\t\tte[3] = n12;\n\t\tte[4] = n22;\n\t\tte[5] = n32;\n\t\tte[6] = n13;\n\t\tte[7] = n23;\n\t\tte[8] = n33;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 1, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrix3Column(this, 0);\n\t\tyAxis.setFromMatrix3Column(this, 1);\n\t\tzAxis.setFromMatrix3Column(this, 2);\n\t\treturn this;\n\t}\n\n\tsetFromMatrix4(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10]);\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[3],\n\t\t\t\t\ta13 = ae[6];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[4],\n\t\t\t\t\ta23 = ae[7];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[5],\n\t\t\t\t\ta33 = ae[8];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[3],\n\t\t\t\t\tb13 = be[6];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[4],\n\t\t\t\t\tb23 = be[7];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[5],\n\t\t\t\t\tb33 = be[8];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[3] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[4] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[5] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[3] *= s;\n\t\tte[6] *= s;\n\t\tte[1] *= s;\n\t\tte[4] *= s;\n\t\tte[7] *= s;\n\t\tte[2] *= s;\n\t\tte[5] *= s;\n\t\tte[8] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst a = te[0],\n\t\t\t\t\tb = te[1],\n\t\t\t\t\tc = te[2],\n\t\t\t\t\td = te[3],\n\t\t\t\t\te = te[4],\n\t\t\t\t\tf = te[5],\n\t\t\t\t\tg = te[6],\n\t\t\t\t\th = te[7],\n\t\t\t\t\ti = te[8];\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\t}\n\n\tinvert() {\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn12 = te[3],\n\t\t\t\t\tn22 = te[4],\n\t\t\t\t\tn32 = te[5],\n\t\t\t\t\tn13 = te[6],\n\t\t\t\t\tn23 = te[7],\n\t\t\t\t\tn33 = te[8],\n\t\t\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\t\t\tt13 = n23 * n12 - n22 * n13,\n\t\t\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n31 * n23 - n33 * n21) * detInv;\n\t\tte[2] = (n32 * n21 - n31 * n22) * detInv;\n\t\tte[3] = t12 * detInv;\n\t\tte[4] = (n33 * n11 - n31 * n13) * detInv;\n\t\tte[5] = (n31 * n12 - n32 * n11) * detInv;\n\t\tte[6] = t13 * detInv;\n\t\tte[7] = (n21 * n13 - n23 * n11) * detInv;\n\t\tte[8] = (n22 * n11 - n21 * n12) * detInv;\n\t\treturn this;\n\t}\n\n\ttranspose() {\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\t\ttmp = m[1];\n\t\tm[1] = m[3];\n\t\tm[3] = tmp;\n\t\ttmp = m[2];\n\t\tm[2] = m[6];\n\t\tm[6] = tmp;\n\t\ttmp = m[5];\n\t\tm[5] = m[7];\n\t\tm[7] = tmp;\n\t\treturn this;\n\t}\n\n\tgetNormalMatrix(matrix4) {\n\t\treturn this.setFromMatrix4(matrix4).invert().transpose();\n\t}\n\n\ttransposeIntoArray(r) {\n\t\tconst m = this.elements;\n\t\tr[0] = m[0];\n\t\tr[1] = m[3];\n\t\tr[2] = m[6];\n\t\tr[3] = m[1];\n\t\tr[4] = m[4];\n\t\tr[5] = m[7];\n\t\tr[6] = m[2];\n\t\tr[7] = m[5];\n\t\tr[8] = m[8];\n\t\treturn this;\n\t}\n\n\tsetUvTransform(tx, ty, sx, sy, rotation, cx, cy) {\n\t\tconst c = Math.cos(rotation);\n\t\tconst s = Math.sin(rotation);\n\t\tthis.set(sx * c, sx * s, -sx * (c * cx + s * cy) + cx + tx, -sy * s, sy * c, -sy * (-s * cx + c * cy) + cy + ty, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tscale(sx, sy) {\n\t\tthis.premultiply(_m3.makeScale(sx, sy));\n\t\treturn this;\n\t}\n\n\trotate(theta) {\n\t\tthis.premultiply(_m3.makeRotation(-theta));\n\t\treturn this;\n\t}\n\n\ttranslate(tx, ty) {\n\t\tthis.premultiply(_m3.makeTranslation(tx, ty));\n\t\treturn this;\n\t} // for 2D Transforms\n\n\n\tmakeTranslation(x, y) {\n\t\tthis.set(1, 0, x, 0, 1, y, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotation(theta) {\n\t\t// counterclockwise\n\t\tconst c = Math.cos(theta);\n\t\tconst s = Math.sin(theta);\n\t\tthis.set(c, -s, 0, s, c, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y) {\n\t\tthis.set(x, 0, 0, 0, y, 0, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\treturn array;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().fromArray(this.elements);\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/new Matrix3();\n\nconst _vector1 = /*@__PURE__*/new Vector3();\n\nconst _vector2 = /*@__PURE__*/new Vector3();\n\nconst _normalMatrix = /*@__PURE__*/new Matrix3();\n\nclass Plane {\n\tconstructor(normal = new Vector3(1, 0, 0), constant = 0) {\n\t\tthis.isPlane = true; // normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\t}\n\n\tset(normal, constant) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = constant;\n\t\treturn this;\n\t}\n\n\tsetComponents(x, y, z, w) {\n\t\tthis.normal.set(x, y, z);\n\t\tthis.constant = w;\n\t\treturn this;\n\t}\n\n\tsetFromNormalAndCoplanarPoint(normal, point) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = -point.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tsetFromCoplanarPoints(a, b, c) {\n\t\tconst normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize(); // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\n\t\tthis.setFromNormalAndCoplanarPoint(normal, a);\n\t\treturn this;\n\t}\n\n\tcopy(plane) {\n\t\tthis.normal.copy(plane.normal);\n\t\tthis.constant = plane.constant;\n\t\treturn this;\n\t}\n\n\tnormalize() {\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar(inverseNormalLength);\n\t\tthis.constant *= inverseNormalLength;\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.constant *= -1;\n\t\tthis.normal.negate();\n\t\treturn this;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn this.normal.dot(point) + this.constant;\n\t}\n\n\tdistanceToSphere(sphere) {\n\t\treturn this.distanceToPoint(sphere.center) - sphere.radius;\n\t}\n\n\tprojectPoint(point, target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);\n\t}\n\n\tintersectLine(line, target) {\n\t\tconst direction = line.delta(_vector1);\n\t\tconst denominator = this.normal.dot(direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (this.distanceToPoint(line.start) === 0) {\n\t\t\t\treturn target.copy(line.start);\n\t\t\t} // Unsure if this is the correct method to handle this case.\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(line.start.dot(this.normal) + this.constant) / denominator;\n\n\t\tif (t < 0 || t > 1) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn target.copy(direction).multiplyScalar(t).add(line.start);\n\t}\n\n\tintersectsLine(line) {\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\t\tconst startSign = this.distanceToPoint(line.start);\n\t\tconst endSign = this.distanceToPoint(line.end);\n\t\treturn startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsPlane(this);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn sphere.intersectsPlane(this);\n\t}\n\n\tcoplanarPoint(target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.constant);\n\t}\n\n\tapplyMatrix4(matrix, optionalNormalMatrix) {\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);\n\n\t\tconst referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);\n\t\tconst normal = this.normal.applyMatrix3(normalMatrix).normalize();\n\t\tthis.constant = -referencePoint.dot(normal);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.constant -= offset.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tequals(plane) {\n\t\treturn plane.normal.equals(this.normal) && plane.constant === this.constant;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/new Vector3();\n\nconst _segCenter = /*@__PURE__*/new Vector3();\n\nconst _segDir = /*@__PURE__*/new Vector3();\n\nconst _diff = /*@__PURE__*/new Vector3();\n\nconst _edge1 = /*@__PURE__*/new Vector3();\n\nconst _edge2 = /*@__PURE__*/new Vector3();\n\nconst _normal = /*@__PURE__*/new Vector3();\n\nclass Ray {\n\tconstructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\t}\n\n\tset(origin, direction) {\n\t\tthis.origin.copy(origin);\n\t\tthis.direction.copy(direction);\n\t\treturn this;\n\t}\n\n\tcopy(ray) {\n\t\tthis.origin.copy(ray.origin);\n\t\tthis.direction.copy(ray.direction);\n\t\treturn this;\n\t}\n\n\tat(t, target = new Vector3()) {\n\t\treturn target.copy(this.direction).multiplyScalar(t).add(this.origin);\n\t}\n\n\tlookAt(v) {\n\t\tthis.direction.copy(v).sub(this.origin).normalize();\n\t\treturn this;\n\t}\n\n\trecast(t) {\n\t\tthis.origin.copy(this.at(t, _vector));\n\t\treturn this;\n\t}\n\n\tclosestPointToPoint(point, target = new Vector3()) {\n\t\ttarget.subVectors(point, this.origin);\n\t\tconst directionDistance = target.dot(this.direction);\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn target.copy(this.origin);\n\t\t}\n\n\t\treturn target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn Math.sqrt(this.distanceSqToPoint(point));\n\t}\n\n\tdistanceSqToPoint(point) {\n\t\tconst directionDistance = _vector.subVectors(point, this.origin).dot(this.direction); // point behind the ray\n\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn this.origin.distanceToSquared(point);\n\t\t}\n\n\t\t_vector.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\n\t\treturn _vector.distanceToSquared(point);\n\t}\n\n\tdistanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\t\t_segCenter.copy(v0).add(v1).multiplyScalar(0.5);\n\n\t\t_segDir.copy(v1).sub(v0).normalize();\n\n\t\t_diff.copy(this.origin).sub(_segCenter);\n\n\t\tconst segExtent = v0.distanceTo(v1) * 0.5;\n\t\tconst a01 = -this.direction.dot(_segDir);\n\n\t\tconst b0 = _diff.dot(this.direction);\n\n\t\tconst b1 = -_diff.dot(_segDir);\n\n\t\tconst c = _diff.lengthSq();\n\n\t\tconst det = Math.abs(1 - a01 * a01);\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif (det > 0) {\n\t\t\t// The ray and segment are not parallel.\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif (s0 >= 0) {\n\t\t\t\tif (s1 >= -extDet) {\n\t\t\t\t\tif (s1 <= extDet) {\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 1\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// region 5\n\t\t\t\t\ts1 = -segExtent;\n\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s1 <= -extDet) {\n\t\t\t\t\t// region 4\n\t\t\t\t\ts0 = Math.max(0, -(-a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else if (s1 <= extDet) {\n\t\t\t\t\t// region 3\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else {\n\t\t\t\t\t// region 2\n\t\t\t\t\ts0 = Math.max(0, -(a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Ray and segment are parallel.\n\t\t\ts1 = a01 > 0 ? -segExtent : segExtent;\n\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t}\n\n\t\tif (optionalPointOnRay) {\n\t\t\toptionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);\n\t\t}\n\n\t\tif (optionalPointOnSegment) {\n\t\t\toptionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);\n\t\t}\n\n\t\treturn sqrDist;\n\t}\n\n\tintersectSphere(sphere, target = new Vector3()) {\n\t\t_vector.subVectors(sphere.center, this.origin);\n\n\t\tconst tca = _vector.dot(this.direction);\n\n\t\tconst d2 = _vector.dot(_vector) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\t\tif (d2 > radius2) return null;\n\t\tconst thc = Math.sqrt(radius2 - d2); // t0 = first intersect point - entrance on front of sphere\n\n\t\tconst t0 = tca - thc; // t1 = second intersect point - exit point on back of sphere\n\n\t\tconst t1 = tca + thc; // test to see if both t0 and t1 are behind the ray - if so, return null\n\n\t\tif (t0 < 0 && t1 < 0) return null; // test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\n\t\tif (t0 < 0) return this.at(t1, target); // else t0 is in front of the ray, so return the first collision point scaled by t0\n\n\t\treturn this.at(t0, target);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tdistanceToPlane(plane) {\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (plane.distanceToPoint(this.origin) === 0) {\n\t\t\t\treturn 0;\n\t\t\t} // Null is preferable to undefined since undefined means.... it is undefined\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(this.origin.dot(plane.normal) + plane.constant) / denominator; // Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\t}\n\n\tintersectPlane(plane, target) {\n\t\tconst t = this.distanceToPlane(plane);\n\n\t\tif (t === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.at(t, target);\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// check if the ray lies on the plane first\n\t\tconst distToPoint = plane.distanceToPoint(this.origin);\n\n\t\tif (distToPoint === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator * distToPoint < 0) {\n\t\t\treturn true;\n\t\t} // ray origin is behind the plane (and is pointing behind it)\n\n\n\t\treturn false;\n\t}\n\n\tintersectBox(box, target) {\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\t\t\tinvdirz = 1 / this.direction.z;\n\t\tconst origin = this.origin;\n\n\t\tif (invdirx >= 0) {\n\t\t\ttmin = (box.min.x - origin.x) * invdirx;\n\t\t\ttmax = (box.max.x - origin.x) * invdirx;\n\t\t} else {\n\t\t\ttmin = (box.max.x - origin.x) * invdirx;\n\t\t\ttmax = (box.min.x - origin.x) * invdirx;\n\t\t}\n\n\t\tif (invdiry >= 0) {\n\t\t\ttymin = (box.min.y - origin.y) * invdiry;\n\t\t\ttymax = (box.max.y - origin.y) * invdiry;\n\t\t} else {\n\t\t\ttymin = (box.max.y - origin.y) * invdiry;\n\t\t\ttymax = (box.min.y - origin.y) * invdiry;\n\t\t}\n\n\t\tif (tmin > tymax || tymin > tmax) return null; // These lines also handle the case where tmin or tmax is NaN\n\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\tif (tymin > tmin || tmin !== tmin) tmin = tymin;\n\t\tif (tymax < tmax || tmax !== tmax) tmax = tymax;\n\n\t\tif (invdirz >= 0) {\n\t\t\ttzmin = (box.min.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.max.z - origin.z) * invdirz;\n\t\t} else {\n\t\t\ttzmin = (box.max.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.min.z - origin.z) * invdirz;\n\t\t}\n\n\t\tif (tmin > tzmax || tzmin > tmax) return null;\n\t\tif (tzmin > tmin || tmin !== tmin) tmin = tzmin;\n\t\tif (tzmax < tmax || tmax !== tmax) tmax = tzmax; //return point closest to the ray (positive side)\n\n\t\tif (tmax < 0) return null;\n\t\treturn this.at(tmin >= 0 ? tmin : tmax, target);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn this.intersectBox(box, _vector) !== null;\n\t}\n\n\tintersectTriangle(a, b, c, backfaceCulling, target) {\n\t\t// Compute the offset origin, edges, and normal.\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\t\t_edge1.subVectors(b, a);\n\n\t\t_edge2.subVectors(c, a);\n\n\t\t_normal.crossVectors(_edge1, _edge2); // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t//\t |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t//\t |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t//\t |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\n\n\t\tlet DdN = this.direction.dot(_normal);\n\t\tlet sign;\n\n\t\tif (DdN > 0) {\n\t\t\tif (backfaceCulling) return null;\n\t\t\tsign = 1;\n\t\t} else if (DdN < 0) {\n\t\t\tsign = -1;\n\t\t\tDdN = -DdN;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\n\t\t_diff.subVectors(this.origin, a);\n\n\t\tconst DdQxE2 = sign * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); // b1 < 0, no intersection\n\n\t\tif (DdQxE2 < 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot(_edge1.cross(_diff)); // b2 < 0, no intersection\n\n\t\tif (DdE1xQ < 0) {\n\t\t\treturn null;\n\t\t} // b1+b2 > 1, no intersection\n\n\n\t\tif (DdQxE2 + DdE1xQ > DdN) {\n\t\t\treturn null;\n\t\t} // Line intersects triangle, check if ray does.\n\n\n\t\tconst QdN = -sign * _diff.dot(_normal); // t < 0, no intersection\n\n\n\t\tif (QdN < 0) {\n\t\t\treturn null;\n\t\t} // Ray intersects triangle.\n\n\n\t\treturn this.at(QdN / DdN, target);\n\t}\n\n\tapplyMatrix4(matrix4) {\n\t\tthis.origin.applyMatrix4(matrix4);\n\t\tthis.direction.transformDirection(matrix4);\n\t\treturn this;\n\t}\n\n\tequals(ray) {\n\t\treturn ray.origin.equals(this.origin) && ray.direction.equals(this.direction);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _box = /*@__PURE__*/new Box3();\n\nconst _v1$1 = /*@__PURE__*/new Vector3();\n\nconst _toFarthestPoint = /*@__PURE__*/new Vector3();\n\nconst _toPoint = /*@__PURE__*/new Vector3();\n\nclass Sphere {\n\tconstructor(center = new Vector3(), radius = -1) {\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\t}\n\n\tset(center, radius) {\n\t\tthis.center.copy(center);\n\t\tthis.radius = radius;\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points, optionalCenter) {\n\t\tconst center = this.center;\n\n\t\tif (optionalCenter !== undefined) {\n\t\t\tcenter.copy(optionalCenter);\n\t\t} else {\n\t\t\t_box.setFromPoints(points).getCenter(center);\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));\n\t\t}\n\n\t\tthis.radius = Math.sqrt(maxRadiusSq);\n\t\treturn this;\n\t}\n\n\tcopy(sphere) {\n\t\tthis.center.copy(sphere.center);\n\t\tthis.radius = sphere.radius;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\treturn this.radius < 0;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.center.set(0, 0, 0);\n\t\tthis.radius = -1;\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.distanceToSquared(this.center) <= this.radius * this.radius;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn point.distanceTo(this.center) - this.radius;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\tconst radiusSum = this.radius + sphere.radius;\n\t\treturn sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsSphere(this);\n\t}\n\n\tintersectsPlane(plane) {\n\t\treturn Math.abs(plane.distanceToPoint(this.center)) <= this.radius;\n\t}\n\n\tclampPoint(point, target) {\n\t\tconst deltaLengthSq = this.center.distanceToSquared(point);\n\t\ttarget.copy(point);\n\n\t\tif (deltaLengthSq > this.radius * this.radius) {\n\t\t\ttarget.sub(this.center).normalize();\n\t\t\ttarget.multiplyScalar(this.radius).add(this.center);\n\t\t}\n\n\t\treturn target;\n\t}\n\n\tgetBoundingBox(target) {\n\t\tif (this.isEmpty()) {\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\t\t}\n\n\t\ttarget.set(this.center, this.center);\n\t\ttarget.expandByScalar(this.radius);\n\t\treturn target;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.center.applyMatrix4(matrix);\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.center.add(offset);\n\t\treturn this;\n\t}\n\n\texpandByPoint(point) {\n\t\tif (this.isEmpty()) {\n\t\t\tthis.center.copy(point);\n\t\t\tthis.radius = 0;\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671\n\n\n\t\t_toPoint.subVectors(point, this.center);\n\n\t\tconst lengthSq = _toPoint.lengthSq();\n\n\t\tif (lengthSq > this.radius * this.radius) {\n\t\t\tconst length = Math.sqrt(lengthSq);\n\t\t\tconst missingRadiusHalf = (length - this.radius) * 0.5; // Nudge this sphere towards the target point. Add half the missing distance to radius,\n\t\t\t// and the other half to position. This gives a tighter enclosure, instead of if\n\t\t\t// the whole missing distance were just added to radius.\n\n\t\t\tthis.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length));\n\t\t\tthis.radius += missingRadiusHalf;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tunion(sphere) {\n\t\t// handle empty sphere cases\n\t\tif (sphere.isEmpty()) {\n\t\t\treturn;\n\t\t} else if (this.isEmpty()) {\n\t\t\tthis.copy(sphere);\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769\n\t\t// To enclose another sphere into this sphere, we only need to enclose two points:\n\t\t// 1) Enclose the farthest point on the other sphere into this sphere.\n\t\t// 2) Enclose the opposite point of the farthest point into this sphere.\n\n\n\t\tif (this.center.equals(sphere.center) === true) {\n\t\t\t_toFarthestPoint.set(0, 0, 1).multiplyScalar(sphere.radius);\n\t\t} else {\n\t\t\t_toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);\n\t\t}\n\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).add(_toFarthestPoint));\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).sub(_toFarthestPoint));\n\t\treturn this;\n\t}\n\n\tequals(sphere) {\n\t\treturn sphere.center.equals(this.center) && sphere.radius === this.radius;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\r\n *\r\n * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\r\n * The azimuthal angle (theta) is measured from the positive z-axis.\r\n */\n\nclass Spherical {\n\tconstructor(radius = 1, phi = 0, theta = 0) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi; // polar angle\n\n\t\tthis.theta = theta; // azimuthal angle\n\n\t\treturn this;\n\t}\n\n\tset(radius, phi, theta) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\t\treturn this;\n\t} // restrict phi to be between EPS and PI-EPS\n\n\n\tmakeSafe() {\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi));\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + y * y + z * z);\n\n\t\tif (this.radius === 0) {\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\t\t} else {\n\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\tthis.phi = Math.acos(clamp(y / this.radius, -1, 1));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/new Vector3();\n\nconst _v1 = /*@__PURE__*/new Vector3();\n\nconst _v2 = /*@__PURE__*/new Vector3();\n\nconst _v3 = /*@__PURE__*/new Vector3();\n\nconst _vab = /*@__PURE__*/new Vector3();\n\nconst _vac = /*@__PURE__*/new Vector3();\n\nconst _vbc = /*@__PURE__*/new Vector3();\n\nconst _vap = /*@__PURE__*/new Vector3();\n\nconst _vbp = /*@__PURE__*/new Vector3();\n\nconst _vcp = /*@__PURE__*/new Vector3();\n\nclass Triangle {\n\tconstructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\t}\n\n\tstatic getNormal(a, b, c, target) {\n\t\ttarget.subVectors(c, b);\n\n\t\t_v0.subVectors(a, b);\n\n\t\ttarget.cross(_v0);\n\t\tconst targetLengthSq = target.lengthSq();\n\n\t\tif (targetLengthSq > 0) {\n\t\t\treturn target.multiplyScalar(1 / Math.sqrt(targetLengthSq));\n\t\t}\n\n\t\treturn target.set(0, 0, 0);\n\t} // static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\n\tstatic getBarycoord(point, a, b, c, target) {\n\t\t_v0.subVectors(c, a);\n\n\t\t_v1.subVectors(b, a);\n\n\t\t_v2.subVectors(point, a);\n\n\t\tconst dot00 = _v0.dot(_v0);\n\n\t\tconst dot01 = _v0.dot(_v1);\n\n\t\tconst dot02 = _v0.dot(_v2);\n\n\t\tconst dot11 = _v1.dot(_v1);\n\n\t\tconst dot12 = _v1.dot(_v2);\n\n\t\tconst denom = dot00 * dot11 - dot01 * dot01; // collinear or singular triangle\n\n\t\tif (denom === 0) {\n\t\t\t// arbitrary location outside of triangle?\n\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\treturn target.set(-2, -1, -1);\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n\t\tconst v = (dot00 * dot12 - dot01 * dot02) * invDenom; // barycentric coordinates must always sum to 1\n\n\t\treturn target.set(1 - u - v, v, u);\n\t}\n\n\tstatic containsPoint(point, a, b, c) {\n\t\tthis.getBarycoord(point, a, b, c, _v3);\n\t\treturn _v3.x >= 0 && _v3.y >= 0 && _v3.x + _v3.y <= 1;\n\t}\n\n\tstatic getUV(point, p1, p2, p3, uv1, uv2, uv3, target) {\n\t\tthis.getBarycoord(point, p1, p2, p3, _v3);\n\t\ttarget.set(0, 0);\n\t\ttarget.addScaledVector(uv1, _v3.x);\n\t\ttarget.addScaledVector(uv2, _v3.y);\n\t\ttarget.addScaledVector(uv3, _v3.z);\n\t\treturn target;\n\t}\n\n\tstatic isFrontFacing(a, b, c, direction) {\n\t\t_v0.subVectors(c, b);\n\n\t\t_v1.subVectors(a, b); // strictly front facing\n\n\n\t\treturn _v0.cross(_v1).dot(direction) < 0 ? true : false;\n\t}\n\n\tset(a, b, c) {\n\t\tthis.a.copy(a);\n\t\tthis.b.copy(b);\n\t\tthis.c.copy(c);\n\t\treturn this;\n\t}\n\n\tsetFromPointsAndIndices(points, i0, i1, i2) {\n\t\tthis.a.copy(points[i0]);\n\t\tthis.b.copy(points[i1]);\n\t\tthis.c.copy(points[i2]);\n\t\treturn this;\n\t} // setFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\t// \tthis.a.fromBufferAttribute( attribute, i0 );\n\t// \tthis.b.fromBufferAttribute( attribute, i1 );\n\t// \tthis.c.fromBufferAttribute( attribute, i2 );\n\t// \treturn this;\n\t// }\n\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(triangle) {\n\t\tthis.a.copy(triangle.a);\n\t\tthis.b.copy(triangle.b);\n\t\tthis.c.copy(triangle.c);\n\t\treturn this;\n\t}\n\n\tgetArea() {\n\t\t_v0.subVectors(this.c, this.b);\n\n\t\t_v1.subVectors(this.a, this.b);\n\n\t\treturn _v0.cross(_v1).length() * 0.5;\n\t}\n\n\tgetMidpoint(target) {\n\t\treturn target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n\t}\n\n\tgetNormal(target) {\n\t\treturn Triangle.getNormal(this.a, this.b, this.c, target);\n\t}\n\n\tgetPlane(target) {\n\t\treturn target.setFromCoplanarPoints(this.a, this.b, this.c);\n\t}\n\n\tgetBarycoord(point, target) {\n\t\treturn Triangle.getBarycoord(point, this.a, this.b, this.c, target);\n\t}\n\n\tgetUV(point, uv1, uv2, uv3, target) {\n\t\treturn Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target);\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn Triangle.containsPoint(point, this.a, this.b, this.c);\n\t}\n\n\tisFrontFacing(direction) {\n\t\treturn Triangle.isFrontFacing(this.a, this.b, this.c, direction);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsTriangle(this);\n\t}\n\n\tclosestPointToPoint(p, target) {\n\t\tconst a = this.a,\n\t\t\t\t\tb = this.b,\n\t\t\t\t\tc = this.c;\n\t\tlet v, w; // algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors(b, a);\n\n\t\t_vac.subVectors(c, a);\n\n\t\t_vap.subVectors(p, a);\n\n\t\tconst d1 = _vab.dot(_vap);\n\n\t\tconst d2 = _vac.dot(_vap);\n\n\t\tif (d1 <= 0 && d2 <= 0) {\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy(a);\n\t\t}\n\n\t\t_vbp.subVectors(p, b);\n\n\t\tconst d3 = _vab.dot(_vbp);\n\n\t\tconst d4 = _vac.dot(_vbp);\n\n\t\tif (d3 >= 0 && d4 <= d3) {\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy(b);\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\n\t\tif (vc <= 0 && d1 >= 0 && d3 <= 0) {\n\t\t\tv = d1 / (d1 - d3); // edge region of AB; barycentric coords (1-v, v, 0)\n\n\t\t\treturn target.copy(a).addScaledVector(_vab, v);\n\t\t}\n\n\t\t_vcp.subVectors(p, c);\n\n\t\tconst d5 = _vab.dot(_vcp);\n\n\t\tconst d6 = _vac.dot(_vcp);\n\n\t\tif (d6 >= 0 && d5 <= d6) {\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy(c);\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\n\t\tif (vb <= 0 && d2 >= 0 && d6 <= 0) {\n\t\t\tw = d2 / (d2 - d6); // edge region of AC; barycentric coords (1-w, 0, w)\n\n\t\t\treturn target.copy(a).addScaledVector(_vac, w);\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\n\t\tif (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {\n\t\t\t_vbc.subVectors(c, b);\n\n\t\t\tw = (d4 - d3) / (d4 - d3 + (d5 - d6)); // edge region of BC; barycentric coords (0, 1-w, w)\n\n\t\t\treturn target.copy(b).addScaledVector(_vbc, w); // edge region of BC\n\t\t} // face region\n\n\n\t\tconst denom = 1 / (va + vb + vc); // u = va * denom\n\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\t\treturn target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w);\n\t}\n\n\tequals(triangle) {\n\t\treturn triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);\n\t}\n\n}\n\nclass Vector4 {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tVector4.prototype.isVector4 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t}\n\n\tget width() {\n\t\treturn this.z;\n\t}\n\n\tset width(value) {\n\t\tthis.z = value;\n\t}\n\n\tget height() {\n\t\treturn this.w;\n\t}\n\n\tset height(value) {\n\t\tthis.w = value;\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetW(w) {\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tthis.w = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tcase 3:\n\t\t\t\treturn this.w;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z, this.w);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = v.w !== undefined ? v.w : 1;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z,\n\t\t\t\t\tw = this.w;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w;\n\t\tthis.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tsetAxisAngleFromQuaternion(q) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\t\t// q is assumed to be normalized\n\t\tthis.w = 2 * Math.acos(q.w);\n\t\tconst s = Math.sqrt(1 - q.w * q.w);\n\n\t\tif (s < 0.0001) {\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\t\t} else {\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetAxisAngleFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tlet angle, x, y, z; // variables for result\n\n\t\tconst epsilon = 0.01,\n\t\t\t\t\t// margin to allow for rounding errors\n\t\tepsilon2 = 0.1,\n\t\t\t\t\t// margin to distinguish between 0 and 180 degrees\n\t\tte = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tif (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\t\t\tif (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\t\t\t\tthis.set(1, 0, 0, 0);\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\t\t\t} // otherwise this singularity is angle = 180\n\n\n\t\t\tangle = Math.PI;\n\t\t\tconst xx = (m11 + 1) / 2;\n\t\t\tconst yy = (m22 + 1) / 2;\n\t\t\tconst zz = (m33 + 1) / 2;\n\t\t\tconst xy = (m12 + m21) / 4;\n\t\t\tconst xz = (m13 + m31) / 4;\n\t\t\tconst yz = (m23 + m32) / 4;\n\n\t\t\tif (xx > yy && xx > zz) {\n\t\t\t\t// m11 is the largest diagonal term\n\t\t\t\tif (xx < epsilon) {\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\tx = Math.sqrt(xx);\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\t\t\t\t}\n\t\t\t} else if (yy > zz) {\n\t\t\t\t// m22 is the largest diagonal term\n\t\t\t\tif (yy < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\ty = Math.sqrt(yy);\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\t\t\t\tif (zz < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\t\t\t\t} else {\n\t\t\t\t\tz = Math.sqrt(zz);\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.set(x, y, z, angle);\n\t\t\treturn this; // return 180 deg rotation\n\t\t} // as we have reached here there are no singularities so we can handle normally\n\n\n\t\tlet s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); // used to normalize\n\n\t\tif (Math.abs(s) < 0.001) s = 1; // prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = (m32 - m23) / s;\n\t\tthis.y = (m13 - m31) / s;\n\t\tthis.z = (m21 - m12) / s;\n\t\tthis.w = Math.acos((m11 + m22 + m33 - 1) / 2);\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\tthis.w = Math.min(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\tthis.w = Math.max(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\tthis.w = Math.max(min.w, Math.min(max.w, this.w));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\tthis.w = Math.max(minVal, Math.min(maxVal, this.w));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\tthis.w = Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\tthis.w = Math.ceil(this.w);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\tthis.w = Math.round(this.w);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\tthis.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\tthis.w = -this.w;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\tthis.w += (v.w - this.w) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\tthis.w = v1.w + (v2.w - v1.w) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\tthis.w = array[offset + 3];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\tarray[offset + 3] = this.w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \tthis.w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\t}\n\n}\n\nexports.ACESFilmicToneMapping = ACESFilmicToneMapping;\nexports.AddEquation = AddEquation;\nexports.AddOperation = AddOperation;\nexports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;\nexports.AdditiveBlending = AdditiveBlending;\nexports.AlphaFormat = AlphaFormat;\nexports.AlwaysDepth = AlwaysDepth;\nexports.AlwaysStencilFunc = AlwaysStencilFunc;\nexports.BackSide = BackSide;\nexports.BasicDepthPacking = BasicDepthPacking;\nexports.BasicShadowMap = BasicShadowMap;\nexports.Box2 = Box2;\nexports.Box3 = Box3;\nexports.ByteType = ByteType;\nexports.CineonToneMapping = CineonToneMapping;\nexports.ClampToEdgeWrapping = ClampToEdgeWrapping;\nexports.Color = Color;\nexports.ColorManagement = ColorManagement;\nexports.CubeReflectionMapping = CubeReflectionMapping;\nexports.CubeRefractionMapping = CubeRefractionMapping;\nexports.CubeUVReflectionMapping = CubeUVReflectionMapping;\nexports.CullFaceBack = CullFaceBack;\nexports.CullFaceFront = CullFaceFront;\nexports.CullFaceFrontBack = CullFaceFrontBack;\nexports.CullFaceNone = CullFaceNone;\nexports.CustomBlending = CustomBlending;\nexports.CustomToneMapping = CustomToneMapping;\nexports.Cylindrical = Cylindrical;\nexports.DecrementStencilOp = DecrementStencilOp;\nexports.DecrementWrapStencilOp = DecrementWrapStencilOp;\nexports.DepthFormat = DepthFormat;\nexports.DepthStencilFormat = DepthStencilFormat;\nexports.DoubleSide = DoubleSide;\nexports.DstAlphaFactor = DstAlphaFactor;\nexports.DstColorFactor = DstColorFactor;\nexports.DynamicCopyUsage = DynamicCopyUsage;\nexports.DynamicDrawUsage = DynamicDrawUsage;\nexports.DynamicReadUsage = DynamicReadUsage;\nexports.EqualDepth = EqualDepth;\nexports.EqualStencilFunc = EqualStencilFunc;\nexports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;\nexports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;\nexports.Euler = Euler;\nexports.FloatType = FloatType;\nexports.FrontSide = FrontSide;\nexports.GLSL1 = GLSL1;\nexports.GLSL3 = GLSL3;\nexports.GreaterDepth = GreaterDepth;\nexports.GreaterEqualDepth = GreaterEqualDepth;\nexports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;\nexports.GreaterStencilFunc = GreaterStencilFunc;\nexports.HalfFloatType = HalfFloatType;\nexports.IncrementStencilOp = IncrementStencilOp;\nexports.IncrementWrapStencilOp = IncrementWrapStencilOp;\nexports.IntType = IntType;\nexports.Interpolant = Interpolant;\nexports.InterpolateDiscrete = InterpolateDiscrete;\nexports.InterpolateLinear = InterpolateLinear;\nexports.InterpolateSmooth = InterpolateSmooth;\nexports.InvertStencilOp = InvertStencilOp;\nexports.KeepStencilOp = KeepStencilOp;\nexports.LessDepth = LessDepth;\nexports.LessEqualDepth = LessEqualDepth;\nexports.LessEqualStencilFunc = LessEqualStencilFunc;\nexports.LessStencilFunc = LessStencilFunc;\nexports.Line3 = Line3;\nexports.LinearEncoding = LinearEncoding;\nexports.LinearFilter = LinearFilter;\nexports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;\nexports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;\nexports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;\nexports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;\nexports.LinearSRGBColorSpace = LinearSRGBColorSpace;\nexports.LinearToSRGB = LinearToSRGB;\nexports.LinearToneMapping = LinearToneMapping;\nexports.LoopOnce = LoopOnce;\nexports.LoopPingPong = LoopPingPong;\nexports.LoopRepeat = LoopRepeat;\nexports.LuminanceAlphaFormat = LuminanceAlphaFormat;\nexports.LuminanceFormat = LuminanceFormat;\nexports.MOUSE = MOUSE;\nexports.MathUtils = MathUtils;\nexports.Matrix3 = Matrix3;\nexports.Matrix4 = Matrix4;\nexports.MaxEquation = MaxEquation;\nexports.MinEquation = MinEquation;\nexports.MirroredRepeatWrapping = MirroredRepeatWrapping;\nexports.MixOperation = MixOperation;\nexports.MultiplyBlending = MultiplyBlending;\nexports.MultiplyOperation = MultiplyOperation;\nexports.NearestFilter = NearestFilter;\nexports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;\nexports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;\nexports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;\nexports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;\nexports.NeverDepth = NeverDepth;\nexports.NeverStencilFunc = NeverStencilFunc;\nexports.NoBlending = NoBlending;\nexports.NoColorSpace = NoColorSpace;\nexports.NoToneMapping = NoToneMapping;\nexports.NormalAnimationBlendMode = NormalAnimationBlendMode;\nexports.NormalBlending = NormalBlending;\nexports.NotEqualDepth = NotEqualDepth;\nexports.NotEqualStencilFunc = NotEqualStencilFunc;\nexports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;\nexports.OneFactor = OneFactor;\nexports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;\nexports.OneMinusDstColorFactor = OneMinusDstColorFactor;\nexports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;\nexports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;\nexports.PCFShadowMap = PCFShadowMap;\nexports.PCFSoftShadowMap = PCFSoftShadowMap;\nexports.Plane = Plane;\nexports.Quaternion = Quaternion;\nexports.REVISION = REVISION;\nexports.RGBADepthPacking = RGBADepthPacking;\nexports.RGBAFormat = RGBAFormat;\nexports.RGBAIntegerFormat = RGBAIntegerFormat;\nexports.RGBA_ASTC_10x10_Format = RGBA_ASTC_10x10_Format;\nexports.RGBA_ASTC_10x5_Format = RGBA_ASTC_10x5_Format;\nexports.RGBA_ASTC_10x6_Format = RGBA_ASTC_10x6_Format;\nexports.RGBA_ASTC_10x8_Format = RGBA_ASTC_10x8_Format;\nexports.RGBA_ASTC_12x10_Format = RGBA_ASTC_12x10_Format;\nexports.RGBA_ASTC_12x12_Format = RGBA_ASTC_12x12_Format;\nexports.RGBA_ASTC_4x4_Format = RGBA_ASTC_4x4_Format;\nexports.RGBA_ASTC_5x4_Format = RGBA_ASTC_5x4_Format;\nexports.RGBA_ASTC_5x5_Format = RGBA_ASTC_5x5_Format;\nexports.RGBA_ASTC_6x5_Format = RGBA_ASTC_6x5_Format;\nexports.RGBA_ASTC_6x6_Format = RGBA_ASTC_6x6_Format;\nexports.RGBA_ASTC_8x5_Format = RGBA_ASTC_8x5_Format;\nexports.RGBA_ASTC_8x6_Format = RGBA_ASTC_8x6_Format;\nexports.RGBA_ASTC_8x8_Format = RGBA_ASTC_8x8_Format;\nexports.RGBA_BPTC_Format = RGBA_BPTC_Format;\nexports.RGBA_ETC2_EAC_Format = RGBA_ETC2_EAC_Format;\nexports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format;\nexports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format;\nexports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;\nexports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;\nexports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;\nexports.RGBFormat = RGBFormat;\nexports.RGB_ETC1_Format = RGB_ETC1_Format;\nexports.RGB_ETC2_Format = RGB_ETC2_Format;\nexports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;\nexports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format;\nexports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format;\nexports.RGFormat = RGFormat;\nexports.RGIntegerFormat = RGIntegerFormat;\nexports.Ray = Ray;\nexports.RedFormat = RedFormat;\nexports.RedIntegerFormat = RedIntegerFormat;\nexports.ReinhardToneMapping = ReinhardToneMapping;\nexports.RepeatWrapping = RepeatWrapping;\nexports.ReplaceStencilOp = ReplaceStencilOp;\nexports.ReverseSubtractEquation = ReverseSubtractEquation;\nexports.SRGBColorSpace = SRGBColorSpace;\nexports.SRGBToLinear = SRGBToLinear;\nexports.ShortType = ShortType;\nexports.Sphere = Sphere;\nexports.Spherical = Spherical;\nexports.SrcAlphaFactor = SrcAlphaFactor;\nexports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;\nexports.SrcColorFactor = SrcColorFactor;\nexports.StaticCopyUsage = StaticCopyUsage;\nexports.StaticDrawUsage = StaticDrawUsage;\nexports.StaticReadUsage = StaticReadUsage;\nexports.StreamCopyUsage = StreamCopyUsage;\nexports.StreamDrawUsage = StreamDrawUsage;\nexports.StreamReadUsage = StreamReadUsage;\nexports.SubtractEquation = SubtractEquation;\nexports.SubtractiveBlending = SubtractiveBlending;\nexports.TOUCH = TOUCH;\nexports.TangentSpaceNormalMap = TangentSpaceNormalMap;\nexports.Triangle = Triangle;\nexports.TriangleFanDrawMode = TriangleFanDrawMode;\nexports.TriangleStripDrawMode = TriangleStripDrawMode;\nexports.TrianglesDrawMode = TrianglesDrawMode;\nexports.UVMapping = UVMapping;\nexports.UnsignedByteType = UnsignedByteType;\nexports.UnsignedInt248Type = UnsignedInt248Type;\nexports.UnsignedIntType = UnsignedIntType;\nexports.UnsignedShort4444Type = UnsignedShort4444Type;\nexports.UnsignedShort5551Type = UnsignedShort5551Type;\nexports.UnsignedShortType = UnsignedShortType;\nexports.VSMShadowMap = VSMShadowMap;\nexports.Vector2 = Vector2;\nexports.Vector3 = Vector3;\nexports.Vector4 = Vector4;\nexports.WrapAroundEnding = WrapAroundEnding;\nexports.ZeroCurvatureEnding = ZeroCurvatureEnding;\nexports.ZeroFactor = ZeroFactor;\nexports.ZeroSlopeEnding = ZeroSlopeEnding;\nexports.ZeroStencilOp = ZeroStencilOp;\nexports._SRGBAFormat = _SRGBAFormat;\nexports.sRGBEncoding = sRGBEncoding;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/threejs-math/build/threejs-math.cjs?")}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(t){var n=__webpack_module_cache__[t];if(void 0!==n)return n.exports;var e=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(e.exports,e,e.exports,__webpack_require__),e.exports}getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var e=Object.create(null);__webpack_require__.r(e);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&n&&t;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((n=>r[n]=()=>t[n]));return r.default=()=>t,__webpack_require__.d(e,r),e},__webpack_require__.d=(t,n)=>{for(var e in n)__webpack_require__.o(n,e)&&!__webpack_require__.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/index.ts");manifesto=__webpack_exports__})(); \ No newline at end of file diff --git a/dist-var/manifesto.js.LICENSE.txt b/dist-var/manifesto.js.LICENSE.txt new file mode 100644 index 00000000..f7149e81 --- /dev/null +++ b/dist-var/manifesto.js.LICENSE.txt @@ -0,0 +1,299 @@ +/*!*********************!*\ + !*** ./src/Size.ts ***! + \*********************/ + +/*!**********************!*\ + !*** ./src/Color.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Light.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Range.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Scene.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Thumb.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/Utils.ts ***! + \**********************/ + +/*!**********************!*\ + !*** ./src/index.ts ***! + \**********************/ + +/*!***********************!*\ + !*** ./src/Camera.ts ***! + \***********************/ + +/*!***********************!*\ + !*** ./src/Canvas.ts ***! + \***********************/ + +/*!************************!*\ + !*** ./src/Service.ts ***! + \************************/ + +/*!*************************!*\ + !*** ./src/Duration.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/Language.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/Manifest.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/Resource.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/Sequence.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/TreeNode.ts ***! + \*************************/ + +/*!*************************!*\ + !*** ./src/internal.ts ***! + \*************************/ + +/*!**************************!*\ + !*** ./src/Rendering.ts ***! + \**************************/ + +/*!**************************!*\ + !*** ./src/Thumbnail.ts ***! + \**************************/ + +/*!**************************!*\ + !*** ./src/Transform.ts ***! + \**************************/ + +/*!***************************!*\ + !*** ./src/Annotation.ts ***! + \***************************/ + +/*!***************************!*\ + !*** ./src/Collection.ts ***! + \***************************/ + +/*!***************************!*\ + !*** ./src/Geometry3d.ts ***! + \***************************/ + +/*!***************************!*\ + !*** ./src/StatusCode.ts ***! + \***************************/ + +/*!****************************!*\ + !*** ./src/LanguageMap.ts ***! + \****************************/ + +/*!*****************************!*\ + !*** ./src/IAccessToken.ts ***! + \*****************************/ + +/*!*****************************!*\ + !*** ./src/IIIFResource.ts ***! + \*****************************/ + +/*!*****************************!*\ + !*** ./src/ManifestType.ts ***! + \*****************************/ + +/*!*****************************!*\ + !*** ./src/TreeNodeType.ts ***! + \*****************************/ + +/*!*****************************!*\ + !*** external "node-fetch" ***! + \*****************************/ + +/*!******************************!*\ + !*** ./src/PointSelector.ts ***! + \******************************/ + +/*!******************************!*\ + !*** ./src/PropertyValue.ts ***! + \******************************/ + +/*!******************************!*\ + !*** ./src/Serialisation.ts ***! + \******************************/ + +/*!*******************************!*\ + !*** ./src/AnnotationBody.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/AnnotationList.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/AnnotationPage.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/JSONLDResource.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/LabelValuePair.ts ***! + \*******************************/ + +/*!*******************************!*\ + !*** ./src/ScaleTransform.ts ***! + \*******************************/ + +/*!********************************!*\ + !*** ./src/RotateTransform.ts ***! + \********************************/ + +/*!********************************!*\ + !*** ./src/TransformParser.ts ***! + \********************************/ + +/*!*********************************!*\ + !*** ./src/ManifestResource.ts ***! + \*********************************/ + +/*!*********************************!*\ + !*** ./src/SpecificResource.ts ***! + \*********************************/ + +/*!**********************************!*\ + !*** ./src/IExternalResource.ts ***! + \**********************************/ + +/*!**********************************!*\ + !*** ./src/IManifestoOptions.ts ***! + \**********************************/ + +/*!***********************************!*\ + !*** ./src/TranslateTransform.ts ***! + \***********************************/ + +/*!*************************************!*\ + !*** ./src/AnnotationBodyParser.ts ***! + \*************************************/ + +/*!**************************************!*\ + !*** ./node_modules/lodash/_root.js ***! + \**************************************/ + +/*!**************************************!*\ + !*** ./src/IExternalResourceData.ts ***! + \**************************************/ + +/*!****************************************!*\ + !*** ./node_modules/lodash/_Symbol.js ***! + \****************************************/ + +/*!****************************************!*\ + !*** ./node_modules/lodash/flatten.js ***! + \****************************************/ + +/*!****************************************!*\ + !*** ./node_modules/lodash/isArray.js ***! + \****************************************/ + +/*!*****************************************!*\ + !*** ./src/IExternalResourceOptions.ts ***! + \*****************************************/ + +/*!******************************************!*\ + !*** ./node_modules/color-name/index.js ***! + \******************************************/ + +/*!*******************************************!*\ + !*** ./node_modules/is-arrayish/index.js ***! + \*******************************************/ + +/*!*******************************************!*\ + !*** ./node_modules/lodash/_arrayPush.js ***! + \*******************************************/ + +/*!*******************************************!*\ + !*** ./node_modules/lodash/_getRawTag.js ***! + \*******************************************/ + +/*!*******************************************!*\ + !*** ./src/IExternalImageResourceData.ts ***! + \*******************************************/ + +/*!********************************************!*\ + !*** ./node_modules/color-string/index.js ***! + \********************************************/ + +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseGetTag.js ***! + \********************************************/ + +/*!********************************************!*\ + !*** ./node_modules/lodash/_freeGlobal.js ***! + \********************************************/ + +/*!********************************************!*\ + !*** ./node_modules/lodash/flattenDeep.js ***! + \********************************************/ + +/*!********************************************!*\ + !*** ./node_modules/lodash/isArguments.js ***! + \********************************************/ + +/*!*********************************************!*\ + !*** ./node_modules/lodash/_baseFlatten.js ***! + \*********************************************/ + +/*!*********************************************!*\ + !*** ./node_modules/lodash/isObjectLike.js ***! + \*********************************************/ + +/*!**********************************************!*\ + !*** ./node_modules/simple-swizzle/index.js ***! + \**********************************************/ + +/*!***********************************************!*\ + !*** ./node_modules/lodash/_isFlattenable.js ***! + \***********************************************/ + +/*!************************************************!*\ + !*** ./node_modules/lodash/_objectToString.js ***! + \************************************************/ + +/*!*************************************************!*\ + !*** ./node_modules/lodash/_baseIsArguments.js ***! + \*************************************************/ + +/*!**************************************************!*\ + !*** ./node_modules/isomorphic-unfetch/index.js ***! + \**************************************************/ + +/*!*****************************************************!*\ + !*** ./node_modules/unfetch/dist/unfetch.module.js ***! + \*****************************************************/ + +/*!**********************************************************!*\ + !*** ./node_modules/threejs-math/build/threejs-math.cjs ***! + \**********************************************************/ + +/*!**************************************************************!*\ + !*** ./node_modules/@iiif/vocabulary/dist-commonjs/index.js ***! + \**************************************************************/ + +/*!***********************************************************************!*\ + !*** ./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js ***! + \***********************************************************************/ diff --git a/docs/.nojekyll b/docs/.nojekyll index e69de29b..e2ac6616 100644 --- a/docs/.nojekyll +++ b/docs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/assets/css/main.css b/docs/assets/css/main.css deleted file mode 100644 index 48b3645c..00000000 --- a/docs/assets/css/main.css +++ /dev/null @@ -1,865 +0,0 @@ -/*! normalize.css v1.1.3 | MIT License | git.io/normalize */ -/* ========================================================================== HTML5 display definitions ========================================================================== */ -/** Correct `block` display not defined in IE 6/7/8/9 and Firefox 3. */ -article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } - -/** Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. */ -audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } - -/** Prevent modern browsers from displaying `audio` without controls. Remove excess height in iOS 5 devices. */ -audio:not([controls]) { display: none; height: 0; } - -/** Address styling not present in IE 7/8/9, Firefox 3, and Safari 4. Known issue: no IE 6 support. */ -[hidden] { display: none; } - -/* ========================================================================== Base ========================================================================== */ -/** 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using `em` units. 2. Prevent iOS text size adjust after orientation change, without disabling user zoom. */ -html { font-size: 100%; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */ font-family: sans-serif; } - -/** Address `font-family` inconsistency between `textarea` and other form elements. */ -button, input, select, textarea { font-family: sans-serif; } - -/** Address margins handled incorrectly in IE 6/7. */ -body { margin: 0; } - -/* ========================================================================== Links ========================================================================== */ -/** Address `outline` inconsistency between Chrome and other browsers. */ -a:focus { outline: thin dotted; } -a:active, a:hover { outline: 0; } - -/** Improve readability when focused and also mouse hovered in all browsers. */ -/* ========================================================================== Typography ========================================================================== */ -/** Address font sizes and margins set differently in IE 6/7. Address font sizes within `section` and `article` in Firefox 4+, Safari 5, and Chrome. */ -h1 { font-size: 2em; margin: 0.67em 0; } - -h2 { font-size: 1.5em; margin: 0.83em 0; } - -h3 { font-size: 1.17em; margin: 1em 0; } - -h4, .tsd-index-panel h3 { font-size: 1em; margin: 1.33em 0; } - -h5 { font-size: 0.83em; margin: 1.67em 0; } - -h6 { font-size: 0.67em; margin: 2.33em 0; } - -/** Address styling not present in IE 7/8/9, Safari 5, and Chrome. */ -abbr[title] { border-bottom: 1px dotted; } - -/** Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome. */ -b, strong { font-weight: bold; } - -blockquote { margin: 1em 40px; } - -/** Address styling not present in Safari 5 and Chrome. */ -dfn { font-style: italic; } - -/** Address differences between Firefox and other browsers. Known issue: no IE 6/7 normalization. */ -hr { box-sizing: content-box; height: 0; } - -/** Address styling not present in IE 6/7/8/9. */ -mark { background: #ff0; color: #000; } - -/** Address margins set differently in IE 6/7. */ -p, pre { margin: 1em 0; } - -/** Correct font family set oddly in IE 6, Safari 4/5, and Chrome. */ -code, kbd, pre, samp { font-family: monospace, serif; _font-family: "courier new", monospace; font-size: 1em; } - -/** Improve readability of pre-formatted text in all browsers. */ -pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } - -/** Address CSS quotes not supported in IE 6/7. */ -q { quotes: none; } -q:before, q:after { content: ""; content: none; } - -/** Address `quotes` property not supported in Safari 4. */ -/** Address inconsistent and variable font size in all browsers. */ -small { font-size: 80%; } - -/** Prevent `sub` and `sup` affecting `line-height` in all browsers. */ -sub { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } - -sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; top: -0.5em; } - -sub { bottom: -0.25em; } - -/* ========================================================================== Lists ========================================================================== */ -/** Address margins set differently in IE 6/7. */ -dl, menu, ol, ul { margin: 1em 0; } - -dd { margin: 0 0 0 40px; } - -/** Address paddings set differently in IE 6/7. */ -menu, ol, ul { padding: 0 0 0 40px; } - -/** Correct list images handled incorrectly in IE 7. */ -nav ul, nav ol { list-style: none; list-style-image: none; } - -/* ========================================================================== Embedded content ========================================================================== */ -/** 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3. 2. Improve image quality when scaled in IE 7. */ -img { border: 0; /* 1 */ -ms-interpolation-mode: bicubic; } - -/* 2 */ -/** Correct overflow displayed oddly in IE 9. */ -svg:not(:root) { overflow: hidden; } - -/* ========================================================================== Figures ========================================================================== */ -/** Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. */ -figure, form { margin: 0; } - -/* ========================================================================== Forms ========================================================================== */ -/** Correct margin displayed oddly in IE 6/7. */ -/** Define consistent border, margin, and padding. */ -fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } - -/** 1. Correct color not being inherited in IE 6/7/8/9. 2. Correct text not wrapping in Firefox 3. 3. Correct alignment displayed oddly in IE 6/7. */ -legend { border: 0; /* 1 */ padding: 0; white-space: normal; /* 2 */ *margin-left: -7px; } - -/* 3 */ -/** 1. Correct font size not being inherited in all browsers. 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5, and Chrome. 3. Improve appearance and consistency in all browsers. */ -button, input, select, textarea { font-size: 100%; /* 1 */ margin: 0; /* 2 */ vertical-align: baseline; /* 3 */ *vertical-align: middle; } - -/* 3 */ -/** Address Firefox 3+ setting `line-height` on `input` using `!important` in the UA stylesheet. */ -button, input { line-height: normal; } - -/** Address inconsistent `text-transform` inheritance for `button` and `select`. All other form control elements do not inherit `text-transform` values. Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+. Correct `select` style inheritance in Firefox 4+ and Opera. */ -button, select { text-transform: none; } - -/** 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` and `video` controls. 2. Correct inability to style clickable `input` types in iOS. 3. Improve usability and consistency of cursor style between image-type `input` and others. 4. Remove inner spacing in IE 7 without affecting normal text inputs. Known issue: inner spacing remains in IE 6. */ -button, html input[type="button"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ *overflow: visible; } - -/* 4 */ -input[type="reset"], input[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ *overflow: visible; } - -/* 4 */ -/** Re-set default cursor for disabled elements. */ -button[disabled], html input[disabled] { cursor: default; } - -/** 1. Address box sizing set to content-box in IE 8/9. 2. Remove excess padding in IE 8/9. 3. Remove excess padding in IE 7. Known issue: excess padding remains in IE 6. */ -input { /* 3 */ } -input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ *height: 13px; /* 3 */ *width: 13px; } -input[type="search"] { -webkit-appearance: textfield; /* 1 */ /* 2 */ box-sizing: content-box; } -input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } - -/** 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome (include `-moz` to future-proof). */ -/** Remove inner padding and search cancel button in Safari 5 and Chrome on OS X. */ -/** Remove inner padding and border in Firefox 3+. */ -button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } - -/** 1. Remove default vertical scrollbar in IE 6/7/8/9. 2. Improve readability and alignment in all browsers. */ -textarea { overflow: auto; /* 1 */ vertical-align: top; } - -/* 2 */ -/* ========================================================================== Tables ========================================================================== */ -/** Remove most spacing between table cells. */ -table { border-collapse: collapse; border-spacing: 0; } - -/* Visual Studio-like style based on original C# coloring by Jason Diamond */ -.hljs { display: inline-block; padding: 0.5em; background: white; color: black; } - -.hljs-comment, .hljs-annotation, .hljs-template_comment, .diff .hljs-header, .hljs-chunk, .apache .hljs-cbracket { color: #008000; } - -.hljs-keyword, .hljs-id, .hljs-built_in, .css .smalltalk .hljs-class, .hljs-winutils, .bash .hljs-variable, .tex .hljs-command, .hljs-request, .hljs-status, .nginx .hljs-title { color: #00f; } - -.xml .hljs-tag { color: #00f; } -.xml .hljs-tag .hljs-value { color: #00f; } - -.hljs-string, .hljs-title, .hljs-parent, .hljs-tag .hljs-value, .hljs-rules .hljs-value { color: #a31515; } - -.ruby .hljs-symbol { color: #a31515; } -.ruby .hljs-symbol .hljs-string { color: #a31515; } - -.hljs-template_tag, .django .hljs-variable, .hljs-addition, .hljs-flow, .hljs-stream, .apache .hljs-tag, .hljs-date, .tex .hljs-formula, .coffeescript .hljs-attribute { color: #a31515; } - -.ruby .hljs-string, .hljs-decorator, .hljs-filter .hljs-argument, .hljs-localvars, .hljs-array, .hljs-attr_selector, .hljs-pseudo, .hljs-pi, .hljs-doctype, .hljs-deletion, .hljs-envvar, .hljs-shebang, .hljs-preprocessor, .hljs-pragma, .userType, .apache .hljs-sqbracket, .nginx .hljs-built_in, .tex .hljs-special, .hljs-prompt { color: #2b91af; } - -.hljs-phpdoc, .hljs-javadoc, .hljs-xmlDocTag { color: #808080; } - -.vhdl .hljs-typename { font-weight: bold; } -.vhdl .hljs-string { color: #666666; } -.vhdl .hljs-literal { color: #a31515; } -.vhdl .hljs-attribute { color: #00b0e8; } - -.xml .hljs-attribute { color: #f00; } - -.col > :first-child, .col-1 > :first-child, .col-2 > :first-child, .col-3 > :first-child, .col-4 > :first-child, .col-5 > :first-child, .col-6 > :first-child, .col-7 > :first-child, .col-8 > :first-child, .col-9 > :first-child, .col-10 > :first-child, .col-11 > :first-child, .tsd-panel > :first-child, ul.tsd-descriptions > li > :first-child, .col > :first-child > :first-child, .col-1 > :first-child > :first-child, .col-2 > :first-child > :first-child, .col-3 > :first-child > :first-child, .col-4 > :first-child > :first-child, .col-5 > :first-child > :first-child, .col-6 > :first-child > :first-child, .col-7 > :first-child > :first-child, .col-8 > :first-child > :first-child, .col-9 > :first-child > :first-child, .col-10 > :first-child > :first-child, .col-11 > :first-child > :first-child, .tsd-panel > :first-child > :first-child, ul.tsd-descriptions > li > :first-child > :first-child, .col > :first-child > :first-child > :first-child, .col-1 > :first-child > :first-child > :first-child, .col-2 > :first-child > :first-child > :first-child, .col-3 > :first-child > :first-child > :first-child, .col-4 > :first-child > :first-child > :first-child, .col-5 > :first-child > :first-child > :first-child, .col-6 > :first-child > :first-child > :first-child, .col-7 > :first-child > :first-child > :first-child, .col-8 > :first-child > :first-child > :first-child, .col-9 > :first-child > :first-child > :first-child, .col-10 > :first-child > :first-child > :first-child, .col-11 > :first-child > :first-child > :first-child, .tsd-panel > :first-child > :first-child > :first-child, ul.tsd-descriptions > li > :first-child > :first-child > :first-child { margin-top: 0; } -.col > :last-child, .col-1 > :last-child, .col-2 > :last-child, .col-3 > :last-child, .col-4 > :last-child, .col-5 > :last-child, .col-6 > :last-child, .col-7 > :last-child, .col-8 > :last-child, .col-9 > :last-child, .col-10 > :last-child, .col-11 > :last-child, .tsd-panel > :last-child, ul.tsd-descriptions > li > :last-child, .col > :last-child > :last-child, .col-1 > :last-child > :last-child, .col-2 > :last-child > :last-child, .col-3 > :last-child > :last-child, .col-4 > :last-child > :last-child, .col-5 > :last-child > :last-child, .col-6 > :last-child > :last-child, .col-7 > :last-child > :last-child, .col-8 > :last-child > :last-child, .col-9 > :last-child > :last-child, .col-10 > :last-child > :last-child, .col-11 > :last-child > :last-child, .tsd-panel > :last-child > :last-child, ul.tsd-descriptions > li > :last-child > :last-child, .col > :last-child > :last-child > :last-child, .col-1 > :last-child > :last-child > :last-child, .col-2 > :last-child > :last-child > :last-child, .col-3 > :last-child > :last-child > :last-child, .col-4 > :last-child > :last-child > :last-child, .col-5 > :last-child > :last-child > :last-child, .col-6 > :last-child > :last-child > :last-child, .col-7 > :last-child > :last-child > :last-child, .col-8 > :last-child > :last-child > :last-child, .col-9 > :last-child > :last-child > :last-child, .col-10 > :last-child > :last-child > :last-child, .col-11 > :last-child > :last-child > :last-child, .tsd-panel > :last-child > :last-child > :last-child, ul.tsd-descriptions > li > :last-child > :last-child > :last-child { margin-bottom: 0; } - -.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; } -@media (max-width: 640px) { .container { padding: 0 20px; } } - -.container-main { padding-bottom: 200px; } - -.row { position: relative; margin: 0 -10px; } -.row:after { visibility: hidden; display: block; content: ""; clear: both; height: 0; } - -.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11 { box-sizing: border-box; float: left; padding: 0 10px; } - -.col-1 { width: 8.33333%; } - -.offset-1 { margin-left: 8.33333%; } - -.col-2 { width: 16.66667%; } - -.offset-2 { margin-left: 16.66667%; } - -.col-3 { width: 25%; } - -.offset-3 { margin-left: 25%; } - -.col-4 { width: 33.33333%; } - -.offset-4 { margin-left: 33.33333%; } - -.col-5 { width: 41.66667%; } - -.offset-5 { margin-left: 41.66667%; } - -.col-6 { width: 50%; } - -.offset-6 { margin-left: 50%; } - -.col-7 { width: 58.33333%; } - -.offset-7 { margin-left: 58.33333%; } - -.col-8 { width: 66.66667%; } - -.offset-8 { margin-left: 66.66667%; } - -.col-9 { width: 75%; } - -.offset-9 { margin-left: 75%; } - -.col-10 { width: 83.33333%; } - -.offset-10 { margin-left: 83.33333%; } - -.col-11 { width: 91.66667%; } - -.offset-11 { margin-left: 91.66667%; } - -.tsd-kind-icon { display: block; position: relative; padding-left: 20px; text-indent: -20px; } -.tsd-kind-icon:before { content: ''; display: inline-block; vertical-align: middle; width: 17px; height: 17px; margin: 0 3px 2px 0; background-image: url(../images/icons.png); } -@media (-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) { .tsd-kind-icon:before { background-image: url(../images/icons@2x.png); background-size: 238px 204px; } } - -.tsd-signature.tsd-kind-icon:before { background-position: 0 -153px; } - -.tsd-kind-object-literal > .tsd-kind-icon:before { background-position: 0px -17px; } -.tsd-kind-object-literal.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -17px; } -.tsd-kind-object-literal.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -17px; } - -.tsd-kind-class > .tsd-kind-icon:before { background-position: 0px -34px; } -.tsd-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -34px; } -.tsd-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -34px; } - -.tsd-kind-class.tsd-has-type-parameter > .tsd-kind-icon:before { background-position: 0px -51px; } -.tsd-kind-class.tsd-has-type-parameter.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -51px; } -.tsd-kind-class.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -51px; } - -.tsd-kind-interface > .tsd-kind-icon:before { background-position: 0px -68px; } -.tsd-kind-interface.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -68px; } -.tsd-kind-interface.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -68px; } - -.tsd-kind-interface.tsd-has-type-parameter > .tsd-kind-icon:before { background-position: 0px -85px; } -.tsd-kind-interface.tsd-has-type-parameter.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -85px; } -.tsd-kind-interface.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -85px; } - -.tsd-kind-module > .tsd-kind-icon:before { background-position: 0px -102px; } -.tsd-kind-module.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -102px; } -.tsd-kind-module.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -102px; } - -.tsd-kind-external-module > .tsd-kind-icon:before { background-position: 0px -102px; } -.tsd-kind-external-module.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -102px; } -.tsd-kind-external-module.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -102px; } - -.tsd-kind-enum > .tsd-kind-icon:before { background-position: 0px -119px; } -.tsd-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -119px; } -.tsd-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -119px; } - -.tsd-kind-enum-member > .tsd-kind-icon:before { background-position: 0px -136px; } -.tsd-kind-enum-member.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -136px; } -.tsd-kind-enum-member.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -136px; } - -.tsd-kind-signature > .tsd-kind-icon:before { background-position: 0px -153px; } -.tsd-kind-signature.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -153px; } -.tsd-kind-signature.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -153px; } - -.tsd-kind-type-alias > .tsd-kind-icon:before { background-position: 0px -170px; } -.tsd-kind-type-alias.tsd-is-protected > .tsd-kind-icon:before { background-position: -17px -170px; } -.tsd-kind-type-alias.tsd-is-private > .tsd-kind-icon:before { background-position: -34px -170px; } - -.tsd-kind-variable > .tsd-kind-icon:before { background-position: -136px -0px; } -.tsd-kind-variable.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -0px; } -.tsd-kind-variable.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -0px; } -.tsd-kind-variable.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -0px; } -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -0px; } -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -0px; } -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -0px; } -.tsd-kind-variable.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -0px; } -.tsd-kind-variable.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -0px; } -.tsd-kind-variable.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -0px; } -.tsd-kind-variable.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -0px; } -.tsd-kind-variable.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -0px; } -.tsd-kind-variable.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -0px; } - -.tsd-kind-property > .tsd-kind-icon:before { background-position: -136px -0px; } -.tsd-kind-property.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -0px; } -.tsd-kind-property.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -0px; } -.tsd-kind-property.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -0px; } -.tsd-kind-property.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -0px; } -.tsd-kind-property.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -0px; } -.tsd-kind-property.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -0px; } -.tsd-kind-property.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -0px; } -.tsd-kind-property.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -0px; } -.tsd-kind-property.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -0px; } -.tsd-kind-property.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -0px; } -.tsd-kind-property.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -0px; } -.tsd-kind-property.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -0px; } - -.tsd-kind-get-signature > .tsd-kind-icon:before { background-position: -136px -17px; } -.tsd-kind-get-signature.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -17px; } -.tsd-kind-get-signature.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -17px; } -.tsd-kind-get-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -17px; } - -.tsd-kind-set-signature > .tsd-kind-icon:before { background-position: -136px -34px; } -.tsd-kind-set-signature.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -34px; } -.tsd-kind-set-signature.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -34px; } -.tsd-kind-set-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -34px; } - -.tsd-kind-accessor > .tsd-kind-icon:before { background-position: -136px -51px; } -.tsd-kind-accessor.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -51px; } -.tsd-kind-accessor.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -51px; } -.tsd-kind-accessor.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -51px; } -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -51px; } -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -51px; } -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -51px; } -.tsd-kind-accessor.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -51px; } -.tsd-kind-accessor.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -51px; } -.tsd-kind-accessor.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -51px; } -.tsd-kind-accessor.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -51px; } -.tsd-kind-accessor.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -51px; } -.tsd-kind-accessor.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -51px; } - -.tsd-kind-function > .tsd-kind-icon:before { background-position: -136px -68px; } -.tsd-kind-function.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -68px; } -.tsd-kind-function.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -68px; } -.tsd-kind-function.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -68px; } -.tsd-kind-function.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -68px; } -.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -68px; } -.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -68px; } -.tsd-kind-function.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -68px; } -.tsd-kind-function.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -68px; } -.tsd-kind-function.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -68px; } -.tsd-kind-function.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -68px; } -.tsd-kind-function.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -68px; } -.tsd-kind-function.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -68px; } - -.tsd-kind-method > .tsd-kind-icon:before { background-position: -136px -68px; } -.tsd-kind-method.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -68px; } -.tsd-kind-method.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -68px; } -.tsd-kind-method.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -68px; } -.tsd-kind-method.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -68px; } -.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -68px; } -.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -68px; } -.tsd-kind-method.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -68px; } -.tsd-kind-method.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -68px; } -.tsd-kind-method.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -68px; } -.tsd-kind-method.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -68px; } -.tsd-kind-method.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -68px; } -.tsd-kind-method.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -68px; } - -.tsd-kind-call-signature > .tsd-kind-icon:before { background-position: -136px -68px; } -.tsd-kind-call-signature.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -68px; } -.tsd-kind-call-signature.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -68px; } -.tsd-kind-call-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -68px; } - -.tsd-kind-function.tsd-has-type-parameter > .tsd-kind-icon:before { background-position: -136px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -85px; } -.tsd-kind-function.tsd-has-type-parameter.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -85px; } - -.tsd-kind-method.tsd-has-type-parameter > .tsd-kind-icon:before { background-position: -136px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -85px; } -.tsd-kind-method.tsd-has-type-parameter.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -85px; } - -.tsd-kind-constructor > .tsd-kind-icon:before { background-position: -136px -102px; } -.tsd-kind-constructor.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -102px; } -.tsd-kind-constructor.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -102px; } -.tsd-kind-constructor.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -102px; } -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -102px; } -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -102px; } -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -102px; } -.tsd-kind-constructor.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -102px; } -.tsd-kind-constructor.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -102px; } -.tsd-kind-constructor.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -102px; } -.tsd-kind-constructor.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -102px; } -.tsd-kind-constructor.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -102px; } -.tsd-kind-constructor.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -102px; } - -.tsd-kind-constructor-signature > .tsd-kind-icon:before { background-position: -136px -102px; } -.tsd-kind-constructor-signature.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -102px; } -.tsd-kind-constructor-signature.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -102px; } -.tsd-kind-constructor-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -102px; } - -.tsd-kind-index-signature > .tsd-kind-icon:before { background-position: -136px -119px; } -.tsd-kind-index-signature.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -119px; } -.tsd-kind-index-signature.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -119px; } -.tsd-kind-index-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -119px; } - -.tsd-kind-event > .tsd-kind-icon:before { background-position: -136px -136px; } -.tsd-kind-event.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -136px; } -.tsd-kind-event.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -136px; } -.tsd-kind-event.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -136px; } -.tsd-kind-event.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -136px; } -.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -136px; } -.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -136px; } -.tsd-kind-event.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -136px; } -.tsd-kind-event.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -136px; } -.tsd-kind-event.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -136px; } -.tsd-kind-event.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -136px; } -.tsd-kind-event.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -136px; } -.tsd-kind-event.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -136px; } - -.tsd-is-static > .tsd-kind-icon:before { background-position: -136px -153px; } -.tsd-is-static.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -153px; } -.tsd-is-static.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -153px; } -.tsd-is-static.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -153px; } -.tsd-is-static.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -153px; } -.tsd-is-static.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -153px; } -.tsd-is-static.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -153px; } -.tsd-is-static.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -153px; } -.tsd-is-static.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -153px; } -.tsd-is-static.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -153px; } -.tsd-is-static.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -153px; } -.tsd-is-static.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -153px; } -.tsd-is-static.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -153px; } - -.tsd-is-static.tsd-kind-function > .tsd-kind-icon:before { background-position: -136px -170px; } -.tsd-is-static.tsd-kind-function.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -170px; } -.tsd-is-static.tsd-kind-function.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -170px; } -.tsd-is-static.tsd-kind-function.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -170px; } - -.tsd-is-static.tsd-kind-method > .tsd-kind-icon:before { background-position: -136px -170px; } -.tsd-is-static.tsd-kind-method.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -170px; } -.tsd-is-static.tsd-kind-method.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -170px; } -.tsd-is-static.tsd-kind-method.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -170px; } - -.tsd-is-static.tsd-kind-call-signature > .tsd-kind-icon:before { background-position: -136px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -170px; } -.tsd-is-static.tsd-kind-call-signature.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -170px; } - -.tsd-is-static.tsd-kind-event > .tsd-kind-icon:before { background-position: -136px -187px; } -.tsd-is-static.tsd-kind-event.tsd-is-protected > .tsd-kind-icon:before { background-position: -153px -187px; } -.tsd-is-static.tsd-kind-event.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class > .tsd-kind-icon:before { background-position: -51px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-inherited > .tsd-kind-icon:before { background-position: -68px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected > .tsd-kind-icon:before { background-position: -85px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-protected.tsd-is-inherited > .tsd-kind-icon:before { background-position: -102px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-class.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum > .tsd-kind-icon:before { background-position: -170px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum.tsd-is-protected > .tsd-kind-icon:before { background-position: -187px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-enum.tsd-is-private > .tsd-kind-icon:before { background-position: -119px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-interface > .tsd-kind-icon:before { background-position: -204px -187px; } -.tsd-is-static.tsd-kind-event.tsd-parent-kind-interface.tsd-is-inherited > .tsd-kind-icon:before { background-position: -221px -187px; } - -.no-transition { transition: none !important; } - -@-webkit-keyframes fade-in { from { opacity: 0; } - to { opacity: 1; } } - -@keyframes fade-in { from { opacity: 0; } - to { opacity: 1; } } -@-webkit-keyframes fade-out { from { opacity: 1; visibility: visible; } - to { opacity: 0; } } -@keyframes fade-out { from { opacity: 1; visibility: visible; } - to { opacity: 0; } } -@-webkit-keyframes fade-in-delayed { 0% { opacity: 0; } - 33% { opacity: 0; } - 100% { opacity: 1; } } -@keyframes fade-in-delayed { 0% { opacity: 0; } - 33% { opacity: 0; } - 100% { opacity: 1; } } -@-webkit-keyframes fade-out-delayed { 0% { opacity: 1; visibility: visible; } - 66% { opacity: 0; } - 100% { opacity: 0; } } -@keyframes fade-out-delayed { 0% { opacity: 1; visibility: visible; } - 66% { opacity: 0; } - 100% { opacity: 0; } } -@-webkit-keyframes shift-to-left { from { -webkit-transform: translate(0, 0); transform: translate(0, 0); } - to { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } } -@keyframes shift-to-left { from { -webkit-transform: translate(0, 0); transform: translate(0, 0); } - to { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } } -@-webkit-keyframes unshift-to-left { from { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } - to { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } -@keyframes unshift-to-left { from { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } - to { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } -@-webkit-keyframes pop-in-from-right { from { -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } - to { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } -@keyframes pop-in-from-right { from { -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } - to { -webkit-transform: translate(0, 0); transform: translate(0, 0); } } -@-webkit-keyframes pop-out-to-right { from { -webkit-transform: translate(0, 0); transform: translate(0, 0); visibility: visible; } - to { -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } } -@keyframes pop-out-to-right { from { -webkit-transform: translate(0, 0); transform: translate(0, 0); visibility: visible; } - to { -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } } -body { background: #fdfdfd; font-family: "Segoe UI", sans-serif; font-size: 16px; color: #222; } - -a { color: #4da6ff; text-decoration: none; } -a:hover { text-decoration: underline; } - -code, pre { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; padding: 0.2em; margin: 0; font-size: 14px; background-color: rgba(0, 0, 0, 0.04); } - -pre { padding: 10px; } -pre code { padding: 0; font-size: 100%; background-color: transparent; } - -.tsd-typography { line-height: 1.333em; } -.tsd-typography ul { list-style: square; padding: 0 0 0 20px; margin: 0; } -.tsd-typography h4, .tsd-typography .tsd-index-panel h3, .tsd-index-panel .tsd-typography h3, .tsd-typography h5, .tsd-typography h6 { font-size: 1em; margin: 0; } -.tsd-typography h5, .tsd-typography h6 { font-weight: normal; } -.tsd-typography p, .tsd-typography ul, .tsd-typography ol { margin: 1em 0; } - -@media (min-width: 901px) and (max-width: 1024px) { html.default .col-content { width: 72%; } - html.default .col-menu { width: 28%; } - html.default .tsd-navigation { padding-left: 10px; } } -@media (max-width: 900px) { html.default .col-content { float: none; width: 100%; } - html.default .col-menu { position: fixed !important; overflow: auto; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; z-index: 1024; top: 0 !important; bottom: 0 !important; left: auto !important; right: 0 !important; width: 100%; padding: 20px 20px 0 0; max-width: 450px; visibility: hidden; background-color: #fff; -webkit-transform: translate(100%, 0); transform: translate(100%, 0); } - html.default .col-menu > *:last-child { padding-bottom: 20px; } - html.default .overlay { content: ""; display: block; position: fixed; z-index: 1023; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.75); visibility: hidden; } - html.default.to-has-menu .overlay { -webkit-animation: fade-in 0.4s; animation: fade-in 0.4s; } - html.default.to-has-menu header, html.default.to-has-menu footer, html.default.to-has-menu .col-content { -webkit-animation: shift-to-left 0.4s; animation: shift-to-left 0.4s; } - html.default.to-has-menu .col-menu { -webkit-animation: pop-in-from-right 0.4s; animation: pop-in-from-right 0.4s; } - html.default.from-has-menu .overlay { -webkit-animation: fade-out 0.4s; animation: fade-out 0.4s; } - html.default.from-has-menu header, html.default.from-has-menu footer, html.default.from-has-menu .col-content { -webkit-animation: unshift-to-left 0.4s; animation: unshift-to-left 0.4s; } - html.default.from-has-menu .col-menu { -webkit-animation: pop-out-to-right 0.4s; animation: pop-out-to-right 0.4s; } - html.default.has-menu body { overflow: hidden; } - html.default.has-menu .overlay { visibility: visible; } - html.default.has-menu header, html.default.has-menu footer, html.default.has-menu .col-content { -webkit-transform: translate(-25%, 0); transform: translate(-25%, 0); } - html.default.has-menu .col-menu { visibility: visible; -webkit-transform: translate(0, 0); transform: translate(0, 0); } } - -.tsd-page-title { padding: 70px 0 20px 0; margin: 0 0 40px 0; background: #fff; box-shadow: 0 0 5px rgba(0, 0, 0, 0.35); } -.tsd-page-title h1 { margin: 0; } - -.tsd-breadcrumb { margin: 0; padding: 0; color: #808080; } -.tsd-breadcrumb a { color: #808080; text-decoration: none; } -.tsd-breadcrumb a:hover { text-decoration: underline; } -.tsd-breadcrumb li { display: inline; } -.tsd-breadcrumb li:after { content: " / "; } - -html.minimal .container { margin: 0; } -html.minimal .container-main { padding-top: 50px; padding-bottom: 0; } -html.minimal .content-wrap { padding-left: 300px; } -html.minimal .tsd-navigation { position: fixed !important; overflow: auto; -webkit-overflow-scrolling: touch; overflow-scrolling: touch; box-sizing: border-box; z-index: 1; left: 0; top: 40px; bottom: 0; width: 300px; padding: 20px; margin: 0; } -html.minimal .tsd-member .tsd-member { margin-left: 0; } -html.minimal .tsd-page-toolbar { position: fixed; z-index: 2; } -html.minimal #tsd-filter .tsd-filter-group { right: 0; -webkit-transform: none; transform: none; } -html.minimal footer { background-color: transparent; } -html.minimal footer .container { padding: 0; } -html.minimal .tsd-generator { padding: 0; } -@media (max-width: 900px) { html.minimal .tsd-navigation { display: none; } - html.minimal .content-wrap { padding-left: 0; } } - -dl.tsd-comment-tags { overflow: hidden; } -dl.tsd-comment-tags dt { clear: both; float: left; padding: 1px 5px; margin: 0 10px 0 0; border-radius: 4px; border: 1px solid #808080; color: #808080; font-size: 0.8em; font-weight: normal; } -dl.tsd-comment-tags dd { margin: 0 0 10px 0; } -dl.tsd-comment-tags p { margin: 0; } - -.tsd-panel.tsd-comment .lead { font-size: 1.1em; line-height: 1.333em; margin-bottom: 2em; } -.tsd-panel.tsd-comment .lead:last-child { margin-bottom: 0; } - -.toggle-protected .tsd-is-private { display: none; } - -.toggle-public .tsd-is-private, .toggle-public .tsd-is-protected, .toggle-public .tsd-is-private-protected { display: none; } - -.toggle-inherited .tsd-is-inherited { display: none; } - -.toggle-only-exported .tsd-is-not-exported { display: none; } - -.toggle-externals .tsd-is-external { display: none; } - -#tsd-filter { position: relative; display: inline-block; height: 40px; vertical-align: bottom; } -.no-filter #tsd-filter { display: none; } -#tsd-filter .tsd-filter-group { display: inline-block; height: 40px; vertical-align: bottom; white-space: nowrap; } -#tsd-filter input { display: none; } -@media (max-width: 900px) { #tsd-filter .tsd-filter-group { display: block; position: absolute; top: 40px; right: 20px; height: auto; background-color: #fff; visibility: hidden; -webkit-transform: translate(50%, 0); transform: translate(50%, 0); box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } - .has-options #tsd-filter .tsd-filter-group { visibility: visible; } - .to-has-options #tsd-filter .tsd-filter-group { -webkit-animation: fade-in 0.2s; animation: fade-in 0.2s; } - .from-has-options #tsd-filter .tsd-filter-group { -webkit-animation: fade-out 0.2s; animation: fade-out 0.2s; } - #tsd-filter label, #tsd-filter .tsd-select { display: block; padding-right: 20px; } } - -footer { border-top: 1px solid #eee; background-color: #fff; } -footer.with-border-bottom { border-bottom: 1px solid #eee; } -footer .tsd-legend-group { font-size: 0; } -footer .tsd-legend { display: inline-block; width: 25%; padding: 0; font-size: 16px; list-style: none; line-height: 1.333em; vertical-align: top; } -@media (max-width: 900px) { footer .tsd-legend { width: 50%; } } - -.tsd-hierarchy { list-style: square; padding: 0 0 0 20px; margin: 0; } -.tsd-hierarchy .target { font-weight: bold; } - -.tsd-index-panel .tsd-index-content { margin-bottom: -30px !important; } -.tsd-index-panel .tsd-index-section { margin-bottom: 30px !important; } -.tsd-index-panel h3 { margin: 0 -20px 10px -20px; padding: 0 20px 10px 20px; border-bottom: 1px solid #eee; } -.tsd-index-panel ul.tsd-index-list { -webkit-column-count: 3; -moz-column-count: 3; -ms-column-count: 3; -o-column-count: 3; column-count: 3; -webkit-column-gap: 20px; -moz-column-gap: 20px; -ms-column-gap: 20px; -o-column-gap: 20px; column-gap: 20px; padding: 0; list-style: none; line-height: 1.333em; } -@media (max-width: 900px) { .tsd-index-panel ul.tsd-index-list { -webkit-column-count: 1; -moz-column-count: 1; -ms-column-count: 1; -o-column-count: 1; column-count: 1; } } -@media (min-width: 901px) and (max-width: 1024px) { .tsd-index-panel ul.tsd-index-list { -webkit-column-count: 2; -moz-column-count: 2; -ms-column-count: 2; -o-column-count: 2; column-count: 2; } } -.tsd-index-panel ul.tsd-index-list li { -webkit-column-break-inside: avoid; -moz-column-break-inside: avoid; -ms-column-break-inside: avoid; -o-column-break-inside: avoid; column-break-inside: avoid; -webkit-page-break-inside: avoid; -moz-page-break-inside: avoid; -ms-page-break-inside: avoid; -o-page-break-inside: avoid; page-break-inside: avoid; } -.tsd-index-panel a, .tsd-index-panel .tsd-parent-kind-module a { color: #9600ff; } -.tsd-index-panel .tsd-parent-kind-interface a { color: #7da01f; } -.tsd-index-panel .tsd-parent-kind-enum a { color: #cc9900; } -.tsd-index-panel .tsd-parent-kind-class a { color: #4da6ff; } -.tsd-index-panel .tsd-kind-module a { color: #9600ff; } -.tsd-index-panel .tsd-kind-interface a { color: #7da01f; } -.tsd-index-panel .tsd-kind-enum a { color: #cc9900; } -.tsd-index-panel .tsd-kind-class a { color: #4da6ff; } -.tsd-index-panel .tsd-is-private a { color: #808080; } - -.tsd-flag { display: inline-block; padding: 1px 5px; border-radius: 4px; color: #fff; background-color: #808080; text-indent: 0; font-size: 14px; font-weight: normal; } - -.tsd-anchor { position: absolute; top: -100px; } - -.tsd-member { position: relative; } -.tsd-member .tsd-anchor + h3 { margin-top: 0; margin-bottom: 0; border-bottom: none; } - -.tsd-navigation { padding: 0 0 0 40px; } -.tsd-navigation a { display: block; padding-top: 2px; padding-bottom: 2px; border-left: 2px solid transparent; color: #222; text-decoration: none; transition: border-left-color 0.1s; } -.tsd-navigation a:hover { text-decoration: underline; } -.tsd-navigation ul { margin: 0; padding: 0; list-style: none; } -.tsd-navigation li { padding: 0; } - -.tsd-navigation.primary { padding-bottom: 40px; } -.tsd-navigation.primary a { display: block; padding-top: 6px; padding-bottom: 6px; } -.tsd-navigation.primary ul li a { padding-left: 5px; } -.tsd-navigation.primary ul li li a { padding-left: 25px; } -.tsd-navigation.primary ul li li li a { padding-left: 45px; } -.tsd-navigation.primary ul li li li li a { padding-left: 65px; } -.tsd-navigation.primary ul li li li li li a { padding-left: 85px; } -.tsd-navigation.primary ul li li li li li li a { padding-left: 105px; } -.tsd-navigation.primary > ul { border-bottom: 1px solid #eee; } -.tsd-navigation.primary li { border-top: 1px solid #eee; } -.tsd-navigation.primary li.current > a { font-weight: bold; } -.tsd-navigation.primary li.label span { display: block; padding: 20px 0 6px 5px; color: #808080; } -.tsd-navigation.primary li.globals + li > span, .tsd-navigation.primary li.globals + li > a { padding-top: 20px; } - -.tsd-navigation.secondary ul { transition: opacity 0.2s; } -.tsd-navigation.secondary ul li a { padding-left: 25px; } -.tsd-navigation.secondary ul li li a { padding-left: 45px; } -.tsd-navigation.secondary ul li li li a { padding-left: 65px; } -.tsd-navigation.secondary ul li li li li a { padding-left: 85px; } -.tsd-navigation.secondary ul li li li li li a { padding-left: 105px; } -.tsd-navigation.secondary ul li li li li li li a { padding-left: 125px; } -.tsd-navigation.secondary ul.current a { border-left-color: #eee; } -.tsd-navigation.secondary li.focus > a, .tsd-navigation.secondary ul.current li.focus > a { border-left-color: #000; } -.tsd-navigation.secondary li.current { margin-top: 20px; margin-bottom: 20px; border-left-color: #eee; } -.tsd-navigation.secondary li.current > a { font-weight: bold; } - -@media (min-width: 901px) { .menu-sticky-wrap { position: static; } - .no-csspositionsticky .menu-sticky-wrap.sticky { position: fixed; } - .no-csspositionsticky .menu-sticky-wrap.sticky-current { position: fixed; } - .no-csspositionsticky .menu-sticky-wrap.sticky-current ul.before-current, .no-csspositionsticky .menu-sticky-wrap.sticky-current ul.after-current { opacity: 0; } - .no-csspositionsticky .menu-sticky-wrap.sticky-bottom { position: absolute; top: auto !important; left: auto !important; bottom: 0; right: 0; } - .csspositionsticky .menu-sticky-wrap.sticky { position: -webkit-sticky; position: sticky; } - .csspositionsticky .menu-sticky-wrap.sticky-current { position: -webkit-sticky; position: sticky; } } - -.tsd-panel { margin: 20px 0; padding: 20px; background-color: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } -.tsd-panel:empty { display: none; } -.tsd-panel > h1, .tsd-panel > h2, .tsd-panel > h3 { margin: 1.5em -20px 10px -20px; padding: 0 20px 10px 20px; border-bottom: 1px solid #eee; } -.tsd-panel > h1.tsd-before-signature, .tsd-panel > h2.tsd-before-signature, .tsd-panel > h3.tsd-before-signature { margin-bottom: 0; border-bottom: 0; } -.tsd-panel table { display: block; width: 100%; overflow: auto; margin-top: 10px; word-break: normal; word-break: keep-all; } -.tsd-panel table th { font-weight: bold; } -.tsd-panel table th, .tsd-panel table td { padding: 6px 13px; border: 1px solid #ddd; } -.tsd-panel table tr { background-color: #fff; border-top: 1px solid #ccc; } -.tsd-panel table tr:nth-child(2n) { background-color: #f8f8f8; } - -.tsd-panel-group { margin: 60px 0; } -.tsd-panel-group > h1, .tsd-panel-group > h2, .tsd-panel-group > h3 { padding-left: 20px; padding-right: 20px; } - -#tsd-search { transition: background-color 0.2s; } -#tsd-search .title { position: relative; z-index: 2; } -#tsd-search .field { position: absolute; left: 0; top: 0; right: 40px; height: 40px; } -#tsd-search .field input { box-sizing: border-box; position: relative; top: -50px; z-index: 1; width: 100%; padding: 0 10px; opacity: 0; outline: 0; border: 0; background: transparent; color: #222; } -#tsd-search .field label { position: absolute; overflow: hidden; right: -40px; } -#tsd-search .field input, #tsd-search .title { transition: opacity 0.2s; } -#tsd-search .results { position: absolute; visibility: hidden; top: 40px; width: 100%; margin: 0; padding: 0; list-style: none; box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } -#tsd-search .results li { padding: 0 10px; background-color: #fdfdfd; } -#tsd-search .results li:nth-child(even) { background-color: #fff; } -#tsd-search .results li.state { display: none; } -#tsd-search .results li.current, #tsd-search .results li:hover { background-color: #eee; } -#tsd-search .results a { display: block; } -#tsd-search .results a:before { top: 10px; } -#tsd-search .results span.parent { color: #808080; font-weight: normal; } -#tsd-search.has-focus { background-color: #eee; } -#tsd-search.has-focus .field input { top: 0; opacity: 1; } -#tsd-search.has-focus .title { z-index: 0; opacity: 0; } -#tsd-search.has-focus .results { visibility: visible; } -#tsd-search.loading .results li.state.loading { display: block; } -#tsd-search.failure .results li.state.failure { display: block; } - -.tsd-signature { margin: 0 0 1em 0; padding: 10px; border: 1px solid #eee; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; } -.tsd-signature.tsd-kind-icon { padding-left: 30px; } -.tsd-signature.tsd-kind-icon:before { top: 10px; left: 10px; } -.tsd-panel > .tsd-signature { margin-left: -20px; margin-right: -20px; border-width: 1px 0; } -.tsd-panel > .tsd-signature.tsd-kind-icon { padding-left: 40px; } -.tsd-panel > .tsd-signature.tsd-kind-icon:before { left: 20px; } - -.tsd-signature-symbol { color: #808080; font-weight: normal; } - -.tsd-signature-type { font-style: italic; font-weight: normal; } - -.tsd-signatures { padding: 0; margin: 0 0 1em 0; border: 1px solid #eee; } -.tsd-signatures .tsd-signature { margin: 0; border-width: 1px 0 0 0; transition: background-color 0.1s; } -.tsd-signatures .tsd-signature:first-child { border-top-width: 0; } -.tsd-signatures .tsd-signature.current { background-color: #eee; } -.tsd-signatures.active > .tsd-signature { cursor: pointer; } -.tsd-panel > .tsd-signatures { margin-left: -20px; margin-right: -20px; border-width: 1px 0; } -.tsd-panel > .tsd-signatures .tsd-signature.tsd-kind-icon { padding-left: 40px; } -.tsd-panel > .tsd-signatures .tsd-signature.tsd-kind-icon:before { left: 20px; } -.tsd-panel > a.anchor + .tsd-signatures { border-top-width: 0; margin-top: -20px; } - -ul.tsd-descriptions { position: relative; overflow: hidden; transition: height 0.3s; padding: 0; list-style: none; } -ul.tsd-descriptions.active > .tsd-description { display: none; } -ul.tsd-descriptions.active > .tsd-description.current { display: block; } -ul.tsd-descriptions.active > .tsd-description.fade-in { -webkit-animation: fade-in-delayed 0.3s; animation: fade-in-delayed 0.3s; } -ul.tsd-descriptions.active > .tsd-description.fade-out { -webkit-animation: fade-out-delayed 0.3s; animation: fade-out-delayed 0.3s; position: absolute; display: block; top: 0; left: 0; right: 0; opacity: 0; visibility: hidden; } -ul.tsd-descriptions h4, ul.tsd-descriptions .tsd-index-panel h3, .tsd-index-panel ul.tsd-descriptions h3 { font-size: 16px; margin: 1em 0 0.5em 0; } - -ul.tsd-parameters, ul.tsd-type-parameters { list-style: square; margin: 0; padding-left: 20px; } -ul.tsd-parameters > li.tsd-parameter-siganture, ul.tsd-type-parameters > li.tsd-parameter-siganture { list-style: none; margin-left: -20px; } -ul.tsd-parameters h5, ul.tsd-type-parameters h5 { font-size: 16px; margin: 1em 0 0.5em 0; } -ul.tsd-parameters .tsd-comment, ul.tsd-type-parameters .tsd-comment { margin-top: -0.5em; } - -.tsd-sources { font-size: 14px; color: #808080; margin: 0 0 1em 0; } -.tsd-sources a { color: #808080; text-decoration: underline; } -.tsd-sources ul, .tsd-sources p { margin: 0 !important; } -.tsd-sources ul { list-style: none; padding: 0; } - -.tsd-page-toolbar { position: absolute; z-index: 1; top: 0; left: 0; width: 100%; height: 40px; color: #333; background: #fff; border-bottom: 1px solid #eee; } -.tsd-page-toolbar a { color: #333; text-decoration: none; } -.tsd-page-toolbar a.title { font-weight: bold; } -.tsd-page-toolbar a.title:hover { text-decoration: underline; } -.tsd-page-toolbar .table-wrap { display: table; width: 100%; height: 40px; } -.tsd-page-toolbar .table-cell { display: table-cell; position: relative; white-space: nowrap; line-height: 40px; } -.tsd-page-toolbar .table-cell:first-child { width: 100%; } - -.tsd-widget:before, .tsd-select .tsd-select-label:before, .tsd-select .tsd-select-list li:before { content: ""; display: inline-block; width: 40px; height: 40px; margin: 0 -8px 0 0; background-image: url(../images/widgets.png); background-repeat: no-repeat; text-indent: -1024px; vertical-align: bottom; } -@media (-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) { .tsd-widget:before, .tsd-select .tsd-select-label:before, .tsd-select .tsd-select-list li:before { background-image: url(../images/widgets@2x.png); background-size: 320px 40px; } } - -.tsd-widget { display: inline-block; overflow: hidden; opacity: 0.6; height: 40px; transition: opacity 0.1s, background-color 0.2s; vertical-align: bottom; cursor: pointer; } -.tsd-widget:hover { opacity: 0.8; } -.tsd-widget.active { opacity: 1; background-color: #eee; } -.tsd-widget.no-caption { width: 40px; } -.tsd-widget.no-caption:before { margin: 0; } -.tsd-widget.search:before { background-position: 0 0; } -.tsd-widget.menu:before { background-position: -40px 0; } -.tsd-widget.options:before { background-position: -80px 0; } -.tsd-widget.options, .tsd-widget.menu { display: none; } -@media (max-width: 900px) { .tsd-widget.options, .tsd-widget.menu { display: inline-block; } } -input[type=checkbox] + .tsd-widget:before { background-position: -120px 0; } -input[type=checkbox]:checked + .tsd-widget:before { background-position: -160px 0; } - -.tsd-select { position: relative; display: inline-block; height: 40px; transition: opacity 0.1s, background-color 0.2s; vertical-align: bottom; cursor: pointer; } -.tsd-select .tsd-select-label { opacity: 0.6; transition: opacity 0.2s; } -.tsd-select .tsd-select-label:before { background-position: -240px 0; } -.tsd-select.active .tsd-select-label { opacity: 0.8; } -.tsd-select.active .tsd-select-list { visibility: visible; opacity: 1; transition-delay: 0s; } -.tsd-select .tsd-select-list { position: absolute; visibility: hidden; top: 40px; left: 0; margin: 0; padding: 0; opacity: 0; list-style: none; box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); transition: visibility 0s 0.2s, opacity 0.2s; } -.tsd-select .tsd-select-list li { padding: 0 20px 0 0; background-color: #fdfdfd; } -.tsd-select .tsd-select-list li:before { background-position: 40px 0; } -.tsd-select .tsd-select-list li:nth-child(even) { background-color: #fff; } -.tsd-select .tsd-select-list li:hover { background-color: #eee; } -.tsd-select .tsd-select-list li.selected:before { background-position: -200px 0; } -@media (max-width: 900px) { .tsd-select .tsd-select-list { top: 0; left: auto; right: 100%; margin-right: -5px; } - .tsd-select .tsd-select-label:before { background-position: -280px 0; } } - -img { max-width: 100%; } diff --git a/docs/assets/css/main.css.map b/docs/assets/css/main.css.map deleted file mode 100644 index bc17fe48..00000000 --- a/docs/assets/css/main.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ -"version": 3, -"mappings": ";;;AASA,gGAAgG,GAC5F,OAAO,EAAE,KAAK;;;AAKlB,oBAAoB,GAChB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,CAAC;;;AAMZ,qBAAqB,GACjB,OAAO,EAAE,IAAI,EACb,MAAM,EAAE,CAAC;;;AAMb,QAAQ,GACJ,OAAO,EAAE,IAAI;;;;AAYjB,IAAI,GACA,SAAS,EAAE,IAAI,UAEf,oBAAoB,EAAE,IAAI,UAE1B,wBAAwB,EAAE,IAAI,UAE9B,WAAW,EAAE,UAAU;;;AAM3B,+BAA+B,GAC3B,WAAW,EAAE,UAAU;;;AAK3B,IAAI,GACA,MAAM,EAAE,CAAC;;;;AAUT,OAAO,GACH,OAAO,EAAE,WAAW;AACxB,iBAAiB,GACb,OAAO,EAAE,CAAC;;;;;AAclB,EAAE,GACE,SAAS,EAAE,GAAG,EACd,MAAM,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AE,CAAC,EACP,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,CAAC,EACV,UAAU,EAAE,IAAI,EAChB,UAAU,EAAE,2BAAwB,EACpC,UAAU,EAAE,gCAAgC;AAE5C,+BAAE,GAEE,OAAO,EAAE,UAAU,EACnB,gBAAgB,EdvIT,OAAO;AcyId,sCAAQ,GACJ,mBAAmB,EAAE,MAAM;AAE/B,+CAAiB,GACb,gBAAgB,EdpIlB,IAAI;AcsIN,qCAAO,GACH,gBAAgB,EdtIV,IAAI;AcwId,+CAAiB,GACb,mBAAmB,EAAE,QAAQ;AlB3IzC,yBAAyB,GkB8IrB,4BAAgB,GACZ,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAI,EACX,YAAY,EAAE,IAAI;EAEtB,oCAAwB,GACpB,mBAAmB,EAAE,QAAQ;;ACzKzC,GAAG,GACC,SAAS,EAAE,IAAI", -"sources": ["../../../../src/default/assets/css/vendors/_normalize.sass","../../../../src/default/assets/css/vendors/_highlight.js.sass","../../../../src/default/assets/css/setup/_mixins.sass","../../../../src/default/assets/css/setup/_grid.sass","../../../../src/default/assets/css/setup/_icons.scss","../../../../src/default/assets/css/setup/_animations.sass","../../../../src/default/assets/css/setup/_typography.sass","../../../../src/default/assets/css/_constants.sass","../../../../src/default/assets/css/layouts/_default.sass","../../../../src/default/assets/css/layouts/_minimal.sass","../../../../src/default/assets/css/elements/_comment.sass","../../../../src/default/assets/css/elements/_filter.sass","../../../../src/default/assets/css/elements/_footer.sass","../../../../src/default/assets/css/elements/_hierarchy.sass","../../../../src/default/assets/css/elements/_index.sass","../../../../src/default/assets/css/elements/_member.sass","../../../../src/default/assets/css/elements/_navigation.sass","../../../../src/default/assets/css/elements/_panel.sass","../../../../src/default/assets/css/elements/_search.sass","../../../../src/default/assets/css/elements/_signatures.sass","../../../../src/default/assets/css/elements/_sources.sass","../../../../src/default/assets/css/elements/_toolbar.sass","../../../../src/default/assets/css/elements/_images.sass"], -"names": [], -"file": "main.css" -} diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css new file mode 100644 index 00000000..e03f751e --- /dev/null +++ b/docs/assets/highlight.css @@ -0,0 +1,85 @@ +:root { + --light-hl-0: #A31515; + --dark-hl-0: #CE9178; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-hl-2: #001080; + --dark-hl-2: #9CDCFE; + --light-hl-3: #AF00DB; + --dark-hl-3: #C586C0; + --light-hl-4: #0000FF; + --dark-hl-4: #569CD6; + --light-hl-5: #008000; + --dark-hl-5: #6A9955; + --light-hl-6: #098658; + --dark-hl-6: #B5CEA8; + --light-hl-7: #795E26; + --dark-hl-7: #DCDCAA; + --light-hl-8: #267F99; + --dark-hl-8: #4EC9B0; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } +pre, code { background: var(--code-background); } diff --git a/docs/assets/icons.js b/docs/assets/icons.js new file mode 100644 index 00000000..b79c9e89 --- /dev/null +++ b/docs/assets/icons.js @@ -0,0 +1,15 @@ +(function(svg) { + svg.innerHTML = ``; + svg.style.display = 'none'; + if (location.protocol === 'file:') { + if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', updateUseElements); + else updateUseElements() + function updateUseElements() { + document.querySelectorAll('use').forEach(el => { + if (el.getAttribute('href').includes('#icon-')) { + el.setAttribute('href', el.getAttribute('href').replace(/.*#/, '#')); + } + }); + } + } +})(document.body.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'svg'))) \ No newline at end of file diff --git a/docs/assets/icons.svg b/docs/assets/icons.svg new file mode 100644 index 00000000..7dead611 --- /dev/null +++ b/docs/assets/icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/images/icons.png b/docs/assets/images/icons.png deleted file mode 100644 index cb2d1157..00000000 Binary files a/docs/assets/images/icons.png and /dev/null differ diff --git a/docs/assets/images/icons@2x.png b/docs/assets/images/icons@2x.png deleted file mode 100644 index 8932ba20..00000000 Binary files a/docs/assets/images/icons@2x.png and /dev/null differ diff --git a/docs/assets/images/widgets.png b/docs/assets/images/widgets.png deleted file mode 100644 index c7380532..00000000 Binary files a/docs/assets/images/widgets.png and /dev/null differ diff --git a/docs/assets/images/widgets@2x.png b/docs/assets/images/widgets@2x.png deleted file mode 100644 index 4bbbd572..00000000 Binary files a/docs/assets/images/widgets@2x.png and /dev/null differ diff --git a/docs/assets/js/main.js b/docs/assets/js/main.js deleted file mode 100644 index 528a3b02..00000000 --- a/docs/assets/js/main.js +++ /dev/null @@ -1,5 +0,0 @@ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function s(a){var b=a.length,c=n.type(a);return"function"!==c&&!n.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a))}function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}function D(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),"string"==typeof(c=a.getAttribute(d))){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c)}catch(e){}M.set(a,b,c)}else c=void 0;return c}function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("