From 4a51dc165c9c0d8f7865c698b2e0c5d69114fa59 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 7 May 2024 13:31:32 -0400 Subject: [PATCH 01/16] Added a uni test for the case of a lookAt property of a camera whose value is PointSelector --- test/index.js | 3 +- .../positioned_camera_lookat_point.js | 95 +++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 test/tests_3d/2_cameras/positioned_camera_lookat_point.js diff --git a/test/index.js b/test/index.js index f7db22f0..d8571996 100644 --- a/test/index.js +++ b/test/index.js @@ -142,7 +142,8 @@ function run_iiif3d_tests(){ describe("2_cameras" , function(){ - importTest('position_camera_lookat_anno', './tests_3d/2_cameras/positioned_camera_lookat_anno.js'); + importTest('position_camera_lookat_anno', './tests_3d/2_cameras/positioned_camera_lookat_anno.js'); + importTest('position_camera_lookat_point', './tests_3d/2_cameras/positioned_camera_lookat_point.js'); }); } diff --git a/test/tests_3d/2_cameras/positioned_camera_lookat_point.js b/test/tests_3d/2_cameras/positioned_camera_lookat_point.js new file mode 100644 index 00000000..95bf5a96 --- /dev/null +++ b/test/tests_3d/2_cameras/positioned_camera_lookat_point.js @@ -0,0 +1,95 @@ +var expect = require('chai').expect; +var should = require('chai').should(); +var manifesto = require('../../../dist-commonjs/'); + +var threejs_math = require('threejs-math'); + +let manifest, annotations, scene; + +let manifest_url = { + local: "", + remote : "https://raw.githubusercontent.com/IIIF/3d/main/manifests/2_cameras/positioned_camera_lookat_point.json" + }.remote; + +describe('positioned_camera_lookat_point', function() { + + it('loads successfully', function(done) { + manifesto.loadManifest(manifest_url).then(function(data) { + manifest = manifesto.parseManifest(data); + done(); + }); + }); + + it('has a sequence', function() { + sequence = manifest.getSequenceByIndex(0); + expect(sequence).to.exist; + }); + + + it('has a scene with two annotation', function(){ + sequence = manifest.getSequenceByIndex(0); + expect(sequence).to.exist; + scene = sequence.getScenes()[0]; + expect(scene).to.exist; + expect(scene.isScene()).to.be.ok; + annotations = scene.getContent(); + expect(annotations.length).to.equal(2); + + + }); + + it('has 1th annotation a Camera', function(){ + var camera_anno = annotations[1]; + let body = camera_anno.getBody()[0]; + let camera = (body.isSpecifResource)?body.getTarget(): + (body.isAnnotationBody)?body: + null; + + expect(camera.isCamera).to.equal(true); + expect(camera.isPerspectiveCamera).to.equal(true); + expect(camera.isModel).to.equal(false,"checking isModel=false"); + expect(camera.FieldOfView).to.equal(45.0); + + let lookedAt = camera.LookAt; + expect( lookedAt , "find the lookAt annotation.id?").to.exist; + + let lookedAtAnnotation = scene.getAnnotationById( lookedAt.id ); + expect( lookedAtAnnotation, "find the lookAt annotation in scene?").to.exist; + + /* + let lookedAtLocation = lookedAtAnnotation.LookAtLocation; + expect( lookedAtLocation ).to.exist; + + let testLocation = [lookedAtLocation.x,lookedAtLocation.y,lookedAtLocation.z]; + expect(testLocation).to.deep.equal( [0.0,0.0,0.0]); + + + let lookedFromLocation = camera_anno.LookAtLocation ; + let direction = lookedAtLocation.clone().sub( lookedFromLocation ); + let exact_unit_direction = direction.clone().divideScalar( direction.length() ); + + expect( [direction.x, direction.y,direction.z]).to.deep.equal([0.0,-3.0,10.0]); + + let euler = manifesto.cameraRelativeRotation( direction ); + + // next want to evaluate the result: + // 1. create a quaternion representation from the euler + // 2. show that athis rotation does 3 things to the unit vectors + // attached to the camera + // 2.1 the camera z axis transforms to be parallel to exact_unit_direction + // 2.2 the rotated camera x axis is perpendicular to global z axis + // 2.3 rotated camera y axis z component is positive + let quat = new threejs_math.Quaternion().setFromEuler( euler ); + + let camera_direction = new threejs_math.Vector3( 0.0, 0.0, -1.0 ).applyQuaternion( quat ); + let direction_error = camera_direction.clone().sub(exact_unit_direction).length(); + expect( direction_error ).to.be.below( 1.0e-8 ); + + let camera_x_axis = new threejs_math.Vector3( 1.0, 0.0, 0.0 ).applyQuaternion( quat ); + expect( Math.abs( camera_x_axis.z )).to.be.below(1.0e-8); + + let camera_y_axis = new threejs_math.Vector3( 0.0, 1.0, 0.0 ).applyQuaternion( quat ); + expect( camera_y_axis.z ).to.be.above(0.0); + */ + }); +}); From e2626ae75cacf11c14b8aaf658287a6d4badef97 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 7 May 2024 14:25:17 -0400 Subject: [PATCH 02/16] Implemented allowing the value of lookAt to be a PointSelector --- src/Camera.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Camera.ts b/src/Camera.ts index 4c962d15..6e5ea886 100644 --- a/src/Camera.ts +++ b/src/Camera.ts @@ -1,7 +1,8 @@ import { IManifestoOptions, Utils, - AnnotationBody } from "./internal"; + AnnotationBody, + PointSelector } from "./internal"; export class Camera extends AnnotationBody { constructor(jsonld?: any, options?: IManifestoOptions) { @@ -37,7 +38,15 @@ export class Camera extends AnnotationBody { get FieldOfView(): number | undefined { return this.getFieldOfView();} getLookAt() : object | null { - return this.getPropertyAsObject("lookAt" ) + let rawObj = this.getPropertyAsObject("lookAt" ) + let 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}'); } get LookAt() : object | null {return this.getLookAt();} From 4b0b5eb74eb1becfb963d8adbdd83cdd68bd0735 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 7 May 2024 14:26:50 -0400 Subject: [PATCH 03/16] Corrected an error the testing of the opertion of the rotation returned from manifesto --- test/tests_3d/2_cameras/positioned_camera_lookat_anno.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests_3d/2_cameras/positioned_camera_lookat_anno.js b/test/tests_3d/2_cameras/positioned_camera_lookat_anno.js index 98fa81f6..c8b392e6 100644 --- a/test/tests_3d/2_cameras/positioned_camera_lookat_anno.js +++ b/test/tests_3d/2_cameras/positioned_camera_lookat_anno.js @@ -86,7 +86,7 @@ describe('positioned_camera_lookat_anno', function() { expect( direction_error ).to.be.below( 1.0e-8 ); let camera_x_axis = new threejs_math.Vector3( 1.0, 0.0, 0.0 ).applyQuaternion( quat ); - expect( Math.abs( camera_x_axis.z )).to.be.below(1.0e-8); + expect( Math.abs( camera_x_axis.y )).to.be.below(1.0e-8); let camera_y_axis = new threejs_math.Vector3( 0.0, 1.0, 0.0 ).applyQuaternion( quat ); expect( camera_y_axis.z ).to.be.above(0.0); From 62dec8c1efeaa82843dc4884d599cc82940be251 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 7 May 2024 14:27:40 -0400 Subject: [PATCH 04/16] Implemented testing of a camera whose lookAt is a point selector --- .../positioned_camera_lookat_point.js | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/test/tests_3d/2_cameras/positioned_camera_lookat_point.js b/test/tests_3d/2_cameras/positioned_camera_lookat_point.js index 95bf5a96..604b33dd 100644 --- a/test/tests_3d/2_cameras/positioned_camera_lookat_point.js +++ b/test/tests_3d/2_cameras/positioned_camera_lookat_point.js @@ -53,23 +53,26 @@ describe('positioned_camera_lookat_point', function() { let lookedAt = camera.LookAt; expect( lookedAt , "find the lookAt annotation.id?").to.exist; - let lookedAtAnnotation = scene.getAnnotationById( lookedAt.id ); - expect( lookedAtAnnotation, "find the lookAt annotation in scene?").to.exist; - - /* - let lookedAtLocation = lookedAtAnnotation.LookAtLocation; + let lookedAtLocation = null; + if ( lookedAt.isPointSelector ){ + lookedAtLocation = lookedAt.getLocation(); + } + else{ + let lookedAtAnnotation = scene.getAnnotationById( lookedAt.id ); + expect( lookedAtAnnotation, "find the lookAt annotation in scene?").to.exist; + lookedAtLocation = lookedAtAnnotation.LookAtLocation; + } expect( lookedAtLocation ).to.exist; - let testLocation = [lookedAtLocation.x,lookedAtLocation.y,lookedAtLocation.z]; - expect(testLocation).to.deep.equal( [0.0,0.0,0.0]); - - let lookedFromLocation = camera_anno.LookAtLocation ; let direction = lookedAtLocation.clone().sub( lookedFromLocation ); let exact_unit_direction = direction.clone().divideScalar( direction.length() ); - expect( [direction.x, direction.y,direction.z]).to.deep.equal([0.0,-3.0,10.0]); + expect( [direction.x, direction.y,direction.z]).to.deep.equal([2.0,-2.0,10.0]); + + let exact_coords = [exact_unit_direction.x, exact_unit_direction.y,exact_unit_direction.z].join(", "); + //console.log(`exact direction ( ${exact_coords} )`) let euler = manifesto.cameraRelativeRotation( direction ); // next want to evaluate the result: @@ -82,14 +85,21 @@ describe('positioned_camera_lookat_point', function() { let quat = new threejs_math.Quaternion().setFromEuler( euler ); let camera_direction = new threejs_math.Vector3( 0.0, 0.0, -1.0 ).applyQuaternion( quat ); - let direction_error = camera_direction.clone().sub(exact_unit_direction).length(); - expect( direction_error ).to.be.below( 1.0e-8 ); + + let camera_direction_coords = [camera_direction.x, camera_direction.y, camera_direction.z ]; + //console.log(`camera direction ( ${camera_direction_coords} )`) + + let direction_error = camera_direction.clone().sub(exact_unit_direction); + let direction_error_coords = [ direction_error.x, direction_error.y, direction_error.z ]; + //console.log(`direction error ( ${direction_error_coords} )`) + + expect( direction_error.length() ).to.be.below( 1.0e-8 ); let camera_x_axis = new threejs_math.Vector3( 1.0, 0.0, 0.0 ).applyQuaternion( quat ); - expect( Math.abs( camera_x_axis.z )).to.be.below(1.0e-8); + expect( Math.abs( camera_x_axis.y )).to.be.below(1.0e-8); let camera_y_axis = new threejs_math.Vector3( 0.0, 1.0, 0.0 ).applyQuaternion( quat ); expect( camera_y_axis.z ).to.be.above(0.0); - */ + }); }); From ba41cba555b04d0bd54cebade4b3c4f7963bc7f6 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 7 May 2024 15:34:21 -0400 Subject: [PATCH 05/16] Added documentation on the getLookAt function --- src/Camera.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Camera.ts b/src/Camera.ts index 6e5ea886..6b4e901d 100644 --- a/src/Camera.ts +++ b/src/Camera.ts @@ -37,7 +37,11 @@ export class Camera extends AnnotationBody { **/ get FieldOfView(): number | undefined { return this.getFieldOfView();} - getLookAt() : object | null { + /** + * @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 { let rawObj = this.getPropertyAsObject("lookAt" ) let rawType = (rawObj["type"] || rawObj["@type"]) if (rawType == "Annotation"){ From 43a953639ebfe3259ba28efdbf77afc35634633d Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 7 May 2024 15:36:27 -0400 Subject: [PATCH 06/16] rebuilt modules and documentation --- dist-commonjs/Annotation.d.ts | 2 +- dist-commonjs/Camera.d.ts | 8 ++++++-- dist-commonjs/Camera.js | 14 +++++++++++++- dist-commonjs/Camera.js.map | 2 +- dist-esmodule/Camera.d.ts | 8 ++++++-- dist-esmodule/Camera.js | 16 ++++++++++++++-- dist-esmodule/Camera.js.map | 2 +- dist-umd/manifesto.js | 2 +- dist-var/manifesto.js | 2 +- docs/classes/Annotation.html | 16 ++++++++-------- docs/classes/AnnotationBody.html | 6 +++--- docs/classes/AnnotationBodyParser.html | 4 ++-- docs/classes/AnnotationList.html | 6 +++--- docs/classes/AnnotationPage.html | 6 +++--- docs/classes/Camera.html | 12 +++++++----- docs/classes/Canvas.html | 10 +++++----- docs/classes/Collection.html | 10 +++++----- docs/classes/Color.html | 16 ++++++++-------- docs/classes/Deserialiser.html | 4 ++-- docs/classes/Duration.html | 4 ++-- docs/classes/IIIFResource.html | 6 +++--- docs/classes/JSONLDResource.html | 6 +++--- docs/classes/LabelValuePair.html | 4 ++-- docs/classes/LanguageMap.html | 6 +++--- docs/classes/Light.html | 8 ++++---- docs/classes/LocalizedValue.html | 10 +++++----- docs/classes/Manifest.html | 12 ++++++------ docs/classes/ManifestResource.html | 6 +++--- docs/classes/PointSelector.html | 6 +++--- docs/classes/PropertyValue.html | 16 ++++++++-------- docs/classes/Range.html | 6 +++--- docs/classes/Rendering.html | 6 +++--- docs/classes/Resource.html | 6 +++--- docs/classes/RotateTransform.html | 6 +++--- docs/classes/ScaleTransform.html | 6 +++--- docs/classes/Scene.html | 6 +++--- docs/classes/Sequence.html | 8 ++++---- docs/classes/Service.html | 6 +++--- docs/classes/Size.html | 4 ++-- docs/classes/SpecificResource.html | 6 +++--- docs/classes/Thumb.html | 4 ++-- docs/classes/Thumbnail.html | 6 +++--- docs/classes/Transform.html | 6 +++--- docs/classes/TransformParser.html | 4 ++-- docs/classes/TranslateTransform.html | 6 +++--- docs/classes/TreeNode.html | 4 ++-- docs/classes/Utils.html | 6 +++--- docs/enums/ManifestType.html | 4 ++-- docs/enums/StatusCode.html | 4 ++-- docs/enums/TreeNodeType.html | 4 ++-- docs/functions/cameraRelativeRotation.html | 2 +- docs/functions/lightRelativeRotation.html | 2 +- docs/functions/loadManifest.html | 2 +- docs/functions/parseManifest.html | 2 +- docs/interfaces/IAccessToken.html | 4 ++-- docs/interfaces/IExternalImageResourceData.html | 4 ++-- docs/interfaces/IExternalResource.html | 4 ++-- docs/interfaces/IExternalResourceData.html | 4 ++-- docs/interfaces/IExternalResourceOptions.html | 4 ++-- docs/interfaces/IManifestoOptions.html | 4 ++-- types/index.d.ts | 6 +++++- 61 files changed, 207 insertions(+), 169 deletions(-) diff --git a/dist-commonjs/Annotation.d.ts b/dist-commonjs/Annotation.d.ts index 6afc5e98..4fdaf072 100644 --- a/dist-commonjs/Annotation.d.ts +++ b/dist-commonjs/Annotation.d.ts @@ -10,7 +10,7 @@ export declare class Annotation extends ManifestResource { @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ } **/ getBody(): (AnnotationBody | SpecificResource)[]; - get Body(): (SpecificResource | AnnotationBody)[]; + get Body(): (AnnotationBody | SpecificResource)[]; /** 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/ diff --git a/dist-commonjs/Camera.d.ts b/dist-commonjs/Camera.d.ts index 00b6a4ac..0486fc31 100644 --- a/dist-commonjs/Camera.d.ts +++ b/dist-commonjs/Camera.d.ts @@ -1,4 +1,4 @@ -import { IManifestoOptions, AnnotationBody } from "./internal"; +import { IManifestoOptions, AnnotationBody, PointSelector } from "./internal"; export declare class Camera extends AnnotationBody { constructor(jsonld?: any, options?: IManifestoOptions); get isPerspectiveCamera(): boolean; @@ -12,6 +12,10 @@ export declare class Camera extends AnnotationBody { Angular unit is degrees **/ get FieldOfView(): number | undefined; - getLookAt(): object | null; + /** + * @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 index ecf7f86d..03bb4d06 100644 --- a/dist-commonjs/Camera.js +++ b/dist-commonjs/Camera.js @@ -57,8 +57,20 @@ var Camera = /** @class */ (function (_super) { 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 () { - return this.getPropertyAsObject("lookAt"); + 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(); }, diff --git a/dist-commonjs/Camera.js.map b/dist-commonjs/Camera.js.map index 40919dbc..314f6745 100644 --- a/dist-commonjs/Camera.js.map +++ b/dist-commonjs/Camera.js.map @@ -1 +1 @@ -{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../src/Camera.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAGuC;AAEvC;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,0BAAS,GAAT;QACE,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;IAC5C,CAAC;IACD,sBAAI,0BAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAGzD,aAAC;AAAD,CAAC,AAvCD,CAA4B,yBAAc,GAuCzC;AAvCY,wBAAM;AAuClB,CAAC"} \ No newline at end of file +{"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-esmodule/Camera.d.ts b/dist-esmodule/Camera.d.ts index 00b6a4ac..0486fc31 100644 --- a/dist-esmodule/Camera.d.ts +++ b/dist-esmodule/Camera.d.ts @@ -1,4 +1,4 @@ -import { IManifestoOptions, AnnotationBody } from "./internal"; +import { IManifestoOptions, AnnotationBody, PointSelector } from "./internal"; export declare class Camera extends AnnotationBody { constructor(jsonld?: any, options?: IManifestoOptions); get isPerspectiveCamera(): boolean; @@ -12,6 +12,10 @@ export declare class Camera extends AnnotationBody { Angular unit is degrees **/ get FieldOfView(): number | undefined; - getLookAt(): object | null; + /** + * @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 index bad17d8e..4e3bf4f3 100644 --- a/dist-esmodule/Camera.js +++ b/dist-esmodule/Camera.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -import { Utils, AnnotationBody } from "./internal"; +import { Utils, AnnotationBody, PointSelector } from "./internal"; var Camera = /** @class */ (function (_super) { __extends(Camera, _super); function Camera(jsonld, options) { @@ -54,8 +54,20 @@ var Camera = /** @class */ (function (_super) { 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 () { - return this.getPropertyAsObject("lookAt"); + 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(); }, diff --git a/dist-esmodule/Camera.js.map b/dist-esmodule/Camera.js.map index 66d96001..7e0255af 100644 --- a/dist-esmodule/Camera.js.map +++ b/dist-esmodule/Camera.js.map @@ -1 +1 @@ -{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../src/Camera.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEH,KAAK,EACL,cAAc,EAAE,MAAM,YAAY,CAAC;AAEvC;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,0BAAS,GAAT;QACE,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;IAC5C,CAAC;IACD,sBAAI,0BAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAGzD,aAAC;AAAD,CAAC,AAvCD,CAA4B,cAAc,GAuCzC;;AAAA,CAAC"} \ No newline at end of file +{"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-umd/manifesto.js b/dist-umd/manifesto.js index 428d6283..0c03709e 100644 --- a/dist-umd/manifesto.js +++ b/dist-umd/manifesto.js @@ -1,2 +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"];\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 Camera.prototype.getLookAt = function () {\n return this.getPropertyAsObject("lookAt");\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 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 /**\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 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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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 +!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"];\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 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 /**\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 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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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-var/manifesto.js b/dist-var/manifesto.js index 68668680..642d524c 100644 --- a/dist-var/manifesto.js +++ b/dist-var/manifesto.js @@ -1,2 +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"];\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 Camera.prototype.getLookAt = function () {\n return this.getPropertyAsObject("lookAt");\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 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 /**\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 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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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 +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"];\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 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 /**\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 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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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/docs/classes/Annotation.html b/docs/classes/Annotation.html index 2a416ef0..134bf185 100644 --- a/docs/classes/Annotation.html +++ b/docs/classes/Annotation.html @@ -1,4 +1,4 @@ -Annotation | manifesto.js

Class Annotation

Hierarchy (view full)

Constructors

constructor +Annotation | manifesto.js

Class Annotation

Hierarchy (view full)

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string

Accessors

  • get LookAtLocation(): Vector3
  • A 3D point coordinate object for the location of an Annotation +

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string

Accessors

  • get LookAtLocation(): Vector3
  • 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)

    -

    Returns Vector3

Methods

Methods

  • 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.

    @@ -56,7 +56,7 @@

    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. *

    -

    Returns SpecificResource | AnnotationBody

  • Returns null | AnnotationMotivation

  • Returns null | AnnotationMotivation

  • 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 @@ -67,11 +67,11 @@

    -

    Parameters

    • name: string

    Returns any

\ No newline at end of file +

Parameters

  • rawbody: any

Returns SpecificResource | AnnotationBody

\ No newline at end of file diff --git a/docs/classes/AnnotationBody.html b/docs/classes/AnnotationBody.html index 4f1d02b2..3dc38052 100644 --- a/docs/classes/AnnotationBody.html +++ b/docs/classes/AnnotationBody.html @@ -5,7 +5,7 @@ a light, camera, or model, or a SpecificResource object wrapping a light, camera, or model. *

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string
isAnnotationBody: boolean = true
isCamera: boolean = false
isLight: boolean = false
isModel: boolean = true
isSpecificResource: boolean = false

Methods

  • A function that wraps the getProperty function, which client +

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string
isAnnotationBody: boolean = true
isCamera: boolean = false
isLight: boolean = false
isModel: boolean = true
isSpecificResource: boolean = false

Methods

  • 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 @@ -50,4 +50,4 @@

    -

    Parameters

    • name: string

    Returns any

\ No newline at end of file +

Parameters

  • name: string

Returns any

\ No newline at end of file diff --git a/docs/classes/AnnotationBodyParser.html b/docs/classes/AnnotationBodyParser.html index 2c84eba4..00228a9a 100644 --- a/docs/classes/AnnotationBodyParser.html +++ b/docs/classes/AnnotationBodyParser.html @@ -1,3 +1,3 @@ -AnnotationBodyParser | manifesto.js

Class AnnotationBodyParser

Constructors

constructor +AnnotationBodyParser | manifesto.js

Class AnnotationBodyParser

Constructors

Methods

Constructors

Methods

\ No newline at end of file +

Constructors

Methods

\ No newline at end of file diff --git a/docs/classes/AnnotationList.html b/docs/classes/AnnotationList.html index 0b9610f2..afcf3bcd 100644 --- a/docs/classes/AnnotationList.html +++ b/docs/classes/AnnotationList.html @@ -1,4 +1,4 @@ -AnnotationList | manifesto.js

Class AnnotationList

Hierarchy (view full)

Constructors

constructor +AnnotationList | manifesto.js

Class AnnotationList

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

__jsonld: any
context: string
id: string
isLoaded: boolean
label: string

Methods

  • A function that wraps the getProperty function, which client +

Constructors

Properties

__jsonld: any
context: string
id: string
isLoaded: boolean
label: string

Methods

  • 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 @@ -22,4 +22,4 @@

    -

    Parameters

    • name: string

    Returns any

\ No newline at end of file +

Parameters

  • name: string

Returns any

\ No newline at end of file diff --git a/docs/classes/AnnotationPage.html b/docs/classes/AnnotationPage.html index 36d02a31..89f90727 100644 --- a/docs/classes/AnnotationPage.html +++ b/docs/classes/AnnotationPage.html @@ -1,4 +1,4 @@ -AnnotationPage | manifesto.js

Class AnnotationPage

Hierarchy (view full)

Constructors

constructor +AnnotationPage | manifesto.js

Class AnnotationPage

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string

Methods

  • A function that wraps the getProperty function, which client +

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string

Methods

  • 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 @@ -35,4 +35,4 @@

    -

    Parameters

    • name: string

    Returns any

\ No newline at end of file +

Parameters

  • name: string

Returns any

\ No newline at end of file diff --git a/docs/classes/Camera.html b/docs/classes/Camera.html index db53a653..fd633f7e 100644 --- a/docs/classes/Camera.html +++ b/docs/classes/Camera.html @@ -5,7 +5,7 @@ a light, camera, or model, or a SpecificResource object wrapping a light, camera, or model. *

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string
isAnnotationBody: boolean = true
isCamera: boolean = false
isLight: boolean = false
isModel: boolean = true
isSpecificResource: boolean = false

Accessors

  • get FieldOfView(): undefined | number
  • Full angular size of perspective viewport in vertical direction. +

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string
isAnnotationBody: boolean = true
isCamera: boolean = false
isLight: boolean = false
isModel: boolean = true
isSpecificResource: boolean = false

Accessors

  • get FieldOfView(): undefined | number
  • Full angular size of perspective viewport in vertical direction. Angular unit is degrees *

    -

    Returns undefined | number

Methods

  • Returns undefined | number

    full angular size of perspective viewport in vertical direction. +

    Returns undefined | number

Methods

  • Returns undefined | number

    full angular size of perspective viewport in vertical direction. Angular unit is degrees *

    -
  • A function that wraps the getProperty function, which client +

  • Returns null | object | PointSelector

    : if not null, is either a PointSelector, or an object +with an id matching the id of an Annotation instance.

    +
  • 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 @@ -61,4 +63,4 @@

    -

    Parameters

    • name: string

    Returns any

\ No newline at end of file +

Parameters

  • name: string

Returns any

\ No newline at end of file diff --git a/docs/classes/Canvas.html b/docs/classes/Canvas.html index 99d8917c..fbe1c4c3 100644 --- a/docs/classes/Canvas.html +++ b/docs/classes/Canvas.html @@ -1,4 +1,4 @@ -Canvas | manifesto.js

Class Canvas

Hierarchy (view full)

Constructors

constructor +Canvas | manifesto.js

Class Canvas

Hierarchy (view full)

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string
index: number
ranges: Range[]

Accessors

Methods

  • Parameters

    • Optional w: number

    Returns string

  • A function that wraps the getProperty function, which client +

Constructors

Properties

__jsonld: any
context: string
externalResource: IExternalResource
id: string
index: number
ranges: Range[]

Accessors

Methods

  • Parameters

    • Optional w: number

    Returns string

  • 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 @@ -58,8 +58,8 @@

    -

    Parameters

    • name: string

    Returns any

  • Returns null | ViewingHint

  • Returns null | ViewingHint

  • Returns the fragment placement values if a resourceAnnotation is placed on a canvas somewhere besides the full extent

    -

    Parameters

    • id: any

    Returns any

  • Returns a given resource Annotation, based on a contained resource or body +

    Parameters

    • id: any

    Returns any

  • Returns a given resource Annotation, based on a contained resource or body id

    -

    Parameters

    • id: any

    Returns any

\ No newline at end of file +

Parameters

  • id: any

Returns any

\ No newline at end of file diff --git a/docs/classes/Collection.html b/docs/classes/Collection.html index 1ad675c6..565fc1a2 100644 --- a/docs/classes/Collection.html +++ b/docs/classes/Collection.html @@ -1,4 +1,4 @@ -Collection | manifesto.js

Class Collection

Hierarchy (view full)

Constructors

constructor +Collection | manifesto.js

Class Collection

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

__jsonld: any
_collections: null | Collection[] = null
_manifests: null | Manifest[] = null
context: string
defaultTree: TreeNode
externalResource: IExternalResource
id: string
index: number = -1
isLoaded: boolean = false
items: IIIFResource[] = []
parentCollection: Collection
parentLabel: string

Methods

  • Note: this only will return the first behavior as per the manifesto convention +

Constructors

Properties

__jsonld: any
_collections: null | Collection[] = null
_manifests: null | Manifest[] = null
context: string
defaultTree: TreeNode
externalResource: IExternalResource
id: string
index: number = -1
isLoaded: boolean = false
items: IIIFResource[] = []
parentCollection: Collection
parentLabel: string

Methods

  • Note: this only will return the first behavior as per the manifesto convention IIIF v3 supports multiple behaviors

    -

    Returns null | Behavior

  • A function that wraps the getProperty function, which client +

    Returns null | Behavior

  • 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 @@ -68,4 +68,4 @@

    -

    Parameters

    • name: string

    Returns any

\ No newline at end of file +

Parameters

  • name: string

Returns any

\ No newline at end of file diff --git a/docs/classes/Color.html b/docs/classes/Color.html index 5313888e..19d168f5 100644 --- a/docs/classes/Color.html +++ b/docs/classes/Color.html @@ -1,7 +1,7 @@ Color | manifesto.js

class structure with red, green, blue values in 0-255 range Uses the color-string library for conversion from and to string representations of color.

-

Constructors

Constructors

Properties

Accessors

CSS blue @@ -9,11 +9,11 @@ red

Methods

Constructors

  • Parameters

    • rgbValue: number[]

      Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red

      -

    Returns Color

Properties

value: number[]

Returns

Array of 3 integers in range 0-255

-

Accessors

  • get CSS(): string
  • Returns string

    hex string (as for CSS ) representation of r,g,b components

    -
  • get blue(): number
  • Returns number

    0 to 255 value of blue color component

    -
  • get green(): number
  • Returns number

    0 to 255 value of green color component

    -
  • get red(): number
  • Returns number

    0 to 255 value of red color component

    -

Methods

  • Parameters

    • cssTerm: string

      hex representtion of color as used in CSS. Ex "#FF0000" as red

      +

    Returns Color

Properties

value: number[]

Returns

Array of 3 integers in range 0-255

+

Accessors

  • get CSS(): string
  • Returns string

    hex string (as for CSS ) representation of r,g,b components

    +
  • get blue(): number
  • Returns number

    0 to 255 value of blue color component

    +
  • get green(): number
  • Returns number

    0 to 255 value of green color component

    +
  • get red(): number
  • Returns number

    0 to 255 value of red color component

    +

Methods

  • Parameters

    • cssTerm: string

      hex representtion of color as used in CSS. Ex "#FF0000" as red

    Returns Color

    Color instance.

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/classes/Deserialiser.html b/docs/classes/Deserialiser.html index 010e4124..627bdc56 100644 --- a/docs/classes/Deserialiser.html +++ b/docs/classes/Deserialiser.html @@ -1,4 +1,4 @@ -Deserialiser | manifesto.js

Class Deserialiser

Constructors

constructor +Deserialiser | manifesto.js

Class Deserialiser

Constructors

Methods

\ No newline at end of file +

Constructors

Methods

\ No newline at end of file diff --git a/docs/classes/Duration.html b/docs/classes/Duration.html index b27ab7f3..44fb0dfa 100644 --- a/docs/classes/Duration.html +++ b/docs/classes/Duration.html @@ -1,5 +1,5 @@ -Duration | manifesto.js

Class Duration

Constructors

constructor +Duration | manifesto.js

Class Duration

Constructors

Properties

Methods

Constructors

Properties

end: number
start: number

Methods

\ No newline at end of file +

Constructors

Properties

end: number
start: number

Methods

\ No newline at end of file diff --git a/docs/classes/IIIFResource.html b/docs/classes/IIIFResource.html index a73d3ee6..ae1b7a15 100644 --- a/docs/classes/IIIFResource.html +++ b/docs/classes/IIIFResource.html @@ -1,4 +1,4 @@ -IIIFResource | manifesto.js

Class IIIFResource

Hierarchy (view full)

Constructors

constructor +IIIFResource | manifesto.js

Class IIIFResource

Hierarchy (view full)

Constructors

Properties

Constructors

Properties

__jsonld: any
context: string
defaultTree: TreeNode
externalResource: IExternalResource
id: string
index: number = -1
isLoaded: boolean = false
parentCollection: Collection
parentLabel: string

Methods

  • A function that wraps the getProperty function, which client +

Constructors

Properties

__jsonld: any
context: string
defaultTree: TreeNode
externalResource: IExternalResource
id: string
index: number = -1
isLoaded: boolean = false
parentCollection: Collection
parentLabel: string

Methods

  • 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 @@ -50,4 +50,4 @@

    -

    Parameters

    • name: string

    Returns any

\ No newline at end of file +

Parameters

  • name: string

Returns any

\ No newline at end of file diff --git a/docs/classes/JSONLDResource.html b/docs/classes/JSONLDResource.html index b65c1887..7e25b0ab 100644 --- a/docs/classes/JSONLDResource.html +++ b/docs/classes/JSONLDResource.html @@ -1,10 +1,10 @@ -JSONLDResource | manifesto.js

Class JSONLDResource

Hierarchy (view full)

Constructors

constructor +JSONLDResource | manifesto.js

Class JSONLDResource

Hierarchy (view full)

Constructors

Properties

__jsonld: any
context: string
id: string

Methods

  • A function that wraps the getProperty function, which client +

Constructors

Properties

__jsonld: any
context: string
id: string

Methods

  • 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 @@ -15,4 +15,4 @@

    -

    Parameters

    • name: string

    Returns any

\ No newline at end of file +

Parameters

  • name: string

Returns any

\ No newline at end of file diff --git a/docs/classes/LabelValuePair.html b/docs/classes/LabelValuePair.html index 4bfc0f2e..6fa740d9 100644 --- a/docs/classes/LabelValuePair.html +++ b/docs/classes/LabelValuePair.html @@ -1,4 +1,4 @@ -LabelValuePair | manifesto.js

Class LabelValuePair

Constructors

constructor +LabelValuePair | manifesto.js

Class LabelValuePair

Constructors

Properties

Constructors

Properties

defaultLocale: string
label: null | PropertyValue
resource: any
value: null | PropertyValue

Methods

  • Parameters

    • Optional locale: string | string[]

    Returns null | string

  • Parameters

    • Optional locale: string | string[]
    • joinWith: string = "<br/>"

    Returns null | string

  • Parameters

    • Optional locale: string | string[]

    Returns (null | string)[]

\ No newline at end of file +

Constructors

Properties

defaultLocale: string
label: null | PropertyValue
resource: any
value: null | PropertyValue

Methods

  • Parameters

    • Optional locale: string | string[]

    Returns null | string

  • Parameters

    • Optional locale: string | string[]
    • joinWith: string = "<br/>"

    Returns null | string

  • Parameters

    • Optional locale: string | string[]

    Returns (null | string)[]

\ No newline at end of file diff --git a/docs/classes/LanguageMap.html b/docs/classes/LanguageMap.html index fc7d2fb6..fb9fae4e 100644 --- a/docs/classes/LanguageMap.html +++ b/docs/classes/LanguageMap.html @@ -1,5 +1,5 @@ LanguageMap | manifesto.js

Class LanguageMap

Deprecated

Use PropertyValue instead

-

Hierarchy

  • Array<Language>
    • LanguageMap

Constructors

Hierarchy

  • Array<Language>
    • LanguageMap

Constructors

Properties

[unscopables] length [species] @@ -196,7 +196,7 @@
  • mapfn: ((v, k) => U)

    A mapping function to call on every element of the array.

      • (v, k): U
      • Parameters

        • v: T
        • k: number

        Returns U

  • Optional thisArg: any

    Value of 'this' used to invoke the mapfn.

  • Returns U[]

    • Parameters

      Returns null | string

      Deprecated

      Use the PropertyValue#getValue instance method instead

      -
    • Parameters

      Returns (null | string)[]

      Deprecated

      Use the PropertyValue#getValues instance method instead

      -
    • Parameters

      • arg: any

      Returns arg is any[]

    • Parameters

      Returns (null | string)[]

      Deprecated

      Use the PropertyValue#getValues instance method instead

      +
    • Parameters

      • arg: any

      Returns arg is any[]

    • Returns a new array from a set of elements.

      Type Parameters

      • T

      Parameters

      • Rest ...items: T[]

        A set of elements to include in the new array object.

      Returns T[]

    \ No newline at end of file diff --git a/docs/classes/Light.html b/docs/classes/Light.html index 3774afec..e8be1212 100644 --- a/docs/classes/Light.html +++ b/docs/classes/Light.html @@ -5,7 +5,7 @@ a light, camera, or model, or a SpecificResource object wrapping a light, camera, or model. *

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    Methods

    • The implementation of the intensity is based on +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    Methods

    • The implementation of the intensity is based on temp-draft-4.md and the example 3D manifests lights @@ -53,7 +53,7 @@ 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

      -

      Returns number

    • A function that wraps the getProperty function, which client +

      Returns number

    • 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 @@ -64,4 +64,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/LocalizedValue.html b/docs/classes/LocalizedValue.html index 698ce321..e91c2b5b 100644 --- a/docs/classes/LocalizedValue.html +++ b/docs/classes/LocalizedValue.html @@ -1,5 +1,5 @@ LocalizedValue | manifesto.js

    Class LocalizedValue

    Utility class to hold one or more values with their associated (optional) locale

    -

    Implements

    • default

    Constructors

    Implements

    • default

    Constructors

    Properties

    _defaultLocale _locale? _value @@ -7,15 +7,15 @@ value

    Methods

    Constructors

    Properties

    _defaultLocale: string
    _locale?: string
    _value: string | string[]

    Accessors

    • get locale(): string
      • +

    Constructors

    Properties

    _defaultLocale: string
    _locale?: string
    _value: string | string[]

    Accessors

    • get locale(): string

      Returns string

      Deprecated

      Don't use, only used for backwards compatibility reasons

      -
    • get value(): string

      Returns string

      Deprecated

      Use PropertyValue#getValue instead

      -

    Methods

    Methods

    • Parse a localized value from a IIIF v2 property value

      Parameters

      • rawVal: any

        value from IIIF resource

      • Optional defaultLocale: string

        deprecated: defaultLocale the default locale to use for this value

        -

      Returns null | LocalizedValue

    \ No newline at end of file +

    Returns null | LocalizedValue

    \ No newline at end of file diff --git a/docs/classes/Manifest.html b/docs/classes/Manifest.html index 53865b77..4fb5ae8a 100644 --- a/docs/classes/Manifest.html +++ b/docs/classes/Manifest.html @@ -3,7 +3,7 @@

    See

    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);
    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld _allRanges _annotationIdMap @@ -67,7 +67,7 @@

    Example

    varisScene
     isSequence
     load
    -

    Constructors

    Properties

    __jsonld: any
    _allRanges: null | Range[] = null
    _annotationIdMap: any
    _topRanges: Range[] = []
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = 0
    isLoaded: boolean = false
    items: Sequence[] = []
    parentCollection: Collection
    parentLabel: string

    Accessors

    • get annotationIdMap(): Object
    • Developer Note: The concept of the "id map" appear in the +

    Constructors

    Properties

    __jsonld: any
    _allRanges: null | Range[] = null
    _annotationIdMap: any
    _topRanges: Range[] = []
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = 0
    isLoaded: boolean = false
    items: Sequence[] = []
    parentCollection: Collection
    parentLabel: string

    Accessors

    • get annotationIdMap(): Object
    • 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

      @@ -75,8 +75,8 @@

      Example

      var
       

      THe annotationIdMap is a Javascript object whose property names are IRI (id values) and property values are instances of the Annotation class

      -

      Returns Object

    Methods

    • Parameters

      • r: any
      • path: string
      • Optional parentRange: Range

      Returns void

    • A function that wraps the getProperty function, which client +

      Returns Object

    Methods

    • Parameters

      • r: any
      • path: string
      • Optional parentRange: Range

      Returns void

    • 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 @@ -87,5 +87,5 @@

      Example

      var
       
    -

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    \ No newline at end of file diff --git a/docs/classes/ManifestResource.html b/docs/classes/ManifestResource.html index 0fd5af9a..aed3dd0f 100644 --- a/docs/classes/ManifestResource.html +++ b/docs/classes/ManifestResource.html @@ -1,4 +1,4 @@ -ManifestResource | manifesto.js

    Class ManifestResource

    Hierarchy (view full)

    Constructors

    constructor +ManifestResource | manifesto.js

    Class ManifestResource

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • 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 @@ -34,4 +34,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/PointSelector.html b/docs/classes/PointSelector.html index 69abd132..1090eeb3 100644 --- a/docs/classes/PointSelector.html +++ b/docs/classes/PointSelector.html @@ -1,4 +1,4 @@ -PointSelector | manifesto.js

    Class PointSelector

    Hierarchy (view full)

    Constructors

    constructor +PointSelector | manifesto.js

    Class PointSelector

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -6,7 +6,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isPointSelector: boolean = true

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isPointSelector: boolean = true

    Methods

    • 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 @@ -17,4 +17,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/PropertyValue.html b/docs/classes/PropertyValue.html index b05183bf..3b1ec069 100644 --- a/docs/classes/PropertyValue.html +++ b/docs/classes/PropertyValue.html @@ -1,7 +1,7 @@ PropertyValue | manifesto.js

    Class PropertyValue

    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

    -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    [unscopables]: {
        [unscopables]?: boolean;
        length?: boolean;
        [iterator]?: any;
        at?: any;
        concat?: any;
        copyWithin?: any;
        entries?: any;
        every?: any;
        fill?: any;
        filter?: any;
        find?: any;
        findIndex?: any;
        flat?: any;
        flatMap?: any;
        forEach?: any;
        includes?: any;
        indexOf?: any;
        join?: any;
        keys?: any;
        lastIndexOf?: any;
        map?: any;
        pop?: any;
        push?: any;
        reduce?: any;
        reduceRight?: any;
        reverse?: any;
        shift?: any;
        slice?: any;
        some?: any;
        sort?: any;
        splice?: any;
        toLocaleString?: any;
        toString?: any;
        unshift?: any;
        values?: any;
    }

    Is an object whose properties have the value 'true' +

    Constructors

    Properties

    [unscopables]: {
        [unscopables]?: boolean;
        length?: boolean;
        [iterator]?: any;
        at?: any;
        concat?: any;
        copyWithin?: any;
        entries?: any;
        every?: any;
        fill?: any;
        filter?: any;
        find?: any;
        findIndex?: any;
        flat?: any;
        flatMap?: any;
        forEach?: any;
        includes?: any;
        indexOf?: any;
        join?: any;
        keys?: any;
        lastIndexOf?: any;
        map?: any;
        pop?: any;
        push?: any;
        reduce?: any;
        reduceRight?: any;
        reverse?: any;
        shift?: any;
        slice?: any;
        some?: any;
        sort?: any;
        splice?: any;
        toLocaleString?: any;
        toString?: any;
        unshift?: any;
        values?: any;
    }

    Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

    Type declaration

    • Optional Readonly [unscopables]?: boolean

      Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

    • Optional length?: boolean

      Gets or sets the length of the array. This is a number one higher than the highest index in the array.

      -
    _defaultLocale?: string
    length: number

    Gets or sets the length of the array. This is a number one higher than the highest index in the array.

    +
    _defaultLocale?: string
    length: number

    Gets or sets the length of the array. This is a number one higher than the highest index in the array.

    [species]: ArrayConstructor

    Methods

    • Iterator

      Returns IterableIterator<LocalizedValue>

    • Takes an integer value and returns the item at that index, allowing for positive and negative integers. @@ -125,17 +125,17 @@

    Returns void

      • Try to find the available locale that best fit's the user's preferences.
      -

      Parameters

      • locales: string[]

      Returns undefined | string

    • Get a value in the most suitable locale.

      +

      Parameters

      • locales: string[]

      Returns undefined | string

    • Get a value in the most suitable locale.

      Parameters

      • Optional locales: string | string[]

        Desired locale, can be a list of locales sorted by descending priority.

      • Optional joinWith: string

        String to join multiple available values by, if undefined only the first available value will be returned

      Returns null | string

      the first value in the most suitable locale or null if none could be found

      -
    • Get all values available in the most suitable locale.

      +
    • Get all values available in the most suitable locale.

      Parameters

      • Optional userLocales: string | string[]

        Desired locale, can be a list of locales sorted by descending priority.

      Returns string[]

      the values for the most suitable locale, empty if none could be found

      -
    • Determines whether an array includes a certain element, returning true or false as appropriate.

      +
    • Determines whether an array includes a certain element, returning true or false as appropriate.

      Parameters

      • searchElement: LocalizedValue

        The element to search for.

      • Optional fromIndex: number

        The position in this array at which to begin searching for searchElement.

      Returns boolean

    • Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

      @@ -170,7 +170,7 @@

      If there's an existing locale that matches the given locale, it will be updated.

      Parameters

      • value: string | string[]

        value to set

      • Optional locale: string

        Locale to set the value for

        -

      Returns void

    • Removes the first element from an array and returns it. +

    Returns void

    • Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

      Returns undefined | LocalizedValue

    • Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. @@ -220,4 +220,4 @@

        • (v, k): U
        • Parameters

          • v: T
          • k: number

          Returns U

    • Optional thisArg: any

      Value of 'this' used to invoke the mapfn.

    Returns U[]

    • Parameters

      • arg: any

      Returns arg is any[]

    • Returns a new array from a set of elements.

      Type Parameters

      • T

      Parameters

      • Rest ...items: T[]

        A set of elements to include in the new array object.

        -

      Returns T[]

    \ No newline at end of file +

    Returns T[]

    \ No newline at end of file diff --git a/docs/classes/Range.html b/docs/classes/Range.html index fe3a27e9..e7fad2ad 100644 --- a/docs/classes/Range.html +++ b/docs/classes/Range.html @@ -1,4 +1,4 @@ -Range | manifesto.js

    Hierarchy (view full)

    Constructors

    constructor +Range | manifesto.js

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    _ranges: null | Range[] = null
    canvases: null | string[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: ManifestResource[] = []
    parentRange: undefined | Range
    path: string
    treeNode: TreeNode

    Methods

    • Returns null | Behavior

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    _ranges: null | Range[] = null
    canvases: null | string[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: ManifestResource[] = []
    parentRange: undefined | Range
    path: string
    treeNode: TreeNode

    Methods

    • Returns null | Behavior

    • 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 @@ -49,4 +49,4 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ViewingDirection

    • Returns null | ViewingHint

    • Parameters

      • time: number

      Returns boolean

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    • Returns null | ViewingHint

    • Parameters

      • time: number

      Returns boolean

    \ No newline at end of file diff --git a/docs/classes/Rendering.html b/docs/classes/Rendering.html index 154342de..ca632b9b 100644 --- a/docs/classes/Rendering.html +++ b/docs/classes/Rendering.html @@ -1,4 +1,4 @@ -Rendering | manifesto.js

    Class Rendering

    Hierarchy (view full)

    Constructors

    constructor +Rendering | manifesto.js

    Class Rendering

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • 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 @@ -35,4 +35,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Resource.html b/docs/classes/Resource.html index 9974854f..e251a3f0 100644 --- a/docs/classes/Resource.html +++ b/docs/classes/Resource.html @@ -1,4 +1,4 @@ -Resource | manifesto.js

    Class Resource

    Hierarchy (view full)

    Constructors

    constructor +Resource | manifesto.js

    Class Resource

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • 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 @@ -42,4 +42,4 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ExternalResourceType

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ExternalResourceType

    \ No newline at end of file diff --git a/docs/classes/RotateTransform.html b/docs/classes/RotateTransform.html index b3255181..7d730a9c 100644 --- a/docs/classes/RotateTransform.html +++ b/docs/classes/RotateTransform.html @@ -1,4 +1,4 @@ -RotateTransform | manifesto.js

    Class RotateTransform

    Hierarchy (view full)

    Constructors

    constructor +RotateTransform | manifesto.js

    Class RotateTransform

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -9,7 +9,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -20,4 +20,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/ScaleTransform.html b/docs/classes/ScaleTransform.html index 2b43469e..4c237337 100644 --- a/docs/classes/ScaleTransform.html +++ b/docs/classes/ScaleTransform.html @@ -1,4 +1,4 @@ -ScaleTransform | manifesto.js

    Class ScaleTransform

    Hierarchy (view full)

    Constructors

    constructor +ScaleTransform | manifesto.js

    Class ScaleTransform

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -9,7 +9,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -20,4 +20,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Scene.html b/docs/classes/Scene.html index 301f5903..ee3b3e4c 100644 --- a/docs/classes/Scene.html +++ b/docs/classes/Scene.html @@ -1,4 +1,4 @@ -Scene | manifesto.js

    Hierarchy (view full)

    Constructors

    constructor +Scene | manifesto.js

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    Methods

    • 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 @@ -38,4 +38,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Sequence.html b/docs/classes/Sequence.html index 6ccda60d..67f83ac1 100644 --- a/docs/classes/Sequence.html +++ b/docs/classes/Sequence.html @@ -1,4 +1,4 @@ -Sequence | manifesto.js

    Class Sequence

    Hierarchy (view full)

    Constructors

    constructor +Sequence | manifesto.js

    Class Sequence

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    _thumbnails: null | Thumbnail[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: Canvas[] = []

    Methods

    • Parameters

      • canvasIndex: number

      Returns any

    • Parameters

      • id: string

      Returns null | number

    • Parameters

      • label: string
      • Optional foliated: boolean

      Returns number

    • Parameters

      • Optional alphanumeric: boolean

      Returns string

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number[]

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    _thumbnails: null | Thumbnail[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: Canvas[] = []

    Methods

    • Parameters

      • canvasIndex: number

      Returns any

    • Parameters

      • id: string

      Returns null | number

    • Parameters

      • label: string
      • Optional foliated: boolean

      Returns number

    • Parameters

      • Optional alphanumeric: boolean

      Returns string

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number[]

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • 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 @@ -60,5 +60,5 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ViewingDirection

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    \ No newline at end of file diff --git a/docs/classes/Service.html b/docs/classes/Service.html index 1ce8e52b..06ebdef2 100644 --- a/docs/classes/Service.html +++ b/docs/classes/Service.html @@ -1,4 +1,4 @@ -Service | manifesto.js

    Class Service

    Hierarchy (view full)

    Constructors

    constructor +Service | manifesto.js

    Class Service

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • Returns null | string

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • Returns null | string

    • 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 @@ -42,4 +42,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Size.html b/docs/classes/Size.html index 61b701b8..df65e81b 100644 --- a/docs/classes/Size.html +++ b/docs/classes/Size.html @@ -1,4 +1,4 @@ -Size | manifesto.js

    Constructors

    constructor +Size | manifesto.js

    Constructors

    Properties

    Constructors

    Properties

    height: number
    width: number
    \ No newline at end of file +

    Constructors

    Properties

    height: number
    width: number
    \ No newline at end of file diff --git a/docs/classes/SpecificResource.html b/docs/classes/SpecificResource.html index 20fd89ed..3492d8c3 100644 --- a/docs/classes/SpecificResource.html +++ b/docs/classes/SpecificResource.html @@ -4,7 +4,7 @@ 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.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = false
    isSpecificResource: boolean = true

    Accessors

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = false
    isSpecificResource: boolean = true

    Accessors

    Methods

    • 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 @@ -47,4 +47,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Thumb.html b/docs/classes/Thumb.html index d0c4b7c5..491737fa 100644 --- a/docs/classes/Thumb.html +++ b/docs/classes/Thumb.html @@ -1,4 +1,4 @@ -Thumb | manifesto.js

    Constructors

    constructor +Thumb | manifesto.js

    Constructors

    Properties

    Constructors

    Properties

    data: any
    height: number
    index: number
    label: string
    uri: string
    viewingHint: null | ViewingHint
    visible: boolean
    width: number
    \ No newline at end of file +

    Constructors

    Properties

    data: any
    height: number
    index: number
    label: string
    uri: string
    viewingHint: null | ViewingHint
    visible: boolean
    width: number
    \ No newline at end of file diff --git a/docs/classes/Thumbnail.html b/docs/classes/Thumbnail.html index 233c6b3e..61891689 100644 --- a/docs/classes/Thumbnail.html +++ b/docs/classes/Thumbnail.html @@ -1,4 +1,4 @@ -Thumbnail | manifesto.js

    Class Thumbnail

    Hierarchy (view full)

    Constructors

    constructor +Thumbnail | manifesto.js

    Class Thumbnail

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • 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 @@ -42,4 +42,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Transform.html b/docs/classes/Transform.html index 0fd2eaba..1dc2f384 100644 --- a/docs/classes/Transform.html +++ b/docs/classes/Transform.html @@ -1,4 +1,4 @@ -Transform | manifesto.js

    Class TransformAbstract

    Hierarchy (view full)

    Constructors

    constructor +Transform | manifesto.js

    Class TransformAbstract

    Hierarchy (view full)

    Constructors

    Properties

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -19,4 +19,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/TransformParser.html b/docs/classes/TransformParser.html index 766230c8..42e0df1f 100644 --- a/docs/classes/TransformParser.html +++ b/docs/classes/TransformParser.html @@ -1,3 +1,3 @@ -TransformParser | manifesto.js

    Class TransformParser

    Constructors

    constructor +TransformParser | manifesto.js

    Class TransformParser

    Constructors

    Methods

    Constructors

    Methods

    \ No newline at end of file +

    Constructors

    Methods

    \ No newline at end of file diff --git a/docs/classes/TranslateTransform.html b/docs/classes/TranslateTransform.html index ac79c4d4..b186d1b1 100644 --- a/docs/classes/TranslateTransform.html +++ b/docs/classes/TranslateTransform.html @@ -1,4 +1,4 @@ -TranslateTransform | manifesto.js

    Class TranslateTransform

    Hierarchy (view full)

    Constructors

    constructor +TranslateTransform | manifesto.js

    Class TranslateTransform

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -9,7 +9,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -20,4 +20,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/TreeNode.html b/docs/classes/TreeNode.html index fc31f72f..0a25f827 100644 --- a/docs/classes/TreeNode.html +++ b/docs/classes/TreeNode.html @@ -1,4 +1,4 @@ -TreeNode | manifesto.js

    Class TreeNode

    Constructors

    constructor +TreeNode | manifesto.js

    Class TreeNode

    Constructors

    Properties

    Constructors

    Properties

    data: any
    expanded: boolean
    id: string
    label: string
    navDate: Date
    nodes: TreeNode[]
    parentNode: TreeNode
    selected: boolean

    Methods

    \ No newline at end of file +

    Constructors

    Properties

    data: any
    expanded: boolean
    id: string
    label: string
    navDate: Date
    nodes: TreeNode[]
    parentNode: TreeNode
    selected: boolean

    Methods

    \ No newline at end of file diff --git a/docs/classes/Utils.html b/docs/classes/Utils.html index 621c3ad3..f5eb03ab 100644 --- a/docs/classes/Utils.html +++ b/docs/classes/Utils.html @@ -1,4 +1,4 @@ -Utils | manifesto.js

    Constructors

    constructor +Utils | manifesto.js

    Constructors

    Methods

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)

      Returns Promise<IExternalResource>

    • Parameters

      • response: any

      Returns any

    • Parameters

      • message: string

      Returns Error

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<void | IExternalResource>

    • Parameters

      Returns void

    • Parameters

      • profile: ServiceProfile

      Returns string

    • Parameters

      • locale: string

      Returns string

    • Parameters

      • resource: any
      • locale: string

      Returns null | string

    • Parameters

      • type: string

      Returns MediaType

    • Parameters

      • resource: any
      • __namedParameters: {
            onlyService?: boolean;
            onlyServices?: boolean;
            skipParentResources?: boolean;
        } = {}
        • Optional onlyService?: boolean
        • Optional onlyServices?: boolean
        • Optional skipParentResources?: boolean

      Returns Service[]

    • Parameters

      • target: string

      Returns null | number[]

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • type: null | string

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource>

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<void>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource>

    • Parameters

      • resources: IExternalResource[]
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource[]>

    • Parameters

      • resources: IExternalResource[]
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource[]>

    • Parameters

      • url: string

      Returns Promise<any>

    • Parameters

      • type: string

      Returns string

    • Parameters

      • url: string

      Returns string

    • Parameters

      • url1: string
      • url2: string

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: any
      • clickThrough: any
      • restricted: any
      • login: any
      • getAccessToken: any
      • storeAccessToken: any
      • resolve: any
      • reject: any

      Returns void

    • Does a depth first traversal of an Object, returning an Object that +

    Constructors

    Methods

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)

      Returns Promise<IExternalResource>

    • Parameters

      • response: any

      Returns any

    • Parameters

      • message: string

      Returns Error

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<void | IExternalResource>

    • Parameters

      Returns void

    • Parameters

      • profile: ServiceProfile

      Returns string

    • Parameters

      • locale: string

      Returns string

    • Parameters

      • resource: any
      • locale: string

      Returns null | string

    • Parameters

      • type: string

      Returns MediaType

    • Parameters

      • resource: any
      • __namedParameters: {
            onlyService?: boolean;
            onlyServices?: boolean;
            skipParentResources?: boolean;
        } = {}
        • Optional onlyService?: boolean
        • Optional onlyServices?: boolean
        • Optional skipParentResources?: boolean

      Returns Service[]

    • Parameters

      • target: string

      Returns null | number[]

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • type: null | string

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource>

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<void>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource>

    • Parameters

      • resources: IExternalResource[]
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource[]>

    • Parameters

      • resources: IExternalResource[]
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource[]>

    • Parameters

      • url: string

      Returns Promise<any>

    • Parameters

      • type: string

      Returns string

    • Parameters

      • url: string

      Returns string

    • Parameters

      • url1: string
      • url2: string

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: any
      • clickThrough: any
      • restricted: any
      • login: any
      • getAccessToken: any
      • storeAccessToken: any
      • resolve: any
      • reject: any

      Returns void

    • Does a depth first traversal of an Object, returning an Object that matches provided k and v arguments

      Parameters

      • object: any
      • k: string
      • v: string

      Returns undefined | object

      Example

      Utils.traverseAndFind({foo: 'bar'}, 'foo', 'bar')
       
      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/enums/ManifestType.html b/docs/enums/ManifestType.html index 0ea4fdbb..26ab9f5d 100644 --- a/docs/enums/ManifestType.html +++ b/docs/enums/ManifestType.html @@ -1,4 +1,4 @@ -ManifestType | manifesto.js

    Enumeration ManifestType

    Enumeration Members

    EMPTY +ManifestType | manifesto.js

    Enumeration ManifestType

    Enumeration Members

    Enumeration Members

    EMPTY: ""
    MANUSCRIPT: "manuscript"
    MONOGRAPH: "monograph"
    \ No newline at end of file +

    Enumeration Members

    EMPTY: ""
    MANUSCRIPT: "manuscript"
    MONOGRAPH: "monograph"
    \ No newline at end of file diff --git a/docs/enums/StatusCode.html b/docs/enums/StatusCode.html index b5237373..e171a951 100644 --- a/docs/enums/StatusCode.html +++ b/docs/enums/StatusCode.html @@ -1,5 +1,5 @@ -StatusCode | manifesto.js

    Enumeration StatusCode

    Enumeration Members

    AUTHORIZATION_FAILED +StatusCode | manifesto.js

    Enumeration StatusCode

    Enumeration Members

    AUTHORIZATION_FAILED: 1
    FORBIDDEN: 2
    INTERNAL_SERVER_ERROR: 3
    RESTRICTED: 4
    \ No newline at end of file +

    Enumeration Members

    AUTHORIZATION_FAILED: 1
    FORBIDDEN: 2
    INTERNAL_SERVER_ERROR: 3
    RESTRICTED: 4
    \ No newline at end of file diff --git a/docs/enums/TreeNodeType.html b/docs/enums/TreeNodeType.html index 03db81dc..49063f7c 100644 --- a/docs/enums/TreeNodeType.html +++ b/docs/enums/TreeNodeType.html @@ -1,4 +1,4 @@ -TreeNodeType | manifesto.js

    Enumeration TreeNodeType

    Enumeration Members

    COLLECTION +TreeNodeType | manifesto.js

    Enumeration TreeNodeType

    Enumeration Members

    Enumeration Members

    COLLECTION: "collection"
    MANIFEST: "manifest"
    RANGE: "range"
    \ No newline at end of file +

    Enumeration Members

    COLLECTION: "collection"
    MANIFEST: "manifest"
    RANGE: "range"
    \ No newline at end of file diff --git a/docs/functions/cameraRelativeRotation.html b/docs/functions/cameraRelativeRotation.html index 772c309f..30e8f411 100644 --- a/docs/functions/cameraRelativeRotation.html +++ b/docs/functions/cameraRelativeRotation.html @@ -12,4 +12,4 @@

    Parameters

    • direction: Vector3

      A vector interpreted as a direction. Client code responsible for not passing a 0-length vector, else a

    Returns Euler

    threejs-math.EulerAngle instance

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/functions/lightRelativeRotation.html b/docs/functions/lightRelativeRotation.html index 833ac65b..7e8eccf1 100644 --- a/docs/functions/lightRelativeRotation.html +++ b/docs/functions/lightRelativeRotation.html @@ -1 +1 @@ -lightRelativeRotation | manifesto.js

    Function lightRelativeRotation

    • Parameters

      • direction: Vector3

      Returns Euler

    \ No newline at end of file +lightRelativeRotation | manifesto.js

    Function lightRelativeRotation

    • Parameters

      • direction: Vector3

      Returns Euler

    \ No newline at end of file diff --git a/docs/functions/loadManifest.html b/docs/functions/loadManifest.html index 3bfbc11e..3385adc9 100644 --- a/docs/functions/loadManifest.html +++ b/docs/functions/loadManifest.html @@ -3,4 +3,4 @@

    Parameters

    • url: string

      string containing the URL to Fetch

    Returns Promise<any>

    Promise The object returned through the Promise is the javascript object obtained by deserializing the json text. *

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/functions/parseManifest.html b/docs/functions/parseManifest.html index a2140399..d04798ef 100644 --- a/docs/functions/parseManifest.html +++ b/docs/functions/parseManifest.html @@ -2,4 +2,4 @@

    Parameters

    • manifest: any

      Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file.

    • Optional options: IManifestoOptions

    Returns null | IIIFResource

    instance of Manifest class. *

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/IAccessToken.html b/docs/interfaces/IAccessToken.html index b3003023..cae6a9ae 100644 --- a/docs/interfaces/IAccessToken.html +++ b/docs/interfaces/IAccessToken.html @@ -1,6 +1,6 @@ -IAccessToken | manifesto.js

    Interface IAccessToken

    interface IAccessToken {
        accessToken: string;
        error: string;
        errorDescription: string;
        expiresIn: number;
        tokenType: string;
    }

    Properties

    accessToken +IAccessToken | manifesto.js

    Interface IAccessToken

    interface IAccessToken {
        accessToken: string;
        error: string;
        errorDescription: string;
        expiresIn: number;
        tokenType: string;
    }

    Properties

    accessToken: string
    error: string
    errorDescription: string
    expiresIn: number
    tokenType: string
    \ No newline at end of file +

    Properties

    accessToken: string
    error: string
    errorDescription: string
    expiresIn: number
    tokenType: string
    \ No newline at end of file diff --git a/docs/interfaces/IExternalImageResourceData.html b/docs/interfaces/IExternalImageResourceData.html index 36e5c52d..4db79e5a 100644 --- a/docs/interfaces/IExternalImageResourceData.html +++ b/docs/interfaces/IExternalImageResourceData.html @@ -1,8 +1,8 @@ -IExternalImageResourceData | manifesto.js

    Interface IExternalImageResourceData

    interface IExternalImageResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        height: number;
        id: string;
        index: number;
        profile: string | any[];
        width: number;
    }

    Hierarchy (view full)

    Properties

    contentLocation +IExternalImageResourceData | manifesto.js

    Interface IExternalImageResourceData

    interface IExternalImageResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        height: number;
        id: string;
        index: number;
        profile: string | any[];
        width: number;
    }

    Hierarchy (view full)

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    height: number
    id: string
    index: number
    profile: string | any[]
    width: number
    \ No newline at end of file +

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    height: number
    id: string
    index: number
    profile: string | any[]
    width: number
    \ No newline at end of file diff --git a/docs/interfaces/IExternalResource.html b/docs/interfaces/IExternalResource.html index e872124b..bfe2c56a 100644 --- a/docs/interfaces/IExternalResource.html +++ b/docs/interfaces/IExternalResource.html @@ -1,4 +1,4 @@ -IExternalResource | manifesto.js

    Interface IExternalResource

    interface IExternalResource {
        authAPIVersion: number;
        authHoldingPage: any;
        clickThroughService: null | Service;
        data: IExternalResourceData;
        dataUri: null | string;
        error: any;
        externalService: null | Service;
        height: number;
        index: number;
        isResponseHandled: boolean;
        kioskService: null | Service;
        loginService: null | Service;
        logoutService: null | Service;
        options?: IManifestoOptions;
        restrictedService: null | Service;
        status: number;
        tokenService: null | Service;
        width: number;
        getData(accessToken?): Promise<IExternalResource>;
        hasServiceDescriptor(): boolean;
        isAccessControlled(): boolean;
    }

    Properties

    authAPIVersion +IExternalResource | manifesto.js

    Interface IExternalResource

    interface IExternalResource {
        authAPIVersion: number;
        authHoldingPage: any;
        clickThroughService: null | Service;
        data: IExternalResourceData;
        dataUri: null | string;
        error: any;
        externalService: null | Service;
        height: number;
        index: number;
        isResponseHandled: boolean;
        kioskService: null | Service;
        loginService: null | Service;
        logoutService: null | Service;
        options?: IManifestoOptions;
        restrictedService: null | Service;
        status: number;
        tokenService: null | Service;
        width: number;
        getData(accessToken?): Promise<IExternalResource>;
        hasServiceDescriptor(): boolean;
        isAccessControlled(): boolean;
    }

    Properties

    authAPIVersion: number
    authHoldingPage: any
    clickThroughService: null | Service
    dataUri: null | string
    error: any
    externalService: null | Service
    height: number
    index: number
    isResponseHandled: boolean
    kioskService: null | Service
    loginService: null | Service
    logoutService: null | Service
    restrictedService: null | Service
    status: number
    tokenService: null | Service
    width: number

    Methods

    \ No newline at end of file +

    Properties

    authAPIVersion: number
    authHoldingPage: any
    clickThroughService: null | Service
    dataUri: null | string
    error: any
    externalService: null | Service
    height: number
    index: number
    isResponseHandled: boolean
    kioskService: null | Service
    loginService: null | Service
    logoutService: null | Service
    restrictedService: null | Service
    status: number
    tokenService: null | Service
    width: number

    Methods

    \ No newline at end of file diff --git a/docs/interfaces/IExternalResourceData.html b/docs/interfaces/IExternalResourceData.html index 98820dcc..f0169b71 100644 --- a/docs/interfaces/IExternalResourceData.html +++ b/docs/interfaces/IExternalResourceData.html @@ -1,6 +1,6 @@ -IExternalResourceData | manifesto.js

    Interface IExternalResourceData

    interface IExternalResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        id: string;
        index: number;
        profile: string | any[];
    }

    Hierarchy (view full)

    Properties

    contentLocation +IExternalResourceData | manifesto.js

    Interface IExternalResourceData

    interface IExternalResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        id: string;
        index: number;
        profile: string | any[];
    }

    Hierarchy (view full)

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    id: string
    index: number
    profile: string | any[]
    \ No newline at end of file +

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    id: string
    index: number
    profile: string | any[]
    \ No newline at end of file diff --git a/docs/interfaces/IExternalResourceOptions.html b/docs/interfaces/IExternalResourceOptions.html index 5deb4c22..05e6624a 100644 --- a/docs/interfaces/IExternalResourceOptions.html +++ b/docs/interfaces/IExternalResourceOptions.html @@ -1,2 +1,2 @@ -IExternalResourceOptions | manifesto.js

    Interface IExternalResourceOptions

    interface IExternalResourceOptions {
        authApiVersion: number;
    }

    Properties

    Properties

    authApiVersion: number
    \ No newline at end of file +IExternalResourceOptions | manifesto.js

    Interface IExternalResourceOptions

    interface IExternalResourceOptions {
        authApiVersion: number;
    }

    Properties

    Properties

    authApiVersion: number
    \ No newline at end of file diff --git a/docs/interfaces/IManifestoOptions.html b/docs/interfaces/IManifestoOptions.html index 4fc6d5a9..ad34d6a5 100644 --- a/docs/interfaces/IManifestoOptions.html +++ b/docs/interfaces/IManifestoOptions.html @@ -1,7 +1,7 @@ -IManifestoOptions | manifesto.js

    Interface IManifestoOptions

    interface IManifestoOptions {
        defaultLabel: string;
        index?: number;
        locale: string;
        navDate?: Date;
        pessimisticAccessControl: boolean;
        resource: IIIFResource;
    }

    Properties

    defaultLabel +IManifestoOptions | manifesto.js

    Interface IManifestoOptions

    interface IManifestoOptions {
        defaultLabel: string;
        index?: number;
        locale: string;
        navDate?: Date;
        pessimisticAccessControl: boolean;
        resource: IIIFResource;
    }

    Properties

    defaultLabel: string
    index?: number
    locale: string
    navDate?: Date
    pessimisticAccessControl: boolean
    resource: IIIFResource
    \ No newline at end of file +

    Properties

    defaultLabel: string
    index?: number
    locale: string
    navDate?: Date
    pessimisticAccessControl: boolean
    resource: IIIFResource
    \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts index ac52094a..3f557b36 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -162,7 +162,11 @@ export declare class Camera extends AnnotationBody { Angular unit is degrees **/ get FieldOfView(): number | undefined; - getLookAt(): object | null; + /** + * @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; } export declare class AnnotationBodyParser { From 81fd2f38bf7c3e8046d7a74046e35bd119977bb3 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Sat, 11 May 2024 15:28:31 -0400 Subject: [PATCH 07/16] Added a short test demonstrating that the return value from AnnotationBody.getIIIFResourceType can be compared to an ExternalResourceType --- test/tests_3d/1_basic_model_in_scene/model_origin.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/tests_3d/1_basic_model_in_scene/model_origin.js b/test/tests_3d/1_basic_model_in_scene/model_origin.js index 46f8cee1..3a4609eb 100644 --- a/test/tests_3d/1_basic_model_in_scene/model_origin.js +++ b/test/tests_3d/1_basic_model_in_scene/model_origin.js @@ -63,6 +63,16 @@ describe('model_origin', function() { body.getType().should.equal(ExternalResourceType.MODEL); }); + it('and body has IIIFResourceType', function(){ + body = annotation.getBody()[0]; + expect(body.getIIIFResourceType()).to.exist; + + let test = ( body.getIIIFResourceType() == ExternalResourceType.MODEL ); + expect(test).to.equal(true); + + }); + + it('body id looks like a model url', function(){ body.id.should.include('astronaut.glb'); }); From 2e2660efe189596979d7f1de28c80f4ac16a70c7 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Sat, 11 May 2024 15:30:14 -0400 Subject: [PATCH 08/16] Added unit testing for a spotlight resource --- test/index.js | 1 + .../3_lights/spotlight_lookat_point.js | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 test/tests_3d/3_lights/spotlight_lookat_point.js diff --git a/test/index.js b/test/index.js index d8571996..655c2a22 100644 --- a/test/index.js +++ b/test/index.js @@ -138,6 +138,7 @@ function run_iiif3d_tests(){ describe("3_lights" , function(){ //importTest('ambient_green_light', './tests_3d/3_lights/ambient_green_light.js'); importTest('directional light', './tests_3d/3_lights/direction_light_transform_rotate.js'); + importTest('spot light', './tests_3d/3_lights/spotlight_lookat_point.js'); }); diff --git a/test/tests_3d/3_lights/spotlight_lookat_point.js b/test/tests_3d/3_lights/spotlight_lookat_point.js new file mode 100644 index 00000000..53b56edf --- /dev/null +++ b/test/tests_3d/3_lights/spotlight_lookat_point.js @@ -0,0 +1,47 @@ +var expect = require('chai').expect; +var should = require('chai').should(); +var manifesto = require('../../../dist-commonjs/'); +//var manifests_3d = require('../fixtures/manifests_3d'); + + +var ExternalResourceType = require('@iiif/vocabulary/dist-commonjs/').ExternalResourceType; +var MediaType = require('@iiif/vocabulary/dist-commonjs/').MediaType; + + +let manifest, sequence, scene , model, body, annotations; + +let manifest_url = { + local: "http://localhost:3001/model_origin.json", + remote : "https://raw.githubusercontent.com/vincentmarchetti/iiif3dtsg/spotlight-manifest/manifests/3_lights/spotlight_lookat_positioned.json" + }.remote; + +describe('spotlight', function() { + + it('loads successfully', function(done) { + manifesto.loadManifest(manifest_url).then(function(data) { + manifest = manifesto.parseManifest(data); + done(); + }); + }); + + it('has a scene with two annotation', function(){ + sequence = manifest.getSequenceByIndex(0); + expect(sequence).to.exist; + scene = sequence.getScenes()[0]; + expect(scene).to.exist; + expect(scene.isScene()).to.be.ok; + annotations = scene.getContent(); + expect(annotations.length).to.equal(2); + + + }); + + + it('with a spot light', function(){ + expect(undefined).to.exist; + }); + + + + +}); From 9d25a6d664181fa763ff0e42dbc1fba6b1aeecbd Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Sun, 12 May 2024 17:14:33 -0400 Subject: [PATCH 09/16] Implemented and test Angle property of SpotLight --- src/AnnotationBodyParser.ts | 2 +- src/Light.ts | 35 +++++++++++++++++++ .../3_lights/spotlight_lookat_point.js | 13 ++++++- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/AnnotationBodyParser.ts b/src/AnnotationBodyParser.ts index b7d4fda5..3537c600 100644 --- a/src/AnnotationBodyParser.ts +++ b/src/AnnotationBodyParser.ts @@ -6,7 +6,7 @@ import { } from "./internal"; -let LightTypes:string[] = ["AmbientLight" , "DirectionalLight"]; +let LightTypes:string[] = ["AmbientLight" , "DirectionalLight", "SpotLight"]; let CameraTypes:string[] = ["PerspectiveCamera", "OrthographicCamera"]; let DisplayedTypes:string[] = ["Image", "Document","Audio","Model","Video"]; export class AnnotationBodyParser { diff --git a/src/Light.ts b/src/Light.ts index 940620c3..27c73808 100644 --- a/src/Light.ts +++ b/src/Light.ts @@ -21,6 +21,10 @@ export class Light extends AnnotationBody { return (Utils.normaliseType(this.getProperty("type")) === "directionallight"); } + get isSpotLight():boolean { + return (Utils.normaliseType(this.getProperty("type")) === "spotlight"); + } + getColor():Color { var hexColor = this.getProperty("color"); if (hexColor) return Color.fromCSS(hexColor); @@ -28,6 +32,8 @@ export class Light extends AnnotationBody { else return new Color([255, 255, 255]); // white light } + get Color() : Color { return this.getColor(); } + /** * The implementation of the intensity is based on * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md } @@ -55,4 +61,33 @@ export class Light extends AnnotationBody { else return 1.0; } + + get Intensity() : number { return this.getIntensity(); } + + /** + * 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 { + if (this.isSpotLight){ + return Number(this.getProperty("angle") ); + } + else{ + return undefined; + } + } + + get Angle(): number|undefined { return this.getAngle();} } \ No newline at end of file diff --git a/test/tests_3d/3_lights/spotlight_lookat_point.js b/test/tests_3d/3_lights/spotlight_lookat_point.js index 53b56edf..549bb157 100644 --- a/test/tests_3d/3_lights/spotlight_lookat_point.js +++ b/test/tests_3d/3_lights/spotlight_lookat_point.js @@ -38,7 +38,18 @@ describe('spotlight', function() { it('with a spot light', function(){ - expect(undefined).to.exist; + // not following find idiom doesn't work if spotlight is inside + // a SpecificResource + let lightAnno = scene.Content.find( (anno) => anno.Body[0].isLight ); + + expect(lightAnno).to.exist; + let body = lightAnno.Body[0]; + let light = (body.isSpecificResource)? body.Source : body; + expect (light.isSpotLight).to.equal(true); + + expect( light.Intensity).to.equal( 0.6 ); + expect( light.Color ).to.exist; + expect( light.Angle ).to.equal(10.0); }); From dfda656abbd8c3e8192f17ae5b3fe33a24bf3610 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Sun, 12 May 2024 21:04:39 -0400 Subject: [PATCH 10/16] implement and test the lookAt property of light --- src/Light.ts | 23 +++++++++++++++++-- .../3_lights/spotlight_lookat_point.js | 4 ++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/Light.ts b/src/Light.ts index 27c73808..c18f4b45 100644 --- a/src/Light.ts +++ b/src/Light.ts @@ -3,7 +3,8 @@ import { IManifestoOptions, Utils, AnnotationBody, - Color } from "./internal"; + Color, + PointSelector } from "./internal"; export class Light extends AnnotationBody { constructor(jsonld?: any, options?: IManifestoOptions) { @@ -90,4 +91,22 @@ export class Light extends AnnotationBody { } get Angle(): number|undefined { return this.getAngle();} -} \ No newline at end of file + + /** + * @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 { + let rawObj = this.getPropertyAsObject("lookAt" ) + let 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}'); + } + get LookAt() : object | null {return this.getLookAt();} + +} diff --git a/test/tests_3d/3_lights/spotlight_lookat_point.js b/test/tests_3d/3_lights/spotlight_lookat_point.js index 549bb157..8120738f 100644 --- a/test/tests_3d/3_lights/spotlight_lookat_point.js +++ b/test/tests_3d/3_lights/spotlight_lookat_point.js @@ -50,6 +50,10 @@ describe('spotlight', function() { expect( light.Intensity).to.equal( 0.6 ); expect( light.Color ).to.exist; expect( light.Angle ).to.equal(10.0); + + let lookAt = light.LookAt; + expect(lookAt).to.exist; + expect(lookAt.isPointSelector).to.equal(true); }); From 1c52474d2c5b86e3a4eec23a39e0c1f1eb5da299 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Sun, 12 May 2024 21:09:28 -0400 Subject: [PATCH 11/16] rebuild modules and documentation --- dist-commonjs/Annotation.d.ts | 2 +- dist-commonjs/AnnotationBodyParser.js | 2 +- dist-commonjs/AnnotationBodyParser.js.map | 2 +- dist-commonjs/Light.d.ts | 29 +++++++- dist-commonjs/Light.js | 66 ++++++++++++++++++ dist-commonjs/Light.js.map | 2 +- dist-esmodule/AnnotationBodyParser.js | 2 +- dist-esmodule/AnnotationBodyParser.js.map | 2 +- dist-esmodule/Light.d.ts | 29 +++++++- dist-esmodule/Light.js | 68 ++++++++++++++++++- dist-esmodule/Light.js.map | 2 +- dist-umd/manifesto.js | 2 +- dist-var/manifesto.js | 2 +- docs/assets/search.js | 2 +- docs/classes/Annotation.html | 16 ++--- docs/classes/AnnotationBody.html | 6 +- docs/classes/AnnotationBodyParser.html | 4 +- docs/classes/AnnotationList.html | 6 +- docs/classes/AnnotationPage.html | 6 +- docs/classes/Camera.html | 12 ++-- docs/classes/Canvas.html | 10 +-- docs/classes/Collection.html | 10 +-- docs/classes/Color.html | 16 ++--- docs/classes/Deserialiser.html | 4 +- docs/classes/Duration.html | 4 +- docs/classes/IIIFResource.html | 6 +- docs/classes/JSONLDResource.html | 6 +- docs/classes/LabelValuePair.html | 4 +- docs/classes/LanguageMap.html | 6 +- docs/classes/Light.html | 30 ++++++-- docs/classes/LocalizedValue.html | 10 +-- docs/classes/Manifest.html | 12 ++-- docs/classes/ManifestResource.html | 6 +- docs/classes/PointSelector.html | 6 +- docs/classes/PropertyValue.html | 16 ++--- docs/classes/Range.html | 6 +- docs/classes/Rendering.html | 6 +- docs/classes/Resource.html | 6 +- docs/classes/RotateTransform.html | 6 +- docs/classes/ScaleTransform.html | 6 +- docs/classes/Scene.html | 6 +- docs/classes/Sequence.html | 8 +-- docs/classes/Service.html | 6 +- docs/classes/Size.html | 4 +- docs/classes/SpecificResource.html | 6 +- docs/classes/Thumb.html | 4 +- docs/classes/Thumbnail.html | 6 +- docs/classes/Transform.html | 6 +- docs/classes/TransformParser.html | 4 +- docs/classes/TranslateTransform.html | 6 +- docs/classes/TreeNode.html | 4 +- docs/classes/Utils.html | 6 +- docs/enums/ManifestType.html | 4 +- docs/enums/StatusCode.html | 4 +- docs/enums/TreeNodeType.html | 4 +- docs/functions/cameraRelativeRotation.html | 2 +- docs/functions/lightRelativeRotation.html | 2 +- docs/functions/loadManifest.html | 2 +- docs/functions/parseManifest.html | 2 +- docs/interfaces/IAccessToken.html | 4 +- .../IExternalImageResourceData.html | 4 +- docs/interfaces/IExternalResource.html | 4 +- docs/interfaces/IExternalResourceData.html | 4 +- docs/interfaces/IExternalResourceOptions.html | 4 +- docs/interfaces/IManifestoOptions.html | 4 +- types/index.d.ts | 27 ++++++++ 66 files changed, 403 insertions(+), 172 deletions(-) diff --git a/dist-commonjs/Annotation.d.ts b/dist-commonjs/Annotation.d.ts index 4fdaf072..6afc5e98 100644 --- a/dist-commonjs/Annotation.d.ts +++ b/dist-commonjs/Annotation.d.ts @@ -10,7 +10,7 @@ export declare class Annotation extends ManifestResource { @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ } **/ getBody(): (AnnotationBody | SpecificResource)[]; - get Body(): (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/ diff --git a/dist-commonjs/AnnotationBodyParser.js b/dist-commonjs/AnnotationBodyParser.js index ed83a253..2c7f398d 100644 --- a/dist-commonjs/AnnotationBodyParser.js +++ b/dist-commonjs/AnnotationBodyParser.js @@ -2,7 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AnnotationBodyParser = void 0; var internal_1 = require("./internal"); -var LightTypes = ["AmbientLight", "DirectionalLight"]; +var LightTypes = ["AmbientLight", "DirectionalLight", "SpotLight"]; var CameraTypes = ["PerspectiveCamera", "OrthographicCamera"]; var DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"]; var AnnotationBodyParser = /** @class */ (function () { diff --git a/dist-commonjs/AnnotationBodyParser.js.map b/dist-commonjs/AnnotationBodyParser.js.map index d534e502..6799d34b 100644 --- a/dist-commonjs/AnnotationBodyParser.js.map +++ b/dist-commonjs/AnnotationBodyParser.js.map @@ -1 +1 @@ -{"version":3,"file":"AnnotationBodyParser.js","sourceRoot":"","sources":["../src/AnnotationBodyParser.ts"],"names":[],"mappings":";;;AAAA,uCAKoB;AAGpB,IAAI,UAAU,GAAY,CAAC,cAAc,EAAG,kBAAkB,CAAC,CAAC;AAChE,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 +{"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/Light.d.ts b/dist-commonjs/Light.d.ts index 426f43d3..b3ccfef6 100644 --- a/dist-commonjs/Light.d.ts +++ b/dist-commonjs/Light.d.ts @@ -1,9 +1,11 @@ -import { IManifestoOptions, AnnotationBody, Color } from "./internal"; +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 } @@ -18,4 +20,29 @@ export declare class Light extends AnnotationBody { * 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 index cbb18b88..1f594bed 100644 --- a/dist-commonjs/Light.js +++ b/dist-commonjs/Light.js @@ -39,6 +39,13 @@ var Light = /** @class */ (function (_super) { 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) @@ -46,6 +53,11 @@ var Light = /** @class */ (function (_super) { 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 } @@ -74,6 +86,60 @@ var Light = /** @class */ (function (_super) { 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; diff --git a/dist-commonjs/Light.js.map b/dist-commonjs/Light.js.map index 796934d4..b2f23751 100644 --- a/dist-commonjs/Light.js.map +++ b/dist-commonjs/Light.js.map @@ -1 +1 @@ -{"version":3,"file":"Light.js","sourceRoot":"","sources":["../src/Light.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,uCAI8B;AAE9B;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,CAAC,KAAK,cAAc,CAAC,CAAC;QAC5E,CAAC;;;OAAA;IAED,sBAAI,qCAAkB;aAAtB;YACE,OAAO,CAAC,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC;QAChF,CAAC;;;OAAA;IAED,wBAAQ,GAAR;QACE,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,QAAQ;YAAE,OAAO,gBAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;;YAExC,OAAO,IAAI,gBAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc;IACxD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,4BAAY,GAAZ;QACE,IAAI,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAI,SAAS,EAAC,CAAC;YACX,IAAG,CAAC;gBACA,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,OAAO,IAAI,SAAS,CAAC,IAAI,KAAG,UAAU,CAAC;oBAC5D,MAAM,IAAI,KAAK,EAAE,CAAC;gBACtB,OAAO,SAAS,CAAC,KAAe,CAAC;YACrC,CAAC;YAAC,OAAM,GAAG,EAAC,CAAC;gBACT,MAAM,IAAI,KAAK,CAAC,2CAA2C,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7F,CAAC;QACL,CAAC;;YAEG,OAAO,GAAG,CAAC;IACjB,CAAC;IACH,YAAC;AAAD,CAAC,AAlDD,CAA2B,yBAAc,GAkDxC;AAlDY,sBAAK"} \ No newline at end of file +{"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,CAAC,KAAK,cAAc,CAAC,CAAC;QAC5E,CAAC;;;OAAA;IAED,sBAAI,qCAAkB;aAAtB;YACE,OAAO,CAAC,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC;QAChF,CAAC;;;OAAA;IAED,sBAAI,8BAAW;aAAf;YACE,OAAO,CAAC,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC;QACzE,CAAC;;;OAAA;IAED,wBAAQ,GAAR;QACE,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,QAAQ;YAAE,OAAO,gBAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;;YAExC,OAAO,IAAI,gBAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc;IACxD,CAAC;IAED,sBAAI,wBAAK;aAAT,cAAsB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAE/C;;;;;;;;;;;;OAYG;IACH,4BAAY,GAAZ;QACE,IAAI,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAI,SAAS,EAAC,CAAC;YACX,IAAG,CAAC;gBACA,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,OAAO,IAAI,SAAS,CAAC,IAAI,KAAG,UAAU,CAAC;oBAC5D,MAAM,IAAI,KAAK,EAAE,CAAC;gBACtB,OAAO,SAAS,CAAC,KAAe,CAAC;YACrC,CAAC;YAAC,OAAM,GAAG,EAAC,CAAC;gBACT,MAAM,IAAI,KAAK,CAAC,2CAA2C,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7F,CAAC;QACL,CAAC;;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,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-esmodule/AnnotationBodyParser.js b/dist-esmodule/AnnotationBodyParser.js index e300489d..d0543434 100644 --- a/dist-esmodule/AnnotationBodyParser.js +++ b/dist-esmodule/AnnotationBodyParser.js @@ -1,5 +1,5 @@ import { AnnotationBody, Light, Camera } from "./internal"; -var LightTypes = ["AmbientLight", "DirectionalLight"]; +var LightTypes = ["AmbientLight", "DirectionalLight", "SpotLight"]; var CameraTypes = ["PerspectiveCamera", "OrthographicCamera"]; var DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"]; var AnnotationBodyParser = /** @class */ (function () { diff --git a/dist-esmodule/AnnotationBodyParser.js.map b/dist-esmodule/AnnotationBodyParser.js.map index 8a81cbda..f1a94af5 100644 --- a/dist-esmodule/AnnotationBodyParser.js.map +++ b/dist-esmodule/AnnotationBodyParser.js.map @@ -1 +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,CAAC,CAAC;AAChE,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 +{"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/Light.d.ts b/dist-esmodule/Light.d.ts index 426f43d3..b3ccfef6 100644 --- a/dist-esmodule/Light.d.ts +++ b/dist-esmodule/Light.d.ts @@ -1,9 +1,11 @@ -import { IManifestoOptions, AnnotationBody, Color } from "./internal"; +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 } @@ -18,4 +20,29 @@ export declare class Light extends AnnotationBody { * 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 index b564351f..95d2dee3 100644 --- a/dist-esmodule/Light.js +++ b/dist-esmodule/Light.js @@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); -import { Utils, AnnotationBody, Color } from "./internal"; +import { Utils, AnnotationBody, Color, PointSelector } from "./internal"; var Light = /** @class */ (function (_super) { __extends(Light, _super); function Light(jsonld, options) { @@ -36,6 +36,13 @@ var Light = /** @class */ (function (_super) { 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) @@ -43,6 +50,11 @@ var Light = /** @class */ (function (_super) { 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 } @@ -71,6 +83,60 @@ var Light = /** @class */ (function (_super) { 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 }; diff --git a/dist-esmodule/Light.js.map b/dist-esmodule/Light.js.map index eb70b390..abd82933 100644 --- a/dist-esmodule/Light.js.map +++ b/dist-esmodule/Light.js.map @@ -1 +1 @@ -{"version":3,"file":"Light.js","sourceRoot":"","sources":["../src/Light.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAEH,KAAK,EACL,cAAc,EACd,KAAK,EAAE,MAAM,YAAY,CAAC;AAE9B;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,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC;QAC5E,CAAC;;;OAAA;IAED,sBAAI,qCAAkB;aAAtB;YACE,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC;QAChF,CAAC;;;OAAA;IAED,wBAAQ,GAAR;QACE,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,QAAQ;YAAE,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;;YAExC,OAAO,IAAI,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc;IACxD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,4BAAY,GAAZ;QACE,IAAI,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAI,SAAS,EAAC,CAAC;YACX,IAAG,CAAC;gBACA,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,OAAO,IAAI,SAAS,CAAC,IAAI,KAAG,UAAU,CAAC;oBAC5D,MAAM,IAAI,KAAK,EAAE,CAAC;gBACtB,OAAO,SAAS,CAAC,KAAe,CAAC;YACrC,CAAC;YAAC,OAAM,GAAG,EAAC,CAAC;gBACT,MAAM,IAAI,KAAK,CAAC,2CAA2C,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7F,CAAC;QACL,CAAC;;YAEG,OAAO,GAAG,CAAC;IACjB,CAAC;IACH,YAAC;AAAD,CAAC,AAlDD,CAA2B,cAAc,GAkDxC"} \ No newline at end of file +{"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,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC;QAC5E,CAAC;;;OAAA;IAED,sBAAI,qCAAkB;aAAtB;YACE,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC;QAChF,CAAC;;;OAAA;IAED,sBAAI,8BAAW;aAAf;YACE,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC;QACzE,CAAC;;;OAAA;IAED,wBAAQ,GAAR;QACE,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,QAAQ;YAAE,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;;YAExC,OAAO,IAAI,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc;IACxD,CAAC;IAED,sBAAI,wBAAK;aAAT,cAAsB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAE/C;;;;;;;;;;;;OAYG;IACH,4BAAY,GAAZ;QACE,IAAI,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC9C,IAAI,SAAS,EAAC,CAAC;YACX,IAAG,CAAC;gBACA,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,OAAO,IAAI,SAAS,CAAC,IAAI,KAAG,UAAU,CAAC;oBAC5D,MAAM,IAAI,KAAK,EAAE,CAAC;gBACtB,OAAO,SAAS,CAAC,KAAe,CAAC;YACrC,CAAC;YAAC,OAAM,GAAG,EAAC,CAAC;gBACT,MAAM,IAAI,KAAK,CAAC,2CAA2C,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7F,CAAC;QACL,CAAC;;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-umd/manifesto.js b/dist-umd/manifesto.js index 0c03709e..ba6b9c8e 100644 --- a/dist-umd/manifesto.js +++ b/dist-umd/manifesto.js @@ -1,2 +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"];\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 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 /**\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 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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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 +!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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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-var/manifesto.js b/dist-var/manifesto.js index 642d524c..86ea5117 100644 --- a/dist-var/manifesto.js +++ b/dist-var/manifesto.js @@ -1,2 +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"];\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 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 /**\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 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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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 +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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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/docs/assets/search.js b/docs/assets/search.js index 44a74116..2156e293 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE7W925LbOLKw+y7lW/89Is7sO08f/vaKPm23Z1bs3THhoEt0mcsqqUZSud0zMe++g4BAAclMHEitq662QGSSAPPwAQn+++54+ON09/Xv/777NOy3d18r8fJu3z32d1/f7Q7d9qduP3zoT+e7l3fPx93d13cfnvf35+GwP/0l/Pmrj+fH3d3Lu/tddzr1p7uv7+7+8xLp8qk7nvpEn9HvyU4bZqZe/+u3X37+8ds3/enwfLzvp24v1/0l/jnZq2zY1Ov9YX86H5/vz4djSZcv4vZB9y/H2+7357mmwe1smAgln/sv51Kpl7ZrJA7bImG22Ro57979z+mw35VJCxpXymQbcZ0dD/351+PhqT+e/ywSG7e/keRXp1/e/09/Xzam+HW1zz14Qd4eu/3pw+H4OBM//XKT1yLureiNuKpGTc1TqfYv4qaL5b05nLtzXyF1fsFi2b/dd7sa0bP2657yru7G0WsWakAZvfmcmtm782n7f4bT/xn2H/vjcO63dXc+N0bwPre3k0YaQCATtX21kovNIBBOWcBbySeNIa0HagerRyIwiT7IIKMG2OAmBhLttMhOzvQlJlj/5dwf992u7r5eIJet0+PwZCO6QvHX1tVS4SR7/fr1977Z2z+fSh8AfuVqbX7s3ve7chV889Vyv+0/dM+7WvHgqtVa/NSfu2137so1CK5YLf1Nv9/2x2H/UC4+vOR28kvfAnjNDTT45/Nw7Le/jfHJ43h5hSLzS1fr81t//DwU26ToglvJrhiL4IrV0t9+fH58v++GipcxvGSd/OH0ar8fY9ThsC+UDy5ZK/+bbv+5K330QfPVcg+7XX9fdd/RJWvlz1BHTnpwwVrZb7r9Q+mrdm29Vupv9/2+XKpvvVpq/8/nfl9sWaIL1sU5VNpCRnpV2UupFkgSQ9x5eUZRKptMaXANqjObCitLJjikka3OcxZoQ6Y7Wa2qs57UmAXJD5kc3DTZqU9ystN8v+2/ZOT4NsUS4LB9fzg+dvPBmg3S1G6xJN9k7hiRcOzadLE8NB2axx2p1KdAyn8P2/PHvBjfbLGcH/rh4WPBOE3tFkv6qftSeFNByzXSSm8tbLrsjcriggpMkDJMS3FBHhNUSq3GBXWYYKU2eL5egAlWyk3ignJMsFILEheUYYKV0mlcUIgJbiW/yB2gmGC1BjlcUIkJVupD4YIiTHAb2QVjgWKCldJpXFCICdbIT+KCQkywTj6BCwowwUq5NC4oxATr5JO4oAgTrJON44I8JlgnFccFeUywUiqFC4owwZo4h8IF6zDBAjywGAssxgErMcCa9H992n+LdP92aX4mvQ8j1JkW4Y83SfNnHRal+pGOxFTaujjz7bEvuI0XcevlUnHIMJeXBg1Fkk4/HrptP39VEGHXpsvlucYJJzeXi1yyVj6eZFCi02uRhFT4ar46n4/D++fCe55dsEr2t/3p/jg8lcuOL1gl+4fDY//UIW4dFRy0XiU1m1Kj0otX3wu1+PHwcCiTfGm5Ttpw3+9Phbd6bbxK5s/d52+7c6HMa+NVMt/043avEosVNV4l87e+f7U7FQ7mtfEqmW+P3f2nYf9QaqyQS1ZajRrXN7tg5RjnMAAx2qU7Bkr0SCZjmH9c7qNKkzBMana9tkTmuJO+QNql2XL/m4W9c5mLgW+JPhT0natRC35LrXb5210HO+ve8go1FqHXQm1I/IpqUo1gi60PhWEJq1OLYmv1KJmfy5Bssf/DMSjh/+pQaJ0Ohc+iGomWemUSi+IeuRqNlnmIBB7FfMQCRFroIXFMinrHOlRaJh9Hhpj4OmxYJh1Hh5j0OnxYKJ1CiKgCtRixxHtSKBHlMVU4sYhdFFGLcrxXIpNEi3PJ1Xix0AKRiBE1QNWYsVILEjUmtanGjdTYBMjxt6f+fvgw3JOhJWxwE/SIdlqEH2f6kojuar3/etjOxx1XAblsrR7LnvAL9MJqXWbhQI0KYfv1kvsxyyueC/EV9dIVa8R1FCqFr5I8BxJEVR554/mivPI7rxW/SnZd0oorsDhxLdWLSl5xdWoT2IqZkcWt5ARZvJOpQjs8tyVVqktsK/RIptqkOovS7QqtyJSb1Kg67a7Qhk69SXXq0+8l+pS+ZcvS8CqNcmg0odjSnVJV3hFHBQnnWIcL6nWpGLtqbFDjP0l0QPvPanxQqk8SIeQjyv8FfQiUQOlSiRMq9KChP6lL/U6scn3IxQBKm+qdWeW64LiFUqQOuZRrgWMXMvmoQi8VWlD4hVSkFsGUxoEUhiFz0yoUU5wfzqEI8STKkUipbBLL4BpUo5kKK0/iGdLIVyOaBdqQmCarVTWqSY1ZgGsyUCP++SaoBumyCNQATZdiGkx8MaQp1SGLaHAtigENqUdhCRsmPl/IViwVTT4JmckdPsUS8aosQmS6MKtYJlGbRQjNlGeVzqyfDlskbcWnk2+7TuKPxXd5bbtO4jfdY3+cZ8K4yKnxGplZtITJXgyWynSisBKmSi1UKp7jWaREzPbFQKlYM5zfEOrUYZtiHZIoiVBlEUgq1ojESIQ21RCpWBMaIRGq1AOkel3K3qZl8KhCmxw6IpVaCo6KdaOwEaFRLTSq1aN4vKqBUXksQ+IiKqCphkVluiRRUS6qvbkuBCaifHQVJCrWgUZEhB71gKhUFxIPEaFZLRwq1QNHQ7gSdWCoVAMcCxEJTxUUKtaAQkKEErVAqCx+o3AQkf9WwaDCSHoOYtAnUA5gyuSSGAiTXg2Bii03iYAIw10NgKo1IfFPRqNq+EOPU4B+8MTO/utNQM+1pyK+49Qh9x0Mp1eP74exDiyj9otZy4Xyvh2Ozll0uwKZSOtCuWCyfHPYpR9m0GaZhNf7c78/DcibEUsJ25VJqkNx8ZjRBC410zMaZEFcpEOSv9VoUYjh4seN0Lc1MtF0PZZYlZnn5OEILhY4J29rJBIALhaJcLcV8wnHb9EkmlO3FfIKDM/c2qyQR6C3SCBC3BZLzIK3QPJi3pbUgMJsgeBaupa1vzmoBszwUpaW0wPnVrHwOk6Vk5gEZrHgRZwsJ5/EY7HsaiqWk0vDsFhwPQMrlpyc4cuIV152DnRBFZbyrZwmFNaK5dfSrEKpuSdfza6ynp9EVsD9V5OqpOQkoCJivVtJJnAU8FtVFConkYZPsdR65pSRTKKmOAypJUwZqThYikTW8aSMPBwjxeF6FT3KyaOgUSyylhUlYw8KEcWZcxUZSsd3cyQT3l05g0lKIfFPIKua+uRsHgl7YpNXzXhK5ZJoB5dfTXRmTzwAOUTQ7v75Jign6KqI5Vw0SsCVX/vj6Wm0i5/7vPov8PalsmEyPvS77S8f/j70fySFzpouu9dScctkzc66OXx6NZ+E4LamVsvuqEBIrYQ6cBRPjYXkKKdDFh3FWixmR/n5isMjOFXr6FFWKpqYAplV2WhWIg6QgMg6gpSVSSAkILSSIeVmFg6R4ulUR5FyEnGMFEus40g5iUVGvZIkpWVmUVIoezFLSutAwaRQdC1Nys7hLE4Cs3kxT8p7H5TrQOdTRXSyMpNICYhexJSyGpBQCUivpkpZyTRWAqLruVK57PRsX0aWCqTn0NJMiaVsKasLBZeABrV0qVRu9vlX86V8bEACJhggVBOmtOwkYqKiwpvJJiAT9GlVlCkrk8ZMQG49Z8rJJkETCFVqSVNOLo6aYqF1rCknEYdNIMCvok1ZiRRuAkJreVM6PqGAE8jvq4hTJhKcY6DoDssJUFoOCZ1CadXUKWsJSewEDGE1dyqWTIInQoNq8jR/7mT52K/d8dTnKr5coySWiu71r8/Dbvv98fD4X6fsRs+g7xfwOpxEoDewtqgtVKO+tG2mBP7AEzrcuE5vyY0kZm6mLG+asYWVeDSnKhK0QEp4P0/jYP31sB360zjXXp/7x9OPQ3IfsJObuHD2Xj4dh8/uyOZazX4b9g+7/pythQx0gpfcRpvLePJvS0fetlwxy346nEc1C16UF7D1Cqm/FEn7ZaWUt93xoc9PsbDl8reoUNgiSbOsLlt+FyR0xTWyOZL94+G+bKLMmldIXlpveLNaw+V1hmtrDG9TX3jL2sIVdYWrawrX1xPeqpZwXR3hLWoIV9YP3qR2cG3d4G1qBm9UL3jTWsFVdYI3qBFcVx94i9rAlXWBN6kJXFkPeJNawBV1gKtrAFfW/92k9m9V3d8Nav6W1/utrfVbXue3tsZvVX3fDWr7ltf1ra3pW1TPt6KWb0Ud3+oavnX1e7eo3btN3d4ta/ay6CcDGMafb4yApi4rMZDVdHHicZWKJR/1EneZwPoqb5f8dFOZNPKjfpjA7Gf9SJkrUqqr+JrPrhVrkstjIvHpj2UVy/R3UDatwAVrZKOfbkKnVurjTWUzK++Covd1oRtKzu3CWb3EJaTkFrikq/QVbikzywpcUzTJVrinQk0KXBSq0Qo3BccJdVW/Yh+djH++sauauqx0VVbThFkdAX2R2KBxpcyljPAq+wacMKVT3mVfVVnOC3MjUe7g4kFZzw0zmuUcXqTOUmqX0aGQIUaqrOSIGY0KWGKkzQqemNGkhClGqqzhiqW6FBuVVXwxq005YwRKreeMGd3yrDHSaDlvLNOjeLxWcMeMJiXsMVJlDX9M6VLIIK+6rOSQaV2yLDLUYzGPzOhQwiQjPdZwybQuBWwy1GQFn0zrkWOUoRJLOWVagxyrDDVYyiszGuSZZaTEcm6Zit/yiWMUPS9MHFMaJBPH4AksSdpScgsSx6v0FYljxnIXJI6R4V6ROBZqUpA4ohqtSBzhOEWlrKgJd/98o1LWqavCUlarETGtjqO5Sur7YmpS2P/sPLBuf9gP993u9WP30P/tOCSlERcslP1T9+Xb4XE8BAyvaorkwsZL73e0O2hBR3yXU7OFcr59PuJxCxAUtFsoyY5D9vFNrZZK2W/7L1khl0YLZfxy/tgfCwcItF0okSoKjUSlD/TPyiCLQCMhmQP8s1LGwu5h//DDkH90cdNSeaDEfpxONA0PJc6aLpN4vPRwNfQZw4i2X/J05z1VCl4o97D//tg9EOVnV3lRs4WjOQwfXleMKNZ8xTy6pLKvtwUTKWq7TGZnj3p4Mw5NUl7cbon/HrJGc5hZzHSxRMYKkMX8kQGoLubPSC2bNeRq2CrZRElyJLayDDkftRS5jaDd7SSXOZOw4ULZtcXvV/krit9TOtDF74EprC5+z0U9+eL3OABaXvye0YSqQI/E15ae52LYdPF7HMcuK37PzXi6+D2e8PXF71mbRhe/A5tWX/xeKrvAoC4ofs9Kzxe/AyWWF79ndKGL3yMN6ovfy+Rmn/+C4vecP0sUv8dObUHxe0p2pvg9CFmWFb+nZefJzJLi94zMVPF7JHdJ8XtadqL4PZS8oPg9LZcqfg+F1ha/pyVSxe+hxNri94xEuvg9Elpf/J6KT+ji94gIVha/J7MLrBw9uMOaQvSUnETx+1XaguL3jCVMFL9HhnBB8Xuh5ETxO6rBguJ3+NxDWJ0wT9NPt4HWcXdl4PqqHTU90S1NUNaQ3MuUl/LufmqSFwYazwYJqT0u0ODxYqQL5IdNF0ufI+3yJzBrXvHc5+lo6X2DxitkXhv99U8CSafu+HrRDe67QoP5JSvkvz2cu13loCPXrNWgavhnV6yVjm+YpCSnd0wWSb1Q8+lDPCWykWtWaPDX/mP3eSiw33Hb9feMLyqQt5teWCiRe4EJb489EsTN5cbNl8p9Z8+nKJ/V8/a3seiu35r3G7viNr5tWzEQW2IUkgFQPoooMrGVGD0vlSqumQnGCmvWyXZNy6O/F8gFt9WFAICoGpUAsMQavDqfj8P751KjGze/oR7f9qf74/BUqkfc/IZ6/HB47J+wwgdEiaDtDTXIY/G5JsvReIlGPx4ekMW8uRaXdreUPNz3+1PRI7g2vaH8n7vP3zq7npV/bXpD+W/6XXcusJRR0xvK/63vX+1ORYN/bXpD+W+P3f2nYf9QZiSRC246Fll0j43KYnyf1SkNWWe+9FY+rBi2zjSoB65Z+WjpJpQ8K9tc57fzC7ZA/vJF26wu5MItUKF68bbIOpe+lf8Lb2N6+ZRMY/4XNKGXURFUUb2UWmaZyOVUzCJVL6lW6VDEDZYsrZb5K2JJE/NXlcuaFfKLnkH98maRx6SXOBFvWb/MWeARUkudM5+wZLmzxDMSS55zr1i57Fkgm1gGnImuXAoskEwsB84kVy4JlkgmlwXnwquXBrNekFwenK+91C0R5llGAcW4ZexBLxdCbFW9ZFhiXehlw7lxqV86rNGAXj6kNalfQkTHI1hGJAsR/A83WUKMOitaQJz0IqbR6dwd548uluPbLJPQ7+dzNO7ftSjufRZ89vsHZJ9oLCNsVy5JqknQ61f39/3p9Pbwqb8O8rA/98cP3X1/+kv4e3Kso4fTVXb6Ir4Av5NIVWpUjsdgfiVF+qYrhWFcLy+XwnvVKnx5Go796XWp7KD5cqHn8ceI3CWFhs2rhEbz9LtLjhmVDnwbpiWhEmTr8jn8R7RNu7zzF38kK34SN0Io8jHetV2hycd0WVC9KveuZGp2KHWFTvMuylzVgufWnS4piH/bCNOQe4p4P/9bagcRV4WSFUHYApWiZbQarapW1uoVezoePgw73A5lVLteekPlUIs1w2iYlr5RhY99Pn989evrv/fHU+5VjDp/MbswYx0m/ROK/HDYbYf9Q3SiVpkm8ZUrVbnfDfef3n48Hp4fPkJUklcHv3qlStuci4p1mMGzxULDauwyualy7GLRdASGC86EYcViL+3qR31+Zb0qM3hbN+jXK1aKrnZ5sR5ZT7doaAriF6BGYdiSE5x3W7HcubdaNAjDyYWzY335cUyw0w4d6IBdvPY5nN70p6fD/tT/0O23tfrMr12pzqfhcPpU/56Cy1YqsTs8DPt6JcBl65U4PM+YfpEW0XUr1YBrbHkFckceF4s+9qfzcbg/99v6p4Bdu1Kd07k7P9c8iOmClYJtjlz/CMBlK5XIZ7yx9MJEF7OXqTi52HnW5fM1uWtd2pq865tmqAuS08XKZfLQbAq6XHCx204lmovFl+SUZelkjQrJN+KXCgN9aVuZRz4NNXlkKOPF7PrCB+BvingGfi/NIXXzsFH5XW+x7RXZrl9sqV0W0a3OdK+e6bj0zCwvFbs73HfEBMflThesFLwHuw3zkvfIpsNFop/602l4HE7n4T4KsCt0SXSxUjl/6E+FMsElC4QHK3x2Kv+92z33v3bDfGku/vkmq31Il0VrfkBTanKjG6YwmenvaJRJ+zw2KJLmW66R5q1P/P6mpMIr1kifzdKU4Oz8JGVGubStTSkS6FuukUZu+cMEZr8LUibzVCPzdBuZY7VV8cQNGt9C5nzPUkoonVoVP93yOz0tvtPYoO4fnruH/qfuCZE6/ZY0paWjFfdWMlRX3RaMEyEuNUiYvOhpjZZp+Fe/JW4x+rn8mVlr8HdW3OkLcAFxO7GyC1wfIrnI9VGC471ThDdChL7LuKMyeTvCEWECMzFkocSMB8QEF7pASj44/q/8ES98wkBexSNe+oSjF6fblr+JL4LGtaMamAC/ew2XG/1aaQAKOsvEDbFu9S88IrDkfafE1rwMiOjCd4GSPtsM/jycu/e7vlwB7KLZ8jtSa1ykEenrEUWyrr70GRRLzPrmKolz75wQSftncp4FrydZ/+R/uElSGHVW9I5MelXVfsdy0kAlJ+Fdt9u9wQ9Zj8VEDUvme/be0PMrwL0lT63I3tv58FR2b2HDhfc22wN9OJ37I1HiEIufty6+31ml+P394fGp2/857B9KZaPXLNaAPKNjJjd7QkeBtNQ5GTOBJadk5GS+sweqFE4r0PZGM6tUPCm99n5tF3/98/V8s/j8fsO2t7hfd7JH2eOOm97oab8qtI+g6eIZXfqwyWe9TN6vHbJPn5J4abxYpq8uKnimYdPV8qjzqkipudOqit7W87gvq/iGZ+0XS/ZN0PMpZnJB62VSh9NPz7vzQBaaAe8+a71U6q/dw7B/+G4/BuW5F2feevETzp6INXvKxedhlUtHz6aiBCdPpsrHilMd6OsthgZhxDhrXn6v4IMFVYJXyC0++ymWuOTkp2x8TJ3ABKdz5flLObmuYeLUilg+0vyWeuDrCpgKdacGlHj+xKlLc9+/4MyloviWPnEJiW/rz1sq0IE8bWmmQPVZSwXSsyctzbRYfM5SgTboKUszDarOWCqRSpywNBdceb5SgWzqdKWZ7NqzlUpiU+JkpXlcWnmuUlHMiJ+qhMSKdWcqlcSMyROV5iHjovOUip5/7jQlZCSWnqWUj/KKfdKic5QKYtsiirjkDKWcbPQEpVhq1flJOd+bPT0plr347KScHtTJSbH42nOTSixu2Zt38zcueWISBbRurgV5WtI8a6w9K6nI6lAnJSHWpvacpBr5Bdn6gjOSinwPfkIS4nvqzkcql12EZirPRirxfOTJSHOvV30uUt7CJ05FgjZ+wZlIBR6uBNlXn4eUl4ufhgTF1p2FlJeKn4QEpdadg1QgtRROVZ+BlPNm1AlIs3XDqvOPshwhSxBuFzeQJx8BMlR77lHJeht16tF8ra32zKMK6eSJR6QW1ecdIdrMF7qjTLnfPz9eNRh/StcYXCsYvvvp17f/b66fF75VmrJZlVApP736+W+/ffPm9a9vs6Kipovl/fLzL//3zatff8iLC1rWSQv3Bh2G/fm3fsxHsN014a832YYw77Fsv06kJgkla+/mxfySOvlzBHOPe2hEdtx8xX1Tpht/1lX2u+y5z00q9qjLLWqRVNKcI7KrbXrpeJOGHR/vauteqwdp4tP6VNt5coQC04LHbfZfb2JKrj0VmRCnDjWZjvgyeiDj2mT2iJDF+6S0exsip8UFbRbcD75/Keg+vXkp2bdrlRvdF3GzRXKQVf9IQGKhP9nz+dj3Px+2SfWDNmUSZt/CsgOIfTU9kALaLZNEniEZCwqaLZNDbDWJpWQ2meRkkDu0YinZ7Vk5OdnV8Vhe8dJ4oVx0XRwVmVwUz0lDV4djMckNZ8n+T0/d/vR2eExKCBstkOG2Tb0teF9nLVdb6SxnDqQvhsxJDSjCHAiuxcu5GZNd0Yxnz+LlzJweOGSOhdeh5awVTdFtYEmXoO2cfJJrx7KroXbWqpNEGxj2apxdLDnrU+pBdl52bvUQqrB06TCnCcXTY/m1ML1Qau7JV2P0rEciGTpwS9UAPSk5Sc/DsHgJOs9IJrh5JLUSmuck0mvRsdT6heiMZHIVOpJbvQSdkZrNRWqXBzLy8LWBSF7dwkBOHrUqEIusXRJI56gEVIqz7iqYlM5Y5yAnvLtydJPO8yloFEaStbAoZ/NISBSbvGo4VCqXhEK4/GoYNHviIQSiowv/y21gUNRbGRCaVKMf4feH42OHPLhYWtiwXFZlshGLXJ5w5DQhk45YgerEo+Bp55OP2XNfnoAU6EPkAjMlKhOBAsnpZGSmwLKEpEAPOimZ6VCfmBTILzUfCxOUGg2yb8TCRKVIh2yygqiyOGEp0IhMWmZ6VCcu5dJLRqQ+gSmQn0hiZgosSGRyGqSTmViDZQlNXgMqqYHSaxObAsmJ5GYmfUGCk9eATnKg/PpEJy+dSHag6MqEJy+XSHqg3MrEp0AumfzMRFcnQLlYiEyCZtFmXSKUk4slQ+BuK9KTnDQ6KYpl1idGBbaUTo5mprQ+QaqQTydJpB71iRI2EkGyhL9i9l9vkiRdeypKkJw6iRVOd2RzSkzUqlBKXF1ZIKRaAqylmzwkWtoe386s8TKZf+3uPz0cD8/77TeHXXqo0NZlUutSzEDm4vQyqQGVWgaCa9PK3HPOppTxg16cTub0wDO5WHhd+paTmEwhY8GL0secfDJ1jGVXp405uXTKGAuuTxeLJSdn+LI0MS87lyJCFZamhzlNqNQwll+bFhZKzT356nQwJ5dOBWPB9WlgUnIyBQwkL0r/MpKJ1C+SWpn25STSKV8stT7dy0gmU71IbnWal5GKp3iRyLr0LiMvF3dWp3U5eVRKF4usTeeSsQeVysUxcVUal5SHpHDh3ZUnUUkpZOoWyKpO23I2j0zZYpNXna6VyiVTNVx+dZo2e+JhikZO3csPt0nUws7KcjWvV9WG4FhOek9wTsK7s3dxOTlxy9mYIPv0ENn4dlssAIhkxy2L7xSXhqeLuLx0tlghET0kjBaaPCKsWK7tpuZ2wwtuI5tIZJLi02f5F2jwY3e69Fgofn7BKtnjV1sLRxw2Xyz35/5LjVzYfLHcsZPt6/0WD+OhWNB6udRj/7nibmHzxXKtkym4z6ndcknn7hi+FgUy51cslm4Tn4L7nNqtk1Tif2DbWzzZqoe66i7HIxjLnR1svlhutmBiJrq4ZqJcOlo2QQlOVk7kZPoU1s7/X57Pv3wgkrI4giKvWqrF98PxVDbFYNulEq8eLCswarpUnj1ms1Bg3HapxPSBnFBm2YGceanRm/jd5z73BuFXLIvN8+g/Er2c/mf0IBcAIvHVawB5+5FfBoBGZPlKQElkVxhLVvH4vNz0kgAUv2xVIK8FvTAANahfG8hLTywPQPELVggq5Bc47yXrBCUaZJcK5oosXi0oiKKoBYNZBFW7ZlAsuyR8q145qIhYKwLWm8lPLyEAV7RkFaEwwioMqW4pN7GcAGUvWFHIRzzkogIMd6rXFbKyy6LYytWFrFRigQFIrVxjyEstYrWLVhoycQ652AC5bt16Q47xZoPZijWAHO0lFx5i1Fu99lBCbKjlhzmsqV2BKJdOL0JQWtSvQyBjECxFfNuf+uPQ7YZTP19BCH9MLklE94d/1G3WV+abbpFiKUn/dUJMMCHt0nalxITpJ+QSHmCl9LnXy4qnM95i+aTjIYSj/meV5OL7Di9YKfv1uX8sFXtpewOJxXf6OrnqRsgsXUicyyxZTCSExuugVNBu//1Gq6DXvgoXQZ1SSev9YUA+pRiJitotlfTNYf9hOD5SuXYsDjReKjP1QQYokvoeQ53E77th93zsawSjl6yU/0PfbREnSIieWi+VWihutZxLi7I5BBovlfl6/+Hwt+OQFXdtVyqplkgG8lYAyaQWNI8MhNfjyOwzztNI8LCXw8icLmWTqxYC5i1VkkRCU7UIROZ0SHDIWP4CDJmTnaKQsfAlELJYembmL0WQefl5AgnVWA4gC61sqYG9veT8KCyAjznZKfYYC1+CHpPSM+QxkL4QPGakk9wxklyNHXNSU9QxlrwEOmakJ5hjJHsBcsxIpohjJLYWOGZkUrwxklmLG3MyadoYi62HjckYhmaNcfZUiRqTMlHSGN5lDfBLSkpwxkDeAsxYkClSlHGWKtZCxlLZCcaI67AAMc6efpjkD/9CpvPwrxul976jstx+1IWYJH8MW+So4Gv//vf6nj/2w8NH5PlPXU8NivoOHu25Oz+fvgkPNXXn/F9/SD7k4IsBr/729odf3rz+/169ff3Lz+++f/X6x+++TXf6griEuIerqqj8739589fX33773c8ZoWG7ZZJe//z2uzc/v/rx3W/fvfn7d2/efffmzS9vMlKpa5Zp8Oa7396+ef3N2+wTjhrWyApePxt4zeae/debvIDXnoreQKcO8aKgiVQgYJY/Ffc8oHtWg66H5BbVZN/PCOgIen5O8I1kvzs0rw163iUpTbJv3NgFfaetXbJvwtwFnWfsXbL3z8NpeI/A16D7a5NF/dObRCMZ+e2hMznwtUQzp+mX272eU2/lr6hVrf5lukqav1CpEAKTWXiMHpCLH6O3VrbnZvOEby4+bHs7DVDENxdeBfZK5P43bSkiwf89MxhrJf+QsCOR6B/m5mSt7J+6L6U3HjS9qfzi2w/bLtegDqwDLRaj9awmFFwHCtTi9ZIxyAL2+VAsRuwl+uCce65EHeIukZwE7XMFFqH2oreCgu3IS1GL28u8AAXcMS9Qi9yrNChzRNXYvUyHHHjHVFmK3ks0ouD7XI9a/F4hvWREqhF8UWRQGEouw/BZDZIgHgaFS1B8gQYEjJ9Jr8TxJZJpID+XXo/kCzQgofxMfjWWL5COg/mZ6Do0XyAXh/MzuXV4vkQuBejnomsRfTYWoiD9PMerwvT5fG8OzuHdlkPzrDQS1gOZ1bi+xJaSwH5uSquRfY18EtrTelRje3QkQkRx7PanXXfu7R8fDsf5Bsh5k9tAC7zbMnox1zrhOi+NUfNNKDG7bIEe4Iuz1Q/4RXxN4XhXaPRmdNL1A/8Cu/L22v123+0WKTe78Pa6LX9rXhAX31pH0o3Qb12dPyl/WoiRp55NhZ0vlk+7GkKLep9TY41o50ObonovtEQj2h3lNav3S8nxgw5q/P3XcQs84Uauv5dXsPz1edhtvz8eHtHaEqzbF/CShFMINF7oGqHwYr+Iio4fKfGRTP/Djfx70Fmh9he9qlYOIzHpxcNM//vDFkvwIwG+zTIJJ/sdbOQoiVhI0GyZnP7LU7ffZuUEzZbJQW17KGFY3jexMhp1n1kczY139/lbd3xccsSnVsukuIb59+1F1LBYVmTTuu22QNC11TIpaSASjz/FQ+rk0fgDSMvWoeVlEbADCEqf1oNImZvfaLnB7Q0Jfyrd1PPNLz/++N034/acXGcvoqZpza1yqLyfXv38+vvvfnublRY0XCrrzauf/+93WUG+VZ2UwCH+7YwdBWb/tTyesOsR26FDV5Gufb0A7XClnUaJZavH7qH/f5673YBEkrEw0HShvH3/pbs//3gYc6ucQNB2mUR7+XDqt3/vds85kbPGi2Tu+6MNSN18eb1NTYkXePMFcvfjRoZR+dzEgQ3XyPrbce5aMVGu3RpJ278dd6efuvP9fJkdExg1XyB3ONn5TlVvBiJnLZdLu6z45AYQbb1I6o/95363Kb9TtP1yyU2lZNh+uWRWKRm2XyA5XQ8fiCwrhE/Kuv/Y339yuz1TkuJmC+TsDt225JZAu4WSvgMbR06vns8fm5xc8qobabFIiRU6bA/jxd987IZ50BxIjZstkNOdz/3j07RB7b+H88e3h0/IIYKB0MQ1txzzTbto0O1lNxz1ejXWaHF/7Ltz/93xiDCS8J2Omi2WM2p6OA7/susWYxV7vy0UnbhysTZv+tP5OIwoo1CJ+QWLZb/euzEc3W1/LJSPX7TkLbw8zaSTChstkHH6ePhjHDWrdIen44E0vPkM1yKH6udidWprThykY9tyaqT4lxE9XD4WBZoukHc+dp/746l/td9+P/6akDdvuuz+yC1G6GNc6PnHhc3+8elw7HbfHB6fDntsa1csEGtfJrkUFYevYQEnhmKir8hn1jTB7zch3VifZd+VB8om5j75EV9MdnxBrezidWtU9pJF62JdlozuiuXqYr0ya9WEWgsXqutGLr1KnRrCZUvUhdqR38sl3qW6r+YWPqG5WcefR/lScKFk+ju6mPz6r+kW2xX6m7qEXan/sm61LvT3dTM61X9llx6t6Fu7yZc7/vkmDgXpsvAzvJGmiVADxbiY2KBxpcxiN4KJXeJFSjXJORFcn6U+pFSr+lm23INUjVnagSQGb5n/KNON/kYf+uZUfqyv6OkgB01gz6LipIkiuYnv+M2lL/igX6EFSXzZDzUiCz7xV6lJ4lt/SY0WfPSPGqfAaeDf6rb/Wr6k+OF4ePzmt98S3by4NsHNs9Oj3gUFIko8DxQTV1ujK3iBhM/JVTvYN/js+xHZ5hL0fUxsb8n0/HDsEWwa9O0bLOr9feahvF/xTDKTpmbCqMDodo/9sXvTj5uiP/ezlPTD894dP/wXvGFy3gdidmOZa4EUtB0m5B8vL9XsX//7biQ1Y3df37Gv+Fcj0v0w9Lvt6e7r3538l3f3h0dbvPaPy29/78epP7ZwTf6yuXv5++albL9SovnHP17+7q+wP9h/sM2au5e/Ny+l+oppFTVrombs7uXv7KUSX2nRRs1Y1Izfvfydv+TsKxl3xqNW4u7l7+IlV1+JRkfNRNRM3r38Xb7k8iu+kVEzGTVTdy9/V1hvKmqm717+rrFmOmpm7l7+brBmJmrW3r38vcWebhs/3Q3xQBowCnYYNi8l/0orHreMB6IZH3jToC3jsWjGh94wtGU8Hs343BuOtoyHpJHU0DXxoDSKGrwmHpZGU8PXxAPTGGoAm3hompYawiYeHDaOQSPQWR0PD2uIYWTgLbGDI1/y9ivFQMt4cJgdHPWSm69Au3homB0aPfYYzzMWDwwbH39jkP7icWHj029aVMN4YNj4+NkGbRmPDBufP2vQlvHQsHEAGENbxmPDxwFgHGvJ47Hh4xAwMX9CPB4bbk2YRNoBEzYOAFOo5Hhs+DgETKMt49Hh4yAwg7aMx4ePg8BaRMt4dPg4BHyDtIvHho8DwBukXTwyfHz8HB0ZHo+MsCYNHRkRj4xoSDsfD41glLEQ8dgIThkLATyMoIyFiEdGSMpYiHhgxPj8ucA8pYiHRmjCWIh4aIQdGvlSiK+4iRvGYyPs2KiXwnylJHg+8dhIOzYaM+QyHhtpLZp5KTdfbUyspowHR45DwFu0ZTw6chwDsUFbxsMjbQSAhh0SxADW4TC0ZTxAUpG2V8YDJDVhe2U8QNIQtlfG4yNbwvbKeHTUhrS9Kh4d1ZC2V8Wjoxhpe1U8OoqTtlfFo6MEaXtVPDpKErZXgRBNEbZXxSOjNGl7VTw2ypC2V8Wjo1rS9qp4fPSGsL06Hh3dELZXx2OjGWF7dTwympO2V8cjowVpe3U8MpoM1HQ8NJoM1DSIn8lATcdDo8lATccjo8lATccDY8bnLzgWqJl4aAwVqJl4aMw4AgK15iYeHMMpK23isTHWpknM9pp4bIwdG4UKjwfHjEMgNNoyHh0zjoEwaEuQ4IyDIFpUz3h8zDgKcoP2GQ9QuyEsZRsPTzuOgkTtfhsPUGtDAtTut/EAteMwSI62jEeoHYdBooPexiPU2tRToi3jEWrt64OOZRuPUDsOg0THso1HqDWk/W1BFtoSFquFaeiGMFnul7ClHSKD5oIbkIpu6HTH/Ra2pRIe90vYUhDu1P0StpSkQ3W/hW0V6VLdb2FbTTpV91vY1pBu1f0Wtm0Jd+l+CVpaPIA5zGYGDhrSZTYQHVhAgDvNBsIDiwhwt9lAfGAhAeboGogPLCXAXV0DCYIFBbizayBEsKwA5xIQI1hagJMJCBIsL8DZBEAJjQUGOJ0ALKGxzADnEwyyHmsFW8zxNQAoNIxibw1ACo1FBwqHTQArNBYfKAI3gQGzAEGhlLABcKGxCEGhLr0BeKGxEEGhnKYBgKGxGEFJvC0YMwsSUIjXAMbQWJZAWDrAGRrLE1BLxyGg44TbbABpaDhpEwFpaHjCJgLW0PCETQS8oeEJmwiYQ8MTNhFwh8bSBdzZNYA8NJYvoPYTkIfGAgbUfgL00FjCQNhPQB8aCxkI+ykgUhW0/QQMorGoAXPjDYAQjaMQmB8HEKJxFAKzyQBDNI5D4KMFSETjUAQ+WoBFNJY4EKwYDJdFDrhNBjSiscwBt8kARzQWOuA2GfCIxlIH3CZLSMCtRVSohQFIorHgAbXJAEk0Fj0QNhlgicbiB8ImAzTRSJodNQBPNBZC4EyoAYCisRgCp0INQBSNBRE4F2oApGgsilBolNwATNFYGKHQnKcBoKKxQEK1eFu4dEGTpAYAi0ZRLKkBwKJRFE1qALBoFMWTGgAsGk0TpQZAi0bTTKkB4KLRNFVqALxoNM2VGoAvGk2TpQYAjEZTbKkBBKPRFF1qNFxrovlSAyhGo2nC1ACQ0WiaMTWAZTSGokwNYBmNoThTA2hGYyjS1ACa0RiaNTUAaDSGpk0NQBqNoRcGAdNoDL00CKBGY+jFQUA1GpNYHgSjZegFQsA1Gssv9AY19oBtNC3FnhrANhpLMHSD9woGzDIMjQfVgG80lmJoPKgGhKOxHEPjQTVgHI0lGYRzApSjsSyDcE6AczSWZhDOCZCOxhINwjkB2sEc7UCdEwO8g1mmgTsnBngHs0wDd04M8A5mqQbunBggHsxyDdw5McA8mGMe+BIzYB7Mcg10kRkQD2apBrrMDHgHs0wDXWgGtINZpkEsNQPewRzvwBebAfFgjnjgy82AeDBHPPAFZ0A8mCMeqLljgHgwyzUw58QA8WCWamDOiQHewSzTwJ0TA7yDWaiBOycGgAezVAN3TgwQD9ZQQJHBvROMIooM7p1wmycQ58RmuycY6ZwY3D/hcAc+WnAPBSM3HDG4jYKRm44Y3EnByI1HDG6lYOTmIwb3UjByAxKDmyksz9Ao62CAdTBObURiAHUwizM0mt8wgDqYBRpa423hhhfryAzeFgyYhRoa5V4MAA9moYZBXTQDwINx2pExADwYpx0ZA8CDcdqRMQA8GKcdGQPAg4mEIwPIg4mEIwPQg4mEIwPQg4mEIwPQg4mEIwPQg4mEIwPYgwnSkQHswQTpyAD2YIJ0ZAB6MJFwZAB6MJlwZIB6MJlwZAB7MJlwZIB7MJlwZAB8MEk6MsA9mCQdGaAeTCYcGeAeTCYcGeAeTCYcGeAeTJKODFAPpkhHBpgHU6QjA8SDqYQjA8SDqYQjA8SDKdqRAeDBFO3IAO9ginZkAHcwRTsywDuYoh0ZAB7MYg2D5kMMIA9msYZhGLVnAHkwTW7bBMCDWahh0MyJAeDBNLXQwgDuYBZpGHyDKcAdzEINgztzADyYxRoGd9EAeTCLNQzuogHyYBZrGNxFA+TB3OYN3EUD5MEs2GhxFw2gB7Noo8XnAsAezMKNFt+WDsAHs3CjxUcYgA9m4UaLjxsAH8wk3BggH8yQbgyAD2ZINwa4BzOkGwPYg5mEGwPcg7UJNwa4B2sTbgyQD9Ym3BggH6xNuDFAPlhLujHAPVhLujFAPVibcGOAerA24cYA9WBtwo0B6sHIDR4MMA9O7vDggHjwDeXGOOAdfEO7MQ54B9/QbowD3sE3pBvjAHfwDenGOKAdfEO6MQ5wB9+QbowD3sE3pBvjAHhwCzVa1IRzADw4WRjCAe7grjQEMRocwA5ugUarsIyFA9jBLdDAd6txADt4Q9UgcAA7eENVIXAAO7jb3IHuVOYAdnALNPAtSRzADm6BBj61AOvglmjgUwvADm6RBj61AO3glmngUwvgDm6RBj61AO3glmi0qBfngHZwizTQqQVgB7dEo0X9PQe0gzN6UYwD3MEZtSjGAe3gjFoU4wB2cEYtinFYOcLpRTEOa0c4vSjGYf0IpxfF+KyGhF4U47CKhNOLYhzWkXBqUYzDOhJOLYpxWEnC6UUxDqtJOL0oxmFFCacXxTgAHVxQi2IcYA4uqEUxDiAHF9SiGAeIgwt6UYwDxMEFvSjGAeLgglwU44BwcEEuinGAOLggF8U4YBxckItiHEAOLshFMQ4YB7cco0VDfw4YB5dUCsYB4eCWYjQbNEvgAHFwizGaDZomcMA4uCUZzQbNEzjAHNzCjGbDsQSTA9LBXc3JRuCNwbi5spMNHh8A1sFd7ckGzfE4gB3cFaBscPcAeAdXNFPkgHhwRTNFDpgHV278zEvZfKXhYAPowZUbP3wOAerBLdpoGnxmAO7BLdxoGnxmAPLB3U6PBp8ZgH1wt9WjQVNIDugHd7s98OJSDvgHdxs+GnxmAADCLeRACxI44B/c8Q8US3NAQLgrVsEDMkBAuCMgKMLmgIFwTZd6ccBAuKaLvThgIFwn4hHAQLgm4xFAQLgm4xHAP7gm4xFAP7hJxCOAfnCTiEcA/eAmEY8A+sFNIh4B9IObRDwC6Ac3ZDwC2Ac3ZDwC2Ac3iXgE0A9uEvEI4B/cJOIRwD94S8YjgH7wloxHAPvgLRmPAPLB20Q8AsgHbxPxCGAfvKXjEQA/eEvHI4B98JaORwD64C0djwDywVs6HgHoQ1jA0TQK88IC0A+xoQISAeiHcNUtDWoSBcAfwpW3NGguJQD/EK7CpUG9nwAERLgNHwz1fgIwEOF2fDDU+wlAQYTb9MFQ7ycABxFu3wdDvZ8AJES4rR8M9X4CoBBhgUfDUO8nAA0RjoYwNC4SAIgId1YGw0cQEBFxOS4DXegUAIkIh0TwYEcAKiIs+8ArvwTgIqJxA4hPDQBGhIUfDcenBiAjwpERvIAdoBFh+Qdemg7QiLD8AwdJArARYQEIXvgoABwRloDgpY8C0BFhCQhe/CgAHRFuLwha/igAHxFuMwhaACkAHxGOjyCRgwB0RFgGghdBCsBHhKUgeBmkAIREWA6CF0IKwEiE5SB4KaQAjERYDoIXQwrASITlIHg5pACMRHCa7wvASIRjJIg/FoCQCMtBMH8sACERloPgWFEARiIsB8GjTQEYibAcBIs2BSAkglMxpIBnbgg6hhTw1A1Bx5ACHrwh6BhSwLM3BB1DitnxG9R6jIDnbwhqPUbAAzgEvR4j4BEcgl6PEfAYDkGvxwh4Eoerf0FiOAEgiXBHceBPC0AS4SAJ/iYATCIsCcEPVQGQRFgOgh+rAhCJsBQEP1gFABJhGQh+tArAI8ISEOJwFTBgDo5wPHABcERY/oHGcICMCEdGOB7iADIi3PkcHA9xABoRFn80HA9xABsRjo1wPMQBbEQ4NsLxEAewEeHYyJi3I7EvYCPCsRGOB6mAjQjHRjgeiQA2IhwbEXgkAtiIcGxE4GMN2IhwbESgx5gJwEaEq4cR6ElmAtARYQnIeB4h9ugAHhEWgTQC94KAjwhNv3gAjwh3ogcaaQE6IiwBaQSe5gA8IhweESgSFICPCMdHxgAK6xmMnkMkAp8XgJIIR0kkPi8AKBEOlBCRESAlwriKXPzNBqhEGJZ4SwArEZaHNBI3AwCWCAtEGombAUBLhNsrQkwiAEyE2yxCzGXATITlIsRZUvDUKTt+ErdFgJkIt2dE4rYIQBPhTgGR+JwD3ES0bvxwWwTQiWjdQRP4nAP0RLTUSRMCsBNh+Uij8NkJ4ImwhKRRuNUC+ES0bqcPPjsBQBGtTpg4gFBE66JLfHYCiCLaNmHiAEaRDqPgs1MCjCI3ZMWuBBxFul0k2NyUgKJIR1FwEycBRZGOouDnAkhAUaSjKLiJk4CiyEvdDPqKSEBRpKMoeEGwBBRFbsgz3yRgKNIxFIXaLAkYinQMReG3BxiKvOwoQd8mCRiKtJgEP/dOAoQiHULBy+UkQCiyobYpSMBPpGUk+L4WCfiJdPxE40fLAX4iHT/Bi+sk4CfSMhLqQYCxs5Ck0WguLgFBke4YUuz4OMBPpGUkDV60JwFAke4sUo2/zoCgSHccqUYTdwkQirycSYrPTMBQpDuYFK/7kACiyAtEIXQGo+d2mVA6g9G7bDTB5zwgKfKy1wSfxwClSLKyRgKQIt0hIvg+ZwlIinSniBh8bgKUIt1BIgZdtJaApUh3lgjxigCcIt1xIoQVAkRFWmrS4BueJUAq0iEVfMezBExFOqZCvFAAq0hXYYOOCBg7h1WI5wa4ihRu+HBDD8CKFCzxjgCyIgVPTHuAVqQQiWkP6Ip0RTaGUAMMn6BOq5AAr0hBhpsS0BV5KbPB33+AV6SrtMGXXCQ861S6wcNfaXjcqcUoDb4HXcITT91WFHwTuoSHnsrEuoGE555amIIvBcjZyafuJB/cAsDDT91OFHx/u4TnnzrYgm9wl/AQVLcTBd/WKuFJqI63tPg7AniLvJyHiuYLEvAW6XgLvllRAt4iHW/BtyhJwFukOxgV33gkAW+R7mxUfOORBLxFuuNR8Y1HEvAW6c5I3eAjCHiLdAel4huPJOAt0vEWfBlMAt4iHW/BV7Yk4C3SnZiKb2mSgLfIywEk+NwAvEVq+oBOCXCL1PReZgl4i3TbUXDjCYCLdNtR8JcV8BZpkQq+BCUBbpGWqOBLUBLQFmmBCr4EJQFskQ62YOcVA9IiLUzBQYsEoEValoIvQUnAWaRFKfgSlASYRVqSgi9BSUBZpAUp+BKUBJBFWo6CL0FJwFik25SCgncJEIt021KQJSgJCIu0EAVbgpIAr0h3wiq6BCUBXZEXuoLqCuCKbKmaAQnIinRkBT27GoyXwyroEpQEYEW6chx0CUoCriJdQQ66BCUBVpGuJAddVJGAqkhXkoMsQUmAVKQryEGWoCTgKdKV46BLUBLgFGWJCXFCNaApyiIT4oxqgFPUhtpGpABNURt6G5ECMEVt6G1ECrAUtSG3ESlAUtSG3EakAEdRG3IbkQIURW3IbUQKUBS1IbcRKcBQ1OUMEjQcUYChKHcIyQYNRxRgKMqdQoLvdlUAoih3DAm+21UBiKLcOST4blcFOIpyh68i8b0CFEW5o0jwfbEKUBTlziLB98UqQFEUXZ+jAERRdH2OAghF0fU5CjAURdfnKEBQFF2fowA/UcwNGhqPKcBPFFmgowA8UczZRjS+UgCeKOYGDY2vFIAnysETPNNSAJ6oywde8DcDwBPlvvGC74RTAJ4o95mXBj2EVQF+olyxDr4TTgF+ohw/wSNkBfiJupTr4K8R4CfK8RM84VOAnyjHT/DYWwF+ohw/wWNvBfiJcmU7+O49BfiJupzIir+jgJ8oV7iD795TAKEoQYclChAUJaiwRAF8oi74BHFygJ0ox06QAEYBcKIcOME/vwG4iXK7UvAPcABsoty+FPwTHACcKLcvBXfJgJwoQR8DrwA4UYI6WVwBaqIkdbK4AshESfpkcQWIiZL0yeIKABMl6ZPFFeAlSlL7vhSgJUpS+74UQCXKHcqKBVCAkyiLQogACmAS5fak4KMFKImyIAR3gvCTMRaD4E4QfjPGQhDcCcKPxlgEgjtB+NUYC0BwJwg/G+PYCL6RV8EvxygyGJl9O0aRVSwKfj9G0fv0FPyCjKL26Sn4BRlFJdYKABGlqbUcBWiIcrtPcGsEYIhyx7Hi1gjAEOWOY8WtEYAhyh3His9vAEOUO44Vn98Ahih3ICtmjQAKUe5AVswaARCi3HGsxKeBwHi541hxawRQiHLHseLWCKAQ5apzMGsEQIhyB7Ji1ghgEOUOZMWsEYAgyh3Hio8WgCDKgg7CGgEIotxHZtA3HDAQZUkHbo0ABFEWdeDWCFAQZUkHbo0ABFEWdODWCDAQ5Y4lwSsFFMAgytXmYNYIYBDlMAheH6oAB1GOgzA8cAYgRDkQwvDAGZAQdSEheEoJUIhqE1YRwBDVklYRwBDVklYRoBC9oayiBiBEb2irqAEI0RvaKmqAQvSGtooaoBC9oa2iBihEb2irqAEL0RvKKmqAQvSGsooakBC9oa2iBihEb2irqAEL0Q1tFTVAIbqhrKIGHEQ3lFXUAILohrKKGhAQ3dBWUQMAohvaKmqAQHRDWkUNAIhuSKuoAf7QDWkVNcAfuiGtogb4QzPSKmqAP7RlHAwvGdIAgGhGWUUN+Id2+0dwnKAB/9DMFZii2bYGCEQ7BILv4NYAgWiHQPAd3BogEO0+cIvv4NYAgWiHQPAd3BogEO0QCL6DWwMEoi9fukV9hAYIRDsEgu/g1gCBaHdgCb6DWwMEoh0CwXdwa4BAtCvHwXdwa4BA9OXMEnwEAQLR7tgS/Ft/GiAQ7RCIwEcQIBDtEIjARxAgEO0QiMBHECAQffksDT6CgIFox0BwIKQBBtEicaaCBiREu/ocgc8NAEP0pUAHnxuAhuhLjQ4+NwAO0Q6HSHxuAB6iRWIdWwMgoh0Qwbd8a0BEtNtKgsY8GjAR7XaSIDGPBkxEu20kSMyjARHRklpY04CHaEkvrGnAQ7SkF9Y0ICJa0gtrGjARLemFNQ2oiHZHtuJeFFAR7Y5sxWIewES0O7AVi3kAEtGWexAxD2Ai2n1IF495ABTR7lO6eMwDqIh2e0awmAdAEW25BxrzACKiHRHBYh5ARLQjIvhoASKiLfUgYh5ARLQiF2c0QCJakYszGn5VV5OLMxp+WFeTizMafltXk4szGn5e1yERvKBDwy/sakHvNNTwI7sOiuDVHxp+aPfymRrcAc0+tutSANwBwQ/uupIcXGMwbg6N4DUaGrAR7dgIXqOhARzRDo7gNRoa8BFtyMgS8BHtTi7BazQ0QCTaUCtrGgAS7Q4uwas5NCAk2m0Twas5NGAk2tC7ezSAJNodX4IXc2iASbQ7vwSvd9AAlGh3gAlewqABKtEOleAlDBqgEu2OcFX4DAK0RDtagnthAEv0pRoH8ZiAlGhXioN5YYBJtKvDwbwwYCTaMRLcCwNGot2GEdwLA0qi3ZYR3AsDTmLclhHUrhtASozbMoLadQNIiXGkBPHCBnAS4zgJ4oUNoCTGURLUCxtASYyjJKgXNoCSGEdJUC9sACcxG2pLlgGcxGyoLVkGUBKzoSq8DWAkpqErvA1gJKahK7wNoCSmISu8DcAkpiELTQ3gJKYhK7wNwCSmISu8DaAkpiErvA2gJMZtE1GoMzGAk5iGqvA2AJOYJlEfbAAoMSxRH2wAKjEOleBlUgagEsPcAijqpgygJcbtFsE/AGYALTGOluBFSgbQEuNoCf4JMANoiXG0BC8nMoCWGAtE0BEBqMS4Uht8d6kBqMQw8qQZA0CJcaAE/96NAaDEWBaC14wZwEmM2ypCTCHASYwrtSGmEOAkxnES/GM6BnAS4zgJ/jUdAziJcZwEL6sygJMYTo4dgCSGk/WJBiAS46ps0GVZAwiJcd+xQZmHAYDEuANe0cMFDeAjxh3xip5laQAeMZaA4GdZGkBHjKAPLTQAjhhBH1poABsxgj600AA0YgR1aKEBXMQI6tBCA6CIEdSBMwYgESPpA2cMgCJG0gfOGIBFjKQPnDEAjBhJHzhjABgxkj600AAwYiR1aKEBWMRI6tBCA6CIkfShhQZAESPpQwsNwCJG0ocWGgBGjKIOLTQAixhFHVpoABQxitptbAASMYrebWwAFDGK3m1sABYxitxtbAAXMYrcbWwAFjGK3G1sABUxitxtbAAVMYrcbWwAFTGudAYvSDWAixjyQzYGYBHjtorgpasGgBGj3Vo2apYBFzGOi6CfQzMAixh3UgnuTwEVMe6gEtydAihiXOEM+ngBEjGubgadCgCJGEs98KkAgIixzAOfCgCHGEs88KkAYIhxB7nidcEG8BBjkQf+/SMDcIghcYgBOMQ4HILvwzUAhxhD1YkawEKM+4wNEQoCGGIcDMErng2AIeZymCse6AIYYhwMweuSDYAhpiVPtjAAhZiW/uCGASTEXE4lQU9oMACFGLdvBK+NNoCGGLdvBK9LNgCIGLdvBPMRAIgYCz1QHwFwiHGf8cV8BIAhxsEQ/GtUBtCQNnWsawtwSOs2juCFzi3gIa3jIfhu/RYgkdYhEbyAuQVUpHVUBK9JbgEWaR0WwWuSW8BFWsdF8JrkFoCR9gJG0FepBWykdXtI8NLhFuCR1m0iwUuHW0BIWreLBC8dbgEiaS/bSNBp3AJG0rqKGrx0uAWUpHUVNXjpcAs4SesqavDS4RaQktZtKMFLh1vASlr3yRu8dLgFtKR1R5NgdrMFrKR1rASvMm4BLmktEdmgEx/AkvbyhV98XgBY0rqP/G7weQFgSev2leBlwy2AJa370C9eNtwCWNK60hq8hqsFsKRlbvTweQFgScvc6OHzAsCS1sESvIarBbykZc584vMC8JLW8RK8MqsFxKR1R5PglVktICYtd58Fw0cQIJOWU0S5Bbyk5W4nFz7WgJe0FolwvISpBbyk5dTJoS2AJS13O/7xWQFgSUvCkhbAktbBErzSqQW4pCUPJWkBLGkdLMFPB28BLWnddhI0hG8BLWndbhI0hG8BLWldWQ0awreAlrSusAYN4VtAS1r6kzgtgCUt/UmcFrCSlv4kTgtgSUt/EqcFtKSlP4nTAlzSXk57xV94wEta8ps4LaAlrSUiHK9LawEuaSWdzbUAl7SSzuZagEtaSWdzLQAmraSzuRYgk1aS2VwLiEkryWyuBcCklWQ21wJe0ioym2sBMGkVmc21gJi0l2//4hYaQJP2Ak1wCw2oSauodK4FzKR1B73iRzy1gJq0l90kuOEH3KR120nwGp8WkJPW4hGOb8FvATtpLSDh+F75FtCT1n0EB98r3wJ60jp6gu+Vby8A5R8v74b95/547rev99v+y93Xv/9+9+7d/5wO+9327uW/794N7p/VS9vr3df/vlN3X//7Py/vGu3+K7j7r778f9O0lz8ku/xhLj8xdrl2/MCy/WP8RKX7g20uf4hL4/ErGk6AFO6PsSDe/eEbjxVe7g9jLlo0/g99aTOu87k/1OXykW/YP1ova3xHvv73f/7z0j8g+3/jA3vX7XbHbv/Qn8KnMR7sND2P8Tgn6uL9/nDuzsNhP2wfu6ewi/H4mGsXTlmsi/vDbtffj13EGjSBBuOXNojLt/2H7nl33h3uu10f3wIP5PPLII6nfxE9PfRn+yDe/zlEM2M8UOnakdSJ68+HJ+RZtiy8XlLXY7cQXskZdeVjtx8+9KczeIBt+AAFdfFTdzz11CDwTdBHQ9667QPXgoVaNCrZA/bswkkkyXloLz8f+35/2EaPcCx3vr7YnHwL5qLH8vzrlYwctvPH58f3+27YxVfz5nr1uPmduhqdMaYN75qcsZ+73TOYME04YRriwu7+vj+dzodP/T4e7cAIjieSE1dvt7OnbIIrRzZFXomoHL5dnJogV0MTXhy+4uP33HPXvj9s/4yMfqB2Q76Z8fVupkZaBA99/K59rhfEVKrQVJLDNvWwG07nsIPwLRk/SZy7/ql7iAah1cH1jBz401N/fz6OPcSGJpRO3//53D8+nY/96fB8vO//GM4fZzOQhw+ipRV5Pn/snobP/fEEJsR4EvB1CnuPPR4ETPf08bDbDvsH+EzGo9CDrijTM/ZwOA7/ss/13Ydu2PWR9xj3jlxfDUbO0Us3kQpjin99HJyyA+/BKzVGZtfLFKU5fBmMDF8m6om9fx522w/Hw+MYQkWXs/ByH5sYagzvu8f+2IUd6FA+o6aRu+7Y77rzOAEQozCGj9fbJwOP+27/uYvMbhsMOCetrrsO+oowfGSUEbv/2N9/Op278/MpnvXBo2sbarzud8P9p/PH4+H54eOpP34e7uP5KkNfrcnnN3n6+B0OTf/mMnrthnwIh93hGD/08B4UNc3vD/vT+fh8fwZXBw/+ElJfVGCX+NcHsuby/w3zDaUP19vLT4z7a7X/F31pzH23nF1i5vFztU7Axv8hLwG29HG19B1K3voo8iJ0PGHpErH7GF75f2kv2YFm/g8z/eEjdh/Mj5ut3B98iuEb/wr5xuYitPVtWq9P6+9izBjJJ38e/z+KjQKzP5YtJ68cw9PZtBEinHP+Cbb05Nuf+y+REmEHfkQv3Vy605f/b3xC1sjLeDTm8hPzT58pP64b/4d/xOOnmS95lxfg8ze18WPmGyt5ebLKP3Td+D+UH7PmcrnxQ268w2m9rJZMF+6PfXfuI+/hnEd/PIKXo9mETjHd4fzqTRteTZome/WwP/fHfbcbzUt/RDQJX3LaRNu+jv3pfBzuz+gdNWE/pME7xWYynK4tGWdsu3MX28VA2Pi5kcsL50fRUA907Oj5OMR9sbAvKlDzOWn3vt9Fl4fxptyQgsmUVof5IJmOXa4f06HoTRNhIOLfMW/syOh525/649DtBhD1joU31wxHU35+exjn+P3HbgCRngynACn8+Tg3OmFqJcgXbAw2o/hmPNXvau4aavD6fZz98+A2x69FEVfBOT5+lSa47mKNhKHu1Haw7U/3x+FpfsdhVKuo0Kz/8tTttyD8DNOrcU8Eeelw7E8DEBtGwIoyHf0XZzR8ZB+/MGFMd5lq3mFvPD7j3ql7asa8QWbekDJv6rlHbOPXoC98zof5radmYsJnHqh51jbWiLo/2ktMYETuxtBgK5wVZJD7Yeh328OHz0P/RxTpBsPJOHnx4fh+2G7jDGncXR68xeS1x8PjzHyGyQSZ3T/0+/7YnSeYMmzjSLcNe9lQpvuhP3f394fHp27/57B/mMfa4ynsAeKg3oqxH5RPtqElJeHmePk1eQdcj4V5giKhxdjH+Xwc3j/D1zLMNT0BFj4ulZqaVg/9+X13/+nheHjeb2eBNAuB2XjiC91J/7H7PACrE97T+HVbp4u8/DEeY0j3B/PBwHIwnbmQR482pMeMTJ0f+vN9tz/sh/tuNzx2Dz30tptgjnBJz9izm1+zAQ5NtyZDn/B6e2HUhQi7oHzN1AVICzkLr07MMHc1fNdYEPgpkuZdLx8vmz8EGeqQHotrJ7PYhYVwUJOx39jPlGEiD7QJ80RBhkBRNwAoh2kuCXZcB/HLoYPp0JDpjr1y/2E4Ps6fgQrH06Qm1DzbGs+WCmbzlCUmpvU8lA2zJZO4AzICDYyLd6TKZ1Pe6Tbc/+ExDtu03h/7P8zlD+6TY+5Da+G9r/QudjyG0/3hU0S9mZI7v7rmPbQhycv1vmBoK8PMwFtin0dKmXxQaMQVsj+/8iZ8kil9mqfJ3GHsGQtdNyKcA34AyJWdh/48JoXPx57Qc6wxDmZk4u2+9POx77YgjlehiTOJF5uKZnQYzaRu5XB87KJ3IlpwmFZV/R/t5cEz7lN4P32UDxQNuaLz0J+xew2NIRkN22uHh48xqAjsjp+0jWL+BfGoyVML7ldujUi84R8Pjz0EzyHH82+ZYH4yp7zpMAwffBR+/vMJ5I7BKPmJfHmuPm5u+HRf/tH7FWnmARzzkQ73eIyzaXimN0V5bT1GER61KP8vrQ/EPbvSnssYcr15vMcxUPjnc7cbQHbXhpQk5RdsD7FPCZNRTmaU47UzfxauWHBygdJe2n/p7pGsnoWhcLtJeJVh/+EAYqSxYD+Y0Ym3b2Q7+xN4alqELjH10M79YwzLgxCPp0KbuQ8Kg0M/rf0777Fdw/0ffsKwjZ+Twv/hLTNvpuTQeyU/8cSEbNnklfxU9Bs7lHdz2oNv7cmgbr2hEQlDs+tOl+gJCZvC8SGXcC6djKYAiUFN2EUiDNz1+4fzxziFDyMGlbp2uO/3p9gQRbTPv9oeGJH0a+xsnOTDqZ8v97JwM0Sbiv8w3szCBTFFAjB79UO0SBlCQL9QIDx0lyY1LofDp9hr6TCISmVUfkcEGgeHACGVRxPbKkIGlrIZ/nLoD1i46CRJpmR7+LIdHkfbAUPxsAueirIeuy+IQ422xfj3dvIBaY3+GLbxTBchT/CeSfulE5FSrt8O3ezxhFswWnL3jL383MFAPcxR/CTz8UDjd4Q1fNpo5oOHadXLr3Aw75q5Z2Tcr4AJH2nI1kfXHpYp7c2XR2zaPxLtgyojE+/v4+E8fJ7vtgjnPbnA+NCf993nbXeObUm0ku3fP2+bSSo6dtZ/oexiG9rFRBfxbYSBAku9+Yfzx/6IZnLhdokUfBr13g777XAPwEAYTGqSAI49HE7n/ojxszAcTY3l07H/jD+/8JXRKTv2dDx8GEDQosKLTeJlfToenvojCDuCay/vgA8d/Ty9/H/j3XYzxdze6zP/ZjFPebmPVrlfNuY+VuB+3osp8/bxhGJTVuEjAx92a7/VU0+rsT7UMNMyoM97Wy+rJVcJgsfRnQ7v/6e/jyZWyBMvN+vDGOlfX/9YvDXxL3bjdWbeQzOvIfd3yj2C5z7Z4u0kYKIBPkBnU8ju4yRvjLQfFO0NjfGro8aHa8bbqdbLalPhB7HzUoc+KvFUL5c/dSD8CaNUmZUP6Fsww1XqHbWbUeJllxDUePMspm0E5HqB7Wy/7Y/D/iGOe0KT5cfH+xP/Cvl1kMaPCmu8Y/E5FvOxD+d+KkxLgT5Fkz4PU9MuB79/Qm/8H3KakH68Uwx/uinwhIO78rNu2v/h3wCf/DdeCebX3ZmP0pmPTrlPYLnxPsYH+dJH8spnsspHB9onHdq/BMYnAiZFnY/9P5+HY78dd/T0j3BzRUj7pnWpy5sw3Zt/nb0qzCN75s0d896S+4yIm2lC+Xsz0735yeHjKO2hnpaer3lUYVIRG7aYFy79sPQcdhfD95mHy4Ft+pVyPcQrWKE18HFRMy0HelNE7vAe+8X2i4VQtE1dfYKpOw9fzDb1Bpzu+z2MAUKYzBMe9NT33e4UpzPhg/TbWXyIKFNk+NSPVD0G4yFEbFKLHKf+n8/93g7sLJrYhAFJYnlx6gTEM+GWZ3L/mL18thob7vH2D8HvyWm8P2s8lm78u8E8wWLeiTJvq7lH4NyvOwsfmUgPmJV3bMqvRGsf2mtP1owPwI03mG0qUL3cG7LwEC6+tAk/dukhnmkh3Zqc+uVh+JSj8elE4++G+VCHed2Zn2rcpy7cWx4hJpIzbaHyVm/C5d5TaY97jPcnxlveNvkizExSuCDTpFb4TufueJ6H0eNR4MFLmAjlgw6QSDqk8OQe9rGX5+Hcvd/1WK1HuKItEkN87o4Pfbz9OwoPUpf2j0+HY7cbV+YPe+CxeIiI29RdTCUP8RwNZtlE1vws85PLBxmNnxTMG3DmpwDznpr7gIZPq+s+IpE+7FA+slE+Y9A+ctB+Yct4/25SaJeo4xDhigFPcBp7Pbg2XFnhKdl43VBYwCRT43E4dzt0AVqEmVbKtbkuqCXXECKS5QW+lxkqbsKpIciNV/56AnjJsI/cnaA+hoX7CSS5U3bs49jdfxr2DzNDLKOd9d7v+sA5lQaPGcZpXAGLzJcMzVfqwY5X7+Y81IRrReQWPttBD+qiAsupknMTkLGQRvuXr5nWkP17yfhE4qd9VomBn3HiJqwGkNPWsWlhKbWoZjuLZ48Ojeu0RWfivyk8OC53DvuH7XBEts2HW1KFz0ukT7yVjyJ08t6dgI8DpEzhCovP9sS0KX1aSPO+WIvE+M94aQjPpjpWzyiZz3+YD5r4ZExpKeOOsTg6DqNURc2xj93pErX4RW6wpyk0wcKH+cIHZpIsUpgj5yZ01MIv+wgfxBjPNQyZmwxk7VyoJBm/xvlQOMX9CFxU8tx2CtN8yji9cl5p5tfQmA95uc/5uMdH3PtNPhktn18K/35KnxcqH8Uqf7nyg6+8I9Z+L76eeI/PXM20Nu89smknFOSjPHKhdPCbLu0qrU8DZxthQnQpyAqnIbk1NfSNgtytN+tjpkuYPYm2WJfD09zRhlsxJLnoMC7zR48H1P2G5IF868K9AtE6SnA1CccT0sNyA06mgW4N3r31YNdb04TZHD22Pkw4oA8yfLXI5bFZIB+9xH72ev4ymYsJynpqI/xrIX26J30QKqfCJU+4DBlE+uqLd6784t1sTzkL9/8bsqh4ODkjNS5dHMeQLoaqMrpJUplT9/h+GOt+oBENdyA35I6D4YSX7IYe0xMt7y8b70EbT+0ab0OYNzjMcyzm83A+bQ+admpNiM/7MTWV+niCrj0X0NNGHW82DW2dTola4k0Yy021TD4D8oaXkYnVcJrXRKrgbWq8fWc+n2Fk3DL2Nct1w3hi2n7on7x/4B5zNP5BMe96mIcazKf4fArypn1KE4CcvMm099ivk2iPHLQPaoz3OIZcTPM3ZO/l8Hw+fLAJU5zshPskyABxOOElkCwyXH6SXPzVxJC8n/Y3w7wxYJ5psHZyuj528usmwk946Q2Gmo7+8Msl2qfK2qNw47GJmWIwclv4cJri1G43f3NDWkJuPB1OH4bjCYUl4YJrYu5Z644tGobrOW1Dm47QPcxW5sM1nbah7+K6KyeGYeHSK7nLYDjt+s/9bkPfSgiNG/pZ2G4aqhseUtO2yWjD6G6i7S307JhNCWVCA+PtisdyLPEW7Q4dqDUK43S/RsG9YRHT/iuyVGw4eZ8e31vwXk7h5+U13Ez00gfK/j1iXh7zbw33jfm0R3PaCeTtoTQTvfQWcirabaaY3OMk7+TN5EJaMtw6PR62MUsId+41/mVnPoJgZJ41nB6fd+cBm9rhmjxZ1nS53iOSmJCEyIms+BpOT93DsH/o9yPLjMsNwh3O0vM/Lejn8tQf7bkSw+ceORMgyNsZufVtOD0dhj26tMHCklWVeDNm7iSsMvQRhk8+G5+FNz7SaPw0YX5lnvlJwb0r5D6r49NuumkJwQ+7mtbhfdyp/RukpzJjH7qYyYHSacfp2J+eDvtT/7Hbb2ehYAjmyK3fw8kum/UowgpLeaeCaB8Yt/6OW3KtcTjZVTW879BfeW/oV29aHyO25MEtY9/9HqzYBaPqI0Af+/gFj8ZHMY0fBOYJFPOPnPsR414PPu1rmlY+vB1VPgxU3i5qP4P0lC77sMjQWdMJe2mjAlUfWvn56YFCM22v9xowj8GYtz3cq8t9EMinvQsTZvexp/LRoPIgRvvHp6dzyHwsY0jYOpzGl3/4MNxjyaiKJpcfHS+58RkAI/nlcIrYeP8ZVFOGW1w1ue18OOHTM4z4/Z36ydR6J9OSWwgu3e7IVytclvU+xxOh1o9RS64MzEF8uMIjplx1MkKeh2qyrtSdm4cNVbiXg7j403A4fUKLaUO1yKqMGYwPa0D5BF+nDVp8csqUQrZHS4ufuiFmjuGpPZIMMnfd/uG5e+jBeU5NWOAryc3x8/g8nFD0cxgvSx+AE8am5HFSYwAX0cgwFJx81vUURI/eST9hI0JAucbi//H48DCeC+N3+uEQnTVxX+E+K5a6U9jXCdMsTE9IvEL2BlQLd7wycjAP3RaLeoOZ4HPQhn7us8VkFW2V8dtsybV1t1//X8h+/UZH6wSUhdwdHoY9+mqH9cjkxoVxt/4ztrOjkeERBPSLPNujHy6MscR9j9dhlQbhmY+M3E+Djdz4sYJgId9HKxvq3n0fOKMOtKCmEL3DPzzeh1wyfez2z27ZJb44LEMnU/XHw/7wcOyeoqUlFjpGRRpPZJd4o6LFxQl3kF0ctmCJNzyFzJBwcz9WItoClefj7vTYne/jGwg9S0suWE+9zBFFaJbIBfPp+udjvJMiPM6vJQfusP9w7B7gvsMmDJo5mcKh0Dx8ZS4mw6c3PjRs+LRW6IMvD++Yz8GZX5riPiriPrLgenInntX6qFn6ZFz5yElN66geOGofWWsfmBoys3zqjv3+jLO+cNfPtMHLJ26SPOvAdTmLQ8KFpGk/1LRkTZ6k53qbH6UZUhSySt1dPGegYYSnSHNtz7CMzXyY+DeTw5jOGk7ocerfH7ZDfxrPHLEhJzydMtzZxMiFNnAObRymh5twSnsAbCTc6KUTk+bUjzcRXxuCZXJRbLoWCA6hKbk5y14Mj1Rk4TZynZpI19N3o1ENAjo/kL5GgSyeo8/yZWGcrskCINvBadw9M1bezE4VCeuQ0+Pwmc3DkdCvS3LHDKwDYGHNqaIv60+n4XE4jXAtXEGLrWQYEJG+IQGkwrICEhwjkLcJrZbQ0/YHyjn6ShPkIYaro2TujBiX8Cxl7yLaDRUcIFvaQtzNyf3SxxhT8XD/WUu6NLxyItyDokgMgQVfcens5Wlf00zKtk7JCrr82YTDz8myy3knIJEPn2Pqri5H8MUrsOESP5mAXS/G4vJwtVOQXirBDXn4SrbkmjgNB3lYZNmSh4bMCCALdyMqMiVx7y48TC18cmQejG6xDwvtSb+MMvlwAUSTOS62LT4cJE0WbJywGv3wYACZEIrt3Avzn+moCXI54/Tx8MeYPdvdD93M9/PQ6LTkEsAJHJ3MwkzCkM7u9NTtT+fhEcyQsMqcnpoJcBk6/YY83dDuKY+JX3g6ErkYPj9CuAlJqSAPcnAX3sOQM3RphhxsZN95CP3IGl67MTo2QNFJlJQ9x3eZh2jNkHsp7P481G6FD5hcRreXz05QCYt2BbmxCjVWIZC7uyRSlMWaOpifNM/Co+YN/cSTWJmFSMeQ52Ofj914wHrf7bcfhj2o4wrzY7JyGP0eQ1hspXxhnCF3Tvs+5vX5YdJFHjgMT0sJdxUbcgSez7AKIDzQriUjLsQWhjvO/VqM9NtAWtL/E3uCWWhbDYm1Pg+n4T3YrxCupBpyyGbbhJuwSk347UJiOqyrmXa1oZPxHy/vnoanfjfs+7uvf//Hf/7z/wOdPiOUwtkCAA=="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE7W925LjNrKw+y7Vt/17hDPoux4ffvcKn3a7Z1bs7ZhwsCV2FZdVUo2kardnYt59BwmBBSQzcSC1rlxugcgkASYyP2SC/747Hf84333567/vfu8Pu7svtXx9d2gfu7sv7/bHdvdDe+g/dufL3eu759P+7su7j8+H7aU/Hs5/CX/+4uHyuL97fbfdt+dzd7778u7uP6+RLp/a07lL9Bn9nuyUcTv1+l+//PTj91+/687H59O2m7q9XveX+Odkr4rxqdft8XC+nJ63l+OppMtXcfug+9fDbXeHy1zT4HY2XIaSL93nS6nUa9s1EvtdkbCx2Ro5v/32P+fjYV8mLWhcKZNv5MvsuO8uP5+OT93p8meR2Lj9jSS/Of/04X+6bdmY4tfVPvfgBXl/ag/nj8fT40z89MtNXou4t6I34kU1amqeS7V/FTddLO/d8dJeugqp8wsWy/5l2+5rRM/ar3vK+7obR69ZqAFl9OZzambvLufd/+nP/6c/PHSn/tLt6u58bozgfe5uJ400gEAmavtqJRebQSCcsoC3kk8aQ1oP1A5Wj0RgEr2TQXoNsMFNDCTaaZGdnOlLTLDu86U7Hdp93X29Qi5bp8fxafToCsW/tK6WCifZ27dvv/XN3v/5VPoA8CtXa/N9+6Hbl6vgm6+W+3X3sX3e14oHV63W4ofu0u7aS1uuQXDFaunvusOuO/WH+3Lx4SW3k1/6FsBrbqDBP5/7U7f7ZfBPHofLKxSZX7pan1+606e+2CZFF9xKdsVYBFeslv7+4fnxw6HtK17G8JJ18vvzm8Nh8FH746FQPrhkrfyv2sOntvTRB81Xyz3u99226r6jS9bKn6GOnPTggrWy37WH+9JX7aX1Wqm/bLtDuVTferXU7p/P3aHYskQXrPNzqLCF9PSqopdSLZAghrjz8oiiVDYZ0uAaVEc2FVaWDHBII1sd5yzQhgx3slpVRz2pMQuCHzI4uGmwUx/kZKf5Ydd9zsjxbYolwGH79nh6bOeDNRukqd1iSb7JfGFE3LGXpovloeHQ3O9IhT4FUv67310e8mJ8s8Vyvuv6+4eCcZraLZb0Q/u58KaClmukld5a2HTZG5XFBRWYIGWYluKCPCaolFqNC+owwUpt8Hi9ABOslJvEBeWYYKUWJC4owwQrpdO4oBAT3Ep+0XKAYoLVGuRwQSUmWKkPhQuKMMFtZBeMBYoJVkqncUEhJlgjP4kLCjHBOvkELijABCvl0rigEBOsk0/igiJMsE42jgvymGCdVBwX5DHBSqkULijCBGv8HAoXrMMEC/DAYiywGAesxABrwv/1Yf8twv3bhfmZ8D70UGdahD/eJMyfdVgU6kc6ElNp5/zM96eu4DZexa2XS8Uhw1xeGjQUSTp/f2x33fxVQYS9NF0uzzVOLHJzucgla+XjQQYlOr0XSUiFr+aby+XUf3guvOfZBatkf92dt6f+qVx2fMEq2d8dH7unFlnWUcFB61VSsyE1Kr14971Qi++P98cyydeW66T12+5wLrzVl8arZP7Yfvq6vRTKfGm8Sua7bkj3KrFYUeNVMn/pujf7c+FgvjReJfP9qd3+3h/uS40VcslKq1Gz9M0uWDnGOQxAjHZpxkCJHslgDFsfl69RpUEYJjW7X1sic8ikL5B2bbZ8/c3C3rnMxcC3RB8K+s7VqAW/pVa7/O2ug511b3mFGovQa6E2JH5FNalGsMXWh8KwhNWpRbG1epTMz2VItnj9wzEosf7VodA6HQqfRTUSLV2VSSyKr8jVaLRshUjgUWyNWIBIC1dIHJOiq2MdKi2TjyNDTHwdNiyTjqNDTHodPiyUTiFEVIFajFiyelIoEeUxVTixiF0UUYtyvFcik0SLc8nVeLHQApGIETVA1ZixUgsSNSa1qcaN1NgEyPGXp27bf+y3pGsJG9wEPaKdFuHHmb4konux3n897ubjjquAXLZWj2VP+BV6YbUuM3egRoWw/XrJ3RDlFc+F+Ip66Zoz+TIKlcJXSZ4DCaIqj7zxfFFe+Z3Xil8luy5oxRVYHLiW6kUFr7g6tQFsxczI4lZygizOZKrQDo9tSZXqAtsKPZKhNqnOonC7Qisy5CY1qg67K7ShQ29Snfrwe4k+pW/ZsjC8SqMcGk0otjRTqmp1xFFBYnGswwX1ulSMXTU2qFk/SXRAr5/V+KBUnyRCyHuU/wv6ECiB0qUSJ1ToQUN/Upf6TKxyfcjNAEqb6syscl1w3EIpUodcyrXAsQsZfFShlwotKPxCKlKLYEr9QArDkLFpFYopjg/nUIR4EuVIpFQ2iWVwDarRTIWVJ/EMaeSrEc0CbUhMk9WqGtWkxizANRmoEf98E1SDdFkEaoCmSzENJr4Y0pTqkEU0uBbFgIbUo7CEDROfL2QrlooGn4TMZIZPsUS8KosQmS7MKpZJ1GYRQjPlWaUz64fjDglb8enk266T+H3xXb60XSfxq/axO80jYVzk1HiNzCxawmQvBktlOlFYCVOlFioVz/EsUiJm+2KgVKwZzm8IdeqwTbEOSZREqLIIJBVrRGIkQptqiFSsCY2QCFXqAVK9LmVv0zJ4VKFNDh2RSi0FR8W6UdiI0KgWGtXqUTxe1cCo3JchcRHl0FTDojJdkqgo59XeXBcCE1FrdBUkKtaBRkSEHvWAqFQXEg8RrlktHCrVA0dDuBJ1YKhUAxwLEQFPFRQq1oBCQoQStUCozH+jcBAR/1bBoEJPeg5i0CdQDmDK5JIYCJNeDYGKLTeJgAjDXQ2AqjUh8U9Go2r4Q49TgH7wwG7815uAnpeeiviOU4fMO+jPbx4/9EMdWEbtV7OWC+V93Z/cYtHuC2QirRfK/eXpWHKTYbNCSWBafnXcp4ctaLPoXrICKnuHwenh0h3OPfKGx/cQtlt0H0WCFkiBxYmH+/180YrvxbdZdB9ZAZW9zwrtjr+/Sc7asNGiO8iLqOy/Dh7HVoZmxinbnNEgi46BEUgQ4xotCsFxPJYIL14jEwVMscQqlpSTh0PjWOCcFa+RSCDjWCRCilfMJxwYR5NozolXyCtYuear1gp5BCyOBCKMeLHELCoOJC8mxEkNKDAcCK7lwdmVNoeBwYK7lP5mVxiUtIIFpoqs5iQmEW8seBHZzckngW4su5rj5uTS+DYWXE9tiyUnZ/gyRpuXnUOzUIWlRDanCQViY/m1/LVQau7JV9PW7MpPQlaw/Fez1aTkJFIlfL1bSSYAKli3qrhpTiKNS2Op9ZQ0I5mEo7EbUstEM1JxFBqJrCOgGXk4+Izd9SremZNHYc5YZC3dTPoeFNSMWU8Vy0z7d3OIGN5dOTVMSiGBZSCrmlPmbB6JJ2OTV00lS+WSMBKXX80gZ088QI+E0+7++SbwMeiqiD5eNUpguZ+70/lpsIufurz6r/D2pbJhMN53+91PH//ed38khc6aLrvXUnHLZJVBI3BbGaqTu6MCIbUS6sBRPDUWkqOcDll0FGuxmB3l5ysOj+BUraNHWaloYApkVkWjWYk4QAIi6whSViaBkIDQSoaUm1k4RIqnUx1FyknEMVIssY4j5SQWGfVKkpSWmUVJoezFLCmtAwWTQtG1NCk7h7M4CczmxTwpv/qgXAcuPlVEJysziZSA6EVMKasBCZWA9GqqlJVMYyUgup4rlctOz/ZlZKlAeg4tzZRYypayulBwCWhQS5dK5WaffzVfyvsGJGCCDkI1YUrLTiImyiu8mWwCMsE1rYoyZWXSmAnIredMOdkkaAKuSi1pysnFUVMstI415STisAk4+FW0KSuRwk1AaC1vSvsnFHAC8X0Vccp4gnMMFN1hOQFKyyGhUyitmjplLSGJnYAhrOZOxZJJ8ERoUE2e5s+dLHj8uT2du1yNomuUxFLRvf71ud/vvj0dH//rnE1NDvp+Ba/DSQR6A2vLMEM16osxZ0rgDzyhw40rS5fcSGLmZgpJpxlbWDtKc6oiQQukhPfzNAzWX4+7vjsPc+3tpXs8f98nM9ed3MSFs/fy6dR/coeM12r2Sz/koF2y1buBTvCS22hzHU/xdenIjy1XzLIfjpdBzYIX5RVsvULqT0XSflop5X17uu/yUyxsufwtKhS2SNIsqssWjAYBXXFVd45kf3/clk2UWfMKyUsrZG9WHbu8MnZtVextKmJvWQ27ohJ2dRXs+grYW1W/rqt8vUXV68qK15tUu66tdL1NleuNKlxvWt26qrL1BlWt6ypab1HNurKS9SZVrCsrWG9SvbqicnV11erKitWbVKuuqlS9QZXq8grVtdWpyytT11alrqpIvUE16vJK1LVVqIsqUFdUn66oPF1ddbqu4vQW1aa3qTS9ZZVpFv1kAMPw840R0NRlJQYaNV0ceLxIxYKPeon7jGP9Im+f/NhYmTTyM5SYwOyHKEmZK0KqF/E1Hwos1iQXx0Ti0593K5bp76BsWoEL1shGPzaGTq3U58bKZlZ+CYre14XLUHJuF87qJUtCSm7BkvQifcWylJllBUtTNMlWLE+FmhQsUahGK5YpOE7oUvUz9pnU+OcbL1VTl5VL1ahpwqwOgL5IbNC4UuZSRvgi+wacMKVTfsl+UWU5L8yNRPkCFw/Kem6Y0Sy34EXqLKV2GR0KGWKkykqOmNGogCVG2qzgiRlNSphipMoarliqS7FRWcUXs9qUM0ag1HrOmNEtzxojjZbzxjI9isdrBXfMaFLCHiNV1vDHlC6FDPJFl5UcMq1LlkWGeizmkRkdSphkpMcaLpnWpYBNhpqs4JNpPXKMMlRiKadMa5BjlaEGS3llRoM8s4yUWM4tU/5bPnCMvOeFgWNKg2TgGDyBJUFbSm5B4PgifUXgmLHcBYFjZLhXBI6FmhQEjqhGKwJHOE5RKStqwt0/36iUdeqqsJR11IiYVqfBXCX1fTU1Kex/dq5cezge+m27f/vY3nd/O/VJacQFC2X/0H7+un8cDmLDq5oiubDx0vsd7A5a0BHf5dRsoZyvn0+43wIEBe0WShrHIfv4plZLpRx23eeskGujhTJ+ujx0p8IBAm0XSqSKQiNR6U9QZGWQRaCRkMwnJ7JShsLu/nD/XZ9/dHHTUnmgxH6YTjQNDyXOmi6TeLr28GLoM4YRbb/k6c57qhS8UO7x8O2pvSfKz17kRc0Wjmbff3xbMaJY8xXz6BrKvt0VTKSo7TKZ7XjUw7thaJLy4nZL1u8+azT7mcVMF0tkrABZzB8ZgOpi/ozUsllD7oatkk2UJEdiK8uQ815L0bIRtLud5LLFJGy4UHZt8fuL/BXF7ykd6OL3wBRWF7/nvJ588XvsAC0vfs9oQlWgR+JrS89zPmy6+D32Y5cVv+dmPF38Hk/4+uL3rE2ji9+BTasvfi+VXWBQFxS/Z6Xni9+BEsuL3zO60MXvkQb1xe9lcrPPf0Hxe249SxS/x4vaguL3lOxM8Xvgsiwrfk/LzpOZJcXvGZmp4vdI7pLi97TsRPF7KHlB8XtaLlX8HgqtLX5PS6SK30OJtcXvGYl08XsktL74PeWf0MXvERGsLH5PRhdYOXpwhzWF6Ck5ieL3F2kLit8zljBR/B4ZwgXF74WSE8XvqAYLit/hcw9hdcI8TT/dBlrH3ZWB6xftqOmJpjRBWX0ylykv5bft1CQvDDSeDRJSe1ygwePVSBfID5sulj5H2uVPYNa84rnPw9HS+waNV8h8afTXPwkknbrjl4tucN8VGswvWSH//fHS7isHHblmrQZVwz+7Yq10PGGSkpzOmCySeqXm06ejSmQj16zQ4K/dQ/upL7Dfcdv194xvKpC3m95YKJF7hQnvTx3ixM3lxs2Xyv1tPJ+ifFbP29/Gort+a95v7IrbrG27ioHYEaOQdIDyXkSRia3E6HmpVHHNTDBWWLNOtmta7v29Qi64rS4EAETVqASAJdbgzeVy6j88lxrduPkN9fi6O29P/VOpHnHzG+rx3fGxe8IKHxAlgrY31CCPxeeaLEfjJRp9f7xHNvPmWlzb3VJyv+0O56JH8NL0hvJ/bD997ex6Vv5L0xvKf9ft20uBpYya3lD+L133Zn8uGvyXpjeU//7Ubn/vD/dlRhK54KZjkUX32KgsxvdZndKQdbaW3moNK4atMw3qgWtWPlq6CSXPyjbXrdv5DVsgf/mmbVYXcuMWqFC9eVtknUvfyv+FtzG9fUqGMf8LmtDbqAiqqN5KLbNM5HYqZpGqt1SrdCjiBku2VsvWK2JLE1uvKrc1K+QXPYP67c2iFZPe4kRWy/ptzoIVIbXVOVsTlmx3lqyMxJbnfFWs3PYskE1sA85EV24FFkgmtgNnkiu3BEskk9uCc+HVW4PZVZDcHpzvvdRtEeZZRgHFuKXvQW8XQmxVvWVYYl3obcO5canfOqzRgN4+pDWp30JExyPYRiQLEfwPN9lCjDor2kCc9CKm0fnSnuaPLpbj2yyT0B3mczTu37Uo7n3mfHaHeyRPNJYRtiuXpPQk6O2b7bY7n98ff+9eBrk/XLrTx3bbnf8S/p4c6+jhtJWdvoovwO8kUpUaldMpmF9Jkb7pSmEY18vLpfBetQqfn/pTd35bKjtovlzoZfgxIndJoWHzKqHRPP3mGmNGpQNfh2FJqATZunwO/xGlaZd3/uqPZMVP4kYIRR7irO0KTR7SZUH1qmxdydTsUOoKneZdlC1VC55be76GIP5tI0xD7ini/fxvqR14XBVKVjhhC1SKttFqtKraWatX7Ol0/NjvcTuUUe3l0hsqh1qsGUbDtPSNKtbY58vDm5/f/r07nXOvYtT5q9mFGesw6Z9Q5Lvjftcf7qMTtco0ia9cqcp2329/f/9wOj7fP0BUklcHv3qlSrvcEhXrMINni4WG1dhlclPl2MWiaQ8MF5xxw4rFXtvVj/r8ynpVZvC2btBfrlgpunrJi/XIrnSLhqbAfwFqFLotOcH5ZSuWO1+tFg1Cf3bu7FBffhoC7PSCDnTALl77HM7vuvPT8XDuvmsPu1p95teuVOf3/nj+vf49BZetVGJ/vO8P9UqAy9YrcXyeMf0iLaLrVqoB99jyCuSOPC4WferOl1O/vXS7+qeAXbtSnfOlvTzXPIjpgpWCxxi5/hGAy1YqkY94Y+mFgS5mL1N+cvHiWRfP18SudWFr8q5vGqEuCE4XK5eJQ7Mh6HLBxct2KtBcLL4kpiwLJ2tUSL4RP1UY6Gvbyjjyqa+JI0MZr2bXFz4Af1PEM/C5NMfUzcNG5Xe9w9Irsl2/2lFZFtGtznSvnum49MwsLxW7P25bYoLjcqcLVgo+gGzDvOQDknS4SPRTdz73j/350m8jB7tCl0QXK5Xzh/5UKBNcskB4sMM3TuW/t/vn7ue2n2/NxT/fZLcP6bJozw9oSk1uNGEKk5n+jkaZtE9DgyJpvuUaad76xO9vSiq8Yo302SxNCc7OT1JmFEuPtSlFAn3LNdLIlD9MYPa7IGUyzzUyz7eROVRbFU/coPEtZM5zllJC6dCq+OmW3+l58Z3GBvVw/9zedz+0T4jU6bekKS0drbi3kqF60W3BOBHiUoOEyYue1mCZ+n91O+IWo5/Ln9loDf7Oizt9BS4gbidWdsHSh0guWvoowXHuFLEaIUJ/yyxHZfL2xEKECcz4kIUSMysgJrhwCaTkg+P/yh/xwicM5FU84qVPOHpx2l35m/gqaFw7qoEJ8NlruNzo10oDUNBZxm+Idat/4RGBJe87JbbmZUBEF74LlPRZMvhzf2k/7LtyBbCLZtvvSK1xkUbkWo8okl3qS59BscTs2lwlcb46J0TS6zM5z4LXk6x/8j/cJCiMOit6Rya9qmq/YzlpoJKT8Fu737/DD1mPxUQNS+Z79t7Q8yvAvSVPrcje2+X4VHZvYcOF9zbLgT6eL92JKHGIxc9bF9/vrFJ8uz0+PrWHP/vDfals9JrFGpBndMzkZk/oKJCWOidjJrDklIyczN/GA1UKpxVoe6OZVSqelF57v2MXf/3z7TxZfH6/Ydtb3K872aPsccdNb/S03xTaR9B08Ywufdjks14m7+cWydOnJF4bL5bpq4sKnmnYdLU86rwqUmrutKqit/Uy5GUV3/Cs/WLJvgl6PsVMLmi9TGp//uF5f+nJQjOwus9aL5X6c3vfH+6/OQxOee7Fmbde/ISzJ2LNnnLxeVjl0tGzqSjByZOp8r7iVAf6doehQegxzpqX3yv4YEGV4BVyi89+iiUuOfkp6x9TJzDB6Vx5/lJOrmuYOLUilo80v6Ue+L4CpkLdqQElK3/i1KX52r/gzKUi/5Y+cQnxb+vPWyrQgTxtaaZA9VlLBdKzJy3NtFh8zlKBNugpSzMNqs5YKpFKnLA0F1x5vlKBbOp0pZns2rOVSnxT4mSluV9aea5Skc+In6qE+Ip1ZyqV+IzJE5XmLuOi85SKnn/uNCVkJJaepZT38orXpEXnKBX4tkUUcckZSjnZ6AlKsdSq85Nya2/29KRY9uKzk3J6UCcnxeJrz00qsbhlb97N37jkiUkU0Lq5FuRpSfOosfaspCKrQ52UhFib2nOSauQXROsLzkgqWnvwE5KQtafufKRy2UVopvJspJKVjzwZab7qVZ+LlLfwiVORoI1fcCZSwQpXguyrz0PKy8VPQ4Ji685CykvFT0KCUuvOQSqQWgqnqs9Ayq1m1AlIs33DqvOPshwhSxBu5zeQJx8BMlR77lHJfht16tF8r632zKMK6eSJR6QW1ecdIdrMN7qjSLk7PD++aDD8lK4xeKlg+OaHn9//v7l+XvlWaco2qoRK+eHNj3/75at3b39+nxUVNV0s76cff/q/7978/F1eXNCyTlqYG3TsD5dfuiEewbJrwl9vkoYw77EsXydSk4SStXfzan5Jnfw5gtniKzQiO26+4r4p040/6yr7Xfbc5yYVe9TlFrVIKmnOEdnVNr10vEnDjo93tXWv1YM08Wl9qu08OUKBacH9tvFfb2JKXnoqMiFOHWoynfBt9EDGS5PZI0I275PStqOLnBYXtFlwP3j+UtB9Onkp2bdrlRvdV3GzRXKQXf9IQGKjP9nz5dR1Px53SfWDNmUSZt/CGgcQ+2p6IAW0WyaJPEMyFhQ0WyaHSDWJpWSSTHIyyAytWEo2PSsnJ7s7Hssr3hovlIvui6Mik5viOWno7nAsJplwluz//NQezu/7x6SEsNECGS5t6n3B+zprudpKZzlzIH0xZE5qQBHmQHAtXs7NmOyOZjx7Fm9n5vTAIXMsvA4tZ61oim4DS7oEbefkk1w7ll0NtbNWnSTawLBX4+xiydk1pR5k52Xndg+hCku3DnOaUDw9ll8L0wul5p58NUbPrkgkQwfLUjVAT0pO0vPQLV6CzjOSCW4eSa2E5jmJ9F50LLV+IzojmdyFjuRWb0FnpGZjkdrtgYw8fG8gkle3MZCTR+0KxCJrtwTSMSoBleKouwompSPWOcgJ764c3aTjfAoahZ5kLSzK2TwSEsUmrxoOlcoloRAuvxoGzZ54CIFo78L/chsYFPVWBoQm1ehH+O3x9NgiDy6WFjYsl1UZbMQilwccOU3IoCNWoDrwKHja+eBj9tyXByAF+hCxwEyJykCgQHI6GJkpsCwgKdCDDkpmOtQHJgXyS83HwgClRoPsG7EwUCnSIRusIKosDlgKNCKDlpke1YFLufSSEakPYArkJ4KYmQILApmcBulgJtZgWUCT14AKaqD02sCmQHIiuJlJXxDg5DWggxwovz7QyUsngh0oujLgycslgh4otzLwKZBLBj8z0dUBUM4XIoOgmbdZFwjl5GLBELjbivAkJ40OimKZ9YFRgS2lg6OZKa0PkCrk00ESqUd9oISNRBAs4a/Y+K83CZJeeioKkJw6iR1Od2RzSkzUqlBKXF1ZIKRaAqylm1ZItLQ9vp1Z42Uy/9puf78/HZ8Pu6+O+/RQoa3LpNaFmIHMxeFlUgMqtAwE14aVueecDSnjB704nMzpgUdysfC68C0nMRlCxoIXhY85+WToGMuuDhtzcumQMRZcHy4WS07O8GVhYl52LkSEKiwND3OaUKFhLL82LCyUmnvy1eFgTi4dCsaC68PApORkCBhIXhT+ZSQToV8ktTLsy0mkQ75Yan24l5FMhnqR3OowLyMVD/EikXXhXUZezu+sDuty8qiQLhZZG84lfQ8qlIt94qowLikPCeHCuysPopJSyNAtkFUdtuVsHhmyxSavOlwrlUuGarj86jBt9sTDEI2cutcfbhOohZ2VxWper6qE4FhOOic4J+G3i1/icnLilrMxQfL0ENl4ui3mAESy45bFd4pLw8NFXF46WqyQiB4SRgtNHhFWLHfspuZ2wwtuI5sIZJLi02f5F2jwfXu+9lgofn7BKtnDV1sLRxw2Xyz3x+5zjVzYfLHcoZPd28MOd+OhWNB6udRT96nibmHzxXLHRabgPqd2yyVd2lP4WhTInF+xWPoY+BTc59RunaSS9Qe2vcWTrXqoq+5yOIKxfLGDzRfLzRZMzEQX10yUS0fLJijBycqJnEwfwo7z/6fny08fiaAs9qDIq5Zq8W1/OpdNMdh2qcSXFSwrMGq6VN54zGahwLjtUonpAzmhzLIDOfNSozfxm09d7g3Cr1jmm+fRfyR6Of3P6EFuAETiq/cA8vYjvw0AjcjynYASz67Ql6zi8Xm56S0BKH7ZrkBeC3pjAGpQvzeQl57YHoDiF+wQVMgvWLyX7BOUaJDdKpgrsni3oMCLojYMZh5U7Z5BsewS961656DCY61wWG8mP72FAJaiJbsIhR5WoUt1S7mJ7QQoe8GOQt7jITcVoLtTva+QlV3mxVbuLmSlEhsMQGrlHkNeahGrXbTTkPFzyM0GyHXr9htyjDfrzFbsAeRoL7nxEKPe6r2HEmJDbT/MYU3tDkS5dHoTgtKifh8CGYNgK+Lr7tyd+nbfn7v5DkL4Y3JLIro//KNus74y33SLFEtJ+q8zYoIJade2KyUmTD8hl1gBVkqfr3pZ8XTEWyyfXHgI4ej6s0py8X2HF6yU/fbSPZaKvba9gcTiO32b3HUjZJZuJM5llmwmEkLjfVDKaR///Ua7oC99FW6COqWS1vtjj3xKMRIVtVsq6avj4WN/eqRi7VgcaLxUZuqDDFAk9T2GOonftv3++dTVCEYvWSn/u67dIYsgIXpqvVRqobjVcq4tyuYQaLxU5tvDx+PfTn1W3Eu7Ukm1RDKQtwJIJrWgeWQgvB5HZp9xnkaCh70cRuZ0KZtctRAwb6mSJBKaqkUgMqdDgkPG8hdgyJzsFIWMhS+BkMXSMzN/KYLMy88TSKjGcgBZaGVLDeztJedHYQF8zMlOscdY+BL0mJSeIY+B9IXgMSOd5I6R5GrsmJOaoo6x5CXQMSM9wRwj2QuQY0YyRRwjsbXAMSOT4o2RzFrcmJNJ08ZYbD1sTPowNGuMo6dK1JiUiZLG8C5rgF9SUoIzBvIWYMaCSJGijLNQsRYylspOMEZchwWIcfb0wyC//xcynft/3Si89x2VxfaDLsQk+aPfIUcFv/Tvf6/v+aHr7x+Q5z91PTUo6jt4tJf28nz+KjzU1J3z//JD8iEHXwx487f33/307u3/9+b9259+/O3bN2+//+brdKeviEuIe3hRFZX/7U/v/vr266+/+TEjNGy3TNLbH99/8+7HN9//9ss37/7+zbvfvnn37qd3GanUNcs0ePfNL+/fvf3qffYJRw1rZAWv3+h4zebe+K83eQFfeip6A506xIuCBlKBgFn8VNxzj+asBl33yRTVZN/PCOgIen5O8I1kv3s0rg163icpTbJv3NgFfaetXbJvwtwFnWfsXbL3T/25/4DA16D7lyaL+qeTRCMZ+fTQmRz4WqKR0/TL7V7PqbfyV3RUrf5lepE0f6FSLgQms/AYPSAXP0ZvrWzPzeYB31x82PZ2GqCIby68CuyVyP1v2lJEgv97ZjDWSv4uYUci0d/Nzcla2T+0n0tvPGh6U/nFtx+2Xa5BHVgHWixG61lNKLgOFKjF6yVjkAXs86FYjNhL9ME591yJOsRdIjkJ2ucKLELtRW8FBduRl6IWt5etAhRwx1aBWuRepUHZQlSN3ct0yIF3TJWl6L1EIwq+z/Woxe8V0ktGpBrBF3kGha7kMgyf1SAJ4qFTuATFF2hAwPiZ9EocXyKZBvJz6fVIvkADEsrP5Fdj+QLpOJifia5D8wVycTg/k1uH50vkUoB+LroW0Wd9IQrSz2O8Kkyfj/fm4BzebTk0z0ojYT2QWY3rS2wpCeznprQa2dfIJ6E9rUc1tkdHIkQUp/Zw3reXbvzj4/E0T4CcN7kNtMC7LaMXc60TS+e1MWq+CSVmly3QA3xxtvoBv4qvKRzvCo3eDYt0/cC/wq68vXa/bNv9IuVmF95et+VvzSvi4lvrSC4j9FtXt56UPy3EyFPPpsLOF8unlxpCi/o1p8Ya0YsPbYrqV6ElGtHLUV6z+nUpOX5wgRp+/3lIgSeWkZffyytY/vrc73ffno6PaG0J1u0reEliUQg0Xrg0QuHF6yIqOn6kxEcy/Q83Wt+Dzgq1v+pVtXMYiUlvHmb6Pxx3WIAfCfBtlkk4j9/BRo6SiIUEzZbJ6T4/tYddVk7QbJkc1LaHEvrlfRM7o1H3mc3R3Hi3n752x8clR3xqtUyKa5h/315FDYtlRTat3e0KBL20WiYlDUTi8ad4SJ08Gn8Aadk6tLwsAnYAQenTehApc/MbbTe43JDwp9Kknq9++v77b74a0nNynb2KmqY1H5VD5f3w5se3337zy/ustKDhUlnv3vz4f7/JCvKt6qQEC+LfLthRYOO/lvsT437Erm/RXaSXvl6BdrjSTqPEttVje9/9P8/tvkc8yVgYaLpQ3qH73G4v3x+H2ConELRdJnG8vD93u7+3++ecyFnjRTIP3Wl0SN18ebtLTYlXePMFcg9DIsOgfG7iwIZrZP3tNF9aMVGu3RpJu7+d9ucf2st2vs2OCYyaL5Dbn8f5TlVvBiJnLZdLu+745AYQbb1I6vfdp26/Kb9TtP1yyaxSMmy/XDKvlAzbL5CcrocPRJYVwidlbR+67e8u2zMlKW62QM7+2O5Kbgm0WyjpG5A4cn7zfHlgObnkVTfSYpESK3TYHYeLv3po+7nTHEiNmy2Q014u3ePTlKD23/3l4f3xd+QQwUBo4ppbjvmmWTTo42U3HPV6NdZosT117aX75nRCGEn4TkfNFssZND2e+n+N+xZDFXu3KxSduHKxNu+68+XUDyijUIn5BYtlvz24MRyW2+5UKB+/aMlbeH2ayUUqbLRAxvnh+McwaqPSLR6OB9Lw5jNcixyqn/PVqdSc2EnH0nJqpPiXET1cPhYFmi6Qdzm1n7rTuXtz2H07/JqQN2+67P7IFCP0MS5c+YeNze7x6Xhq918dH5+OByy1KxaItS+TXIqKw9ewgBNDMdFX5DN7muD3m5BurM+y78oDZRNzn/yILyY7vqBWdvG+NSp7yaZ1sS5LRnfFdnWxXpm9akKthRvVdSOX3qVODeGyLepC7cjv5RLvUt1Xcwuf0Nys48+jfCu4UDL9HV1Mfv3XdIvtCv1NXcKu1H9Zt1oX+vu6GZ3qv7JLj1b0rd3kyx3/fJMFBemy8DO8kaYJVwPFuJjYoHGlzOJlBBO7ZBUp1SS3iOD6LF1DSrWqn2XLV5CqMUsvIInBW7Z+lOlGf6MPfXMqP9ZX9HSQgyawZ1Fx0kSR3MR3/ObSF3zQr9CCJL7shxqRBZ/4q9Qk8a2/pEYLPvpHjVOwaODf6h7/tXxL8ePp+PjVL78kunn10gQ3z06P+iUoEFGy8kAxcbU1uoMXSPiU3LWDfYPPvp+QNJeg71MivSXT8/2pQ7Bp0LdvsKj3D5mH8mHFM8lMmpoJowOj2z52p/ZdNyRFf+pmIenH54M7fvgveMPkvA/E7Icy1wIpaDtMyD9eX6vZv/z33UBqhu6+vONfiC8GpPux7/a7892Xvzr5r++2x8exeO0f19/+3g1Tf2jhmvxlc/f6181r1XxhmPjHP17/6q8Yfxj/YWzG7l7/yl4r/YWQNmrGomb87vWv/LWWX1jOomY8aibuXv8qXgv+hRY8aiaiZvLu9a/ytdBfSNtEzWTUTN29/lW9FuoLYXTUTEXN9N3rXzXWm46ambvXvxqsmYma2bvXv1qsmY2aNXevf22wx9vEj3dDPREGxmEciM1rJb6wQsUt46FgwyNnDG0ZjwYbnjrjaMt4QNjw4JlAW8ZjwhQ1diweFaap0WPxuDBDjR+LR4ZZagRZPDasocaQxaPDhzFgEp3X8fBwRo0jBy/KODrqtWi+0E38RvF4dPg4Ovq1sF9oA4THo8PH0TFDnwy2jEeHD2PALNpnPDx8GATWoHrG48OHUeAbtGU8QHwYBs7QlvEI8WEcOEdbxkMkhnHgAmsp4iESw0BwiT0lEY+RGK2ZQlsCezYMBNeo9HiMxDAQ3KAt4zESw0Bwi7aMx0gMA8EbVM94jMQwEGKDtozHSAwDIRjaMh4jMQyEQMdIxGMkRyOHjpGMx0gy0vLHQyQ5ZT1kPEJSUNZDgjVHUtZDxuMjFWU9ZDw8chgDIbHFU8bDIw1lPWQ8OnIcHfVayi+kAi3j0ZHj6OjX0n5hOHhC8eiocXQMZttVPDpqNHL2tdp8wVR8QyoeHjUMgmjQlvH4qGEU5AZtGQ+QGr0C1BdRwC8Y1yCOtoyHSGnSGqt4iJQhrbGKx0hZ0hqreIxUQ1pjFY+R3pDWWMdjpBlpjXU8RpqT1ljHY6QFaY11PEZaktZYx2OkFWmNNXDfNGmNdTxG2pDWWMdjpC1pjXU8RrohrbGOx8hsSGts4jEyjLTGJh4jw0lrbOIxMoK0xiYeIyNJa2ziMTKkL2fiITKkL2eAj036ciYeIEP6ciYeH0P6ciYeHjuMgRSYL2fj4bGkL2fj0bHDEEjUwNt4dKwg7baNR8eOVk5h1tjGo2PH0dGo9Hh47DAI0qAt4/GxwyhIi7YEYdAwDLJB9YxHyA7joDZon/EQNRvScjbxEDXDQCh0LWjiMWpGRwFdC5p4jJphIJRAW8Zj1AwDodBxb+IxasYQVaEt4zFqxlcIHc0mHqNmGAiFjmYTj1FjSWvcgGi1IW1XAwPWDWm83G9h23GYLBo2bkDUuqEDI/db2JYOjdxvYVtJLrLut7CtIpdZ91vYVpMLrfstbGvIpdb9Fra15GLrfgvbNuQi6n4L2o48AV9G2Yw1MHIhZZA2jEwBX0oZ5A0jVcAXUwaJw8gV8KWPQeYwogV88WMQO4x0AV/+GCQPI2DAYQZkDyNiwHEGpA8jZMCBBuAPbKQMONIAAIKNnAGHGhwCotEmNthSyACEYJxEdgxQCDayBo0jKsAh2EgbNAGpwIiNvEGjdJEBFsFG4qDRVZ4BGsFG5qBRusMAj2AjddAKbwsGbeQOKPtjAEmwETwQRg9ACTaiB8LoCQj2BLmSMgAmmEgYSIAmmEgYSAAnmEgYSIAnmEgYSAAomEgYSIAo2Agi8BWQAUjBRhRBGFOAKdhIIwhjCkgFG4EEYUwBrGAjkyCMqYRIVtLGFCALNpIJfH1ngFowhy3wBR5wC+bABW6kAbpgjl3g4wbgBXP0Ah83gC/YCCkI4gyGbaQUuJEGAIONmAI30oBgsJFT4EYaIAw2ggrcSCvI0UcLqVGLAygGG1kFbqQBxmAjrCCMNAAZbMQVhJEGKIMpmjcxADPYiCxwjsQAzmAjtMBJEgNAg43YAmdJDCANNoILjXrRDEANNqILjUZFDGANNsIL3eBt4Q4ITZ8YQBtM0/yJAbjBNE2gGMAbTNMMigHAwQxNoRhAHMzQHIoByMEMTaIYwBzM0CyKAdDBDE2jGEAdzNA8igHawQxNpJiBm1c0k2KAeTBDUykGsAczNJdigHwwS5MpBtgHszSbYgB/MEvTKQYACLM0n2IAgTBLEyoGIAiz9H4joCDM0juOAIMwS+85Ag7CbGLXEYyZpfcdAQlhI+8wG9T6AxbCGpJXMQBD2Ig8DMO7BSM2Qg+Du90AiLARexjc7QZIhI3gw+BuN4AibEQfRqG+NMAibIQfBl8wARhhI/4wBm8LN4uHoTEWbwv3i8dhQyMrDuAIHwGIRVMwOIAjfAQgluFtwbbxCEDwFZ4DOMJHAIKv8BzAET4CEHyF5wCO8BGA4Cs8B3CEjwAEX+E5gCN8BCD4Cs8BHOEjAMFXeA7gCB8BCL7CcwBH+AhA8BWeAzjCWWK3H8ARzhL7/QCOcJbY8QdwhLPEnj+AI5wldv0BHOEsse8P6AhniZ1/gEc4S+z9w/wMTu/+c5ihwen9fz5L0qAzADhM0+B0DgCHiRqczgLgMFWD03kAHCZrcDoTgMN0DU7nAnCYsMHpbAAOUzY4nQ/AASLhgs4I4ICRcEHmBHCASLggswI4ICRckHkBHAASLsjMAA74CBdkbgAHeISPCMTiOXMAj3BB5gdwQEf4SEAsuhJzQEf4SEAsnt4E6AgfCYhFARgHdITLxMoG6AiXiZUN0BEuEysboCNcJlY2QEe4TKxsgI5wmVjZAB3hMrGyATrCZWJlA3SEy8TKBugIV4mVDeARrhIrG+AjXCVWNgBIuEqsbICQcJVY2QAi4SqVzQbGTSVWNsBIuEqsbICRcJVY2QAj4SqxsgFGwnViZQOMhOvEygYYCdeJlQ0wEq4TKxtgJFwnVjbASLhOrGyAkXCdWNkAI+E6sbIBRsJ1YmUDjITrxMoGGAk3iZUNMBJu6JUNIBJu6JUNEBJu6JUNABJu6JUN8BFu6JUN4BE+IhCLBmIc4BE+IhBrUPMP8AgfEQi+CgI6wl1WCBqzcUBHuCVTsDmAI3wEIBYP7wAc4SMAadAIngM4wkcA0qBhOQdwhI8ApMH9BgBH+EhAGtwZAHSEjwikwZ0BgEf4yEAa3BkAfISPEKTBZwMAJHykIA0alnNASPhIQRp8iAEh4SMGafBxA4iEN4mFDSAS3iQWNoBIeJNY2AAi4U1iYQOIhDeJhQ0gEt4kFjaASHiTWNgAIuFNKl0b5munErZBxvYmkbINEInYJJK2ASIRm0TaNkAkYpNI3AaIRGwSqdsAkYhNInkbIBKxSaRvA0QiNokEboBIxCaRwg0QiWD0wiYAIhGMXNgEICSCkQubAIBEMHJhE4CPCEYubALgEcHIhU0AOiIcHdmgNl0APCIYGbMJQEfESEBwMyIAHREjAWEbNLARAI+IEYHgyYQC4BExIhDcPgmAR4QrYkHtkwB4RLgEEjS9XAA8IkYEgueLCYBHBCfBvwB0RHAS/AsARwQnwb8AbERwEvwLgEYEJ8G/gOUsI/1gG3R9F7CiRZDkX8CSFpc9skF9ATGrahHkGihgXYtLH8EnL6xscekj+ByDtS0jAyHmGKxuGSEIvgYKWN/i0kfQNVDACheXPoKugQIAEuHSR3BbCgCJcOkjuC0FgES49BF8DQSARLj0EXwNBIBEuPQRfA0EgES49BGieAmM2whBiDUQABIxQhBiDQSARLj0EXwNBIBEuPQRfA0EgES48hd83AAgEa4ABh83AEjECEFw+wT4iBgZCG6fAB4RIwLB7ROgI2IkILh9AnBEjAAEt0+AjQhXB7NB4wQB4IhQZMQmABsRrhZmg8YUAsAR4cphNmhQIQAdEdpVzqJRhQB4RGhnJi0WkArAR8TIQNgGTfUTAJCIEYIwhjsPgJCIkYIwhkaEAiAS4dJIGL5kAEYiNM0kBWAkQtNMUgBGIlweyVAizL6wHDYG4+cSSfDCWgEoiRhRCGP4zACcRBhX/IzPDEBKxIhDGMNnBmAlwrjxQwNOAWiJMG780IhTAF4iRibCOD4zADARIxTBK0kEACbCAROUawtATMRIRQg3DRATYen8LQGQiRixCF61JwAyEa6eBq3VEACZCJtwUQAyETbhogBkImzCRQHIRNiEiwKQibAJFwUgE2ETLgpAJsImXBSATESTcFEAMhFNwkUByEQ0CRcFIBPRJFwUgExEk3BRADIRTcJFAchENAkXBSAT0SRcFIBMRJNwUQAyEU3CRQHIRG5oF0UCZCI3tIsiATKRG9JFkYCYyA3pokgATOSGdFEk4CVyQ7ooEuASuSFdFAloiRyJCOPonqIEuERuSBdFAloiRyLCOHpehgS4RI5IhHE03pKAl0h3uAdH10MJiIl0OSUcXQ8lYCbyesQHuh5KQE2kyyrh6HooATeRLq2Eo+uhBOREOnLC0fVQAnIiRzzCBLoeSsBOpGMnAvWUJIAn0sETgY8ggCfSHf4h0IJACeiJdPQEd38kwCfS1d+g+7cS4BPpTgER+NQA/ES6g0AEPjUAQJEOoODHEwCCIkdMQpw7ABCKHDkJDp0kYChyBCV4DasEEEWOpASvYpWAosgRlOB1rBJAFOnyS9BKVgkoinQJJmgtqwQQRSZqcCSAKHIEJXg9qwQQRY6gBK9olQCiyBGU4DWtEkAUOYISvKpVAogiR1CC17VKAFHkCErwylYJDwqR9OaAhEeFOIiCrswSnhYyghJ8ZZbwwJARlOAQUs7ODJGkFyrhsSEjKMG9UAlPDpG0Zynh2SGS9iwlPD5E0p6lhAeISNqzlACiSEV7lhJAFKnoTR0JIIpU9KaOBBRFKnpTRwKMIhW9qSMBR5GK3tSRAKRIV4iDenUSkBQ5whLCqwMgRTqQgr8XgKTIEZbgXh3gKHJEJbhXByiKHEEJ7tUBhiJHTIJ7dYCgyBGS4F4d4CfS8ROBezKAn8gRkeBeHaAn0tETgTs9gJ5IV4UjcKcH4BPpynAE7vQAfiIdP5G40wP4iXT8ROJOD+An0vGTIaxG3GHAT6TjJ/gxGRLwE+n4icR9E8BPpOMnEvdNAD+Rjp9IfLABP5GOn0iUXUjAT+TISJjEzTsAKHKEJEyigE8CgiJHSsII5wAgFGnpNw8QFOkqcogzn8DwWZe8gIc+AKHIK0JBuaEEDEU6hjK4EljPYPgcRFH4xAAURTqKovCJATCKdBiF8CYAR5EjK2EKf7UBSJG2SbwmgKRId1KJwu0AQCmycUXeuB0ALEVe00/wWQRginT5J8RkBjRFjsSEmEeApkiXgKJxawRwinQZKBq3RoCnyMbVMeKTDgAV2biNcdwaAaIiR2rC8Hp+CZCKGrEJcZwXQCpqxCYML/5XgKkod4wJXrerAFVR13NM0AmqAFdR7iAT3MwpQFaUO8lEoxNUAbaiNpo2cwrQFeXoCj5BFaArakOeiqEAXVEuFwWdngrAFeXgCm7mFIArysEVjb5+CsAVdS3YQc2cAnBFObiCV+kpAFfUtWQHfUsUgCvKHWiCPwzAVpRjKwY1XAqwFeXYiiHuD4yeYyt4qZ4CbEWN+AQ/7VABtKIcWjH4GwXQiqKPVlUArCiXl4InxyhAVpQjKwZdShQgK+p6xCr+pgKyokZ6QjwKQFaUO2fVoKhCAbSiRnxCHBgI0IribvDwaQ/YiuKuChx/qQFcUS5FxeInMQK6otwJJxafnQCvKJekYlF7rwBfUY6vEDoDwKKuh5wQOoPxc2kqeGGMAohFXfNU8LkMGIuiC3kUQCxqxCgMT6NWgLEo4cYPn54Asijpxg/d41aAsijJEm8JwCxqRCmUKQKcRUk3fvgEBaBFOdCCp1MrQFqUIy3EOwVQi5Lk2RkKkBblSAv14MD4jTiF4UndCrAWJZvEWwLPa1WbxMSHR7Yqlpj48NRWV9TT4GrAg1sVeTKUgie3Ktr1VLOzW90RQ7gNgMe3uqoefEtGwRNcXeoKnuKu4CGu7hRXPMddwXNcXfIKnuSuAHRROrGvoAB2USNbwbcKFOAuyuWu4OnzCpAX5XJX8Px5BdiLcuwFT6BXgL0oV92DZ8kqQF+UK+/Z4G8JoC/Kne+K50YqQF+UO+IVT3hUgL4od8orntWkAH1R7qBXPFVJAfqirueg4FMD0BflDkLBU5UUoC/KnYSywUcQ0BfljkLBU5UUoC/K0Rd8m0wB+qIcfcF3vhSgL8qdhoInQSlAX5Q7DgVPglKAvqgRsOC7WQrAF2XptGgF6Ity+Sv48gfoi3L5K/jLCuCLGvkKvkOlAHtR7kxYdIdKAfSiRrpCRGeAvChHXoiTqsHIjWwF36FSgLuoEa3gO1QKYBflTofFjSGgLmoEK/gOlQLQRbkTYtEdKgWYi3JnxOJjDJCLcvkrKIlXgLgol7+C7lApQFzUCFXwHSoFgItyZ8Wi1EcB3qIcb8FPOAe4RTV0HYICtEU1qbPL4eHlqdPLwfHlm8T55YC16E3iBHOAWvQmcYY5IC3alfzgZ5MD0KJdyQ9+OjngLNqV/ODnkwPMot2RsfgJ5YCyaHdkLH5GOcAsekPnHWmAWTSj8440oCya0XlHGkAWzci8Iw0Qi2Zk3pEGgEUzMu9IA7yiGZl3pAFd0YzMO9KArWh3IAqeh6sBW9HXE1FQ90QDtqLdkSh4vqwGcEW7M1HwfFkN4Ip2h6Lg+bIa4BU9EhTU49cArmh3KAqeWqsBXNHuVBQ8tVYDuKLpuh8N2Iqm6340ICuarvvRAKxouu5HA6yi6bofDaCKdt+xYaiDpgFU0XTdjwZIRbtv2eDJxRogFe0+Z8NRj0sDpKIdUsFjLw2QinYfteH4uwGQinYnx+K5cxogFe2OjuUSf3Bg7K5nx+LvBoAq2kEV3GfWAKroa/kP/iIBqKIdVMFDQA2ginZQBffGNYAq2kEV3BvXAKpoVwKE5/tpAFW0qwHC8/00gCraFQHh+X4aYBUtaRdFA6qiJe2iaABVtIMqqHurAVPRV6aC9guQinZIBXdnAFHRLoEFd2cAUNEugQV3ZwBR0S6BBV+aAVHRLoEFX5oBUNEjM6E+ywLGzR2Tgrs+AKdod0wK7voAmqLdMSm46wO/i+OOScFdH/hlHE0njGn4bRxNJ4xp+HWckZYQLhX8Ps4ISwiXCn4hxyWx4OM2+0aOJldF+JGcEZTgqyL8Ss6ISfBVEX4mZ4Qk+KoI+IkeEQm+KgJ6oh09wVOBNaAn2tDuCWAn2n0tB62M0QCdaEPn+GlATrShc/w0ACfa0NG3BtxEG3rjRwNsol3SCm6eADXR7hRZ3DwBaqLdKbK4eQLURI9khDBPgJrokYwQ5glQEz2SEcI8AWqiRzJCmCdATfRIRgjzBKiJHskI9e0oMG4jGSHME6Am2lX94OYJUBM9khHCPAFqokcyQpgnQE20O0oWHzdATfRIRgjzBKiJHskIbp4ANNHu4zqoeQLMRI9cBDdPAJlod5As3hSM2UhFcPMEgIm+fmAH95cBMdGu4gc1TwCYGAdM8CpUA4iJccREoK61AcjEOGQiUNfaAGZiHDPBaw8MgCZmQ5tJA6CJ2dBm0gBoYja0mTQAmpgNbSYNgCZmQ5tJA6CJ2dBm0gBoYhhtJg2AJobRZtIAaGIYbSYNoCaG0WbSAGxiGG0mDeAmhtFm0gBwYhhtJg0gJ4bRZtIAcGIYbSYN4CaG0WbSAGxiOG0mDaAmhtNm0gBoYjhtJg2gJoaTZtIAZmI4aSYNICaGk2bSAGJiOGkmDSAmhpNm0gBiYtx3f/GyJAOYieGkmTSAmRiXiIITCAOYiXGf/8Xzxw2gJsZREzwp3ABqYhw1wZPCDaAmxn0HGE8KN4CaGEdN8KRwA6iJcdQETwo3gJoYR00kvmgAamIcNcGTwg2gJsadmYInhRtATcz1mzv4zADUxLiCHzwp3ABqYq7HpuAjCKiJceemSHwEATUxjppIfAQBNTGOmih8BAE1MY6aKHwEATUx7uwUPHvbAGxiHDbBGZIB3MTIxFEOBoAT4yp/FD43ADkxrvQHzws3AJ2Ya+0PPjcAOzGOnSh8bgB4YlRiM9wAemIcPcGTyA3AJybxPWED8IlJfFHYAHxiEt8UNgCfmMRXhQ3AJybxXWED8IlJfFnYAHxiEt8WNgCfmMTXhQ3AJybxfWED8IlJfGHYAHxiEt8YNoCfmMRXhg0AKCbxnWEDCIpJfGnYwE8Np741DD82nPraMPzccOp7w/CDw6kvDsNPDqe+OQw/Opz46jD87HDiu8OzDw+TGzwGfno48e1h+PHhxNeHAT4xDp/gJSMG8BNjGZ3BaABAMQ6g4PUlBhAU4wgKXtlhAEIxDqHglR0GMBTjin5wjcG4OYSCF4EYwFCMYyh4EYgBEMU4iIIXgRhAUYylXU0AUYw7OgWvATGAohj6gzwGQBTjjk7By0UMoCjG5Z7g5SIGcBTT0ElDBoAU4w5PwatFDEApxp2egtdTGABTjDs+BS+RMACnGIdT8BIJA3CKcWfO4t8nMgCoWAdU0HXZAp5ir+U+2PppAU6xrtoHXZctoCnWFfug67IFMMU6mIKuyxbAFOsyUNB12QKYYl0GCrouWwBTrMtAQe27BTDFugwU1L5bAFNs4qPFFsAUm/hosQUwxSY+WmwBTLGJjxZbAFNs4qPFFsAUy+iMLwtgimV0xpcFMMUyuq7cAphiGV1XbgFMsYyuK7cAplhG1pVbwFIsJ6tbLUAplpN15RaQFMvJunILQIrlZF25BSDFXj/Jgy4vFqAUy8m6cgtQiuWJqmQLYIrliapkC3CKdTgFL8uyAKdY7swkunBZAFSsS0LBv6FmAVCxDqjgJVEWABXrgAr+FTULgIp1QAUvXbIAqNiRmeBDAnCKdXU9eKKnBTjFCvrIGwtoinU0xaKrnAU0xbrCHrxIzQKaYl0OCjGLAE2xrrCHmEWAplhHUyy62FpAU6yjKfjXiiygKdbRFIu/UYCmWEkPH2ApVtJFkRagFOuqetANXgtIinWf6cEfMQAp1p1Cix59aAFHse4UWvSoTQswinUfMUaP2rSAolhFH6loAUSxij5S0QKGYhV9pKIFCMUq+khFCwiKVfSRihYAFKvog28sAChW0QffWABQrKIPvrEAoFhFH3xjAUCxmj74xgKAYjV9pKIFAMVq+khFCwCK1fSRihYAFKvpIxUtAChW00cqWgBQrKaPVLQAoFhNH6loAUCxmj5S0QKAYjWd2mwBQLGGTm22AKBYQ6c2WwBQrCFTmy3gJ9aQqc0W4BNryNRmC+iJNWRqswX0xBoytdkCemJd3Q5eEWsBP7H0d3os4Cf2+hVj3DsBBMVatyuO2mkAUKwDKPgaC/iJdYemoGzcAnxi3ZkpAm8LRs2V7aDPF7AT66p20LkA2Ikd8Qg+FwA5sSMcwecC4CZ2RCP4XADUxLoTZ/HCZAu4iR3RCP59JwuwiaWxiQXYxDpsgif9WoBNbEMWqloATaz7SA/hIQJqYh01wYuuLaAm9nrmLO4AA2piHTXBS6MtoCa2Ic/YsICZ2Cbx8RALmEnjmAl+VEQDoEnjklDw+uwGUJPGJaHgpdENwCaNS0JBV4sGYJNmRCP4atEAbNK4zxmjq0UDsElz/VYP6v42gJs0qeNnGwBOmmsWClpx3QBy0jhygtcINACdNA6d4HXUDWAnjWMneGl0A+BJ4+AJXhrdAHrSOHqCl0Y3AJ80V3yCvlEN4CeNS0bBK5gbAFAal42CVzA3gKA0jqDgFcwNQCiNQyh4BXMDGEpzTUjBJxKgKI3LSMErmBvAURqXkoJXMDeApDQuJwWvYG4AS2ncB3zwCuYG0JTGnZOCmc8GsJTGsRS82LkBNKUZgQn6RdkGsJTm+n1jfF4AltK4Dxxv8HkBWErjUlPw6uUGsJTGfeIYr15uAEtpXEEPXjrWAJbSCLdJh88LwFIa4ZLT8XkBWErjWApeOtYAmtIIZ0DxeQFoSuNoCl4P1gCc0rhTUvB6sAbglEa4753hIwhwSiNo9twAmtJIFyLgow1oSiNdRhg+2oCmNJI+1bQBMKWRbpcVnxkApjQ0TGkATGkcTMFrrBpAUxr6jJQGwJTGwRT8KPMG0JTGpaWgHn0DaEpzzUrB24Khc9U8qEffAJrSuGoe1KNvAE1p6G/6NACmNPQ3fRrAUhr6mz4NQCkN/U2fBpCUhv6mTwNASnM9iRZ/7QFJaehv+jQApDQjLBF4TVwDSEqj6eiuASSl0XR01wCS0mg6umsASWk0Hd01gKQ0mozuGgBSGk1Gdw3gKI0mo7sGYJRGk9FdAyhKo8norgEQpXF1PApdaQFEaa4QBTfqgKI0hozuGgBRGncILX7mVAMwSnNNQ8EXCwBSGpeHgtclNgClNMbVX+ELAIApzUhMBF4K0ACc0riP+OAp+w3AKY3DKXjKfnMFKv94fdcfPnWnS7d7e9h1n+++/PXXu99++5/z8bDf3b3+991vvftn/Xrs9e7Lf9/puy///Z/Xd8y4/0rh/muu/89Yc/1D8esf9voTF9e2wwelxz+GD3C6P/i1zfA5Mtfvxv+hmftjKMd3f/jGQzWZ+6NRVy24/8PrM2wHuj/M9fKBd4x/NF7W8I58+e///Oe1f0Dj/w0P7Ld2vz+1h/vuHD6N4Zip6XkMh0tRFx8Ox0t76Y+HfvfYPoVdDIfZvHThlMW62B73+247dBFrwAMNhu+CEJfvuo/t8/6yP27bfRd1YG0gX27cgxhOIyN6uu8u44P48Ge/i59FE3SkZeL6y/EJe5YmvJ5T12O3EF4pGurKx/bQf+zOF/AAZfgAGXXxU3s6d9QgCBX0wclbH/vAtRChFlwke5g/u+G0rODZkfNwvPxy6rrDcRc9wqHU+uXFluRbgIjmgejhQADiysvD8+OHQ9vv46tFYFCGLHrqanzGyPDtI2fsp3b/DCaMDieMJS5st9vufL4cf+8O0dWSBWNlqFeu3e1mT7kJrhxAFXklonL4dklqgrSH+/jdMMFlfEPqOtmn8NrQMgxfvc9d++G4+zNaK4KnzEjjGF/vJnikhQ61oGZm0sKy0MKSoz31sO/Pl+jZh2/X8J3mXAdP7X08eBsedCDIUTg/ddvLaegitlChePoJXC7d49Pl1J2Pz6dt90d/eZhNXRE+ioZW5Pny0D71n7rTGUyJ4WTjl7lvr8vmcLAx3dPDcb/rD/ezh6JCk2fJ6fF8eTie+n+ND/a3j22/76JlZ0hNmboZElLS3XTx47Dh46AMyAfwLg4u3ctlhtIcvg5NcBW31BP78Nzvdx9Px8fB94reAxO+B96paagx3LaP3amNOggmIRfUNHLXnbp9exkmAGIWBr8zuH3qqW3bw6c2ttebYMQFaa/dhXCVYeEqQ5m/7UO3/f18aS/P0dUDJHzRmFMDtt33298vD6fj8/3DuTt96rdgwoarvCUf4OQjxC9xuGhsrsPXbMiHcNwfIzMYTnPWeMdVU/N9ezycL6fn7SXuJXh7rw43u3p83juWfmZd/59x31B5h79h3o33/ry5ut/cbrw/7914wbw/b70/7//QVxddednKd6jkVdZwEuzV1b8GEdp3OJzJcPX5G+/z+z+s/8Oran04MOR0uT+k/8Mrb6fGzVVo49s0cooUro2HmJN88pfh/yMvJ3hjhpLq5JWDgzubPrIJfY6rEsPZ+omuPkdKhNbWj+h1IK73ba7/z/zgMXUdTmaVH3I/9saPK/N/+EcsfLwnN/4PdR0PzfyY+cZaaz+KPn7kUyDpx8xHktYPufUrT+NlNWTAsT117aWLlhG3inSnE3g5mAqXg3SHyNUyvJo0UePV/eHSnQ7tfjAz3QnpKzRYtK0e+zp158up317QO9JhP6ThO8fmUoReAulw7NpLG9tHHdpHb0eEH8WGeqBDR8+nPu7LhH1RPpuPatsP3T663IQuHyMFk0GxCSNKMqC7Xj8EVNGbJkOP5PoK+AmvSEd61527U9/ue+AADzU/L9bDUgv+7jjM8e1D2wOXL3RWSP9o93yaG50wOJPkCzZ4nZGjM5xK+LJYM2rwukPMD4QNpVEL42yOD5/cCUyjX8YsdadjB7vuvD31T3MzG7q3hvLRus9P7WEH/NAwQBtyLMhL+1N37oHY0DgbynR0n53R8C5+/MIEzt11zk0LtrfDzFtv5q0u9waZe0PKG+5Xbo/k7PUP6ZdD1Xju5r0F7Zma8bTOeOl2c11ErMrdGOp0hbOC9HY/9t1+d/z4qe/+iFze8KlI8uLj6UO/28Wh0pDF/jKeZKg0eOrQfPLQeJN84L47dKf2MuGYfhd7vE0YmzDKdN93l3a7PT4+tYc/+8M94nQ3IetQ1Fsx9IMRzuFo9YAsUWvBcPkMPdjQY00JfiEAgCkOB80EjhP1Pg59XC6n/sMzfKFloIOdQLWHnJaakPfd5UO7/f3+dHw+7GauOA9h3XCODd1J99B+6oG9Cu9p+A7w9V3d+FeKcg+H/kBIGdocbjMXiujRhuSak9H3fXfZtofjod+2+/6xve/gOr0JZpfQ9Fy/uJk5H+BwbSOdpvD68cKoiybsglqlpi7A/BYmvDoxw9zV8C3lgYXRJEl8uXy4bPYQ5CbUIT0WL53MvB4egklDeo1DP1OMijxQFtovSTpPUTcAqYeBMsmGXAcgypWhzUg9iePhY396nD8DHY5nk5pQ8zhtODErmM3cL2mJaT13gsNArUm8kqTvGr7TPjjycdjGh2jeq2Zmit/9ku4XXu4pgfBhtZhM4LRu+8V5OHj0upJbf9v+Dy/d+rXdkuzm5b6gU6yiRdE7xZOnknxQqK8WRsTWIwXv4CgfIBoy6hh6xpzeTRPOAY8fyF2l++4yhJPPp47QcyiLDmZkYk5f+3no2h2IAHRo4prEi035QcFrxZO3cjw9ttE7EcUA047u9Q/u5yOXPvj300f7rV1L7ibddxfkXk1oDEk/ery2v3+IEUe4C+axlX+NuZ/PXF7/EH7X2KrEG/5wfOwgu1aBIM+apPCTObWa9n3/0fvvlz+fQNQZequ+s7srKfQv/nRf/nb8bjj3u9i8uf4hPFgT3lwID3Kk70f5TXDtR1cb7S2A/8NrYX0kYcntnOEeB0fhn8/tvgdxYRPyldS6MPYQrylhGCvIWHS4draehZsegtwcHS/tPrdbhAfw0IluWGJV6Q8fj8BHGs4YCGZ04u0bqNDhDJ5aGIew1PvQX7pHwNtD3JvybeaLULj158mFf/v9MsA8S2Xa2wOPFLnyf/iEDMGnuNIvS37myYn2+nwO5ZGu9gRS+x0P49m58frYjbc0KmFp9u356j4hflM4QOQ20LWTwRbMndAQHJiUH7jvDveXhzggCF0Gnbq233aHc2yJwr0Yz5r8265IcDZ0Nszy/tzN95p5mInRpBxADFXzcO5okp2NV99HG50qxI6e44jJEKbG5Xj8PV62bLjZtvHQOhVb+bwM1CMOIUQqFidSTMI1NGU9/OVwZeDhBpYiudTYw+dd/zhYEeiUh12IlL/12H5GltZgnqlpMZlWg7RGf/S7eMqHgYpftYTfcbIqpVy369vZ4wkTQRoyh2e8/NJClz3cXp8Syjwo80sg81aLecLI/S4JV/6PZtr08h7G5Jh6n0P7uag9cNPGb1Zt/B9euvXulVWJF/nxeOk/zV7D8JFwcrPyvrsc2k+79hIblcCY+W0Z6R+AIsnq0Fn3mTKQITNJuaDgNkKClzIBx8tDd8JiOhbmXqQA1qD3rj/s+i1ABDLQwZAUcejheL50J4zBqfDtSYzl06n7RDy/MFEqZceeTsePPXBfwkwc0yRe1qfT8ak7AQckuPb6Dkyz+jphr//PPM1ik/ftXwDu7Tj3pFiwyUv1b4s3LNLPe+mdd+0dC+0ba+9zaB/mGh8tm2lH1/scdtpK9BFw42U15E5D8Dja8/HD/3TbeIUJQoDrzfpIwKeeeofJu+HM2zrmgwbul2ruNRRscpga/1i8n+SNkZzCUh/0az45795h8sbIeJtmvD7W77Ba7+lbP0yNl9Wk/BA0/5OHSU4q9VSvlz+18aLAQ3dVZeUDDhcmJqfe0TGzJd66CRORfOgkp1QEcs9h7Oyw60794T52gEKT5cfHryf+FfL9M7+nzf1bxX20xRv/Ygg/FaZgcwrWfESmp0wJn4NhfGqH8dKtn0A2tQ8w3RR4wsFdeeFTDol/A/zCx3z0z/1LwSdm4H174ZONhQ9u5eTte5de+zdGe+/A+HwD46Vb/0xtij+fun8+96duN2QHdY+zBI1gjZhA/PVNmO7Nv87egnFv7rgnZMLjNOFzKsTkyE6p1c10b96meT/K+N0444Vb/2RtymPDNgTD7SOensPuYvg+i9AvatKvlOsh3gULPVb/VLzhEZMpIvPMh36x5DMevayJq88wiBehjWhSb8B52x2gDxCugjKxgp67rt2f47gmxB4Tf/E5PClGfO4Gvh4jch3MVcZTD6D753N3GAd25k1sQocksUU5dQI2BcPEazIHbbx8tqMbDuCUy+VptneBmX9bmF8XuV9EufeOhXelhfRoYYqAJ5rtWYX2C5v2u9nGl5wYL9166dYbzCblqF7vbY4TwuQT0yTWsWsP8bMNRsYTRb9bz7xFZ968ML+Cc+/qcK+78CuD8JU5YvLlp9jDO1raxzB6AufePTNeuvXSrbe8TfJFmJkkzcOZm/DEz5f2dJm70TwEBCaFlYMOEE865PFkJv3Qy3N/aT/sOyQ/qIkC2MQQX9rTfRetNSFK5ClAM6RzH0/tftjdPx7AiiXC9bhJ3cVUeBFHBCEZvA79VLjlJ5d/r5iHb9wbcO6ngPArtfDBgJhcqMkj8W6H9p6N9hjaeG/XeOnWS7cpyEtUk4Rc3sgEpxmvBxY+3GORKdl4LUpYRqVT43G8tHt0KzpkeSa1tLkuqM3XkCaSxQq+lzk0DpP/JJm85a8nqpk2YR+5OyHWmDBvhcy2Hfo4tdvf+8P9zBCH+Yg+SJTei1OpMHiIMM7DXlhkvsIMbDKRzl+9n4PRMBvJkmmAYwcdqM4KvA+dnJuAjIXpFX5NZN5b5f695HJC8t7Ep2zaDBizkLYqHx2oaYsptb02dhbPHhsa1ylZZwLBKTw4bHz2h/tdf0JS8MMsbOnjEuUdDO2tnUneuxPw0EPKFEYQHk3IKbHdTJts3umQifGf8dJwh2CqpvV+EPfxD/e7+mIyprSUIessXlACGY2h5thDe756LX67G2Q3hSZYejdfesdMkQUPc+TMwoVa+iVIeifG8ukmqenVkxV8oZKk/xrHQ6HH7EfAD7Nfw/wC6kPG6ZXzW13cu3Tch/3Cx3zC4yvh103p11bp31jp30/l40LtvVg95Yr4wdd+ITZ+M9lMvMdHrnbapfcrsm0mFOS9PHLLtPeJm+N+rQ8DZykxIbqUZLlUn05vDd9dMm9v1sdMlzAZQ22KdTk+zRfaMClDkZsOw4Z/9HjAtnaYcUS+dWHWQLSPElgdMjE8JT2Mxcgw0O3Gu7ce5L+xMFtJ0GPr3YQj9iDDjA9Fbo/NHPmo6NpjkgkwTClG/iX1AEn610L5cE95J1R52mT9ZoclnUh8rz5YpxkZ+fnij99c9cdvs5R2HvZjyaro/uzs27DrcRq8wTifXodGjsw76s/t44d+KDuC9jcMYxnpLfVnvHg4dFnEBPG8gfRrmF8O2VRB5m0V9whM+BBeTDlGE0SZ6KBfAvVUaeQtrvFW2kzZPl66pQ3bOVHVvAndwKmUyq/B3mZzMibrz/PazNCWMM8juA+FOOnyDH3NwuTQpHjnxnMVv1wwH64xv0Zzn+fBvXzh6YCY/MPJjZ7Y5bQQTQnMfovF+A1S46VbL92S+3D+hsZ7OT5fjh/HWCuOk8JcC9K37M94JSaP8vuuGl51byb85Jd4v+Byb0e4xyHCe89icrumvEaPZ5S3NXo6u8TvtBjvJBgv3HriYv0K3pC55f15cnHb/fzNDUELmQPbnz/2pzPKWcK92sTcGxcGZL9RhFtBDSP9q3O4ssxCl3A7qOH0ML9k9sQ3Ee7akgkK/Xnffer2G/pWQt7M6WcxdsPobkIGzDPacLqbMKQljwnpz7MpEfo9zJtWPhX/Jt6i/bEFpU7hfridNnG9izrlcNEOydm7A/G9hZ6Ef0mur+FmAp/ex/bLOffyuH9rhF8MxJTo6X1a6V115ZcQPe0wTzXDPjI0Xrr1/oH1S0izIT218+NxF2OIMCOdeW7GvfPByRCtPz8+7y89NrXD7Xyyqup6vacrMVwJ3WCy4Kw/P7X3/eG+OwwYFOz2ht7vVP2l6Ofy1J3G8y36Tx1yNkFYjUKmz/Xnp2N/QHdFeJg8qxNvxmw5CXmX35TxwRnzJpl5G8/8Xh33W7vcTwrhl0LhN2eFX0/ktPvgh11PW/h+89P4N8hMVc7edbF+AW3oiOV86s5Px8O5e2gPu5krGDI9Mn+8P487bh1Kv8Ik2smB8i9h4++4Ibcp+/O4IYf3Ha5XU0Dq92D87mFDngk19N0dwGZfMKr+hfa+j3+fmTcQzMcN3MMr7h+58CMmvB7SGyM5bZp4O6q9ZdV+29d4BGSmSNu7RZYOuM7YSxvVjfm54uennypsytH3lpl7gsa9oyG8usLzCem30uRE6L3vqfXkQnrM4beazHSQmvdlLMlp+/Pw8vcf+y0Wx+pocvnRmfIgfATASfQ5dH9EQphwr5SsBOnPEZPvPoFK0LB0xZCJ7/0Zn9thuOAXFO9VNn4CNmTqwrXbPflehrc4HWzn0Y0f4IbckZhvAIQ7S3KKkScL5oM5Q9bEulMDsXEOc0iIi3/vj+ffsULgcPdQknnw80z2sIBVTNR3ygzzJt+SifljlyOmfmr7GHaGh7Io0kXdt4f75/a+A+dSsXDRU2R6/nxShzOKzOwYL0sf4xP61+SxWIP7F2HQ0JGcduB9HCx9QK/IVWb0JwFeG04uGM6fD1flKAeVfDhEZyz2LEO0zVN3Cvs6Y5qFwQ0JZ8jegGphlTeZzTF0hvnMwUzwFoXcV8dOuQgz9vwKoshNfVcx8C+kYoCFBWaKrGDdH+/7A/puh0sbyc2GeoFnLKWE6fD8BPpFnlcJhKl6Pl+CJx7A0AFW9BCefcnJjB5sCIdvNwS5wd7p2VAPwfeBUvIw55syDGSNQTivNblp+9gent3GT3yxDC+mRuDxeDjen9qnOO8zPLtCk3ojeeosXN8Vm6gJ2cVxBzaZw0PVLMlID0NV5Fgr83zanx/byzbendtEhSvUyE29zMsXQvtEbtlP1z+f9rH4MFGPHLjj4eOpvYeZjyyMmwQZCaL7H2HIdrUdPkryFJSJabfSh+newed+f4n7HT3h3UjhfQxhp3XFI3rvfCsf0+uptMLv5BrPLY3Xx/qFypIB6lN76g4XHBmGG1hTAaWP/xR57oLrcuaRhKmEUwnctGlOHgzoepsfKRoOPnm0mLt4jlJDX0+Tdns8lDN+8UJ+wKeVwz/31CM5dx+Ou747DyenjM4nPG6zifKnqRkJzuONk5vCNKDSHmLDEEYkxiYmzbkbbiK+NuTTZM3KdC0QHLJXMj1svBieEMnDswdMaiK9nEIcjWrg2fmB9FUSZB0ffaYxDz12Q5YgjR2ch/ydofZndmhmGDKkx+ETR/yS0EEnT8SYVSKE+eCavqw7n/vH/jwwunAjLn5TQs+IXBsSXCssbCD5M8KKWZgtKT1NUeQR4b7WZf4QQxOjyBB8blzCvWHtKUSzoZwDJKkupOaCzNg+dSBxPfSpySUNr90IKbQmaQbmfEUneHuL+BJvUrZ1ilrQXVQWDr8gCz/nnYBd+vA5pu7qepBgvJEbVjqRkdjLxaiDHr6H5CqVwI8ifCUbcleeZoyCR1n4lFWegUQe8mFNxibu3YVHwoVPjgyI0ST/8BwcMmJF0X6YFmESl84T88NBMiRYOGPHBZgoQY0WekFMdBj/TOe3kLsi54fjH0MYPSZRtLO1X4RGpyF3Es7gJGgeRhKWXOzOT+3hfOkfgRMVFrzTUzPBP8OFm5G7g2NWe8z+wpOayD31+YHILCwIVeS5au7CLXQ5TXS+JfWIkcz38HwTsop4TM2O5YUn/ZBnhOF57iFjs2RKxpghiNqtqIopefnsNJdwm1SSqV2osQrn8N01kKLex6mD+dH5PDw739JPPAmYech2LHnc9+XUDufFd+1h97E/gAU5jI/J2mX8uxQhV/DbwpbMRvJ9zEPsENqRxybDk1vCvGZLHgzyfIF1COHheg3pcc1tYXjWi5qCap9N0pDrP5GVzEPbakms9ak/9x9AxXhIxiw5ZLNEZRYGt9Knm6rp4DAfKlq8sOofr++e+qdu3x+6uy9//cd//vP/A7xooUwb4AIA"; \ No newline at end of file diff --git a/docs/classes/Annotation.html b/docs/classes/Annotation.html index 134bf185..ebfd6922 100644 --- a/docs/classes/Annotation.html +++ b/docs/classes/Annotation.html @@ -1,4 +1,4 @@ -Annotation | manifesto.js

    Class Annotation

    Hierarchy (view full)

    Constructors

    constructor +Annotation | manifesto.js

    Class Annotation

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    • get LookAtLocation(): Vector3
    • A 3D point coordinate object for the location of an Annotation +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    • get LookAtLocation(): Vector3
    • 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)

      -

      Returns Vector3

    Methods

    Methods

    • 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.

      @@ -56,7 +56,7 @@

      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. *

      -

      Returns SpecificResource | AnnotationBody

    • Returns null | AnnotationMotivation

    • Returns null | AnnotationMotivation

    • 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 @@ -67,11 +67,11 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • rawbody: any

    Returns SpecificResource | AnnotationBody

    \ No newline at end of file diff --git a/docs/classes/AnnotationBody.html b/docs/classes/AnnotationBody.html index 3dc38052..7d53f125 100644 --- a/docs/classes/AnnotationBody.html +++ b/docs/classes/AnnotationBody.html @@ -5,7 +5,7 @@ a light, camera, or model, or a SpecificResource object wrapping a light, camera, or model. *

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Methods

    • 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 @@ -50,4 +50,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/AnnotationBodyParser.html b/docs/classes/AnnotationBodyParser.html index 00228a9a..14de1cb9 100644 --- a/docs/classes/AnnotationBodyParser.html +++ b/docs/classes/AnnotationBodyParser.html @@ -1,3 +1,3 @@ -AnnotationBodyParser | manifesto.js

    Class AnnotationBodyParser

    Constructors

    constructor +AnnotationBodyParser | manifesto.js

    Class AnnotationBodyParser

    Constructors

    Methods

    Constructors

    Methods

    \ No newline at end of file +

    Constructors

    Methods

    \ No newline at end of file diff --git a/docs/classes/AnnotationList.html b/docs/classes/AnnotationList.html index afcf3bcd..85e4814c 100644 --- a/docs/classes/AnnotationList.html +++ b/docs/classes/AnnotationList.html @@ -1,4 +1,4 @@ -AnnotationList | manifesto.js

    Class AnnotationList

    Hierarchy (view full)

    Constructors

    constructor +AnnotationList | manifesto.js

    Class AnnotationList

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isLoaded: boolean
    label: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isLoaded: boolean
    label: string

    Methods

    • 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 @@ -22,4 +22,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/AnnotationPage.html b/docs/classes/AnnotationPage.html index 89f90727..6158b360 100644 --- a/docs/classes/AnnotationPage.html +++ b/docs/classes/AnnotationPage.html @@ -1,4 +1,4 @@ -AnnotationPage | manifesto.js

    Class AnnotationPage

    Hierarchy (view full)

    Constructors

    constructor +AnnotationPage | manifesto.js

    Class AnnotationPage

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • 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 @@ -35,4 +35,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Camera.html b/docs/classes/Camera.html index fd633f7e..75d559af 100644 --- a/docs/classes/Camera.html +++ b/docs/classes/Camera.html @@ -5,7 +5,7 @@ a light, camera, or model, or a SpecificResource object wrapping a light, camera, or model. *

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    • get FieldOfView(): undefined | number
    • Full angular size of perspective viewport in vertical direction. +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    • get FieldOfView(): undefined | number
    • Full angular size of perspective viewport in vertical direction. Angular unit is degrees *

      -

      Returns undefined | number

    Methods

    • Returns undefined | number

      full angular size of perspective viewport in vertical direction. +

      Returns undefined | number

    Methods

    • Returns undefined | number

      full angular size of perspective viewport in vertical direction. Angular unit is degrees *

      -
    • Returns null | object | PointSelector

      : if not null, is either a PointSelector, or an object with an id matching the id of an Annotation instance.

      -
    • A function that wraps the getProperty function, which client +

    • 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 @@ -63,4 +63,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Canvas.html b/docs/classes/Canvas.html index fbe1c4c3..7c45de0d 100644 --- a/docs/classes/Canvas.html +++ b/docs/classes/Canvas.html @@ -1,4 +1,4 @@ -Canvas | manifesto.js

    Class Canvas

    Hierarchy (view full)

    Constructors

    constructor +Canvas | manifesto.js

    Class Canvas

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number
    ranges: Range[]

    Accessors

    Methods

    • Parameters

      • Optional w: number

      Returns string

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number
    ranges: Range[]

    Accessors

    Methods

    • Parameters

      • Optional w: number

      Returns string

    • 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 @@ -58,8 +58,8 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ViewingHint

    • Returns null | ViewingHint

    • Returns the fragment placement values if a resourceAnnotation is placed on a canvas somewhere besides the full extent

      -

      Parameters

      • id: any

      Returns any

    • Returns a given resource Annotation, based on a contained resource or body +

      Parameters

      • id: any

      Returns any

    • Returns a given resource Annotation, based on a contained resource or body id

      -

      Parameters

      • id: any

      Returns any

    \ No newline at end of file +

    Parameters

    • id: any

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Collection.html b/docs/classes/Collection.html index 565fc1a2..1322e9d2 100644 --- a/docs/classes/Collection.html +++ b/docs/classes/Collection.html @@ -1,4 +1,4 @@ -Collection | manifesto.js

    Class Collection

    Hierarchy (view full)

    Constructors

    constructor +Collection | manifesto.js

    Class Collection

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    _collections: null | Collection[] = null
    _manifests: null | Manifest[] = null
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = -1
    isLoaded: boolean = false
    items: IIIFResource[] = []
    parentCollection: Collection
    parentLabel: string

    Methods

    • Note: this only will return the first behavior as per the manifesto convention +

    Constructors

    Properties

    __jsonld: any
    _collections: null | Collection[] = null
    _manifests: null | Manifest[] = null
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = -1
    isLoaded: boolean = false
    items: IIIFResource[] = []
    parentCollection: Collection
    parentLabel: string

    Methods

    • Note: this only will return the first behavior as per the manifesto convention IIIF v3 supports multiple behaviors

      -

      Returns null | Behavior

    • A function that wraps the getProperty function, which client +

      Returns null | Behavior

    • 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 @@ -68,4 +68,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Color.html b/docs/classes/Color.html index 19d168f5..d01d8671 100644 --- a/docs/classes/Color.html +++ b/docs/classes/Color.html @@ -1,7 +1,7 @@ Color | manifesto.js

    class structure with red, green, blue values in 0-255 range Uses the color-string library for conversion from and to string representations of color.

    -

    Constructors

    Constructors

    Properties

    Accessors

    CSS blue @@ -9,11 +9,11 @@ red

    Methods

    Constructors

    • Parameters

      • rgbValue: number[]

        Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red

        -

      Returns Color

    Properties

    value: number[]

    Returns

    Array of 3 integers in range 0-255

    -

    Accessors

    • get CSS(): string
    • Returns string

      hex string (as for CSS ) representation of r,g,b components

      -
    • get blue(): number
    • Returns number

      0 to 255 value of blue color component

      -
    • get green(): number
    • Returns number

      0 to 255 value of green color component

      -
    • get red(): number
    • Returns number

      0 to 255 value of red color component

      -

    Methods

    • Parameters

      • cssTerm: string

        hex representtion of color as used in CSS. Ex "#FF0000" as red

        +

      Returns Color

    Properties

    value: number[]

    Returns

    Array of 3 integers in range 0-255

    +

    Accessors

    • get CSS(): string
    • Returns string

      hex string (as for CSS ) representation of r,g,b components

      +
    • get blue(): number
    • Returns number

      0 to 255 value of blue color component

      +
    • get green(): number
    • Returns number

      0 to 255 value of green color component

      +
    • get red(): number
    • Returns number

      0 to 255 value of red color component

      +

    Methods

    • Parameters

      • cssTerm: string

        hex representtion of color as used in CSS. Ex "#FF0000" as red

      Returns Color

      Color instance.

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/Deserialiser.html b/docs/classes/Deserialiser.html index 627bdc56..5c81e37c 100644 --- a/docs/classes/Deserialiser.html +++ b/docs/classes/Deserialiser.html @@ -1,4 +1,4 @@ -Deserialiser | manifesto.js

    Class Deserialiser

    Constructors

    constructor +Deserialiser | manifesto.js

    Class Deserialiser

    Constructors

    Methods

    \ No newline at end of file +

    Constructors

    Methods

    \ No newline at end of file diff --git a/docs/classes/Duration.html b/docs/classes/Duration.html index 44fb0dfa..6a14c199 100644 --- a/docs/classes/Duration.html +++ b/docs/classes/Duration.html @@ -1,5 +1,5 @@ -Duration | manifesto.js

    Class Duration

    Constructors

    constructor +Duration | manifesto.js

    Class Duration

    Constructors

    Properties

    Methods

    Constructors

    Properties

    end: number
    start: number

    Methods

    \ No newline at end of file +

    Constructors

    Properties

    end: number
    start: number

    Methods

    \ No newline at end of file diff --git a/docs/classes/IIIFResource.html b/docs/classes/IIIFResource.html index ae1b7a15..f17d8b67 100644 --- a/docs/classes/IIIFResource.html +++ b/docs/classes/IIIFResource.html @@ -1,4 +1,4 @@ -IIIFResource | manifesto.js

    Class IIIFResource

    Hierarchy (view full)

    Constructors

    constructor +IIIFResource | manifesto.js

    Class IIIFResource

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = -1
    isLoaded: boolean = false
    parentCollection: Collection
    parentLabel: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = -1
    isLoaded: boolean = false
    parentCollection: Collection
    parentLabel: string

    Methods

    • 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 @@ -50,4 +50,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/JSONLDResource.html b/docs/classes/JSONLDResource.html index 7e25b0ab..84659ee7 100644 --- a/docs/classes/JSONLDResource.html +++ b/docs/classes/JSONLDResource.html @@ -1,10 +1,10 @@ -JSONLDResource | manifesto.js

    Class JSONLDResource

    Hierarchy (view full)

    Constructors

    constructor +JSONLDResource | manifesto.js

    Class JSONLDResource

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string

    Methods

    • 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 @@ -15,4 +15,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/LabelValuePair.html b/docs/classes/LabelValuePair.html index 6fa740d9..a23c25a4 100644 --- a/docs/classes/LabelValuePair.html +++ b/docs/classes/LabelValuePair.html @@ -1,4 +1,4 @@ -LabelValuePair | manifesto.js

    Class LabelValuePair

    Constructors

    constructor +LabelValuePair | manifesto.js

    Class LabelValuePair

    Constructors

    Properties

    Constructors

    Properties

    defaultLocale: string
    label: null | PropertyValue
    resource: any
    value: null | PropertyValue

    Methods

    • Parameters

      • Optional locale: string | string[]

      Returns null | string

    • Parameters

      • Optional locale: string | string[]
      • joinWith: string = "<br/>"

      Returns null | string

    • Parameters

      • Optional locale: string | string[]

      Returns (null | string)[]

    \ No newline at end of file +

    Constructors

    Properties

    defaultLocale: string
    label: null | PropertyValue
    resource: any
    value: null | PropertyValue

    Methods

    • Parameters

      • Optional locale: string | string[]

      Returns null | string

    • Parameters

      • Optional locale: string | string[]
      • joinWith: string = "<br/>"

      Returns null | string

    • Parameters

      • Optional locale: string | string[]

      Returns (null | string)[]

    \ No newline at end of file diff --git a/docs/classes/LanguageMap.html b/docs/classes/LanguageMap.html index fb9fae4e..11bcb41a 100644 --- a/docs/classes/LanguageMap.html +++ b/docs/classes/LanguageMap.html @@ -1,5 +1,5 @@ LanguageMap | manifesto.js

    Class LanguageMap

    Deprecated

    Use PropertyValue instead

    -

    Hierarchy

    • Array<Language>
      • LanguageMap

    Constructors

    Hierarchy

    • Array<Language>
      • LanguageMap

    Constructors

    Properties

    [unscopables] length [species] @@ -196,7 +196,7 @@
  • mapfn: ((v, k) => U)

    A mapping function to call on every element of the array.

      • (v, k): U
      • Parameters

        • v: T
        • k: number

        Returns U

  • Optional thisArg: any

    Value of 'this' used to invoke the mapfn.

  • Returns U[]

    • Parameters

      Returns null | string

      Deprecated

      Use the PropertyValue#getValue instance method instead

      -
    • Parameters

      Returns (null | string)[]

      Deprecated

      Use the PropertyValue#getValues instance method instead

      -
    • Parameters

      • arg: any

      Returns arg is any[]

    • Parameters

      Returns (null | string)[]

      Deprecated

      Use the PropertyValue#getValues instance method instead

      +
    • Parameters

      • arg: any

      Returns arg is any[]

    • Returns a new array from a set of elements.

      Type Parameters

      • T

      Parameters

      • Rest ...items: T[]

        A set of elements to include in the new array object.

      Returns T[]

    \ No newline at end of file diff --git a/docs/classes/Light.html b/docs/classes/Light.html index e8be1212..4df682ad 100644 --- a/docs/classes/Light.html +++ b/docs/classes/Light.html @@ -5,7 +5,7 @@ a light, camera, or model, or a SpecificResource object wrapping a light, camera, or model. *

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    Methods

    • The implementation of the intensity is based on +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    • get Angle(): undefined | number
    • Returns undefined | number

    Methods

    • 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 undefined | number

      number

      +
    • The implementation of the intensity is based on temp-draft-4.md and the example 3D manifests lights @@ -53,7 +69,9 @@ 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

      -

      Returns number

    • A function that wraps the getProperty function, which client +

      Returns number

    • Returns null | object | PointSelector

      : if not null, is either a PointSelector, or an object +with an id matching the id of an Annotation instance.

      +
    • 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 @@ -64,4 +82,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/LocalizedValue.html b/docs/classes/LocalizedValue.html index e91c2b5b..adf29193 100644 --- a/docs/classes/LocalizedValue.html +++ b/docs/classes/LocalizedValue.html @@ -1,5 +1,5 @@ LocalizedValue | manifesto.js

    Class LocalizedValue

    Utility class to hold one or more values with their associated (optional) locale

    -

    Implements

    • default

    Constructors

    Implements

    • default

    Constructors

    Properties

    _defaultLocale _locale? _value @@ -7,15 +7,15 @@ value

    Methods

    Constructors

    Properties

    _defaultLocale: string
    _locale?: string
    _value: string | string[]

    Accessors

    • get locale(): string
      • +

    Constructors

    Properties

    _defaultLocale: string
    _locale?: string
    _value: string | string[]

    Accessors

    • get locale(): string

      Returns string

      Deprecated

      Don't use, only used for backwards compatibility reasons

      -
    • get value(): string

      Returns string

      Deprecated

      Use PropertyValue#getValue instead

      -

    Methods

    Methods

    • Parse a localized value from a IIIF v2 property value

      Parameters

      • rawVal: any

        value from IIIF resource

      • Optional defaultLocale: string

        deprecated: defaultLocale the default locale to use for this value

        -

      Returns null | LocalizedValue

    \ No newline at end of file +

    Returns null | LocalizedValue

    \ No newline at end of file diff --git a/docs/classes/Manifest.html b/docs/classes/Manifest.html index 4fb5ae8a..442f5e71 100644 --- a/docs/classes/Manifest.html +++ b/docs/classes/Manifest.html @@ -3,7 +3,7 @@

    See

    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);
    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld _allRanges _annotationIdMap @@ -67,7 +67,7 @@

    Example

    varisScene
     isSequence
     load
    -

    Constructors

    Properties

    __jsonld: any
    _allRanges: null | Range[] = null
    _annotationIdMap: any
    _topRanges: Range[] = []
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = 0
    isLoaded: boolean = false
    items: Sequence[] = []
    parentCollection: Collection
    parentLabel: string

    Accessors

    • get annotationIdMap(): Object
    • Developer Note: The concept of the "id map" appear in the +

    Constructors

    Properties

    __jsonld: any
    _allRanges: null | Range[] = null
    _annotationIdMap: any
    _topRanges: Range[] = []
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = 0
    isLoaded: boolean = false
    items: Sequence[] = []
    parentCollection: Collection
    parentLabel: string

    Accessors

    • get annotationIdMap(): Object
    • 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

      @@ -75,8 +75,8 @@

      Example

      var
       

      THe annotationIdMap is a Javascript object whose property names are IRI (id values) and property values are instances of the Annotation class

      -

      Returns Object

    Methods

    • Parameters

      • r: any
      • path: string
      • Optional parentRange: Range

      Returns void

    • A function that wraps the getProperty function, which client +

      Returns Object

    Methods

    • Parameters

      • r: any
      • path: string
      • Optional parentRange: Range

      Returns void

    • 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 @@ -87,5 +87,5 @@

      Example

      var
       
    -

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    \ No newline at end of file diff --git a/docs/classes/ManifestResource.html b/docs/classes/ManifestResource.html index aed3dd0f..c8c5369e 100644 --- a/docs/classes/ManifestResource.html +++ b/docs/classes/ManifestResource.html @@ -1,4 +1,4 @@ -ManifestResource | manifesto.js

    Class ManifestResource

    Hierarchy (view full)

    Constructors

    constructor +ManifestResource | manifesto.js

    Class ManifestResource

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • 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 @@ -34,4 +34,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/PointSelector.html b/docs/classes/PointSelector.html index 1090eeb3..cc760bdc 100644 --- a/docs/classes/PointSelector.html +++ b/docs/classes/PointSelector.html @@ -1,4 +1,4 @@ -PointSelector | manifesto.js

    Class PointSelector

    Hierarchy (view full)

    Constructors

    constructor +PointSelector | manifesto.js

    Class PointSelector

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -6,7 +6,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isPointSelector: boolean = true

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isPointSelector: boolean = true

    Methods

    • 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 @@ -17,4 +17,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/PropertyValue.html b/docs/classes/PropertyValue.html index 3b1ec069..c7fd0a8c 100644 --- a/docs/classes/PropertyValue.html +++ b/docs/classes/PropertyValue.html @@ -1,7 +1,7 @@ PropertyValue | manifesto.js

    Class PropertyValue

    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

    -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    [unscopables]: {
        [unscopables]?: boolean;
        length?: boolean;
        [iterator]?: any;
        at?: any;
        concat?: any;
        copyWithin?: any;
        entries?: any;
        every?: any;
        fill?: any;
        filter?: any;
        find?: any;
        findIndex?: any;
        flat?: any;
        flatMap?: any;
        forEach?: any;
        includes?: any;
        indexOf?: any;
        join?: any;
        keys?: any;
        lastIndexOf?: any;
        map?: any;
        pop?: any;
        push?: any;
        reduce?: any;
        reduceRight?: any;
        reverse?: any;
        shift?: any;
        slice?: any;
        some?: any;
        sort?: any;
        splice?: any;
        toLocaleString?: any;
        toString?: any;
        unshift?: any;
        values?: any;
    }

    Is an object whose properties have the value 'true' +

    Constructors

    Properties

    [unscopables]: {
        [unscopables]?: boolean;
        length?: boolean;
        [iterator]?: any;
        at?: any;
        concat?: any;
        copyWithin?: any;
        entries?: any;
        every?: any;
        fill?: any;
        filter?: any;
        find?: any;
        findIndex?: any;
        flat?: any;
        flatMap?: any;
        forEach?: any;
        includes?: any;
        indexOf?: any;
        join?: any;
        keys?: any;
        lastIndexOf?: any;
        map?: any;
        pop?: any;
        push?: any;
        reduce?: any;
        reduceRight?: any;
        reverse?: any;
        shift?: any;
        slice?: any;
        some?: any;
        sort?: any;
        splice?: any;
        toLocaleString?: any;
        toString?: any;
        unshift?: any;
        values?: any;
    }

    Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

    Type declaration

    • Optional Readonly [unscopables]?: boolean

      Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

    • Optional length?: boolean

      Gets or sets the length of the array. This is a number one higher than the highest index in the array.

      -
    _defaultLocale?: string
    length: number

    Gets or sets the length of the array. This is a number one higher than the highest index in the array.

    +
    _defaultLocale?: string
    length: number

    Gets or sets the length of the array. This is a number one higher than the highest index in the array.

    [species]: ArrayConstructor

    Methods

    • Iterator

      Returns IterableIterator<LocalizedValue>

    • Takes an integer value and returns the item at that index, allowing for positive and negative integers. @@ -125,17 +125,17 @@

    Returns void

      • Try to find the available locale that best fit's the user's preferences.
      -

      Parameters

      • locales: string[]

      Returns undefined | string

    • Get a value in the most suitable locale.

      +

      Parameters

      • locales: string[]

      Returns undefined | string

    • Get a value in the most suitable locale.

      Parameters

      • Optional locales: string | string[]

        Desired locale, can be a list of locales sorted by descending priority.

      • Optional joinWith: string

        String to join multiple available values by, if undefined only the first available value will be returned

      Returns null | string

      the first value in the most suitable locale or null if none could be found

      -
    • Get all values available in the most suitable locale.

      +
    • Get all values available in the most suitable locale.

      Parameters

      • Optional userLocales: string | string[]

        Desired locale, can be a list of locales sorted by descending priority.

      Returns string[]

      the values for the most suitable locale, empty if none could be found

      -
    • Determines whether an array includes a certain element, returning true or false as appropriate.

      +
    • Determines whether an array includes a certain element, returning true or false as appropriate.

      Parameters

      • searchElement: LocalizedValue

        The element to search for.

      • Optional fromIndex: number

        The position in this array at which to begin searching for searchElement.

      Returns boolean

    • Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

      @@ -170,7 +170,7 @@

      If there's an existing locale that matches the given locale, it will be updated.

      Parameters

      • value: string | string[]

        value to set

      • Optional locale: string

        Locale to set the value for

        -

      Returns void

    • Removes the first element from an array and returns it. +

    Returns void

    • Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

      Returns undefined | LocalizedValue

    • Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. @@ -220,4 +220,4 @@

        • (v, k): U
        • Parameters

          • v: T
          • k: number

          Returns U

    • Optional thisArg: any

      Value of 'this' used to invoke the mapfn.

    Returns U[]

    • Parameters

      • arg: any

      Returns arg is any[]

    • Returns a new array from a set of elements.

      Type Parameters

      • T

      Parameters

      • Rest ...items: T[]

        A set of elements to include in the new array object.

        -

      Returns T[]

    \ No newline at end of file +

    Returns T[]

    \ No newline at end of file diff --git a/docs/classes/Range.html b/docs/classes/Range.html index e7fad2ad..e4552fb8 100644 --- a/docs/classes/Range.html +++ b/docs/classes/Range.html @@ -1,4 +1,4 @@ -Range | manifesto.js

    Hierarchy (view full)

    Constructors

    constructor +Range | manifesto.js

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    _ranges: null | Range[] = null
    canvases: null | string[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: ManifestResource[] = []
    parentRange: undefined | Range
    path: string
    treeNode: TreeNode

    Methods

    • Returns null | Behavior

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    _ranges: null | Range[] = null
    canvases: null | string[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: ManifestResource[] = []
    parentRange: undefined | Range
    path: string
    treeNode: TreeNode

    Methods

    • Returns null | Behavior

    • 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 @@ -49,4 +49,4 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ViewingDirection

    • Returns null | ViewingHint

    • Parameters

      • time: number

      Returns boolean

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    • Returns null | ViewingHint

    • Parameters

      • time: number

      Returns boolean

    \ No newline at end of file diff --git a/docs/classes/Rendering.html b/docs/classes/Rendering.html index ca632b9b..44fe16ac 100644 --- a/docs/classes/Rendering.html +++ b/docs/classes/Rendering.html @@ -1,4 +1,4 @@ -Rendering | manifesto.js

    Class Rendering

    Hierarchy (view full)

    Constructors

    constructor +Rendering | manifesto.js

    Class Rendering

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • 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 @@ -35,4 +35,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Resource.html b/docs/classes/Resource.html index e251a3f0..2e20069f 100644 --- a/docs/classes/Resource.html +++ b/docs/classes/Resource.html @@ -1,4 +1,4 @@ -Resource | manifesto.js

    Class Resource

    Hierarchy (view full)

    Constructors

    constructor +Resource | manifesto.js

    Class Resource

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • 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 @@ -42,4 +42,4 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ExternalResourceType

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ExternalResourceType

    \ No newline at end of file diff --git a/docs/classes/RotateTransform.html b/docs/classes/RotateTransform.html index 7d730a9c..e250accd 100644 --- a/docs/classes/RotateTransform.html +++ b/docs/classes/RotateTransform.html @@ -1,4 +1,4 @@ -RotateTransform | manifesto.js

    Class RotateTransform

    Hierarchy (view full)

    Constructors

    constructor +RotateTransform | manifesto.js

    Class RotateTransform

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -9,7 +9,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -20,4 +20,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/ScaleTransform.html b/docs/classes/ScaleTransform.html index 4c237337..79196904 100644 --- a/docs/classes/ScaleTransform.html +++ b/docs/classes/ScaleTransform.html @@ -1,4 +1,4 @@ -ScaleTransform | manifesto.js

    Class ScaleTransform

    Hierarchy (view full)

    Constructors

    constructor +ScaleTransform | manifesto.js

    Class ScaleTransform

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -9,7 +9,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -20,4 +20,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Scene.html b/docs/classes/Scene.html index ee3b3e4c..07e641c2 100644 --- a/docs/classes/Scene.html +++ b/docs/classes/Scene.html @@ -1,4 +1,4 @@ -Scene | manifesto.js

    Hierarchy (view full)

    Constructors

    constructor +Scene | manifesto.js

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    Methods

    • 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 @@ -38,4 +38,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Sequence.html b/docs/classes/Sequence.html index 67f83ac1..dbed6ab2 100644 --- a/docs/classes/Sequence.html +++ b/docs/classes/Sequence.html @@ -1,4 +1,4 @@ -Sequence | manifesto.js

    Class Sequence

    Hierarchy (view full)

    Constructors

    constructor +Sequence | manifesto.js

    Class Sequence

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    _thumbnails: null | Thumbnail[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: Canvas[] = []

    Methods

    • Parameters

      • canvasIndex: number

      Returns any

    • Parameters

      • id: string

      Returns null | number

    • Parameters

      • label: string
      • Optional foliated: boolean

      Returns number

    • Parameters

      • Optional alphanumeric: boolean

      Returns string

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number[]

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    _thumbnails: null | Thumbnail[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: Canvas[] = []

    Methods

    • Parameters

      • canvasIndex: number

      Returns any

    • Parameters

      • id: string

      Returns null | number

    • Parameters

      • label: string
      • Optional foliated: boolean

      Returns number

    • Parameters

      • Optional alphanumeric: boolean

      Returns string

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number[]

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • 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 @@ -60,5 +60,5 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ViewingDirection

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    \ No newline at end of file diff --git a/docs/classes/Service.html b/docs/classes/Service.html index 06ebdef2..6f25f05a 100644 --- a/docs/classes/Service.html +++ b/docs/classes/Service.html @@ -1,4 +1,4 @@ -Service | manifesto.js

    Class Service

    Hierarchy (view full)

    Constructors

    constructor +Service | manifesto.js

    Class Service

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • Returns null | string

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • Returns null | string

    • 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 @@ -42,4 +42,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Size.html b/docs/classes/Size.html index df65e81b..622bf6ab 100644 --- a/docs/classes/Size.html +++ b/docs/classes/Size.html @@ -1,4 +1,4 @@ -Size | manifesto.js

    Constructors

    constructor +Size | manifesto.js

    Constructors

    Properties

    Constructors

    Properties

    height: number
    width: number
    \ No newline at end of file +

    Constructors

    Properties

    height: number
    width: number
    \ No newline at end of file diff --git a/docs/classes/SpecificResource.html b/docs/classes/SpecificResource.html index 3492d8c3..ad660404 100644 --- a/docs/classes/SpecificResource.html +++ b/docs/classes/SpecificResource.html @@ -4,7 +4,7 @@ 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.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = false
    isSpecificResource: boolean = true

    Accessors

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = false
    isSpecificResource: boolean = true

    Accessors

    Methods

    • 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 @@ -47,4 +47,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Thumb.html b/docs/classes/Thumb.html index 491737fa..34549dc3 100644 --- a/docs/classes/Thumb.html +++ b/docs/classes/Thumb.html @@ -1,4 +1,4 @@ -Thumb | manifesto.js

    Constructors

    constructor +Thumb | manifesto.js

    Constructors

    Properties

    Constructors

    Properties

    data: any
    height: number
    index: number
    label: string
    uri: string
    viewingHint: null | ViewingHint
    visible: boolean
    width: number
    \ No newline at end of file +

    Constructors

    Properties

    data: any
    height: number
    index: number
    label: string
    uri: string
    viewingHint: null | ViewingHint
    visible: boolean
    width: number
    \ No newline at end of file diff --git a/docs/classes/Thumbnail.html b/docs/classes/Thumbnail.html index 61891689..14f4befb 100644 --- a/docs/classes/Thumbnail.html +++ b/docs/classes/Thumbnail.html @@ -1,4 +1,4 @@ -Thumbnail | manifesto.js

    Class Thumbnail

    Hierarchy (view full)

    Constructors

    constructor +Thumbnail | manifesto.js

    Class Thumbnail

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • 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 @@ -42,4 +42,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Transform.html b/docs/classes/Transform.html index 1dc2f384..9a549ce7 100644 --- a/docs/classes/Transform.html +++ b/docs/classes/Transform.html @@ -1,4 +1,4 @@ -Transform | manifesto.js

    Class TransformAbstract

    Hierarchy (view full)

    Constructors

    constructor +Transform | manifesto.js

    Class TransformAbstract

    Hierarchy (view full)

    Constructors

    Properties

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -19,4 +19,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/TransformParser.html b/docs/classes/TransformParser.html index 42e0df1f..4170bb0b 100644 --- a/docs/classes/TransformParser.html +++ b/docs/classes/TransformParser.html @@ -1,3 +1,3 @@ -TransformParser | manifesto.js

    Class TransformParser

    Constructors

    constructor +TransformParser | manifesto.js

    Class TransformParser

    Constructors

    Methods

    Constructors

    Methods

    \ No newline at end of file +

    Constructors

    Methods

    \ No newline at end of file diff --git a/docs/classes/TranslateTransform.html b/docs/classes/TranslateTransform.html index b186d1b1..ff6efd88 100644 --- a/docs/classes/TranslateTransform.html +++ b/docs/classes/TranslateTransform.html @@ -1,4 +1,4 @@ -TranslateTransform | manifesto.js

    Class TranslateTransform

    Hierarchy (view full)

    Constructors

    constructor +TranslateTransform | manifesto.js

    Class TranslateTransform

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -9,7 +9,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -20,4 +20,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/TreeNode.html b/docs/classes/TreeNode.html index 0a25f827..74138981 100644 --- a/docs/classes/TreeNode.html +++ b/docs/classes/TreeNode.html @@ -1,4 +1,4 @@ -TreeNode | manifesto.js

    Class TreeNode

    Constructors

    constructor +TreeNode | manifesto.js

    Class TreeNode

    Constructors

    Properties

    Constructors

    Properties

    data: any
    expanded: boolean
    id: string
    label: string
    navDate: Date
    nodes: TreeNode[]
    parentNode: TreeNode
    selected: boolean

    Methods

    \ No newline at end of file +

    Constructors

    Properties

    data: any
    expanded: boolean
    id: string
    label: string
    navDate: Date
    nodes: TreeNode[]
    parentNode: TreeNode
    selected: boolean

    Methods

    \ No newline at end of file diff --git a/docs/classes/Utils.html b/docs/classes/Utils.html index f5eb03ab..bafbe5cc 100644 --- a/docs/classes/Utils.html +++ b/docs/classes/Utils.html @@ -1,4 +1,4 @@ -Utils | manifesto.js

    Constructors

    constructor +Utils | manifesto.js

    Constructors

    Methods

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)

      Returns Promise<IExternalResource>

    • Parameters

      • response: any

      Returns any

    • Parameters

      • message: string

      Returns Error

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<void | IExternalResource>

    • Parameters

      Returns void

    • Parameters

      • profile: ServiceProfile

      Returns string

    • Parameters

      • locale: string

      Returns string

    • Parameters

      • resource: any
      • locale: string

      Returns null | string

    • Parameters

      • type: string

      Returns MediaType

    • Parameters

      • resource: any
      • __namedParameters: {
            onlyService?: boolean;
            onlyServices?: boolean;
            skipParentResources?: boolean;
        } = {}
        • Optional onlyService?: boolean
        • Optional onlyServices?: boolean
        • Optional skipParentResources?: boolean

      Returns Service[]

    • Parameters

      • target: string

      Returns null | number[]

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • type: null | string

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource>

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<void>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource>

    • Parameters

      • resources: IExternalResource[]
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource[]>

    • Parameters

      • resources: IExternalResource[]
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource[]>

    • Parameters

      • url: string

      Returns Promise<any>

    • Parameters

      • type: string

      Returns string

    • Parameters

      • url: string

      Returns string

    • Parameters

      • url1: string
      • url2: string

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: any
      • clickThrough: any
      • restricted: any
      • login: any
      • getAccessToken: any
      • storeAccessToken: any
      • resolve: any
      • reject: any

      Returns void

    • Does a depth first traversal of an Object, returning an Object that +

    Constructors

    Methods

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)

      Returns Promise<IExternalResource>

    • Parameters

      • response: any

      Returns any

    • Parameters

      • message: string

      Returns Error

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<void | IExternalResource>

    • Parameters

      Returns void

    • Parameters

      • profile: ServiceProfile

      Returns string

    • Parameters

      • locale: string

      Returns string

    • Parameters

      • resource: any
      • locale: string

      Returns null | string

    • Parameters

      • type: string

      Returns MediaType

    • Parameters

      • resource: any
      • __namedParameters: {
            onlyService?: boolean;
            onlyServices?: boolean;
            skipParentResources?: boolean;
        } = {}
        • Optional onlyService?: boolean
        • Optional onlyServices?: boolean
        • Optional skipParentResources?: boolean

      Returns Service[]

    • Parameters

      • target: string

      Returns null | number[]

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • type: null | string

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource>

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<void>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource>

    • Parameters

      • resources: IExternalResource[]
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource[]>

    • Parameters

      • resources: IExternalResource[]
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource[]>

    • Parameters

      • url: string

      Returns Promise<any>

    • Parameters

      • type: string

      Returns string

    • Parameters

      • url: string

      Returns string

    • Parameters

      • url1: string
      • url2: string

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: any
      • clickThrough: any
      • restricted: any
      • login: any
      • getAccessToken: any
      • storeAccessToken: any
      • resolve: any
      • reject: any

      Returns void

    • Does a depth first traversal of an Object, returning an Object that matches provided k and v arguments

      Parameters

      • object: any
      • k: string
      • v: string

      Returns undefined | object

      Example

      Utils.traverseAndFind({foo: 'bar'}, 'foo', 'bar')
       
      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/enums/ManifestType.html b/docs/enums/ManifestType.html index 26ab9f5d..b306e22a 100644 --- a/docs/enums/ManifestType.html +++ b/docs/enums/ManifestType.html @@ -1,4 +1,4 @@ -ManifestType | manifesto.js

    Enumeration ManifestType

    Enumeration Members

    EMPTY +ManifestType | manifesto.js

    Enumeration ManifestType

    Enumeration Members

    Enumeration Members

    EMPTY: ""
    MANUSCRIPT: "manuscript"
    MONOGRAPH: "monograph"
    \ No newline at end of file +

    Enumeration Members

    EMPTY: ""
    MANUSCRIPT: "manuscript"
    MONOGRAPH: "monograph"
    \ No newline at end of file diff --git a/docs/enums/StatusCode.html b/docs/enums/StatusCode.html index e171a951..8ae0e8a3 100644 --- a/docs/enums/StatusCode.html +++ b/docs/enums/StatusCode.html @@ -1,5 +1,5 @@ -StatusCode | manifesto.js

    Enumeration StatusCode

    Enumeration Members

    AUTHORIZATION_FAILED +StatusCode | manifesto.js

    Enumeration StatusCode

    Enumeration Members

    AUTHORIZATION_FAILED: 1
    FORBIDDEN: 2
    INTERNAL_SERVER_ERROR: 3
    RESTRICTED: 4
    \ No newline at end of file +

    Enumeration Members

    AUTHORIZATION_FAILED: 1
    FORBIDDEN: 2
    INTERNAL_SERVER_ERROR: 3
    RESTRICTED: 4
    \ No newline at end of file diff --git a/docs/enums/TreeNodeType.html b/docs/enums/TreeNodeType.html index 49063f7c..02ab4202 100644 --- a/docs/enums/TreeNodeType.html +++ b/docs/enums/TreeNodeType.html @@ -1,4 +1,4 @@ -TreeNodeType | manifesto.js

    Enumeration TreeNodeType

    Enumeration Members

    COLLECTION +TreeNodeType | manifesto.js

    Enumeration TreeNodeType

    Enumeration Members

    Enumeration Members

    COLLECTION: "collection"
    MANIFEST: "manifest"
    RANGE: "range"
    \ No newline at end of file +

    Enumeration Members

    COLLECTION: "collection"
    MANIFEST: "manifest"
    RANGE: "range"
    \ No newline at end of file diff --git a/docs/functions/cameraRelativeRotation.html b/docs/functions/cameraRelativeRotation.html index 30e8f411..13fc1ad2 100644 --- a/docs/functions/cameraRelativeRotation.html +++ b/docs/functions/cameraRelativeRotation.html @@ -12,4 +12,4 @@

    Parameters

    • direction: Vector3

      A vector interpreted as a direction. Client code responsible for not passing a 0-length vector, else a

    Returns Euler

    threejs-math.EulerAngle instance

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/functions/lightRelativeRotation.html b/docs/functions/lightRelativeRotation.html index 7e8eccf1..c82899d5 100644 --- a/docs/functions/lightRelativeRotation.html +++ b/docs/functions/lightRelativeRotation.html @@ -1 +1 @@ -lightRelativeRotation | manifesto.js

    Function lightRelativeRotation

    • Parameters

      • direction: Vector3

      Returns Euler

    \ No newline at end of file +lightRelativeRotation | manifesto.js

    Function lightRelativeRotation

    • Parameters

      • direction: Vector3

      Returns Euler

    \ No newline at end of file diff --git a/docs/functions/loadManifest.html b/docs/functions/loadManifest.html index 3385adc9..bfd25f9a 100644 --- a/docs/functions/loadManifest.html +++ b/docs/functions/loadManifest.html @@ -3,4 +3,4 @@

    Parameters

    • url: string

      string containing the URL to Fetch

    Returns Promise<any>

    Promise The object returned through the Promise is the javascript object obtained by deserializing the json text. *

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/functions/parseManifest.html b/docs/functions/parseManifest.html index d04798ef..7194ac32 100644 --- a/docs/functions/parseManifest.html +++ b/docs/functions/parseManifest.html @@ -2,4 +2,4 @@

    Parameters

    • manifest: any

      Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file.

    • Optional options: IManifestoOptions

    Returns null | IIIFResource

    instance of Manifest class. *

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/IAccessToken.html b/docs/interfaces/IAccessToken.html index cae6a9ae..f8c35aab 100644 --- a/docs/interfaces/IAccessToken.html +++ b/docs/interfaces/IAccessToken.html @@ -1,6 +1,6 @@ -IAccessToken | manifesto.js

    Interface IAccessToken

    interface IAccessToken {
        accessToken: string;
        error: string;
        errorDescription: string;
        expiresIn: number;
        tokenType: string;
    }

    Properties

    accessToken +IAccessToken | manifesto.js

    Interface IAccessToken

    interface IAccessToken {
        accessToken: string;
        error: string;
        errorDescription: string;
        expiresIn: number;
        tokenType: string;
    }

    Properties

    accessToken: string
    error: string
    errorDescription: string
    expiresIn: number
    tokenType: string
    \ No newline at end of file +

    Properties

    accessToken: string
    error: string
    errorDescription: string
    expiresIn: number
    tokenType: string
    \ No newline at end of file diff --git a/docs/interfaces/IExternalImageResourceData.html b/docs/interfaces/IExternalImageResourceData.html index 4db79e5a..6e100c32 100644 --- a/docs/interfaces/IExternalImageResourceData.html +++ b/docs/interfaces/IExternalImageResourceData.html @@ -1,8 +1,8 @@ -IExternalImageResourceData | manifesto.js

    Interface IExternalImageResourceData

    interface IExternalImageResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        height: number;
        id: string;
        index: number;
        profile: string | any[];
        width: number;
    }

    Hierarchy (view full)

    Properties

    contentLocation +IExternalImageResourceData | manifesto.js

    Interface IExternalImageResourceData

    interface IExternalImageResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        height: number;
        id: string;
        index: number;
        profile: string | any[];
        width: number;
    }

    Hierarchy (view full)

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    height: number
    id: string
    index: number
    profile: string | any[]
    width: number
    \ No newline at end of file +

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    height: number
    id: string
    index: number
    profile: string | any[]
    width: number
    \ No newline at end of file diff --git a/docs/interfaces/IExternalResource.html b/docs/interfaces/IExternalResource.html index bfe2c56a..d6bbc3f0 100644 --- a/docs/interfaces/IExternalResource.html +++ b/docs/interfaces/IExternalResource.html @@ -1,4 +1,4 @@ -IExternalResource | manifesto.js

    Interface IExternalResource

    interface IExternalResource {
        authAPIVersion: number;
        authHoldingPage: any;
        clickThroughService: null | Service;
        data: IExternalResourceData;
        dataUri: null | string;
        error: any;
        externalService: null | Service;
        height: number;
        index: number;
        isResponseHandled: boolean;
        kioskService: null | Service;
        loginService: null | Service;
        logoutService: null | Service;
        options?: IManifestoOptions;
        restrictedService: null | Service;
        status: number;
        tokenService: null | Service;
        width: number;
        getData(accessToken?): Promise<IExternalResource>;
        hasServiceDescriptor(): boolean;
        isAccessControlled(): boolean;
    }

    Properties

    authAPIVersion +IExternalResource | manifesto.js

    Interface IExternalResource

    interface IExternalResource {
        authAPIVersion: number;
        authHoldingPage: any;
        clickThroughService: null | Service;
        data: IExternalResourceData;
        dataUri: null | string;
        error: any;
        externalService: null | Service;
        height: number;
        index: number;
        isResponseHandled: boolean;
        kioskService: null | Service;
        loginService: null | Service;
        logoutService: null | Service;
        options?: IManifestoOptions;
        restrictedService: null | Service;
        status: number;
        tokenService: null | Service;
        width: number;
        getData(accessToken?): Promise<IExternalResource>;
        hasServiceDescriptor(): boolean;
        isAccessControlled(): boolean;
    }

    Properties

    authAPIVersion: number
    authHoldingPage: any
    clickThroughService: null | Service
    dataUri: null | string
    error: any
    externalService: null | Service
    height: number
    index: number
    isResponseHandled: boolean
    kioskService: null | Service
    loginService: null | Service
    logoutService: null | Service
    restrictedService: null | Service
    status: number
    tokenService: null | Service
    width: number

    Methods

    \ No newline at end of file +

    Properties

    authAPIVersion: number
    authHoldingPage: any
    clickThroughService: null | Service
    dataUri: null | string
    error: any
    externalService: null | Service
    height: number
    index: number
    isResponseHandled: boolean
    kioskService: null | Service
    loginService: null | Service
    logoutService: null | Service
    restrictedService: null | Service
    status: number
    tokenService: null | Service
    width: number

    Methods

    \ No newline at end of file diff --git a/docs/interfaces/IExternalResourceData.html b/docs/interfaces/IExternalResourceData.html index f0169b71..c885c0fa 100644 --- a/docs/interfaces/IExternalResourceData.html +++ b/docs/interfaces/IExternalResourceData.html @@ -1,6 +1,6 @@ -IExternalResourceData | manifesto.js

    Interface IExternalResourceData

    interface IExternalResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        id: string;
        index: number;
        profile: string | any[];
    }

    Hierarchy (view full)

    Properties

    contentLocation +IExternalResourceData | manifesto.js

    Interface IExternalResourceData

    interface IExternalResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        id: string;
        index: number;
        profile: string | any[];
    }

    Hierarchy (view full)

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    id: string
    index: number
    profile: string | any[]
    \ No newline at end of file +

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    id: string
    index: number
    profile: string | any[]
    \ No newline at end of file diff --git a/docs/interfaces/IExternalResourceOptions.html b/docs/interfaces/IExternalResourceOptions.html index 05e6624a..d88022e0 100644 --- a/docs/interfaces/IExternalResourceOptions.html +++ b/docs/interfaces/IExternalResourceOptions.html @@ -1,2 +1,2 @@ -IExternalResourceOptions | manifesto.js

    Interface IExternalResourceOptions

    interface IExternalResourceOptions {
        authApiVersion: number;
    }

    Properties

    Properties

    authApiVersion: number
    \ No newline at end of file +IExternalResourceOptions | manifesto.js

    Interface IExternalResourceOptions

    interface IExternalResourceOptions {
        authApiVersion: number;
    }

    Properties

    Properties

    authApiVersion: number
    \ No newline at end of file diff --git a/docs/interfaces/IManifestoOptions.html b/docs/interfaces/IManifestoOptions.html index ad34d6a5..4c899968 100644 --- a/docs/interfaces/IManifestoOptions.html +++ b/docs/interfaces/IManifestoOptions.html @@ -1,7 +1,7 @@ -IManifestoOptions | manifesto.js

    Interface IManifestoOptions

    interface IManifestoOptions {
        defaultLabel: string;
        index?: number;
        locale: string;
        navDate?: Date;
        pessimisticAccessControl: boolean;
        resource: IIIFResource;
    }

    Properties

    defaultLabel +IManifestoOptions | manifesto.js

    Interface IManifestoOptions

    interface IManifestoOptions {
        defaultLabel: string;
        index?: number;
        locale: string;
        navDate?: Date;
        pessimisticAccessControl: boolean;
        resource: IIIFResource;
    }

    Properties

    defaultLabel: string
    index?: number
    locale: string
    navDate?: Date
    pessimisticAccessControl: boolean
    resource: IIIFResource
    \ No newline at end of file +

    Properties

    defaultLabel: string
    index?: number
    locale: string
    navDate?: Date
    pessimisticAccessControl: boolean
    resource: IIIFResource
    \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts index 3f557b36..10ed3ea9 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -133,7 +133,9 @@ 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 } @@ -148,6 +150,31 @@ export declare class Light extends AnnotationBody { * 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; } export declare class Camera extends AnnotationBody { constructor(jsonld?: any, options?: IManifestoOptions); From c64795a4d713b1f1dd54c65c78f1d8c7079b8c68 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 14 May 2024 06:06:11 -0400 Subject: [PATCH 12/16] Implemented the Location getter --- src/PointSelector.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/PointSelector.ts b/src/PointSelector.ts index e1ab649f..e86a73b1 100644 --- a/src/PointSelector.ts +++ b/src/PointSelector.ts @@ -15,13 +15,15 @@ export class PointSelector extends JSONLDResource { super(jsonld); } + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ getLocation() : Vector3 { return new Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z ); - /* - return { x:Number(this.__jsonld.x), - y:Number(this.__jsonld.y), - z:Number(this.__jsonld.z) - } - */ } + + /** + @returns the 3D coordinates of the point as a Vector3 instance. + **/ + get Location() : Vector3 { return this.getLocation(); } } From 985243cdd7025ab3305868f5fffc52a3d2b0249f Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 14 May 2024 06:06:43 -0400 Subject: [PATCH 13/16] implemented the Source getter --- src/SpecificResource.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SpecificResource.ts b/src/SpecificResource.ts index 606bce75..94fc8b48 100644 --- a/src/SpecificResource.ts +++ b/src/SpecificResource.ts @@ -68,6 +68,8 @@ export class SpecificResource extends ManifestResource { throw new Error("cannot resolve Source " + JSON.stringify(raw)); } + get Source() : object | AnnotationBody {return this.getSource(); } + getSelector() : PointSelector | null { const raw = this.getProperty("selector"); From cd2b91cb70ba8ec9d67343b02db49e34573a4c68 Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 14 May 2024 06:12:44 -0400 Subject: [PATCH 14/16] Adjusted the test condition to match the edited manifest --- test/tests_3d/3_lights/spotlight_lookat_point.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests_3d/3_lights/spotlight_lookat_point.js b/test/tests_3d/3_lights/spotlight_lookat_point.js index 8120738f..5b3c0d48 100644 --- a/test/tests_3d/3_lights/spotlight_lookat_point.js +++ b/test/tests_3d/3_lights/spotlight_lookat_point.js @@ -49,7 +49,7 @@ describe('spotlight', function() { expect( light.Intensity).to.equal( 0.6 ); expect( light.Color ).to.exist; - expect( light.Angle ).to.equal(10.0); + expect( light.Angle ).to.equal(3.5); let lookAt = light.LookAt; expect(lookAt).to.exist; From 29ec91caf555f7872d505ea94df8c9f8a5fe048a Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 14 May 2024 06:18:56 -0400 Subject: [PATCH 15/16] rebuilt modules and docs, set package draft version to 0.5.0 --- dist-commonjs/PointSelector.d.ts | 7 +++++++ dist-commonjs/PointSelector.js | 17 +++++++++++------ dist-commonjs/PointSelector.js.map | 2 +- dist-commonjs/SpecificResource.d.ts | 1 + dist-commonjs/SpecificResource.js | 5 +++++ dist-commonjs/SpecificResource.js.map | 2 +- dist-esmodule/PointSelector.d.ts | 7 +++++++ dist-esmodule/PointSelector.js | 17 +++++++++++------ dist-esmodule/PointSelector.js.map | 2 +- dist-esmodule/SpecificResource.d.ts | 1 + dist-esmodule/SpecificResource.js | 5 +++++ dist-esmodule/SpecificResource.js.map | 2 +- dist-umd/manifesto.js | 2 +- dist-var/manifesto.js | 2 +- docs/assets/search.js | 2 +- docs/classes/Annotation.html | 16 ++++++++-------- docs/classes/AnnotationBody.html | 6 +++--- docs/classes/AnnotationBodyParser.html | 4 ++-- docs/classes/AnnotationList.html | 6 +++--- docs/classes/AnnotationPage.html | 6 +++--- docs/classes/Camera.html | 12 ++++++------ docs/classes/Canvas.html | 10 +++++----- docs/classes/Collection.html | 10 +++++----- docs/classes/Color.html | 16 ++++++++-------- docs/classes/Deserialiser.html | 4 ++-- docs/classes/Duration.html | 4 ++-- docs/classes/IIIFResource.html | 6 +++--- docs/classes/JSONLDResource.html | 6 +++--- docs/classes/LabelValuePair.html | 4 ++-- docs/classes/LanguageMap.html | 6 +++--- docs/classes/Light.html | 12 ++++++------ docs/classes/LocalizedValue.html | 10 +++++----- docs/classes/Manifest.html | 12 ++++++------ docs/classes/ManifestResource.html | 6 +++--- docs/classes/PointSelector.html | 11 ++++++++--- docs/classes/PropertyValue.html | 16 ++++++++-------- docs/classes/Range.html | 6 +++--- docs/classes/Rendering.html | 6 +++--- docs/classes/Resource.html | 6 +++--- docs/classes/RotateTransform.html | 6 +++--- docs/classes/ScaleTransform.html | 6 +++--- docs/classes/Scene.html | 6 +++--- docs/classes/Sequence.html | 8 ++++---- docs/classes/Service.html | 6 +++--- docs/classes/Size.html | 4 ++-- docs/classes/SpecificResource.html | 7 ++++--- docs/classes/Thumb.html | 4 ++-- docs/classes/Thumbnail.html | 6 +++--- docs/classes/Transform.html | 6 +++--- docs/classes/TransformParser.html | 4 ++-- docs/classes/TranslateTransform.html | 6 +++--- docs/classes/TreeNode.html | 4 ++-- docs/classes/Utils.html | 6 +++--- docs/enums/ManifestType.html | 4 ++-- docs/enums/StatusCode.html | 4 ++-- docs/enums/TreeNodeType.html | 4 ++-- docs/functions/cameraRelativeRotation.html | 2 +- docs/functions/lightRelativeRotation.html | 2 +- docs/functions/loadManifest.html | 2 +- docs/functions/parseManifest.html | 2 +- docs/interfaces/IAccessToken.html | 4 ++-- docs/interfaces/IExternalImageResourceData.html | 4 ++-- docs/interfaces/IExternalResource.html | 4 ++-- docs/interfaces/IExternalResourceData.html | 4 ++-- docs/interfaces/IExternalResourceOptions.html | 4 ++-- docs/interfaces/IManifestoOptions.html | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- types/index.d.ts | 8 ++++++++ 69 files changed, 231 insertions(+), 181 deletions(-) diff --git a/dist-commonjs/PointSelector.d.ts b/dist-commonjs/PointSelector.d.ts index 3d337f04..6da73cf8 100644 --- a/dist-commonjs/PointSelector.d.ts +++ b/dist-commonjs/PointSelector.d.ts @@ -3,5 +3,12 @@ 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 index f4d47e72..e4b4d75b 100644 --- a/dist-commonjs/PointSelector.js +++ b/dist-commonjs/PointSelector.js @@ -25,15 +25,20 @@ var PointSelector = /** @class */ (function (_super) { _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); - /* - return { x:Number(this.__jsonld.x), - y:Number(this.__jsonld.y), - z:Number(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; diff --git a/dist-commonjs/PointSelector.js.map b/dist-commonjs/PointSelector.js.map index 62303bae..3c9cd822 100644 --- a/dist-commonjs/PointSelector.js.map +++ b/dist-commonjs/PointSelector.js.map @@ -1 +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,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;QACvE;;;;;UAKC;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AAjBD,CAAmC,yBAAc,GAiBhD;AAjBY,sCAAa"} \ No newline at end of file +{"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/SpecificResource.d.ts b/dist-commonjs/SpecificResource.d.ts index 51706df1..d7b0e79e 100644 --- a/dist-commonjs/SpecificResource.d.ts +++ b/dist-commonjs/SpecificResource.d.ts @@ -13,6 +13,7 @@ export declare class SpecificResource extends ManifestResource { isSpecificResource: boolean; constructor(jsonld: any, options?: IManifestoOptions); getSource(): object | AnnotationBody; + get Source(): object | AnnotationBody; getSelector(): PointSelector | null; get Selector(): PointSelector | null; getTransform(): Transform[]; diff --git a/dist-commonjs/SpecificResource.js b/dist-commonjs/SpecificResource.js index dcdea246..e5c2246d 100644 --- a/dist-commonjs/SpecificResource.js +++ b/dist-commonjs/SpecificResource.js @@ -71,6 +71,11 @@ var SpecificResource = /** @class */ (function (_super) { } 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) { diff --git a/dist-commonjs/SpecificResource.js.map b/dist-commonjs/SpecificResource.js.map index 21406d99..f558dbd7 100644 --- a/dist-commonjs/SpecificResource.js.map +++ b/dist-commonjs/SpecificResource.js.map @@ -1 +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,EAAC,CAAC;YACL,IAAI,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACzC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBAC3C,OAAO,UAAU,CAAC;QAC1B,CAAC;QACD,IAAI,GAAG,EACP,CAAC;YACG,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,IAAI,EACR,CAAC;gBACG,OAAO,+BAAoB,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAE,CAAC;YACnE,CAAC;QACL,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,sCAAW,GAAX;QAEC,IAAM,GAAG,GAAI,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,GAAG,EAAC,CAAC;YACJ,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,IAAI,EACR,CAAC;gBACG,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,eAAe;oBAAE,OAAO,IAAI,wBAAa,CAAC,IAAI,CAAC,CAAC;YACzE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,8CAA8C,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrG,CAAC;QACA,OAAO,IAAI,CAAC;IACd,CAAC;IAAA,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,AAhFD,CAAsC,2BAAgB,GAgFrD;AAhFY,4CAAgB"} \ No newline at end of file +{"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,EAAC,CAAC;YACL,IAAI,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACzC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBAC3C,OAAO,UAAU,CAAC;QAC1B,CAAC;QACD,IAAI,GAAG,EACP,CAAC;YACG,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,IAAI,EACR,CAAC;gBACG,OAAO,+BAAoB,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAE,CAAC;YACnE,CAAC;QACL,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,sBAAI,oCAAM;aAAV,cAAwC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAElE,sCAAW,GAAX;QAEC,IAAM,GAAG,GAAI,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,GAAG,EAAC,CAAC;YACJ,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,IAAI,EACR,CAAC;gBACG,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,eAAe;oBAAE,OAAO,IAAI,wBAAa,CAAC,IAAI,CAAC,CAAC;YACzE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,8CAA8C,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrG,CAAC;QACA,OAAO,IAAI,CAAC;IACd,CAAC;IAAA,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-esmodule/PointSelector.d.ts b/dist-esmodule/PointSelector.d.ts index 3d337f04..6da73cf8 100644 --- a/dist-esmodule/PointSelector.d.ts +++ b/dist-esmodule/PointSelector.d.ts @@ -3,5 +3,12 @@ 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 index 4a25af9a..92c5f39b 100644 --- a/dist-esmodule/PointSelector.js +++ b/dist-esmodule/PointSelector.js @@ -22,15 +22,20 @@ var PointSelector = /** @class */ (function (_super) { _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); - /* - return { x:Number(this.__jsonld.x), - y:Number(this.__jsonld.y), - z:Number(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 }; diff --git a/dist-esmodule/PointSelector.js.map b/dist-esmodule/PointSelector.js.map index f761ccb2..4c705fac 100644 --- a/dist-esmodule/PointSelector.js.map +++ b/dist-esmodule/PointSelector.js.map @@ -1 +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,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;QACvE;;;;;UAKC;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AAjBD,CAAmC,cAAc,GAiBhD"} \ No newline at end of file +{"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/SpecificResource.d.ts b/dist-esmodule/SpecificResource.d.ts index 51706df1..d7b0e79e 100644 --- a/dist-esmodule/SpecificResource.d.ts +++ b/dist-esmodule/SpecificResource.d.ts @@ -13,6 +13,7 @@ export declare class SpecificResource extends ManifestResource { isSpecificResource: boolean; constructor(jsonld: any, options?: IManifestoOptions); getSource(): object | AnnotationBody; + get Source(): object | AnnotationBody; getSelector(): PointSelector | null; get Selector(): PointSelector | null; getTransform(): Transform[]; diff --git a/dist-esmodule/SpecificResource.js b/dist-esmodule/SpecificResource.js index 385e23ec..01a49f3a 100644 --- a/dist-esmodule/SpecificResource.js +++ b/dist-esmodule/SpecificResource.js @@ -68,6 +68,11 @@ var SpecificResource = /** @class */ (function (_super) { } 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) { diff --git a/dist-esmodule/SpecificResource.js.map b/dist-esmodule/SpecificResource.js.map index df9e2784..beccad73 100644 --- a/dist-esmodule/SpecificResource.js.map +++ b/dist-esmodule/SpecificResource.js.map @@ -1 +1 @@ -{"version":3,"file":"SpecificResource.js","sourceRoot":"","sources":["../src/SpecificResource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEL,gBAAgB,EAEhB,oBAAoB,EAEpB,eAAe,EACf,aAAa,EACd,MAAM,YAAY,CAAC;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,EAAC,CAAC;YACL,IAAI,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACzC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBAC3C,OAAO,UAAU,CAAC;QAC1B,CAAC;QACD,IAAI,GAAG,EACP,CAAC;YACG,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,IAAI,EACR,CAAC;gBACG,OAAO,oBAAoB,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAE,CAAC;YACnE,CAAC;QACL,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,sCAAW,GAAX;QAEC,IAAM,GAAG,GAAI,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,GAAG,EAAC,CAAC;YACJ,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,IAAI,EACR,CAAC;gBACG,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,eAAe;oBAAE,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;YACzE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,8CAA8C,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrG,CAAC;QACA,OAAO,IAAI,CAAC;IACd,CAAC;IAAA,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,eAAe,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,AAhFD,CAAsC,gBAAgB,GAgFrD"} \ No newline at end of file +{"version":3,"file":"SpecificResource.js","sourceRoot":"","sources":["../src/SpecificResource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEL,gBAAgB,EAEhB,oBAAoB,EAEpB,eAAe,EACf,aAAa,EACd,MAAM,YAAY,CAAC;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,EAAC,CAAC;YACL,IAAI,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACzC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;gBAC3C,OAAO,UAAU,CAAC;QAC1B,CAAC;QACD,IAAI,GAAG,EACP,CAAC;YACG,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,IAAI,EACR,CAAC;gBACG,OAAO,oBAAoB,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAE,CAAC;YACnE,CAAC;QACL,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,sBAAI,oCAAM;aAAV,cAAwC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;;;OAAA;IAElE,sCAAW,GAAX;QAEC,IAAM,GAAG,GAAI,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC1C,IAAI,GAAG,EAAC,CAAC;YACJ,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,IAAI,EACR,CAAC;gBACG,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,eAAe;oBAAE,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;YACzE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,8CAA8C,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrG,CAAC;QACA,OAAO,IAAI,CAAC;IACd,CAAC;IAAA,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,eAAe,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,gBAAgB,GAkFrD"} \ No newline at end of file diff --git a/dist-umd/manifesto.js b/dist-umd/manifesto.js index ba6b9c8e..6851b5d8 100644 --- a/dist-umd/manifesto.js +++ b/dist-umd/manifesto.js @@ -1,2 +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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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 +!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-var/manifesto.js b/dist-var/manifesto.js index 86ea5117..679e6795 100644 --- a/dist-var/manifesto.js +++ b/dist-var/manifesto.js @@ -1,2 +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 PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\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 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 +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/docs/assets/search.js b/docs/assets/search.js index 2156e293..01ef2d91 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE7W925LjNrKw+y7Vt/17hDPoux4ffvcKn3a7Z1bs7ZhwsCV2FZdVUo2kardnYt59BwmBBSQzcSC1rlxugcgkASYyP2SC/747Hf84333567/vfu8Pu7svtXx9d2gfu7sv7/bHdvdDe+g/dufL3eu759P+7su7j8+H7aU/Hs5/CX/+4uHyuL97fbfdt+dzd7778u7uP6+RLp/a07lL9Bn9nuyUcTv1+l+//PTj91+/687H59O2m7q9XveX+Odkr4rxqdft8XC+nJ63l+OppMtXcfug+9fDbXeHy1zT4HY2XIaSL93nS6nUa9s1EvtdkbCx2Ro5v/32P+fjYV8mLWhcKZNv5MvsuO8uP5+OT93p8meR2Lj9jSS/Of/04X+6bdmY4tfVPvfgBXl/ag/nj8fT40z89MtNXou4t6I34kU1amqeS7V/FTddLO/d8dJeugqp8wsWy/5l2+5rRM/ar3vK+7obR69ZqAFl9OZzambvLufd/+nP/6c/PHSn/tLt6u58bozgfe5uJ400gEAmavtqJRebQSCcsoC3kk8aQ1oP1A5Wj0RgEr2TQXoNsMFNDCTaaZGdnOlLTLDu86U7Hdp93X29Qi5bp8fxafToCsW/tK6WCifZ27dvv/XN3v/5VPoA8CtXa/N9+6Hbl6vgm6+W+3X3sX3e14oHV63W4ofu0u7aS1uuQXDFaunvusOuO/WH+3Lx4SW3k1/6FsBrbqDBP5/7U7f7ZfBPHofLKxSZX7pan1+606e+2CZFF9xKdsVYBFeslv7+4fnxw6HtK17G8JJ18vvzm8Nh8FH746FQPrhkrfyv2sOntvTRB81Xyz3u99226r6jS9bKn6GOnPTggrWy37WH+9JX7aX1Wqm/bLtDuVTferXU7p/P3aHYskQXrPNzqLCF9PSqopdSLZAghrjz8oiiVDYZ0uAaVEc2FVaWDHBII1sd5yzQhgx3slpVRz2pMQuCHzI4uGmwUx/kZKf5Ydd9zsjxbYolwGH79nh6bOeDNRukqd1iSb7JfGFE3LGXpovloeHQ3O9IhT4FUv67310e8mJ8s8Vyvuv6+4eCcZraLZb0Q/u58KaClmukld5a2HTZG5XFBRWYIGWYluKCPCaolFqNC+owwUpt8Hi9ABOslJvEBeWYYKUWJC4owwQrpdO4oBAT3Ep+0XKAYoLVGuRwQSUmWKkPhQuKMMFtZBeMBYoJVkqncUEhJlgjP4kLCjHBOvkELijABCvl0rigEBOsk0/igiJMsE42jgvymGCdVBwX5DHBSqkULijCBGv8HAoXrMMEC/DAYiywGAesxABrwv/1Yf8twv3bhfmZ8D70UGdahD/eJMyfdVgU6kc6ElNp5/zM96eu4DZexa2XS8Uhw1xeGjQUSTp/f2x33fxVQYS9NF0uzzVOLHJzucgla+XjQQYlOr0XSUiFr+aby+XUf3guvOfZBatkf92dt6f+qVx2fMEq2d8dH7unFlnWUcFB61VSsyE1Kr14971Qi++P98cyydeW66T12+5wLrzVl8arZP7Yfvq6vRTKfGm8Sua7bkj3KrFYUeNVMn/pujf7c+FgvjReJfP9qd3+3h/uS40VcslKq1Gz9M0uWDnGOQxAjHZpxkCJHslgDFsfl69RpUEYJjW7X1sic8ikL5B2bbZ8/c3C3rnMxcC3RB8K+s7VqAW/pVa7/O2ug511b3mFGovQa6E2JH5FNalGsMXWh8KwhNWpRbG1epTMz2VItnj9wzEosf7VodA6HQqfRTUSLV2VSSyKr8jVaLRshUjgUWyNWIBIC1dIHJOiq2MdKi2TjyNDTHwdNiyTjqNDTHodPiyUTiFEVIFajFiyelIoEeUxVTixiF0UUYtyvFcik0SLc8nVeLHQApGIETVA1ZixUgsSNSa1qcaN1NgEyPGXp27bf+y3pGsJG9wEPaKdFuHHmb4konux3n897ubjjquAXLZWj2VP+BV6YbUuM3egRoWw/XrJ3RDlFc+F+Ip66Zoz+TIKlcJXSZ4DCaIqj7zxfFFe+Z3Xil8luy5oxRVYHLiW6kUFr7g6tQFsxczI4lZygizOZKrQDo9tSZXqAtsKPZKhNqnOonC7Qisy5CY1qg67K7ShQ29Snfrwe4k+pW/ZsjC8SqMcGk0otjRTqmp1xFFBYnGswwX1ulSMXTU2qFk/SXRAr5/V+KBUnyRCyHuU/wv6ECiB0qUSJ1ToQUN/Upf6TKxyfcjNAEqb6syscl1w3EIpUodcyrXAsQsZfFShlwotKPxCKlKLYEr9QArDkLFpFYopjg/nUIR4EuVIpFQ2iWVwDarRTIWVJ/EMaeSrEc0CbUhMk9WqGtWkxizANRmoEf98E1SDdFkEaoCmSzENJr4Y0pTqkEU0uBbFgIbUo7CEDROfL2QrlooGn4TMZIZPsUS8KosQmS7MKpZJ1GYRQjPlWaUz64fjDglb8enk266T+H3xXb60XSfxq/axO80jYVzk1HiNzCxawmQvBktlOlFYCVOlFioVz/EsUiJm+2KgVKwZzm8IdeqwTbEOSZREqLIIJBVrRGIkQptqiFSsCY2QCFXqAVK9LmVv0zJ4VKFNDh2RSi0FR8W6UdiI0KgWGtXqUTxe1cCo3JchcRHl0FTDojJdkqgo59XeXBcCE1FrdBUkKtaBRkSEHvWAqFQXEg8RrlktHCrVA0dDuBJ1YKhUAxwLEQFPFRQq1oBCQoQStUCozH+jcBAR/1bBoEJPeg5i0CdQDmDK5JIYCJNeDYGKLTeJgAjDXQ2AqjUh8U9Go2r4Q49TgH7wwG7815uAnpeeiviOU4fMO+jPbx4/9EMdWEbtV7OWC+V93Z/cYtHuC2QirRfK/eXpWHKTYbNCSWBafnXcp4ctaLPoXrICKnuHwenh0h3OPfKGx/cQtlt0H0WCFkiBxYmH+/180YrvxbdZdB9ZAZW9zwrtjr+/Sc7asNGiO8iLqOy/Dh7HVoZmxinbnNEgi46BEUgQ4xotCsFxPJYIL14jEwVMscQqlpSTh0PjWOCcFa+RSCDjWCRCilfMJxwYR5NozolXyCtYuear1gp5BCyOBCKMeLHELCoOJC8mxEkNKDAcCK7lwdmVNoeBwYK7lP5mVxiUtIIFpoqs5iQmEW8seBHZzckngW4su5rj5uTS+DYWXE9tiyUnZ/gyRpuXnUOzUIWlRDanCQViY/m1/LVQau7JV9PW7MpPQlaw/Fez1aTkJFIlfL1bSSYAKli3qrhpTiKNS2Op9ZQ0I5mEo7EbUstEM1JxFBqJrCOgGXk4+Izd9SremZNHYc5YZC3dTPoeFNSMWU8Vy0z7d3OIGN5dOTVMSiGBZSCrmlPmbB6JJ2OTV00lS+WSMBKXX80gZ088QI+E0+7++SbwMeiqiD5eNUpguZ+70/lpsIufurz6r/D2pbJhMN53+91PH//ed38khc6aLrvXUnHLZJVBI3BbGaqTu6MCIbUS6sBRPDUWkqOcDll0FGuxmB3l5ysOj+BUraNHWaloYApkVkWjWYk4QAIi6whSViaBkIDQSoaUm1k4RIqnUx1FyknEMVIssY4j5SQWGfVKkpSWmUVJoezFLCmtAwWTQtG1NCk7h7M4CczmxTwpv/qgXAcuPlVEJysziZSA6EVMKasBCZWA9GqqlJVMYyUgup4rlctOz/ZlZKlAeg4tzZRYypayulBwCWhQS5dK5WaffzVfyvsGJGCCDkI1YUrLTiImyiu8mWwCMsE1rYoyZWXSmAnIredMOdkkaAKuSi1pysnFUVMstI415STisAk4+FW0KSuRwk1AaC1vSvsnFHAC8X0Vccp4gnMMFN1hOQFKyyGhUyitmjplLSGJnYAhrOZOxZJJ8ERoUE2e5s+dLHj8uT2du1yNomuUxFLRvf71ud/vvj0dH//rnE1NDvp+Ba/DSQR6A2vLMEM16osxZ0rgDzyhw40rS5fcSGLmZgpJpxlbWDtKc6oiQQukhPfzNAzWX4+7vjsPc+3tpXs8f98nM9ed3MSFs/fy6dR/coeM12r2Sz/koF2y1buBTvCS22hzHU/xdenIjy1XzLIfjpdBzYIX5RVsvULqT0XSflop5X17uu/yUyxsufwtKhS2SNIsqssWjAYBXXFVd45kf3/clk2UWfMKyUsrZG9WHbu8MnZtVextKmJvWQ27ohJ2dRXs+grYW1W/rqt8vUXV68qK15tUu66tdL1NleuNKlxvWt26qrL1BlWt6ypab1HNurKS9SZVrCsrWG9SvbqicnV11erKitWbVKuuqlS9QZXq8grVtdWpyytT11alrqpIvUE16vJK1LVVqIsqUFdUn66oPF1ddbqu4vQW1aa3qTS9ZZVpFv1kAMPw840R0NRlJQYaNV0ceLxIxYKPeon7jGP9Im+f/NhYmTTyM5SYwOyHKEmZK0KqF/E1Hwos1iQXx0Ti0593K5bp76BsWoEL1shGPzaGTq3U58bKZlZ+CYre14XLUHJuF87qJUtCSm7BkvQifcWylJllBUtTNMlWLE+FmhQsUahGK5YpOE7oUvUz9pnU+OcbL1VTl5VL1ahpwqwOgL5IbNC4UuZSRvgi+wacMKVTfsl+UWU5L8yNRPkCFw/Kem6Y0Sy34EXqLKV2GR0KGWKkykqOmNGogCVG2qzgiRlNSphipMoarliqS7FRWcUXs9qUM0ag1HrOmNEtzxojjZbzxjI9isdrBXfMaFLCHiNV1vDHlC6FDPJFl5UcMq1LlkWGeizmkRkdSphkpMcaLpnWpYBNhpqs4JNpPXKMMlRiKadMa5BjlaEGS3llRoM8s4yUWM4tU/5bPnCMvOeFgWNKg2TgGDyBJUFbSm5B4PgifUXgmLHcBYFjZLhXBI6FmhQEjqhGKwJHOE5RKStqwt0/36iUdeqqsJR11IiYVqfBXCX1fTU1Kex/dq5cezge+m27f/vY3nd/O/VJacQFC2X/0H7+un8cDmLDq5oiubDx0vsd7A5a0BHf5dRsoZyvn0+43wIEBe0WShrHIfv4plZLpRx23eeskGujhTJ+ujx0p8IBAm0XSqSKQiNR6U9QZGWQRaCRkMwnJ7JShsLu/nD/XZ9/dHHTUnmgxH6YTjQNDyXOmi6TeLr28GLoM4YRbb/k6c57qhS8UO7x8O2pvSfKz17kRc0Wjmbff3xbMaJY8xXz6BrKvt0VTKSo7TKZ7XjUw7thaJLy4nZL1u8+azT7mcVMF0tkrABZzB8ZgOpi/ozUsllD7oatkk2UJEdiK8uQ815L0bIRtLud5LLFJGy4UHZt8fuL/BXF7ykd6OL3wBRWF7/nvJ588XvsAC0vfs9oQlWgR+JrS89zPmy6+D32Y5cVv+dmPF38Hk/4+uL3rE2ji9+BTasvfi+VXWBQFxS/Z6Xni9+BEsuL3zO60MXvkQb1xe9lcrPPf0Hxe249SxS/x4vaguL3lOxM8Xvgsiwrfk/LzpOZJcXvGZmp4vdI7pLi97TsRPF7KHlB8XtaLlX8HgqtLX5PS6SK30OJtcXvGYl08XsktL74PeWf0MXvERGsLH5PRhdYOXpwhzWF6Ck5ieL3F2kLit8zljBR/B4ZwgXF74WSE8XvqAYLit/hcw9hdcI8TT/dBlrH3ZWB6xftqOmJpjRBWX0ylykv5bft1CQvDDSeDRJSe1ygwePVSBfID5sulj5H2uVPYNa84rnPw9HS+waNV8h8afTXPwkknbrjl4tucN8VGswvWSH//fHS7isHHblmrQZVwz+7Yq10PGGSkpzOmCySeqXm06ejSmQj16zQ4K/dQ/upL7Dfcdv194xvKpC3m95YKJF7hQnvTx3ixM3lxs2Xyv1tPJ+ifFbP29/Gort+a95v7IrbrG27ioHYEaOQdIDyXkSRia3E6HmpVHHNTDBWWLNOtmta7v29Qi64rS4EAETVqASAJdbgzeVy6j88lxrduPkN9fi6O29P/VOpHnHzG+rx3fGxe8IKHxAlgrY31CCPxeeaLEfjJRp9f7xHNvPmWlzb3VJyv+0O56JH8NL0hvJ/bD997ex6Vv5L0xvKf9ft20uBpYya3lD+L133Zn8uGvyXpjeU//7Ubn/vD/dlRhK54KZjkUX32KgsxvdZndKQdbaW3moNK4atMw3qgWtWPlq6CSXPyjbXrdv5DVsgf/mmbVYXcuMWqFC9eVtknUvfyv+FtzG9fUqGMf8LmtDbqAiqqN5KLbNM5HYqZpGqt1SrdCjiBku2VsvWK2JLE1uvKrc1K+QXPYP67c2iFZPe4kRWy/ptzoIVIbXVOVsTlmx3lqyMxJbnfFWs3PYskE1sA85EV24FFkgmtgNnkiu3BEskk9uCc+HVW4PZVZDcHpzvvdRtEeZZRgHFuKXvQW8XQmxVvWVYYl3obcO5canfOqzRgN4+pDWp30JExyPYRiQLEfwPN9lCjDor2kCc9CKm0fnSnuaPLpbj2yyT0B3mczTu37Uo7n3mfHaHeyRPNJYRtiuXpPQk6O2b7bY7n98ff+9eBrk/XLrTx3bbnf8S/p4c6+jhtJWdvoovwO8kUpUaldMpmF9Jkb7pSmEY18vLpfBetQqfn/pTd35bKjtovlzoZfgxIndJoWHzKqHRPP3mGmNGpQNfh2FJqATZunwO/xGlaZd3/uqPZMVP4kYIRR7irO0KTR7SZUH1qmxdydTsUOoKneZdlC1VC55be76GIP5tI0xD7ini/fxvqR14XBVKVjhhC1SKttFqtKraWatX7Ol0/NjvcTuUUe3l0hsqh1qsGUbDtPSNKtbY58vDm5/f/r07nXOvYtT5q9mFGesw6Z9Q5Lvjftcf7qMTtco0ia9cqcp2329/f/9wOj7fP0BUklcHv3qlSrvcEhXrMINni4WG1dhlclPl2MWiaQ8MF5xxw4rFXtvVj/r8ynpVZvC2btBfrlgpunrJi/XIrnSLhqbAfwFqFLotOcH5ZSuWO1+tFg1Cf3bu7FBffhoC7PSCDnTALl77HM7vuvPT8XDuvmsPu1p95teuVOf3/nj+vf49BZetVGJ/vO8P9UqAy9YrcXyeMf0iLaLrVqoB99jyCuSOPC4WferOl1O/vXS7+qeAXbtSnfOlvTzXPIjpgpWCxxi5/hGAy1YqkY94Y+mFgS5mL1N+cvHiWRfP18SudWFr8q5vGqEuCE4XK5eJQ7Mh6HLBxct2KtBcLL4kpiwLJ2tUSL4RP1UY6Gvbyjjyqa+JI0MZr2bXFz4Af1PEM/C5NMfUzcNG5Xe9w9Irsl2/2lFZFtGtznSvnum49MwsLxW7P25bYoLjcqcLVgo+gGzDvOQDknS4SPRTdz73j/350m8jB7tCl0QXK5Xzh/5UKBNcskB4sMM3TuW/t/vn7ue2n2/NxT/fZLcP6bJozw9oSk1uNGEKk5n+jkaZtE9DgyJpvuUaad76xO9vSiq8Yo302SxNCc7OT1JmFEuPtSlFAn3LNdLIlD9MYPa7IGUyzzUyz7eROVRbFU/coPEtZM5zllJC6dCq+OmW3+l58Z3GBvVw/9zedz+0T4jU6bekKS0drbi3kqF60W3BOBHiUoOEyYue1mCZ+n91O+IWo5/Ln9loDf7Oizt9BS4gbidWdsHSh0guWvoowXHuFLEaIUJ/yyxHZfL2xEKECcz4kIUSMysgJrhwCaTkg+P/yh/xwicM5FU84qVPOHpx2l35m/gqaFw7qoEJ8NlruNzo10oDUNBZxm+Idat/4RGBJe87JbbmZUBEF74LlPRZMvhzf2k/7LtyBbCLZtvvSK1xkUbkWo8okl3qS59BscTs2lwlcb46J0TS6zM5z4LXk6x/8j/cJCiMOit6Rya9qmq/YzlpoJKT8Fu737/DD1mPxUQNS+Z79t7Q8yvAvSVPrcje2+X4VHZvYcOF9zbLgT6eL92JKHGIxc9bF9/vrFJ8uz0+PrWHP/vDfals9JrFGpBndMzkZk/oKJCWOidjJrDklIyczN/GA1UKpxVoe6OZVSqelF57v2MXf/3z7TxZfH6/Ydtb3K872aPsccdNb/S03xTaR9B08Ywufdjks14m7+cWydOnJF4bL5bpq4sKnmnYdLU86rwqUmrutKqit/Uy5GUV3/Cs/WLJvgl6PsVMLmi9TGp//uF5f+nJQjOwus9aL5X6c3vfH+6/OQxOee7Fmbde/ISzJ2LNnnLxeVjl0tGzqSjByZOp8r7iVAf6doehQegxzpqX3yv4YEGV4BVyi89+iiUuOfkp6x9TJzDB6Vx5/lJOrmuYOLUilo80v6Ue+L4CpkLdqQElK3/i1KX52r/gzKUi/5Y+cQnxb+vPWyrQgTxtaaZA9VlLBdKzJy3NtFh8zlKBNugpSzMNqs5YKpFKnLA0F1x5vlKBbOp0pZns2rOVSnxT4mSluV9aea5Skc+In6qE+Ip1ZyqV+IzJE5XmLuOi85SKnn/uNCVkJJaepZT38orXpEXnKBX4tkUUcckZSjnZ6AlKsdSq85Nya2/29KRY9uKzk3J6UCcnxeJrz00qsbhlb97N37jkiUkU0Lq5FuRpSfOosfaspCKrQ52UhFib2nOSauQXROsLzkgqWnvwE5KQtafufKRy2UVopvJspJKVjzwZab7qVZ+LlLfwiVORoI1fcCZSwQpXguyrz0PKy8VPQ4Ji685CykvFT0KCUuvOQSqQWgqnqs9Ayq1m1AlIs33DqvOPshwhSxBu5zeQJx8BMlR77lHJfht16tF8r632zKMK6eSJR6QW1ecdIdrMN7qjSLk7PD++aDD8lK4xeKlg+OaHn9//v7l+XvlWaco2qoRK+eHNj3/75at3b39+nxUVNV0s76cff/q/7978/F1eXNCyTlqYG3TsD5dfuiEewbJrwl9vkoYw77EsXydSk4SStXfzan5Jnfw5gtniKzQiO26+4r4p040/6yr7Xfbc5yYVe9TlFrVIKmnOEdnVNr10vEnDjo93tXWv1YM08Wl9qu08OUKBacH9tvFfb2JKXnoqMiFOHWoynfBt9EDGS5PZI0I275PStqOLnBYXtFlwP3j+UtB9Onkp2bdrlRvdV3GzRXKQXf9IQGKjP9nz5dR1Px53SfWDNmUSZt/CGgcQ+2p6IAW0WyaJPEMyFhQ0WyaHSDWJpWSSTHIyyAytWEo2PSsnJ7s7Hssr3hovlIvui6Mik5viOWno7nAsJplwluz//NQezu/7x6SEsNECGS5t6n3B+zprudpKZzlzIH0xZE5qQBHmQHAtXs7NmOyOZjx7Fm9n5vTAIXMsvA4tZ61oim4DS7oEbefkk1w7ll0NtbNWnSTawLBX4+xiydk1pR5k52Xndg+hCku3DnOaUDw9ll8L0wul5p58NUbPrkgkQwfLUjVAT0pO0vPQLV6CzjOSCW4eSa2E5jmJ9F50LLV+IzojmdyFjuRWb0FnpGZjkdrtgYw8fG8gkle3MZCTR+0KxCJrtwTSMSoBleKouwompSPWOcgJ764c3aTjfAoahZ5kLSzK2TwSEsUmrxoOlcoloRAuvxoGzZ54CIFo78L/chsYFPVWBoQm1ehH+O3x9NgiDy6WFjYsl1UZbMQilwccOU3IoCNWoDrwKHja+eBj9tyXByAF+hCxwEyJykCgQHI6GJkpsCwgKdCDDkpmOtQHJgXyS83HwgClRoPsG7EwUCnSIRusIKosDlgKNCKDlpke1YFLufSSEakPYArkJ4KYmQILApmcBulgJtZgWUCT14AKaqD02sCmQHIiuJlJXxDg5DWggxwovz7QyUsngh0oujLgycslgh4otzLwKZBLBj8z0dUBUM4XIoOgmbdZFwjl5GLBELjbivAkJ40OimKZ9YFRgS2lg6OZKa0PkCrk00ESqUd9oISNRBAs4a/Y+K83CZJeeioKkJw6iR1Od2RzSkzUqlBKXF1ZIKRaAqylm1ZItLQ9vp1Z42Uy/9puf78/HZ8Pu6+O+/RQoa3LpNaFmIHMxeFlUgMqtAwE14aVueecDSnjB704nMzpgUdysfC68C0nMRlCxoIXhY85+WToGMuuDhtzcumQMRZcHy4WS07O8GVhYl52LkSEKiwND3OaUKFhLL82LCyUmnvy1eFgTi4dCsaC68PApORkCBhIXhT+ZSQToV8ktTLsy0mkQ75Yan24l5FMhnqR3OowLyMVD/EikXXhXUZezu+sDuty8qiQLhZZG84lfQ8qlIt94qowLikPCeHCuysPopJSyNAtkFUdtuVsHhmyxSavOlwrlUuGarj86jBt9sTDEI2cutcfbhOohZ2VxWper6qE4FhOOic4J+G3i1/icnLilrMxQfL0ENl4ui3mAESy45bFd4pLw8NFXF46WqyQiB4SRgtNHhFWLHfspuZ2wwtuI5sIZJLi02f5F2jwfXu+9lgofn7BKtnDV1sLRxw2Xyz3x+5zjVzYfLHcoZPd28MOd+OhWNB6udRT96nibmHzxXLHRabgPqd2yyVd2lP4WhTInF+xWPoY+BTc59RunaSS9Qe2vcWTrXqoq+5yOIKxfLGDzRfLzRZMzEQX10yUS0fLJijBycqJnEwfwo7z/6fny08fiaAs9qDIq5Zq8W1/OpdNMdh2qcSXFSwrMGq6VN54zGahwLjtUonpAzmhzLIDOfNSozfxm09d7g3Cr1jmm+fRfyR6Of3P6EFuAETiq/cA8vYjvw0AjcjynYASz67Ql6zi8Xm56S0BKH7ZrkBeC3pjAGpQvzeQl57YHoDiF+wQVMgvWLyX7BOUaJDdKpgrsni3oMCLojYMZh5U7Z5BsewS961656DCY61wWG8mP72FAJaiJbsIhR5WoUt1S7mJ7QQoe8GOQt7jITcVoLtTva+QlV3mxVbuLmSlEhsMQGrlHkNeahGrXbTTkPFzyM0GyHXr9htyjDfrzFbsAeRoL7nxEKPe6r2HEmJDbT/MYU3tDkS5dHoTgtKifh8CGYNgK+Lr7tyd+nbfn7v5DkL4Y3JLIro//KNus74y33SLFEtJ+q8zYoIJade2KyUmTD8hl1gBVkqfr3pZ8XTEWyyfXHgI4ej6s0py8X2HF6yU/fbSPZaKvba9gcTiO32b3HUjZJZuJM5llmwmEkLjfVDKaR///Ua7oC99FW6COqWS1vtjj3xKMRIVtVsq6avj4WN/eqRi7VgcaLxUZuqDDFAk9T2GOonftv3++dTVCEYvWSn/u67dIYsgIXpqvVRqobjVcq4tyuYQaLxU5tvDx+PfTn1W3Eu7Ukm1RDKQtwJIJrWgeWQgvB5HZp9xnkaCh70cRuZ0KZtctRAwb6mSJBKaqkUgMqdDgkPG8hdgyJzsFIWMhS+BkMXSMzN/KYLMy88TSKjGcgBZaGVLDeztJedHYQF8zMlOscdY+BL0mJSeIY+B9IXgMSOd5I6R5GrsmJOaoo6x5CXQMSM9wRwj2QuQY0YyRRwjsbXAMSOT4o2RzFrcmJNJ08ZYbD1sTPowNGuMo6dK1JiUiZLG8C5rgF9SUoIzBvIWYMaCSJGijLNQsRYylspOMEZchwWIcfb0wyC//xcynft/3Si89x2VxfaDLsQk+aPfIUcFv/Tvf6/v+aHr7x+Q5z91PTUo6jt4tJf28nz+KjzU1J3z//JD8iEHXwx487f33/307u3/9+b9259+/O3bN2+//+brdKeviEuIe3hRFZX/7U/v/vr266+/+TEjNGy3TNLbH99/8+7HN9//9ss37/7+zbvfvnn37qd3GanUNcs0ePfNL+/fvf3qffYJRw1rZAWv3+h4zebe+K83eQFfeip6A506xIuCBlKBgFn8VNxzj+asBl33yRTVZN/PCOgIen5O8I1kv3s0rg163icpTbJv3NgFfaetXbJvwtwFnWfsXbL3T/25/4DA16D7lyaL+qeTRCMZ+fTQmRz4WqKR0/TL7V7PqbfyV3RUrf5lepE0f6FSLgQms/AYPSAXP0ZvrWzPzeYB31x82PZ2GqCIby68CuyVyP1v2lJEgv97ZjDWSv4uYUci0d/Nzcla2T+0n0tvPGh6U/nFtx+2Xa5BHVgHWixG61lNKLgOFKjF6yVjkAXs86FYjNhL9ME591yJOsRdIjkJ2ucKLELtRW8FBduRl6IWt5etAhRwx1aBWuRepUHZQlSN3ct0yIF3TJWl6L1EIwq+z/Woxe8V0ktGpBrBF3kGha7kMgyf1SAJ4qFTuATFF2hAwPiZ9EocXyKZBvJz6fVIvkADEsrP5Fdj+QLpOJifia5D8wVycTg/k1uH50vkUoB+LroW0Wd9IQrSz2O8Kkyfj/fm4BzebTk0z0ojYT2QWY3rS2wpCeznprQa2dfIJ6E9rUc1tkdHIkQUp/Zw3reXbvzj4/E0T4CcN7kNtMC7LaMXc60TS+e1MWq+CSVmly3QA3xxtvoBv4qvKRzvCo3eDYt0/cC/wq68vXa/bNv9IuVmF95et+VvzSvi4lvrSC4j9FtXt56UPy3EyFPPpsLOF8unlxpCi/o1p8Ya0YsPbYrqV6ElGtHLUV6z+nUpOX5wgRp+/3lIgSeWkZffyytY/vrc73ffno6PaG0J1u0reEliUQg0Xrg0QuHF6yIqOn6kxEcy/Q83Wt+Dzgq1v+pVtXMYiUlvHmb6Pxx3WIAfCfBtlkk4j9/BRo6SiIUEzZbJ6T4/tYddVk7QbJkc1LaHEvrlfRM7o1H3mc3R3Hi3n752x8clR3xqtUyKa5h/315FDYtlRTat3e0KBL20WiYlDUTi8ad4SJ08Gn8Aadk6tLwsAnYAQenTehApc/MbbTe43JDwp9Kknq9++v77b74a0nNynb2KmqY1H5VD5f3w5se3337zy/ustKDhUlnv3vz4f7/JCvKt6qQEC+LfLthRYOO/lvsT437Erm/RXaSXvl6BdrjSTqPEttVje9/9P8/tvkc8yVgYaLpQ3qH73G4v3x+H2ConELRdJnG8vD93u7+3++ecyFnjRTIP3Wl0SN18ebtLTYlXePMFcg9DIsOgfG7iwIZrZP3tNF9aMVGu3RpJu7+d9ucf2st2vs2OCYyaL5Dbn8f5TlVvBiJnLZdLu+745AYQbb1I6vfdp26/Kb9TtP1yyaxSMmy/XDKvlAzbL5CcrocPRJYVwidlbR+67e8u2zMlKW62QM7+2O5Kbgm0WyjpG5A4cn7zfHlgObnkVTfSYpESK3TYHYeLv3po+7nTHEiNmy2Q014u3ePTlKD23/3l4f3xd+QQwUBo4ppbjvmmWTTo42U3HPV6NdZosT117aX75nRCGEn4TkfNFssZND2e+n+N+xZDFXu3KxSduHKxNu+68+XUDyijUIn5BYtlvz24MRyW2+5UKB+/aMlbeH2ayUUqbLRAxvnh+McwaqPSLR6OB9Lw5jNcixyqn/PVqdSc2EnH0nJqpPiXET1cPhYFmi6Qdzm1n7rTuXtz2H07/JqQN2+67P7IFCP0MS5c+YeNze7x6Xhq918dH5+OByy1KxaItS+TXIqKw9ewgBNDMdFX5DN7muD3m5BurM+y78oDZRNzn/yILyY7vqBWdvG+NSp7yaZ1sS5LRnfFdnWxXpm9akKthRvVdSOX3qVODeGyLepC7cjv5RLvUt1Xcwuf0Nys48+jfCu4UDL9HV1Mfv3XdIvtCv1NXcKu1H9Zt1oX+vu6GZ3qv7JLj1b0rd3kyx3/fJMFBemy8DO8kaYJVwPFuJjYoHGlzOJlBBO7ZBUp1SS3iOD6LF1DSrWqn2XLV5CqMUsvIInBW7Z+lOlGf6MPfXMqP9ZX9HSQgyawZ1Fx0kSR3MR3/ObSF3zQr9CCJL7shxqRBZ/4q9Qk8a2/pEYLPvpHjVOwaODf6h7/tXxL8ePp+PjVL78kunn10gQ3z06P+iUoEFGy8kAxcbU1uoMXSPiU3LWDfYPPvp+QNJeg71MivSXT8/2pQ7Bp0LdvsKj3D5mH8mHFM8lMmpoJowOj2z52p/ZdNyRFf+pmIenH54M7fvgveMPkvA/E7Icy1wIpaDtMyD9eX6vZv/z33UBqhu6+vONfiC8GpPux7/a7892Xvzr5r++2x8exeO0f19/+3g1Tf2jhmvxlc/f6181r1XxhmPjHP17/6q8Yfxj/YWzG7l7/yl4r/YWQNmrGomb87vWv/LWWX1jOomY8aibuXv8qXgv+hRY8aiaiZvLu9a/ytdBfSNtEzWTUTN29/lW9FuoLYXTUTEXN9N3rXzXWm46ambvXvxqsmYma2bvXv1qsmY2aNXevf22wx9vEj3dDPREGxmEciM1rJb6wQsUt46FgwyNnDG0ZjwYbnjrjaMt4QNjw4JlAW8ZjwhQ1diweFaap0WPxuDBDjR+LR4ZZagRZPDasocaQxaPDhzFgEp3X8fBwRo0jBy/KODrqtWi+0E38RvF4dPg4Ovq1sF9oA4THo8PH0TFDnwy2jEeHD2PALNpnPDx8GATWoHrG48OHUeAbtGU8QHwYBs7QlvEI8WEcOEdbxkMkhnHgAmsp4iESw0BwiT0lEY+RGK2ZQlsCezYMBNeo9HiMxDAQ3KAt4zESw0Bwi7aMx0gMA8EbVM94jMQwEGKDtozHSAwDIRjaMh4jMQyEQMdIxGMkRyOHjpGMx0gy0vLHQyQ5ZT1kPEJSUNZDgjVHUtZDxuMjFWU9ZDw8chgDIbHFU8bDIw1lPWQ8OnIcHfVayi+kAi3j0ZHj6OjX0n5hOHhC8eiocXQMZttVPDpqNHL2tdp8wVR8QyoeHjUMgmjQlvH4qGEU5AZtGQ+QGr0C1BdRwC8Y1yCOtoyHSGnSGqt4iJQhrbGKx0hZ0hqreIxUQ1pjFY+R3pDWWMdjpBlpjXU8RpqT1ljHY6QFaY11PEZaktZYx2OkFWmNNXDfNGmNdTxG2pDWWMdjpC1pjXU8RrohrbGOx8hsSGts4jEyjLTGJh4jw0lrbOIxMoK0xiYeIyNJa2ziMTKkL2fiITKkL2eAj036ciYeIEP6ciYeH0P6ciYeHjuMgRSYL2fj4bGkL2fj0bHDEEjUwNt4dKwg7baNR8eOVk5h1tjGo2PH0dGo9Hh47DAI0qAt4/GxwyhIi7YEYdAwDLJB9YxHyA7joDZon/EQNRvScjbxEDXDQCh0LWjiMWpGRwFdC5p4jJphIJRAW8Zj1AwDodBxb+IxasYQVaEt4zFqxlcIHc0mHqNmGAiFjmYTj1FjSWvcgGi1IW1XAwPWDWm83G9h23GYLBo2bkDUuqEDI/db2JYOjdxvYVtJLrLut7CtIpdZ91vYVpMLrfstbGvIpdb9Fra15GLrfgvbNuQi6n4L2o48AV9G2Yw1MHIhZZA2jEwBX0oZ5A0jVcAXUwaJw8gV8KWPQeYwogV88WMQO4x0AV/+GCQPI2DAYQZkDyNiwHEGpA8jZMCBBuAPbKQMONIAAIKNnAGHGhwCotEmNthSyACEYJxEdgxQCDayBo0jKsAh2EgbNAGpwIiNvEGjdJEBFsFG4qDRVZ4BGsFG5qBRusMAj2AjddAKbwsGbeQOKPtjAEmwETwQRg9ACTaiB8LoCQj2BLmSMgAmmEgYSIAmmEgYSAAnmEgYSIAnmEgYSAAomEgYSIAo2Agi8BWQAUjBRhRBGFOAKdhIIwhjCkgFG4EEYUwBrGAjkyCMqYRIVtLGFCALNpIJfH1ngFowhy3wBR5wC+bABW6kAbpgjl3g4wbgBXP0Ah83gC/YCCkI4gyGbaQUuJEGAIONmAI30oBgsJFT4EYaIAw2ggrcSCvI0UcLqVGLAygGG1kFbqQBxmAjrCCMNAAZbMQVhJEGKIMpmjcxADPYiCxwjsQAzmAjtMBJEgNAg43YAmdJDCANNoILjXrRDEANNqILjUZFDGANNsIL3eBt4Q4ITZ8YQBtM0/yJAbjBNE2gGMAbTNMMigHAwQxNoRhAHMzQHIoByMEMTaIYwBzM0CyKAdDBDE2jGEAdzNA8igHawQxNpJiBm1c0k2KAeTBDUykGsAczNJdigHwwS5MpBtgHszSbYgB/MEvTKQYACLM0n2IAgTBLEyoGIAiz9H4joCDM0juOAIMwS+85Ag7CbGLXEYyZpfcdAQlhI+8wG9T6AxbCGpJXMQBD2Ig8DMO7BSM2Qg+Du90AiLARexjc7QZIhI3gw+BuN4AibEQfRqG+NMAibIQfBl8wARhhI/4wBm8LN4uHoTEWbwv3i8dhQyMrDuAIHwGIRVMwOIAjfAQgluFtwbbxCEDwFZ4DOMJHAIKv8BzAET4CEHyF5wCO8BGA4Cs8B3CEjwAEX+E5gCN8BCD4Cs8BHOEjAMFXeA7gCB8BCL7CcwBH+AhA8BWeAzjCWWK3H8ARzhL7/QCOcJbY8QdwhLPEnj+AI5wldv0BHOEsse8P6AhniZ1/gEc4S+z9w/wMTu/+c5ihwen9fz5L0qAzADhM0+B0DgCHiRqczgLgMFWD03kAHCZrcDoTgMN0DU7nAnCYsMHpbAAOUzY4nQ/AASLhgs4I4ICRcEHmBHCASLggswI4ICRckHkBHAASLsjMAA74CBdkbgAHeISPCMTiOXMAj3BB5gdwQEf4SEAsuhJzQEf4SEAsnt4E6AgfCYhFARgHdITLxMoG6AiXiZUN0BEuEysboCNcJlY2QEe4TKxsgI5wmVjZAB3hMrGyATrCZWJlA3SEy8TKBugIV4mVDeARrhIrG+AjXCVWNgBIuEqsbICQcJVY2QAi4SqVzQbGTSVWNsBIuEqsbICRcJVY2QAj4SqxsgFGwnViZQOMhOvEygYYCdeJlQ0wEq4TKxtgJFwnVjbASLhOrGyAkXCdWNkAI+E6sbIBRsJ1YmUDjITrxMoGGAk3iZUNMBJu6JUNIBJu6JUNEBJu6JUNABJu6JUN8BFu6JUN4BE+IhCLBmIc4BE+IhBrUPMP8AgfEQi+CgI6wl1WCBqzcUBHuCVTsDmAI3wEIBYP7wAc4SMAadAIngM4wkcA0qBhOQdwhI8ApMH9BgBH+EhAGtwZAHSEjwikwZ0BgEf4yEAa3BkAfISPEKTBZwMAJHykIA0alnNASPhIQRp8iAEh4SMGafBxA4iEN4mFDSAS3iQWNoBIeJNY2AAi4U1iYQOIhDeJhQ0gEt4kFjaASHiTWNgAIuFNKl0b5munErZBxvYmkbINEInYJJK2ASIRm0TaNkAkYpNI3AaIRGwSqdsAkYhNInkbIBKxSaRvA0QiNokEboBIxCaRwg0QiWD0wiYAIhGMXNgEICSCkQubAIBEMHJhE4CPCEYubALgEcHIhU0AOiIcHdmgNl0APCIYGbMJQEfESEBwMyIAHREjAWEbNLARAI+IEYHgyYQC4BExIhDcPgmAR4QrYkHtkwB4RLgEEjS9XAA8IkYEgueLCYBHBCfBvwB0RHAS/AsARwQnwb8AbERwEvwLgEYEJ8G/gOUsI/1gG3R9F7CiRZDkX8CSFpc9skF9ATGrahHkGihgXYtLH8EnL6xscekj+ByDtS0jAyHmGKxuGSEIvgYKWN/i0kfQNVDACheXPoKugQIAEuHSR3BbCgCJcOkjuC0FgES49BF8DQSARLj0EXwNBIBEuPQRfA0EgES49BGieAmM2whBiDUQABIxQhBiDQSARLj0EXwNBIBEuPQRfA0EgES48hd83AAgEa4ABh83AEjECEFw+wT4iBgZCG6fAB4RIwLB7ROgI2IkILh9AnBEjAAEt0+AjQhXB7NB4wQB4IhQZMQmABsRrhZmg8YUAsAR4cphNmhQIQAdEdpVzqJRhQB4RGhnJi0WkArAR8TIQNgGTfUTAJCIEYIwhjsPgJCIkYIwhkaEAiAS4dJIGL5kAEYiNM0kBWAkQtNMUgBGIlweyVAizL6wHDYG4+cSSfDCWgEoiRhRCGP4zACcRBhX/IzPDEBKxIhDGMNnBmAlwrjxQwNOAWiJMG780IhTAF4iRibCOD4zADARIxTBK0kEACbCAROUawtATMRIRQg3DRATYen8LQGQiRixCF61JwAyEa6eBq3VEACZCJtwUQAyETbhogBkImzCRQHIRNiEiwKQibAJFwUgE2ETLgpAJsImXBSATESTcFEAMhFNwkUByEQ0CRcFIBPRJFwUgExEk3BRADIRTcJFAchENAkXBSAT0SRcFIBMRJNwUQAyEU3CRQHIRG5oF0UCZCI3tIsiATKRG9JFkYCYyA3pokgATOSGdFEk4CVyQ7ooEuASuSFdFAloiRyJCOPonqIEuERuSBdFAloiRyLCOHpehgS4RI5IhHE03pKAl0h3uAdH10MJiIl0OSUcXQ8lYCbyesQHuh5KQE2kyyrh6HooATeRLq2Eo+uhBOREOnLC0fVQAnIiRzzCBLoeSsBOpGMnAvWUJIAn0sETgY8ggCfSHf4h0IJACeiJdPQEd38kwCfS1d+g+7cS4BPpTgER+NQA/ES6g0AEPjUAQJEOoODHEwCCIkdMQpw7ABCKHDkJDp0kYChyBCV4DasEEEWOpASvYpWAosgRlOB1rBJAFOnyS9BKVgkoinQJJmgtqwQQRSZqcCSAKHIEJXg9qwQQRY6gBK9olQCiyBGU4DWtEkAUOYISvKpVAogiR1CC17VKAFHkCErwylYJDwqR9OaAhEeFOIiCrswSnhYyghJ8ZZbwwJARlOAQUs7ODJGkFyrhsSEjKMG9UAlPDpG0Zynh2SGS9iwlPD5E0p6lhAeISNqzlACiSEV7lhJAFKnoTR0JIIpU9KaOBBRFKnpTRwKMIhW9qSMBR5GK3tSRAKRIV4iDenUSkBQ5whLCqwMgRTqQgr8XgKTIEZbgXh3gKHJEJbhXByiKHEEJ7tUBhiJHTIJ7dYCgyBGS4F4d4CfS8ROBezKAn8gRkeBeHaAn0tETgTs9gJ5IV4UjcKcH4BPpynAE7vQAfiIdP5G40wP4iXT8ROJOD+An0vGTIaxG3GHAT6TjJ/gxGRLwE+n4icR9E8BPpOMnEvdNAD+Rjp9IfLABP5GOn0iUXUjAT+TISJjEzTsAKHKEJEyigE8CgiJHSsII5wAgFGnpNw8QFOkqcogzn8DwWZe8gIc+AKHIK0JBuaEEDEU6hjK4EljPYPgcRFH4xAAURTqKovCJATCKdBiF8CYAR5EjK2EKf7UBSJG2SbwmgKRId1KJwu0AQCmycUXeuB0ALEVe00/wWQRginT5J8RkBjRFjsSEmEeApkiXgKJxawRwinQZKBq3RoCnyMbVMeKTDgAV2biNcdwaAaIiR2rC8Hp+CZCKGrEJcZwXQCpqxCYML/5XgKkod4wJXrerAFVR13NM0AmqAFdR7iAT3MwpQFaUO8lEoxNUAbaiNpo2cwrQFeXoCj5BFaArakOeiqEAXVEuFwWdngrAFeXgCm7mFIArysEVjb5+CsAVdS3YQc2cAnBFObiCV+kpAFfUtWQHfUsUgCvKHWiCPwzAVpRjKwY1XAqwFeXYiiHuD4yeYyt4qZ4CbEWN+AQ/7VABtKIcWjH4GwXQiqKPVlUArCiXl4InxyhAVpQjKwZdShQgK+p6xCr+pgKyokZ6QjwKQFaUO2fVoKhCAbSiRnxCHBgI0IribvDwaQ/YiuKuChx/qQFcUS5FxeInMQK6otwJJxafnQCvKJekYlF7rwBfUY6vEDoDwKKuh5wQOoPxc2kqeGGMAohFXfNU8LkMGIuiC3kUQCxqxCgMT6NWgLEo4cYPn54Asijpxg/d41aAsijJEm8JwCxqRCmUKQKcRUk3fvgEBaBFOdCCp1MrQFqUIy3EOwVQi5Lk2RkKkBblSAv14MD4jTiF4UndCrAWJZvEWwLPa1WbxMSHR7Yqlpj48NRWV9TT4GrAg1sVeTKUgie3Ktr1VLOzW90RQ7gNgMe3uqoefEtGwRNcXeoKnuKu4CGu7hRXPMddwXNcXfIKnuSuAHRROrGvoAB2USNbwbcKFOAuyuWu4OnzCpAX5XJX8Px5BdiLcuwFT6BXgL0oV92DZ8kqQF+UK+/Z4G8JoC/Kne+K50YqQF+UO+IVT3hUgL4od8orntWkAH1R7qBXPFVJAfqirueg4FMD0BflDkLBU5UUoC/KnYSywUcQ0BfljkLBU5UUoC/K0Rd8m0wB+qIcfcF3vhSgL8qdhoInQSlAX5Q7DgVPglKAvqgRsOC7WQrAF2XptGgF6Ity+Sv48gfoi3L5K/jLCuCLGvkKvkOlAHtR7kxYdIdKAfSiRrpCRGeAvChHXoiTqsHIjWwF36FSgLuoEa3gO1QKYBflTofFjSGgLmoEK/gOlQLQRbkTYtEdKgWYi3JnxOJjDJCLcvkrKIlXgLgol7+C7lApQFzUCFXwHSoFgItyZ8Wi1EcB3qIcb8FPOAe4RTV0HYICtEU1qbPL4eHlqdPLwfHlm8T55YC16E3iBHOAWvQmcYY5IC3alfzgZ5MD0KJdyQ9+OjngLNqV/ODnkwPMot2RsfgJ5YCyaHdkLH5GOcAsekPnHWmAWTSj8440oCya0XlHGkAWzci8Iw0Qi2Zk3pEGgEUzMu9IA7yiGZl3pAFd0YzMO9KArWh3IAqeh6sBW9HXE1FQ90QDtqLdkSh4vqwGcEW7M1HwfFkN4Ip2h6Lg+bIa4BU9EhTU49cArmh3KAqeWqsBXNHuVBQ8tVYDuKLpuh8N2Iqm6340ICuarvvRAKxouu5HA6yi6bofDaCKdt+xYaiDpgFU0XTdjwZIRbtv2eDJxRogFe0+Z8NRj0sDpKIdUsFjLw2QinYfteH4uwGQinYnx+K5cxogFe2OjuUSf3Bg7K5nx+LvBoAq2kEV3GfWAKroa/kP/iIBqKIdVMFDQA2ginZQBffGNYAq2kEV3BvXAKpoVwKE5/tpAFW0qwHC8/00gCraFQHh+X4aYBUtaRdFA6qiJe2iaABVtIMqqHurAVPRV6aC9guQinZIBXdnAFHRLoEFd2cAUNEugQV3ZwBR0S6BBV+aAVHRLoEFX5oBUNEjM6E+ywLGzR2Tgrs+AKdod0wK7voAmqLdMSm46wO/i+OOScFdH/hlHE0njGn4bRxNJ4xp+HWckZYQLhX8Ps4ISwiXCn4hxyWx4OM2+0aOJldF+JGcEZTgqyL8Ss6ISfBVEX4mZ4Qk+KoI+IkeEQm+KgJ6oh09wVOBNaAn2tDuCWAn2n0tB62M0QCdaEPn+GlATrShc/w0ACfa0NG3BtxEG3rjRwNsol3SCm6eADXR7hRZ3DwBaqLdKbK4eQLURI9khDBPgJrokYwQ5glQEz2SEcI8AWqiRzJCmCdATfRIRgjzBKiJHskI9e0oMG4jGSHME6Am2lX94OYJUBM9khHCPAFqokcyQpgnQE20O0oWHzdATfRIRgjzBKiJHskIbp4ANNHu4zqoeQLMRI9cBDdPAJlod5As3hSM2UhFcPMEgIm+fmAH95cBMdGu4gc1TwCYGAdM8CpUA4iJccREoK61AcjEOGQiUNfaAGZiHDPBaw8MgCZmQ5tJA6CJ2dBm0gBoYja0mTQAmpgNbSYNgCZmQ5tJA6CJ2dBm0gBoYhhtJg2AJobRZtIAaGIYbSYNoCaG0WbSAGxiGG0mDeAmhtFm0gBwYhhtJg0gJ4bRZtIAcGIYbSYN4CaG0WbSAGxiOG0mDaAmhtNm0gBoYjhtJg2gJoaTZtIAZmI4aSYNICaGk2bSAGJiOGkmDSAmhpNm0gBiYtx3f/GyJAOYieGkmTSAmRiXiIITCAOYiXGf/8Xzxw2gJsZREzwp3ABqYhw1wZPCDaAmxn0HGE8KN4CaGEdN8KRwA6iJcdQETwo3gJoYR00kvmgAamIcNcGTwg2gJsadmYInhRtATcz1mzv4zADUxLiCHzwp3ABqYq7HpuAjCKiJceemSHwEATUxjppIfAQBNTGOmih8BAE1MY6aKHwEATUx7uwUPHvbAGxiHDbBGZIB3MTIxFEOBoAT4yp/FD43ADkxrvQHzws3AJ2Ya+0PPjcAOzGOnSh8bgB4YlRiM9wAemIcPcGTyA3AJybxPWED8IlJfFHYAHxiEt8UNgCfmMRXhQ3AJybxXWED8IlJfFnYAHxiEt8WNgCfmMTXhQ3AJybxfWED8IlJfGHYAHxiEt8YNoCfmMRXhg0AKCbxnWEDCIpJfGnYwE8Np741DD82nPraMPzccOp7w/CDw6kvDsNPDqe+OQw/Opz46jD87HDiu8OzDw+TGzwGfno48e1h+PHhxNeHAT4xDp/gJSMG8BNjGZ3BaABAMQ6g4PUlBhAU4wgKXtlhAEIxDqHglR0GMBTjin5wjcG4OYSCF4EYwFCMYyh4EYgBEMU4iIIXgRhAUYylXU0AUYw7OgWvATGAohj6gzwGQBTjjk7By0UMoCjG5Z7g5SIGcBTT0ElDBoAU4w5PwatFDEApxp2egtdTGABTjDs+BS+RMACnGIdT8BIJA3CKcWfO4t8nMgCoWAdU0HXZAp5ir+U+2PppAU6xrtoHXZctoCnWFfug67IFMMU6mIKuyxbAFOsyUNB12QKYYl0GCrouWwBTrMtAQe27BTDFugwU1L5bAFNs4qPFFsAUm/hosQUwxSY+WmwBTLGJjxZbAFNs4qPFFsAUy+iMLwtgimV0xpcFMMUyuq7cAphiGV1XbgFMsYyuK7cAplhG1pVbwFIsJ6tbLUAplpN15RaQFMvJunILQIrlZF25BSDFXj/Jgy4vFqAUy8m6cgtQiuWJqmQLYIrliapkC3CKdTgFL8uyAKdY7swkunBZAFSsS0LBv6FmAVCxDqjgJVEWABXrgAr+FTULgIp1QAUvXbIAqNiRmeBDAnCKdXU9eKKnBTjFCvrIGwtoinU0xaKrnAU0xbrCHrxIzQKaYl0OCjGLAE2xrrCHmEWAplhHUyy62FpAU6yjKfjXiiygKdbRFIu/UYCmWEkPH2ApVtJFkRagFOuqetANXgtIinWf6cEfMQAp1p1Cix59aAFHse4UWvSoTQswinUfMUaP2rSAolhFH6loAUSxij5S0QKGYhV9pKIFCMUq+khFCwiKVfSRihYAFKvog28sAChW0QffWABQrKIPvrEAoFhFH3xjAUCxmj74xgKAYjV9pKIFAMVq+khFCwCK1fSRihYAFKvpIxUtAChW00cqWgBQrKaPVLQAoFhNH6loAUCxmj5S0QKAYjWd2mwBQLGGTm22AKBYQ6c2WwBQrCFTmy3gJ9aQqc0W4BNryNRmC+iJNWRqswX0xBoytdkCemJd3Q5eEWsBP7H0d3os4Cf2+hVj3DsBBMVatyuO2mkAUKwDKPgaC/iJdYemoGzcAnxi3ZkpAm8LRs2V7aDPF7AT66p20LkA2Ikd8Qg+FwA5sSMcwecC4CZ2RCP4XADUxLoTZ/HCZAu4iR3RCP59JwuwiaWxiQXYxDpsgif9WoBNbEMWqloATaz7SA/hIQJqYh01wYuuLaAm9nrmLO4AA2piHTXBS6MtoCa2Ic/YsICZ2Cbx8RALmEnjmAl+VEQDoEnjklDw+uwGUJPGJaHgpdENwCaNS0JBV4sGYJNmRCP4atEAbNK4zxmjq0UDsElz/VYP6v42gJs0qeNnGwBOmmsWClpx3QBy0jhygtcINACdNA6d4HXUDWAnjWMneGl0A+BJ4+AJXhrdAHrSOHqCl0Y3AJ80V3yCvlEN4CeNS0bBK5gbAFAal42CVzA3gKA0jqDgFcwNQCiNQyh4BXMDGEpzTUjBJxKgKI3LSMErmBvAURqXkoJXMDeApDQuJwWvYG4AS2ncB3zwCuYG0JTGnZOCmc8GsJTGsRS82LkBNKUZgQn6RdkGsJTm+n1jfF4AltK4Dxxv8HkBWErjUlPw6uUGsJTGfeIYr15uAEtpXEEPXjrWAJbSCLdJh88LwFIa4ZLT8XkBWErjWApeOtYAmtIIZ0DxeQFoSuNoCl4P1gCc0rhTUvB6sAbglEa4753hIwhwSiNo9twAmtJIFyLgow1oSiNdRhg+2oCmNJI+1bQBMKWRbpcVnxkApjQ0TGkATGkcTMFrrBpAUxr6jJQGwJTGwRT8KPMG0JTGpaWgHn0DaEpzzUrB24Khc9U8qEffAJrSuGoe1KNvAE1p6G/6NACmNPQ3fRrAUhr6mz4NQCkN/U2fBpCUhv6mTwNASnM9iRZ/7QFJaehv+jQApDQjLBF4TVwDSEqj6eiuASSl0XR01wCS0mg6umsASWk0Hd01gKQ0mozuGgBSGk1Gdw3gKI0mo7sGYJRGk9FdAyhKo8norgEQpXF1PApdaQFEaa4QBTfqgKI0hozuGgBRGncILX7mVAMwSnNNQ8EXCwBSGpeHgtclNgClNMbVX+ELAIApzUhMBF4K0ACc0riP+OAp+w3AKY3DKXjKfnMFKv94fdcfPnWnS7d7e9h1n+++/PXXu99++5/z8bDf3b3+991vvftn/Xrs9e7Lf9/puy///Z/Xd8y4/0rh/muu/89Yc/1D8esf9voTF9e2wwelxz+GD3C6P/i1zfA5Mtfvxv+hmftjKMd3f/jGQzWZ+6NRVy24/8PrM2wHuj/M9fKBd4x/NF7W8I58+e///Oe1f0Dj/w0P7Ld2vz+1h/vuHD6N4Zip6XkMh0tRFx8Ox0t76Y+HfvfYPoVdDIfZvHThlMW62B73+247dBFrwAMNhu+CEJfvuo/t8/6yP27bfRd1YG0gX27cgxhOIyN6uu8u44P48Ge/i59FE3SkZeL6y/EJe5YmvJ5T12O3EF4pGurKx/bQf+zOF/AAZfgAGXXxU3s6d9QgCBX0wclbH/vAtRChFlwke5g/u+G0rODZkfNwvPxy6rrDcRc9wqHU+uXFluRbgIjmgejhQADiysvD8+OHQ9vv46tFYFCGLHrqanzGyPDtI2fsp3b/DCaMDieMJS5st9vufL4cf+8O0dWSBWNlqFeu3e1mT7kJrhxAFXklonL4dklqgrSH+/jdMMFlfEPqOtmn8NrQMgxfvc9d++G4+zNaK4KnzEjjGF/vJnikhQ61oGZm0sKy0MKSoz31sO/Pl+jZh2/X8J3mXAdP7X08eBsedCDIUTg/ddvLaegitlChePoJXC7d49Pl1J2Pz6dt90d/eZhNXRE+ioZW5Pny0D71n7rTGUyJ4WTjl7lvr8vmcLAx3dPDcb/rD/ezh6JCk2fJ6fF8eTie+n+ND/a3j22/76JlZ0hNmboZElLS3XTx47Dh46AMyAfwLg4u3ctlhtIcvg5NcBW31BP78Nzvdx9Px8fB94reAxO+B96paagx3LaP3amNOggmIRfUNHLXnbp9exkmAGIWBr8zuH3qqW3bw6c2ttebYMQFaa/dhXCVYeEqQ5m/7UO3/f18aS/P0dUDJHzRmFMDtt33298vD6fj8/3DuTt96rdgwoarvCUf4OQjxC9xuGhsrsPXbMiHcNwfIzMYTnPWeMdVU/N9ezycL6fn7SXuJXh7rw43u3p83juWfmZd/59x31B5h79h3o33/ry5ut/cbrw/7914wbw/b70/7//QVxddednKd6jkVdZwEuzV1b8GEdp3OJzJcPX5G+/z+z+s/8Oran04MOR0uT+k/8Mrb6fGzVVo49s0cooUro2HmJN88pfh/yMvJ3hjhpLq5JWDgzubPrIJfY6rEsPZ+omuPkdKhNbWj+h1IK73ba7/z/zgMXUdTmaVH3I/9saPK/N/+EcsfLwnN/4PdR0PzfyY+cZaaz+KPn7kUyDpx8xHktYPufUrT+NlNWTAsT117aWLlhG3inSnE3g5mAqXg3SHyNUyvJo0UePV/eHSnQ7tfjAz3QnpKzRYtK0e+zp158up317QO9JhP6ThO8fmUoReAulw7NpLG9tHHdpHb0eEH8WGeqBDR8+nPu7LhH1RPpuPatsP3T663IQuHyMFk0GxCSNKMqC7Xj8EVNGbJkOP5PoK+AmvSEd61527U9/ue+AADzU/L9bDUgv+7jjM8e1D2wOXL3RWSP9o93yaG50wOJPkCzZ4nZGjM5xK+LJYM2rwukPMD4QNpVEL42yOD5/cCUyjX8YsdadjB7vuvD31T3MzG7q3hvLRus9P7WEH/NAwQBtyLMhL+1N37oHY0DgbynR0n53R8C5+/MIEzt11zk0LtrfDzFtv5q0u9waZe0PKG+5Xbo/k7PUP6ZdD1Xju5r0F7Zma8bTOeOl2c11ErMrdGOp0hbOC9HY/9t1+d/z4qe/+iFze8KlI8uLj6UO/28Wh0pDF/jKeZKg0eOrQfPLQeJN84L47dKf2MuGYfhd7vE0YmzDKdN93l3a7PT4+tYc/+8M94nQ3IetQ1Fsx9IMRzuFo9YAsUWvBcPkMPdjQY00JfiEAgCkOB80EjhP1Pg59XC6n/sMzfKFloIOdQLWHnJaakPfd5UO7/f3+dHw+7GauOA9h3XCODd1J99B+6oG9Cu9p+A7w9V3d+FeKcg+H/kBIGdocbjMXiujRhuSak9H3fXfZtofjod+2+/6xve/gOr0JZpfQ9Fy/uJk5H+BwbSOdpvD68cKoiybsglqlpi7A/BYmvDoxw9zV8C3lgYXRJEl8uXy4bPYQ5CbUIT0WL53MvB4egklDeo1DP1OMijxQFtovSTpPUTcAqYeBMsmGXAcgypWhzUg9iePhY396nD8DHY5nk5pQ8zhtODErmM3cL2mJaT13gsNArUm8kqTvGr7TPjjycdjGh2jeq2Zmit/9ku4XXu4pgfBhtZhM4LRu+8V5OHj0upJbf9v+Dy/d+rXdkuzm5b6gU6yiRdE7xZOnknxQqK8WRsTWIwXv4CgfIBoy6hh6xpzeTRPOAY8fyF2l++4yhJPPp47QcyiLDmZkYk5f+3no2h2IAHRo4prEi035QcFrxZO3cjw9ttE7EcUA047u9Q/u5yOXPvj300f7rV1L7ibddxfkXk1oDEk/ery2v3+IEUe4C+axlX+NuZ/PXF7/EH7X2KrEG/5wfOwgu1aBIM+apPCTObWa9n3/0fvvlz+fQNQZequ+s7srKfQv/nRf/nb8bjj3u9i8uf4hPFgT3lwID3Kk70f5TXDtR1cb7S2A/8NrYX0kYcntnOEeB0fhn8/tvgdxYRPyldS6MPYQrylhGCvIWHS4draehZsegtwcHS/tPrdbhAfw0IluWGJV6Q8fj8BHGs4YCGZ04u0bqNDhDJ5aGIew1PvQX7pHwNtD3JvybeaLULj158mFf/v9MsA8S2Xa2wOPFLnyf/iEDMGnuNIvS37myYn2+nwO5ZGu9gRS+x0P49m58frYjbc0KmFp9u356j4hflM4QOQ20LWTwRbMndAQHJiUH7jvDveXhzggCF0Gnbq233aHc2yJwr0Yz5r8265IcDZ0Nszy/tzN95p5mInRpBxADFXzcO5okp2NV99HG50qxI6e44jJEKbG5Xj8PV62bLjZtvHQOhVb+bwM1CMOIUQqFidSTMI1NGU9/OVwZeDhBpYiudTYw+dd/zhYEeiUh12IlL/12H5GltZgnqlpMZlWg7RGf/S7eMqHgYpftYTfcbIqpVy369vZ4wkTQRoyh2e8/NJClz3cXp8Syjwo80sg81aLecLI/S4JV/6PZtr08h7G5Jh6n0P7uag9cNPGb1Zt/B9euvXulVWJF/nxeOk/zV7D8JFwcrPyvrsc2k+79hIblcCY+W0Z6R+AIsnq0Fn3mTKQITNJuaDgNkKClzIBx8tDd8JiOhbmXqQA1qD3rj/s+i1ABDLQwZAUcejheL50J4zBqfDtSYzl06n7RDy/MFEqZceeTsePPXBfwkwc0yRe1qfT8ak7AQckuPb6Dkyz+jphr//PPM1ik/ftXwDu7Tj3pFiwyUv1b4s3LNLPe+mdd+0dC+0ba+9zaB/mGh8tm2lH1/scdtpK9BFw42U15E5D8Dja8/HD/3TbeIUJQoDrzfpIwKeeeofJu+HM2zrmgwbul2ruNRRscpga/1i8n+SNkZzCUh/0az45795h8sbIeJtmvD7W77Ba7+lbP0yNl9Wk/BA0/5OHSU4q9VSvlz+18aLAQ3dVZeUDDhcmJqfe0TGzJd66CRORfOgkp1QEcs9h7Oyw60794T52gEKT5cfHryf+FfL9M7+nzf1bxX20xRv/Ygg/FaZgcwrWfESmp0wJn4NhfGqH8dKtn0A2tQ8w3RR4wsFdeeFTDol/A/zCx3z0z/1LwSdm4H174ZONhQ9u5eTte5de+zdGe+/A+HwD46Vb/0xtij+fun8+96duN2QHdY+zBI1gjZhA/PVNmO7Nv87egnFv7rgnZMLjNOFzKsTkyE6p1c10b96meT/K+N0444Vb/2RtymPDNgTD7SOensPuYvg+i9AvatKvlOsh3gULPVb/VLzhEZMpIvPMh36x5DMevayJq88wiBehjWhSb8B52x2gDxCugjKxgp67rt2f47gmxB4Tf/E5PClGfO4Gvh4jch3MVcZTD6D753N3GAd25k1sQocksUU5dQI2BcPEazIHbbx8tqMbDuCUy+VptneBmX9bmF8XuV9EufeOhXelhfRoYYqAJ5rtWYX2C5v2u9nGl5wYL9166dYbzCblqF7vbY4TwuQT0yTWsWsP8bMNRsYTRb9bz7xFZ968ML+Cc+/qcK+78CuD8JU5YvLlp9jDO1raxzB6AufePTNeuvXSrbe8TfJFmJkkzcOZm/DEz5f2dJm70TwEBCaFlYMOEE865PFkJv3Qy3N/aT/sOyQ/qIkC2MQQX9rTfRetNSFK5ClAM6RzH0/tftjdPx7AiiXC9bhJ3cVUeBFHBCEZvA79VLjlJ5d/r5iHb9wbcO6ngPArtfDBgJhcqMkj8W6H9p6N9hjaeG/XeOnWS7cpyEtUk4Rc3sgEpxmvBxY+3GORKdl4LUpYRqVT43G8tHt0KzpkeSa1tLkuqM3XkCaSxQq+lzk0DpP/JJm85a8nqpk2YR+5OyHWmDBvhcy2Hfo4tdvf+8P9zBCH+Yg+SJTei1OpMHiIMM7DXlhkvsIMbDKRzl+9n4PRMBvJkmmAYwcdqM4KvA+dnJuAjIXpFX5NZN5b5f695HJC8t7Ep2zaDBizkLYqHx2oaYsptb02dhbPHhsa1ylZZwLBKTw4bHz2h/tdf0JS8MMsbOnjEuUdDO2tnUneuxPw0EPKFEYQHk3IKbHdTJts3umQifGf8dJwh2CqpvV+EPfxD/e7+mIyprSUIessXlACGY2h5thDe756LX67G2Q3hSZYejdfesdMkQUPc+TMwoVa+iVIeifG8ukmqenVkxV8oZKk/xrHQ6HH7EfAD7Nfw/wC6kPG6ZXzW13cu3Tch/3Cx3zC4yvh103p11bp31jp30/l40LtvVg95Yr4wdd+ITZ+M9lMvMdHrnbapfcrsm0mFOS9PHLLtPeJm+N+rQ8DZykxIbqUZLlUn05vDd9dMm9v1sdMlzAZQ22KdTk+zRfaMClDkZsOw4Z/9HjAtnaYcUS+dWHWQLSPElgdMjE8JT2Mxcgw0O3Gu7ce5L+xMFtJ0GPr3YQj9iDDjA9Fbo/NHPmo6NpjkgkwTClG/iX1AEn610L5cE95J1R52mT9ZoclnUh8rz5YpxkZ+fnij99c9cdvs5R2HvZjyaro/uzs27DrcRq8wTifXodGjsw76s/t44d+KDuC9jcMYxnpLfVnvHg4dFnEBPG8gfRrmF8O2VRB5m0V9whM+BBeTDlGE0SZ6KBfAvVUaeQtrvFW2kzZPl66pQ3bOVHVvAndwKmUyq/B3mZzMibrz/PazNCWMM8juA+FOOnyDH3NwuTQpHjnxnMVv1wwH64xv0Zzn+fBvXzh6YCY/MPJjZ7Y5bQQTQnMfovF+A1S46VbL92S+3D+hsZ7OT5fjh/HWCuOk8JcC9K37M94JSaP8vuuGl51byb85Jd4v+Byb0e4xyHCe89icrumvEaPZ5S3NXo6u8TvtBjvJBgv3HriYv0K3pC55f15cnHb/fzNDUELmQPbnz/2pzPKWcK92sTcGxcGZL9RhFtBDSP9q3O4ssxCl3A7qOH0ML9k9sQ3Ee7akgkK/Xnffer2G/pWQt7M6WcxdsPobkIGzDPacLqbMKQljwnpz7MpEfo9zJtWPhX/Jt6i/bEFpU7hfridNnG9izrlcNEOydm7A/G9hZ6Ef0mur+FmAp/ex/bLOffyuH9rhF8MxJTo6X1a6V115ZcQPe0wTzXDPjI0Xrr1/oH1S0izIT218+NxF2OIMCOdeW7GvfPByRCtPz8+7y89NrXD7Xyyqup6vacrMVwJ3WCy4Kw/P7X3/eG+OwwYFOz2ht7vVP2l6Ofy1J3G8y36Tx1yNkFYjUKmz/Xnp2N/QHdFeJg8qxNvxmw5CXmX35TxwRnzJpl5G8/8Xh33W7vcTwrhl0LhN2eFX0/ktPvgh11PW/h+89P4N8hMVc7edbF+AW3oiOV86s5Px8O5e2gPu5krGDI9Mn+8P487bh1Kv8Ik2smB8i9h4++4Ibcp+/O4IYf3Ha5XU0Dq92D87mFDngk19N0dwGZfMKr+hfa+j3+fmTcQzMcN3MMr7h+58CMmvB7SGyM5bZp4O6q9ZdV+29d4BGSmSNu7RZYOuM7YSxvVjfm54uennypsytH3lpl7gsa9oyG8usLzCem30uRE6L3vqfXkQnrM4beazHSQmvdlLMlp+/Pw8vcf+y0Wx+pocvnRmfIgfATASfQ5dH9EQphwr5SsBOnPEZPvPoFK0LB0xZCJ7/0Zn9thuOAXFO9VNn4CNmTqwrXbPflehrc4HWzn0Y0f4IbckZhvAIQ7S3KKkScL5oM5Q9bEulMDsXEOc0iIi3/vj+ffsULgcPdQknnw80z2sIBVTNR3ygzzJt+SifljlyOmfmr7GHaGh7Io0kXdt4f75/a+A+dSsXDRU2R6/nxShzOKzOwYL0sf4xP61+SxWIP7F2HQ0JGcduB9HCx9QK/IVWb0JwFeG04uGM6fD1flKAeVfDhEZyz2LEO0zVN3Cvs6Y5qFwQ0JZ8jegGphlTeZzTF0hvnMwUzwFoXcV8dOuQgz9vwKoshNfVcx8C+kYoCFBWaKrGDdH+/7A/puh0sbyc2GeoFnLKWE6fD8BPpFnlcJhKl6Pl+CJx7A0AFW9BCefcnJjB5sCIdvNwS5wd7p2VAPwfeBUvIw55syDGSNQTivNblp+9gent3GT3yxDC+mRuDxeDjen9qnOO8zPLtCk3ojeeosXN8Vm6gJ2cVxBzaZw0PVLMlID0NV5Fgr83zanx/byzbendtEhSvUyE29zMsXQvtEbtlP1z+f9rH4MFGPHLjj4eOpvYeZjyyMmwQZCaL7H2HIdrUdPkryFJSJabfSh+newed+f4n7HT3h3UjhfQxhp3XFI3rvfCsf0+uptMLv5BrPLY3Xx/qFypIB6lN76g4XHBmGG1hTAaWP/xR57oLrcuaRhKmEUwnctGlOHgzoepsfKRoOPnm0mLt4jlJDX0+Tdns8lDN+8UJ+wKeVwz/31CM5dx+Ou747DyenjM4nPG6zifKnqRkJzuONk5vCNKDSHmLDEEYkxiYmzbkbbiK+NuTTZM3KdC0QHLJXMj1svBieEMnDswdMaiK9nEIcjWrg2fmB9FUSZB0ffaYxDz12Q5YgjR2ch/ydofZndmhmGDKkx+ETR/yS0EEnT8SYVSKE+eCavqw7n/vH/jwwunAjLn5TQs+IXBsSXCssbCD5M8KKWZgtKT1NUeQR4b7WZf4QQxOjyBB8blzCvWHtKUSzoZwDJKkupOaCzNg+dSBxPfSpySUNr90IKbQmaQbmfEUneHuL+BJvUrZ1ilrQXVQWDr8gCz/nnYBd+vA5pu7qepBgvJEbVjqRkdjLxaiDHr6H5CqVwI8ifCUbcleeZoyCR1n4lFWegUQe8mFNxibu3YVHwoVPjgyI0ST/8BwcMmJF0X6YFmESl84T88NBMiRYOGPHBZgoQY0WekFMdBj/TOe3kLsi54fjH0MYPSZRtLO1X4RGpyF3Es7gJGgeRhKWXOzOT+3hfOkfgRMVFrzTUzPBP8OFm5G7g2NWe8z+wpOayD31+YHILCwIVeS5au7CLXQ5TXS+JfWIkcz38HwTsop4TM2O5YUn/ZBnhOF57iFjs2RKxpghiNqtqIopefnsNJdwm1SSqV2osQrn8N01kKLex6mD+dH5PDw739JPPAmYech2LHnc9+XUDufFd+1h97E/gAU5jI/J2mX8uxQhV/DbwpbMRvJ9zEPsENqRxybDk1vCvGZLHgzyfIF1COHheg3pcc1tYXjWi5qCap9N0pDrP5GVzEPbakms9ak/9x9AxXhIxiw5ZLNEZRYGt9Knm6rp4DAfKlq8sOofr++e+qdu3x+6uy9//cd//vP/A7xooUwb4AIA"; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE7W925LjNrKw+y7Vt/17RJzpux4ffvcKn3a7Z1bs7ZhwsEvsKi6rpBpJ1W7PxLz7DgICBSQzcSC1rlxugcgkAebhAxL8993x8Mfp7stf/333+7Df3n2pxOu7fffU3315tzt02x+6/fCxP53vXt+9HHd3X959fNnfn4fD/vSX8OcvHs9Pu7vXd/e77nTqT3df3t395zXS5XN3PPWJPqPfk502zEy9/tcvP/34/dfv+tPh5XjfT91ervtL/HOyV9mwqdf7w/50Pr7cnw/Hki5fxe2D7l+Pt93vz3NNg9vZMBFKPvefz6VSL23XSBy2RcJsszVyfvvtf06H/a5MWtC4UibbiOvseOjPPx8Pz/3x/GeR2Lj9jSS/Of304X/6+7Ixxa+rfe7BC/L+2O1PHw/Hp5n46ZebvBZxb0VvxFU1amqeSrV/FTddLO/d4dyd+wqp8wsWy/7lvtvViJ61X/eUd3U3jl6zUAPK6M3n1MzenU/b/zOc/s+wf+yPw7nf1t353BjB+9zeThppAIFM1PbVSi42g0A4ZQFvJZ80hrQeqB2sHonAJPogg4waYIObGEi00yI7OdOXmGD953N/3He7uvt6hVy2To/Ds43oCsVfW1dLhZPs7du33/pm7/98Ln0A+JWrtfm++9DvylXwzVfL/br/2L3sasWDq1Zr8UN/7rbduSvXILhitfR3/X7bH4f9Q7n48JLbyS99C+A1N9Dgny/Dsd/+MsYnT+PlFYrML12tzy/98dNQbJOiC24lu2IsgitWS3//+PL0Yd8NFS9jeMk6+cPpzX4/xqjDYV8oH1yyVv5X3f5TV/rog+ar5R52u/6+6r6jS9bKn6GOnPTggrWy33X7h9JX7dp6rdRf7vt9uVTferXU/p8v/b7YskQXrItzqLSFjPSqspdSLZAkhrjz8oyiVDaZ0uAaVGc2FVaWTHBII1ud5yzQhkx3slpVZz2pMQuSHzI5uGmyU5/kZKf5ftt/zsjxbYolwGH79nB86uaDNRukqd1iSb7J3DEi4di16WJ5aDo0jztSqU+BlP8etufHvBjfbLGc7/rh4bFgnKZ2iyX90H0uvKmg5RpppbcWNl32RmVxQQUmSBmmpbggjwkqpVbjgjpMsFIbPF8vwAQr5SZxQTkmWKkFiQvKMMFK6TQuKMQEt5Jf5A5QTLBagxwuqMQEK/WhcEERJriN7IKxQDHBSuk0LijEBGvkJ3FBISZYJ5/ABQWYYKVcGhcUYoJ18klcUIQJ1snGcUEeE6yTiuOCPCZYKZXCBUWYYE2cQ+GCdZhgAR5YjAUW44CVGGBN+r8+7b9Fun+7ND+T3ocR6kyL8MebpPmzDotS/UhHYiptXZz5/tgX3MaruPVyqThkmMtLg4YiSafvD922n78qiLBr0+XyXOOEk5vLRS5ZKx9PMijR6bVIQip8Nd+cz8fhw0vhPc8uWCX76/50fxyey2XHF6yS/d3hqX/uELeOCg5ar5KaTalR6cWr74VafH94OJRJvrRcJ2247/enwlu9Nl4l88fu09fduVDmtfEqme/6cbtXicWKGq+S+Uvfv9mdCgfz2niVzPfH7v73Yf9QaqyQS1ZajRrXN7tg5RjnMAAx2qU7Bkr0SCZjmH9c7qNKkzBMana9tkTmuJO+QNql2XL/m4W9c5mLgW+JPhT0natRC35LrXb5210HO+ve8go1FqHXQm1I/IpqUo1gi60PhWEJq1OLYmv1KJmfy5Bssf/DMSjh/+pQaJ0Ohc+iGomWemUSi+IeuRqNlnmIBB7FfMQCRFroIXFMinrHOlRaJh9Hhpj4OmxYJh1Hh5j0OnxYKJ1CiKgCtRixxHtSKBHlMVU4sYhdFFGLcrxXIpNEi3PJ1Xix0AKRiBE1QNWYsVILEjUmtanGjdTYBMjxl+f+fvg43JOhJWxwE/SIdlqEH2f6kojuar3/etjOxx1XAblsrR7LnvAr9MJqXWbhQI0KYft6yYo14vocqgSvkDoLf8bcsngGxlesvuc64askzzEIUQtI3ni+FLD8zmvFr5JdlyrjCixOl0v1olJmXJ3atLliZmQhLzlBFu+fqtAOz6hJlerS6Qo9kgk+qc6iJL9CKzLRJzWqTvYrtKETflKd+qR/iT6lb9my5L9KoxyQTSi2dH9WlXfEAUXCOdZBinpdKsauGlbU+E8SWND+sxpalOqTBBf5OPZ/QR8CYFC6VEKMCj3opQZSl/r9X+X6kEsQlDbV+8HKdcEhD6VIHegp1wKHPWTKUwV8KrSgoA+pSC34KY0DKfhDZsRVAKg4K52jGOJJlIOYUtkkDMI1qAZCFVaehEKkka8GQwu0IeFQVqtqQJQaswASZVBK/PNNABHSZREeApouhUOY+GI0VKpDFgzhWhRjIVKPwsI5THy+fK5YKpp8EjKT+4qKJeK1YITIdDlYsUyiIowQmikKK51ZPxy2SNqKTyffdp3E74vv8tp2ncSvuqf+OM+EcZFT4zUys2gJk70YLJXpRGElTJVaqFQ8x7NIiZjti4FSsWY4vyHUqcM2xTokURKhyiKQVKwRiZEIbaohUrEmNEIiVKkHSPW6lL1Ny+BRhTY5dEQqtRQcFetGYSNCo1poVKtH8XhVA6PyWIbERVRAUw2LynRJoqJcVHtzXQhMRPnoKkhUrAONiAg96gFRqS4kHiJCs1o4VKoHjoZwJerAUKkGOBYiEp4qKFSsAYWECCVqgVBZ/EbhICL/rYJBhZH0HMSgT6AcwJTJJTEQJr0aAhVbbhIBEYa7GgBVa0Lin4xG1fCHHqcA/eCJnf3Xm4Cea09FfMepQ+47GE5vnj4MY/VZRu1Xs5YL5X09HJ2z6HYFMpHWC+X+8nwoucmwWaEkMC2/OuzSwxa0WXQvWQGVvcPkdH/u96cBecPjewjbLbqPIkELpMCSyP3Dbu604nvxbRbdR1ZAZe+z8r7D72+SszZstOgO8iIq+6+Dx7GVoZlxyjZnNMiiY2AEEsS4RotCcByPJcKL18hEAVMssYol5eTh0DgWOGfFayQSyDgWiZDiFfMJB8bRJJpz4hXyCjzX3GutkEfA4kggwogXS8yi4kDyYkKc1IACw4HgWh6c9bQ5DAwc7lL6m/UwKGkFDqaKrOYkJhFvLHgR2c3JJ4FuLLua4+bk0vg2FlxPbYslJ2f4Mkabl51Ds1CFpUQ2pwkFYmP5tfy1UGruyVfT1qznJyErcP/VbDUpOYlUiVjvVpIJgAr8VhU3zUmkcWkstZ6SZiSTcDQOQ2qZaEYqjkIjkXUENCMPB59xuF7FO3PyKMwZi6ylm8nYg4KaMeupYpnp+G4OEcO7K6eGSSkksAxkVXPKnM0j8WRs8qqpZKlcEkbi8qsZ5OyJB+iRCNrdP98EPgZdFdHHi0YJLPdzfzw9j3bxU59X/xXevlQ2TMaHfrf96ePfh/6PpNBZ02X3WipumawyaARuK0N1cndUIKRWQh04iqfGQnKU0yGLjmItFrOj/HzF4RGcqnX0KCsVTUyBzKpsNCsRB0hAZB1BysokEBIQWsmQcjMLh0jxdKqjSDmJOEaKJdZxpJzEIqNeSZLSMrMoKZS9mCWldaBgUii6liZl53AWJ4HZvJgn5b0PynWg86kiOlmZSaQERC9iSlkNSKgEpFdTpaxkGisB0fVcqVx2erYvI0sF0nNoaabEUraU1YWCS0CDWrpUKjf7/Kv5Uj42IAETDBCqCVNadhIxUVHhzWQTkAn6tCrKlJVJYyYgt54z5WSToAmEKrWkKScXR02x0DrWlJOIwyYQ4FfRpqxECjcBobW8KR2fUMAJ5PdVxCkTCc4xUHSH5QQoLYeETqG0auqUtYQkdgKGsJo7FUsmwROhQTV5mj93suDx5+546nM1iq5REktF9/rXl2G3/fZ4ePqvU3ZrctD3K3gdTiLQG1hbhhmqUV+MOVMCf+AJHW5cWbrkRhIzN1NIOs3YwtpRmlMVCVogJbyf53Gw/nrYDv1pnGtvz/3T6fshuXPdyU1cOHsvn4/DJ3e0ea1mvwzjHrRztno30AlechttLuPJvy4dedtyxSz74XAe1Sx4UV7B1iuk/lQk7aeVUt53x4c+P8XClsvfokJhiyTNsrpswWiQ0BVXdedI9veH+7KJMmteIXlphezNqmOXV8aurYq9TUXsLathV1TCrq6CXV8Be6vq13WVr7eoel1Z8XqTate1la63qXK9UYXrTatbV1W23qCqdV1F6y2qWVdWst6kinVlBetNqldXVK6urlpdWbF6k2rVVZWqN6hSXV6hurY6dXll6tqq1FUVqTeoRl1eibq2CnVRBeqK6tMVlaerq07XVZzeotr0NpWmt6wyzaKfDGAYf74xApq6rMRAVtPFicdVKpZ81EvcZQLrq7xd8hNnZdLIj19iArOfvyRlrkipruJrPk9YrEkuj4nEpz8qVyzT30HZtAIXrJGNfuIMnVqpj5yVzay8C4re14VuKDm3C2f1EpeQklvgkq7SV7ilzCwrcE3RJFvhngo1KXBRqEYr3BQcJ9RV/Yx9nDX++cauauqy0lVZTRNmdQT0RWKDxpUylzLCq+wbcMKUTnmXfVVlOS/MjUS5g4sHZT03zGiWc3iROkupXUaHQoYYqbKSI2Y0KmCJkTYreGJGkxKmGKmyhiuW6lJsVFbxxaw25YwRKLWeM2Z0y7PGSKPlvLFMj+LxWsEdM5qUsMdIlTX8MaVLIYO86rKSQ6Z1ybLIUI/FPDKjQwmTjPRYwyXTuhSwyVCTFXwyrUeOUYZKLOWUaQ1yrDLUYCmvzGiQZ5aREsu5ZSp+yyeOUfS8MHFMaZBMHIMnsCRpS8ktSByv0lckjhnLXZA4RoZ7ReJYqElB4ohqtCJxhOMUlbKiJtz9841KWaeuCktZrUbEtDqO5iqp76upSWH/s3Pluv1hP9x3u7dP3UP/t+OQlEZcsFD2D93nr4en8SA2vKopkgsbL73f0e6gBR3xXU7NFsr5+uWIxy1AUNBuoSQ7DtnHN7VaKmW/7T9nhVwaLZTx0/mxPxYOEGi7UCJVFBqJSn+CIiuDLAKNhGQ+OZGVMhZ2D/uH74b8o4ublsoDJfbjdKJpeChx1nSZxOOlh6uhzxhGtP2SpzvvqVLwQrmH/bfH7oEoP7vKi5otHM1h+Pi2YkSx5ivm0SWVfbstmEhR22UyO3vUw7txaJLy4nZL/PeQNZrDzGKmiyUyVoAs5o8MQHUxf0Zq2awhV8NWySZKkiOxlWXI+ailyG0E7W4nucyZhA0Xyq4tfr/KX1H8ntKBLn4PTGF18Xsu6skXv8cB0PLi94wmVAV6JL629DwXw6aL3+M4dlnxe27G08Xv8YSvL37P2jS6+B3YtPri91LZBQZ1QfF7Vnq++B0osbz4PaMLXfweaVBf/F4mN/v8FxS/5/xZovg9dmoLit9TsjPF70HIsqz4PS07T2aWFL9nZKaK3yO5S4rf07ITxe+h5AXF72m5VPF7KLS2+D0tkSp+DyXWFr9nJNLF75HQ+uL3VHxCF79HRLCy+D2ZXWDl6MEd1hSip+Qkit+v0hYUv2csYaL4PTKEC4rfCyUnit9RDRYUv8PnHsLqhHmafroNtI67KwPXV+2o6YluaYKyhuRepryU3+6nJnlhoPFskJDa4wINni5GukB+2HSx9DnSLn8Cs+YVz32ejpbeN2i8Qua10V//JJB06o6vF93gvis0mF+yQv77w7nbVQ46cs1aDaqGf3bFWun4hklKcnrHZJHUCzWfPh1VIhu5ZoUGf+0fu09Dgf2O266/Z3xRgbzd9MJCidwLTHh/7JEgbi43br5U7m/2fIryWT1vfxuL7vqteb+xK27j27YVA7ElRiEZAOWjiCITW4nR81Kp4pqZYKywZp1s17Q8+nuFXHBbXQgAiKpRCQBLrMGb8/k4fHgpNbpx8xvq8XV/uj8Oz6V6xM1vqMd3h6f+GSt8QJQI2t5QgzwWn2uyHI2XaPT94QFZzJtrcWl3S8nDfb8/FT2Ca9Mbyv+x+/S1s+tZ+demN5T/rt915wJLGTW9ofxf+v7N7lQ0+NemN5T//tjd/z7sH8qMJHLBTccii+6xUVmM77M6pSHrzJfeyocVw9aZBvXANSsfLd2Ekmdlm+v8dn7BFshfvmib1YVcuAUqVC/eFlnn0rfyf+FtTC+fkmnM/4Im9DIqgiqql1LLLBO5nIpZpOol1SodirjBkqXVMn9FLGli/qpyWbNCftEzqF/eLPKY9BIn4i3rlzkLPEJqqXPmE5Ysd5Z4RmLJc+4VK5c9C2QTy4Az0ZVLgQWSieXAmeTKJcESyeSy4Fx49dJg1guSy4PztZe6JcI8yyigGLeMPejlQoitqpcMS6wLvWw4Ny71S4c1GtDLh7Qm9UuI6HgEy4hkIYL/4SZLiFFnRQuIk17ENDqdu+P80cVyfJtlEvr9fI7G/bsWxb3Pgs9+/4DsE41lhO3KJUk1CXr75v6+P53eH37vr4M87M/98WN335/+Ev6eHOvo4XSVnb6KL8DvJFKVGpXjMZhfSZG+6UphGNfLy6XwXrUKn5+HY396Wyo7aL5c6Hn8MSJ3SaFh8yqh0Tz95pJjRqUDX4dpSagE2bp8Dv8RbdMu7/zVH8mKn8SNEIo8xru2KzR5TJcF1aty70qmZodSV+g076LMVS14bt3pkoL4t40wDbmniPfzv6V2EHFVKFkRhC1QKVpGq9GqamWtXrHn4+HjsMPtUEa166U3VA61WDOMhmnpG1X42Jfz45uf3/69P55yr2LU+avZhRnrMOmfUOS7w2477B+iE7XKNImvXKnK/W64//394/Hw8vAIUUleHfzqlSptcy4q1mEGzxYLDauxy+SmyrGLRdMRGC44E4YVi720qx/1+ZX1qszgbd2gX69YKbra5cV6ZD3doqEpiF+AGoVhS05w3m3FcufeatEgDCcXzo715ccxwU47dKADdvHa53B615+eD/tT/12339bqM792pTq/D4fT7/XvKbhspRK7w8Owr1cCXLZeicPLjOkXaRFdt1INuMaWVyB35HGx6GN/Oh+H+3O/rX8K2LUr1Tmdu/NLzYOYLlgp2ObI9Y8AXLZSiXzGG0svTHQxe5mKk4udZ10+X5O71qWtybu+aYa6IDldrFwmD82moMsFF7vtVKK5WHxJTlmWTtaokHwjfqow0Je2lXnk81CTR4YyXs2uL3wA/qaIZ+D30hxSNw8bld/1Ftteke361ZbaZRHd6kz36pmOS8/M8lKxu8N9R0xwXO50wUrBe7DbMC95j2w6XCT6uT+dhqfhdB7uowC7QpdEFyuV84f+VCgTXLJAeLDCZ6fy37vdS/9zN8yX5uKfb7Lah3RZtOYHNKUmN7phCpOZ/o5GmbRPY4Miab7lGmne+sTvb0oqvGKN9NksTQnOzk9SZpRL29qUIoG+5Rpp5JY/TGD2uyBlMk81Mk+3kTlWWxVP3KDxLWTO9yylhNKpVfHTLb/T0+I7jQ3q/uGle+h/6J4RqdNvSVNaOlpxbyVDddVtwTgR4lKDhMmLntZomYZ/9VviFqOfy5+ZtQZ/Z8WdvgIXELcTK7vA9SGSi1wfJTjeO0V4I0Tobxl3VCZvRzgiTGAmhiyUmPGAmOBCF0jJB8f/lT/ihU8YyKt4xEufcPTidNvyN/FV0Lh2VAMT4Hev4XKjXysNQEFnmbgh1q3+hUcElrzvlNialwERXfguUNJnm8FfhnP3YdeXK4BdNFt+R2qNizQifT2iSNbVlz6DYolZ31wlce6dEyJp/0zOs+D1JOuf/A83SQqjzorekUmvqtrvWE4aqOQk/Nbtdu/wQ9ZjMVHDkvmevTf0/Apwb8lTK7L3dj48l91b2HDhvc32QB9O5/5IlDjE4ueti+93Vil+f394eu72fw77h1LZ6DWLNSDP6JjJzZ7QUSAtdU7GTGDJKRk5mb/ZA1UKpxVoe6OZVSqelF57v7aLv/75dr5ZfH6/Ydtb3K872aPsccdNb/S03xTaR9B08Ywufdjks14m7+cO2adPSbw0XizTVxcVPNOw6Wp51HlVpNTcaVVFb+t53JdVfMOz9osl+ybo+RQzuaD1MqnD6YeX3XkgC82Ad5+1Xir15+5h2D98sx+D8tyLM2+9+AlnT8SaPeXi87DKpaNnU1GCkydT5WPFqQ707RZDgzBinDUvv1fwwYIqwSvkFp/9FEtccvJTNj6mTmCC07ny/KWcXNcwcWpFLB9pfks98HUFTIW6UwNKPH/i1KW5719w5lJRfEufuITEt/XnLRXoQJ62NFOg+qylAunZk5ZmWiw+Z6lAG/SUpZkGVWcslUglTliaC648X6lANnW60kx27dlKJbEpcbLSPC6tPFepKGbET1VCYsW6M5VKYsbkiUrzkHHReUpFzz93mhIyEkvPUspHecU+adE5SgWxbRFFXHKGUk42eoJSLLXq/KSc782enhTLXnx2Uk4P6uSkWHztuUklFrfszbv5G5c8MYkCWjfXgjwtaZ411p6VVGR1qJOSEGtTe05SjfyCbH3BGUlFvgc/IQnxPXXnI5XLLkIzlWcjlXg+8mSkuderPhcpb+ETpyJBG7/gTKQCD1eC7KvPQ8rLxU9DgmLrzkLKS8VPQoJS685BKpBaCqeqz0DKeTPqBKTZumHV+UdZjpAlCLeLG8iTjwAZqj33qGS9jTr1aL7WVnvmUYV08sQjUovq844QbeYL3VGm3O9fnq4ajD+lawyuFQzf/PDz+/83188r3ypN2axKqJQf3vz4t1++evf25/dZUVHTxfJ++vGn//vuzc/f5cUFLeukhXuDDsP+/Es/5iPY7prw15tsQ5j3WLZfJ1KThJK1d/Nqfkmd/DmCucc9NCI7bl4pN0bQNWIXyyxyF/j4VvmMsrGem3FseMuteJFU0oUgsqv9SOkcI50JPseqPUqtHqRbSetT7VvIEQrMGR4r2n+9ifm69lRktpw61GQ64kv3gYxrk9kjQjYMJKXd27A8LS5os+B+8D1TQffpDVPJvl2r3Oi+ipstkoPsNIgEJDYXJHs+H/v+x8M2qX7QpkzC7PtbdgCxL7UHUkC7ZZLIcytjQUGzZXKI7S2xlMzGlpwMcldYLCW7JSwnJ7siH8srXo4vlIuuxaMikwvxOWnoinQsJrnJLdn/6bnbn94PT0kJYaMFMtxWrfcF7+us5WornWXbgfTFYDupAUW1A8G1SDs3Y7KrqPHsWbyEmtMDB9ux8DqcnbWiKaIOLOkSnJ6TT7L0WHY1SM9adZKiA8NejdCLJWd9Sj08z8vOrVhCFZYuV+Y0oRh+LL8W4BdKzT35anSf9UgktwduqRraJyUniX0YFi/B9RnJBKuPpFaC+pxEev07llq/+J2RTK58R3Krl70zUrO5SO2SREYevh4RyatbjMjJo1YiYpG1yxDpHJWASnHWXQWT0hnrHOSEd1eObtJ5PgWNwkiyFhblbB4JiWKTVw2HSuWSUAiXXw2DZk88hEB0dOF/uQ0MinorA0KTavQj/PZwfOqQBxdLCxuWy6pMNmKRyxOOnCZk0hErUJ14FDztfPIxe+7LE5ACfYhcYKZEZSJQIDmdjMwUWJaQFOhBJyUzHeoTkwL5peZjYYJSo0H2jViYqBTpkE1WEFUWJywFGpFJy0yP6sSlXHrJiNQnMAXyE0nMTIEFiUxOg3QyE2uwLKHJa0AlNVB6bWJTIDmR3MykL0hw8hrQSQ6UX5/o5KUTyQ4UXZnw5OUSSQ+UW5n4FMglk5+Z6OoEKBcLkUnQLNqsS4RycrFkCNxtRXqSk0YnRbHM+sSowJbSydHMlNYnSBXy6SSJ1KM+UcJGIkiW8FfM/utNkqRrT0UJklMnscLpjolOiYlaFUqJt9MUCKmWAOv3Jg+JltPHtzNrvEzmX7v73x+Oh5f99qvDLj1UaOsyqXUpZiBzcXqZ1IBKLQPBtWll7jlnU8r4QS9OJ3N64JlcLLwufctJTKaQseBF6WNOPpk6xrKr08acXDpljAXXp4vFkpMzfFmamJedSxGhCkvTw5wmVGoYy69NCwul5p58dTqYk0ungrHg+jQwKTmZAgaSF6V/GclE6hdJrUz7chLplC+WWp/uZSSTqV4ktzrNy0jFU7xIZF16l5GXizur07qcPCqli0XWpnPJ2INK5eKYuCqNS8pDUrjw7sqTqKQUMnULZFWnbTmbR6ZsscmrTtdK5ZKpGi6/Ok2bPfEwRSOn7uWH2yRqYWdluZrXq2pDcCwnvSc4J+G3s3dxOTlxy9mYIPv0ENn4dlssAIhkxy2L7xSXhqeLuLx0tlghET2YjBaaPJasWK7tpuZ2wwtuI5tIZJLi098PKNDg++506bFQ/PyCVbLHL8UWjjhsvljuj/3nGrmw+WK5Yyfbt/stHsZDsaD1cqnH/lPF3cLmi+VaJ1Nwn1O75ZLO3TF8LQpkzq9YLN0mPgX3ObVbJ6nE/8C2t3iyVQ911V2Oxz6WOzvYfLHcbMHETHRxzUS5dLRsghKcrJzIyfQprJ3/P72cf/pIJGVxBEVetVSLb4fjqWyKwbZLJV49WFZg1HSpPHu0Z6HAuO1SielDQKHMskNA81KjN/GbT33uDcKvWBab59F/JHo5/c/oQS4AROKr1wDy9iO/DACNyPKVgJLIrjCWrOLxebnpJQEoftmqQF4LemEAalC/NpCXnlgegOIXrBBUyC9w3kvWCUo0yC4VzBVZvFpQEEVRCwazCKp2zaBYdkn4Vr1yUBGxVgSsN5OfXkIArmjJKkJhhFUYUt1SbmI5AcpesKKQj3jIRQUY7lSvK2Rll0WxlasLWanEAgOQWrnGkJdaxGoXrTRk4hxysQFy3br1hhzjzQazFWsAOdpLLjzEqLd67aGE2FDLD3NYU7sCUS6dXoSgtKhfh0DGIFiK+Lo/9ceh2w2nfr6CEP6YXJKI7g//kNysr8x35CLFUpL+64SYYELape1KiQnTT8glPMBK6XOvlxVPZ7zF8knHQwhH/c8qycX3HV6wUvbbc/9UKvbS9gYSi+/0bXLVjZBZupA4l1mymEgIjddBqaDd/vuNVkGvfRUugjqlktb744B8vjESFbVbKumrw/7jcHyicu1YHGi8VGbqIxBQJPUNiDqJ33bD7uXY1whGL1kp/7u+2yJOkBA9tV4qtVDcajmXFmVzCDReKvPt/uPhb8chK+7arlRSLZEM5K0AkkktaB4ZCK/HkdlnnKeR4GEvh5E5XcomVy0EzFuqJImEpmoRiMzpkOCQsfwFGDInO0UhY+FLIGSx9MzMX4og8/LzBBKqsRxAFlrZUgN7e8n5UVgAH3OyU+wxFr4EPSalZ8hjIH0heMxIJ7ljJLkaO+akpqhjLHkJdMxITzDHSPYC5JiRTBHHSGwtcMzIpHhjJLMWN+Zk0rQxFlsPG5MxDM0a4+ypEjUmZaKkMbzLGuCXlJTgjIG8BZixIFOkKOMsVayFjKWyE4wR12EBYpw9/TDJH/6FTOfhXzdK731HZbn9qAsxSf4YtshRwdf+/e/1PT/2w8Mj8vynrqcGRX0Hj/bcnV9OX4WHmrpvC1x/SD7k4CsFb/72/ruf3r39/968f/vTj799++bt9998ne70FXEJcQ9XVVH53/707q9vv/76mx8zQsN2yyS9/fH9N+9+fPP9b7988+7v37z77Zt37356l5FKXbNMg3ff/PL+3duv3mefcNSwRlbw+tnAazb37L/e5AW89lT0Bjp1iBcFTaQCAbP8qbjnAd2zGnQ9JLeoJvt+QUBH0PNLgm8k+92heW3Q8y5JaZJ948Yu6Dtt7ZJ9E+Yu6Dxj75K9fxpOwwcEvgbdX5ss6p/eJBrJyG8PncmBryWaOU2/3O71nHorf0WtavUv01XS/IVKhRCYzMJj9IBc/Bi9tbI9N5snfHPxYdvbaYAivrnwKrBXIve/aUsRCf7vmcFYK/m7hB2JRH83NydrZf/QfS698aDpTeUX337YdrkGdWAdaLEYrWc1oeA6UKAWr5eMQRawz4diMWIv0Qfn3HMl6hB3ieQkaJ8rsAi1F70VFGxHXopa3F7mBSjgjnmBWuRepUGZI6rG7mU65MA7pspS9F6iEQXf53rU4vcK6SUjUo3giyKDwlByGYbPapAE8TAoXILiCzQgYPxMeiWOL5FMA/m59HokX6ABCeVn8quxfIF0HMzPRNeh+QK5OJyfya3D8yVyKUA/F12L6LOxEAXp5zleFabP53tzcA7vthyaZ6WRsB7IrMb1JbaUBPZzU1qN7Gvkk9Ce1qMa26MjESKKY7c/7bpzb//4eDjON0DOm9wGWuDdltGLudYJ13lpjJpvQonZZQv0AF+5rX7Ar+JrCse7QqN3o5OuH/hX2JW31+6X+263SLnZhbfXbflb84q4+NY6km6Efuvq/En500KMPPVsKux8sXza1RBa1PucGmtEOx/aFNV7oSUa0e4or1m9X0qOH3RQ4+8/j1vgCTdy/b28guWvL8Nu++3x8ITWlmDdvoKXJJxCoPFC1wiFF/tFVHT8SImPZPofbuTfg84Ktb/oVbVyGIlJLx5m+t8ftliCHwnwbZZJONnvYCNHScRCgmbL5PSfn7v9NisnaLZMDmrbQwnD8r6JldGo+8ziaG68u09fu+PjkiM+tVomxTXMv2+voobFsiKb1m23BYKurZZJSQORePwpHlInj8YfQFq2Di0vi4AdQFD6tB5Eytz8RssNbm9I+FPppp6vfvr++2++Grfn5Dp7FTVNa26VQ+X98ObHt99+88v7rLSg4VJZ7978+H+/yQryreqkBA7xb2fsKDD7r+XxhF2P2A4duop07esVaIcr7TRKLFs9dQ/9//PS7QYkkoyFgaYL5e37z939+fvDmFvlBIK2yyTay4dTv/17t3vJiZw1XiRz3x9tQOrmy9ttakq8wpsvkLsfNzKMyucmDmy4RtbfjnPXioly7dZI2v7tuDv90J3v58vsmMCo+QK5w8nOd6p6MxA5a7lc2mXFJzeAaOtFUr/vP/W7Tfmdou2XS24qJcP2yyWzSsmw/QLJ6Xr4QGRZIXxS1v1jf/+72+2ZkhQ3WyBnd+i2JbcE2i2U9A3YOHJ683J+bHJyyatupMUiJVbosD2MF3/12A3zoDmQGjdbIKc7n/un52mD2n8P58f3h9+RQwQDoYlrbjnmm3bRoNvLbjjq9Wqs0eL+2Hfn/pvjEWEk4TsdNVssZ9T0cBz+Zdctxir2flsoOnHlYm3e9afzcRhRRqES8wsWy367d2M4utv+WCgfv2jJW3h5mkknFTZaIOP0ePhjHDWrdIen44E0vPkM1yKH6udidWprThykY9tyaqT4lxE9XD4WBZoukHc+dp/646l/s99+O/6akDdvuuz+yC1G6GNc6PnHhc3+6flw7HZfHZ6eD3tsa1csEGtfJrkUFYevYQEnhmKir8hn1jTB7zch3VifZd+VB8om5j75EV9MdnxBrezidWtU9pJF62JdlozuiuXqYr0ya9WEWgsXqutGLr1KnRrCZUvUhdqR38sl3qW6r+YWPqG5WcefR/lScKFk+ju6mPz6r+kW2xX6m7qEXan/sm61LvT3dTM61X9llx6t6Fu7yZc7/vkmDgXpsvAzvJGmiVADxbiY2KBxpcxiN4KJXeJFSjXJORFcn6U+pFSr+lm23INUjVnagSQGb5n/KNON/kYf+uZUfqyv6OkgB01gz6LipIkiuYnv+M2lL/igX6EFSXzZDzUiCz7xV6lJ4lt/SY0WfPSPGqfAaeDf6rb/Wr6k+PF4ePrql18S3by6NsHNs9Oj3gUFIko8DxQTV1ujK3iBhE/JVTvYN/js+xHZ5hL0fUxsb8n0/HDsEWwa9O0bLOr9Q+ahfFjxTDKTpmbCqMDodk/9sXvXj5uiP/WzlPTjy94dP/wXvGFy3gdidmOZa4EUtB0m5B+vL9XsX/77biQ1Y3df3rEv+Bcj0v049Lvt6e7LX53813f3hydbvPaPy29/78epP7ZwTf6yuXv96+a1bL/QnP/jH69/9VfYH+w/2GbN3etfm9dSfcGViZo1UTN29/pX9lqJL4xoomYsasbvXv/KX3P2hZKxUB41E3evfxWvufpCbtqomYiaybvXv8rXXH7BWx01k1Ezdff6V4X1pqJm+u71rxprpqNm5u71rwZrZqJm7d3rX1vs8bbx491QT6QB42AHYvNa8i+MlHHLeCia8ZE3DdoyHo1mfOoNQ1vGA9KMD77haMt4TBpJjV0Tj0qjqNFr4nFpNDV+TTwyjaFGsInHpmmpMWzi0WHjGDQCndfx8LCGGkcGXhQ7OvI1b7/QTfxGsXh0mB0d9ZqbL1TL4pbx6DA7Onrss4Et49Fh4xg0Bu0zHh42DkLTonrG48PGUWAbtGU8QGwcBtagLeMRYuM4MIa2jIeIj+PAONaSx0PEx4FgAntKPB4jbq2ZRFsCezYOBFOo9HiM+DgQTKMt4zHi40Awg7aMx4iPA8FaVM94jPg4EHyDtozHiI8DwRu0ZTxGfBwIjo4Rj8dIWCOHjpGIx0g0pOWPh0gwynqIeIQEp6yHAD5HUNZDxOMjJGU9RDw8YhwDLjDnKeLhEZqyHiIeHWFHR74W4guh49ER8egIOzrqtTBfaAGeUDw60o6Oxmy7jEdHWiNnXsvNF42Ob0jGwyPHQeAt2jIeHzmOgtigLeMBkjYqQGMRCeIC64MY2jIeIqlIayzjIZKatMYyHiNpSGss4zGSLWmNZTxGakNaYxWPkWpIa6ziMVKMtMYqHiPFSWus4jFSgrTGKh4jJUlrrED4pkhrrOIxUpq0xioeI2VIa6ziMVItaY1VPEZ6Q1pjHY+RbkhrrOMx0oy0xjoeI81Ja6zjMdKCtMY6HiNNxnI6HiJNxnIaxNhkLKfjAdJkLKfj8dFkLKfj4THjGAiOxXImHh5DxnImHh0zDoFADbyJR8dw0m6beHSMtXISs8YmHh1jR0eh0uPhMeMgCI22jMfHjKMgDNoSpEHjMIgW1TMeITOOg9ygfcZD1G5Iy9nGQ9SOAyFRX9DGY9TaQAH1BW08Ru04EJKjLeMxaseBkOi4t/EYtTZFlWjLeIxa+wqho9nGY9SOAyHR0WzjMWoNaY1bkK22pO1qYcK6IY2X+y1sa4fJoGnjBmStGzoxcr+FbenUyP0WthWkk3W/hW0l6Wbdb2FbRTpa91vYVpOu1v0WtjWks3W/hW1b0om634K2lifgbrSZsYaGdKQNpA2WKeCutIG8wVIF3Jk2kDhYroC7vgYyB4sWcOfXQOxg6QLu/hpIHixgwGEGZA8WMeA4A9IHCxlwoAH4Q2MpA440AIBoLGfAoQaDgMjaxBZzhQ2AEA0jkV0DKERjWYPCERXgEI2lDYqAVGDELG9QKF1sAItoLHFQqJdvAI1oLHNQKN1pAI9oLHVQEm8LBs1yB6XQtoBJNJY8oJywAVCi4QkDySHYSxhIACYaTtOjBqCJhtP8qAFwouE0QWoAnmg4zZAaACgaTlOkBiCKhtMcqQGQohE0SWoApmgEzZIaQCoaQdOkBsCKRtA8qREQydJEqQHIohE0U2oAtWgETZUawC0aQXOlBqCLRtBkqQHwohE0W2oAvmgkTZcaADAaSfKlBhCMRpKEqQEIo5EkY2oAw2gkSZkaCUE6yZkaQDEayyqURi0O4BiNJFlTA0BGY3EFYdABymgssCAMOoAZjUUWOJtqAM5oFM2cGgA0GkVTpwYgjUbR3KkBUKOx6EKhWVEDsEZj4YVq8bZwBWQcGo1mRg1AG40FGIT1B3CjsQiDsP4AbzQWYhDWHwCOxmIMwvoDxNFYkEFYfwA5GosyCOsPMEdjYQZh/QHoaCzOIKw/QB2NJRqE9Qe0o7FQg7D+Gi5eadr6A+bRWLRBWH+APRpLNwjrD8hHY/kGYf0B+2gs4iCsP8AfjYUchPUHAKRxBAS3/gCBNBZ0ENYfQJDGog7C+gMM0jgOgi8QgmGztAO3/gCENBZ34NYfkJDG8g5ihRKMmQUexBolGDJLPHSDWn9AQxrLPHDrD3BIY6GHxsNuAEQaiz00HnYDJNJY8KHxsBtAkcaiD42H3QCLNBZ+aIXG0gCMNBZ/aNxhAjTSWACiDd4WrhfbfA3NrBiAI8wCELPB24JFYwtATIPdGwNwhFkAYhjeFiwcb+iUjQE4wjZ0ysYAHGEWgOAengE4wiwAwT08A3CEWQCCe3gG4AizAAT38AzAEWYBCO7hGYAjzAIQ3MMzAEeYBSC4h2cAjjC3GwPfGQDgCHP7MfC9AQCOMAtAiN0BAI4wC0CI/QEAjjBLQIgdAoCOMItAiD0CAI8wy0CIXQJwf4aFIMQ+AbhDw1IQ3MOz2SYNRnp4BrdpWAyCe3gGN2pYDIJ7eAa3algMgnt4BjdrWAyCe3gGt2u4/Rqoh2dww4bFILiHZ3DLhsUguIdnAJEwi0FwD88AImGWg+AengFGwiwHQT08A4iEWQyCengGCAmzFAT18AwAEmYhCOrhGeAjzDIQ1MMzgEeYRSAGda8M4BHmNnCgO5EAHWGWgBh8exOgI8wSEIN6YgboCLMExKAAjAE6wkTCswE6wkTCswE6wkTCswE6wkTCswE6wkTCswE6wkTCswE6wkTCswE6wkTCswE6wmTCswE6wmTCswE8wmTCswE+wmTCswFAwmTCswFCwmTCswFEwmTCswFEwmTCswFGwmTCswFGwmTCswFGwlTCswFGwlTCswFGwlTCswFGwlTCswFGwlTCswFGwlTCswFGwlTCswFGwlTCswFGwlTCswFGwlTCswFGwnTCswFGwnTCswFGwjTt2QAiYZr2bICQME17NgBImKY9G+AjTNOeDeARZhGIQRMxBvAIswjEGNT8AzzCLALBvSCgI8wSEIPnbICOMHprCANwhFkA0uLpHYAjzAKQFs3gGYAjzAKQFt9rD+AIswCkxeMGAEeYJSAtHgwAOsIsAmnxYADgEWYZSIsHA4CPMAtBWnw2AEDCLAVp0bScAULCLAVp8SEGhIRZDNJs8IEDjIS1Cc8GGAlrE54NMBLWJjwbYCSsTXg2wEhYm/BsgJGwNuHZACNhbcKzAUbCN7Rn44CR8A3t2ThgJHxDezYOGAnf0J6NA0bCN7Rn44CR8A3t2ThgJHxDezYOGAnf0J6NA0bCN7Rn44CR8A3t2ThgJLyhPRsHjIQ3tGfjgJHwhvRsHCAS3pCejQNCwhvSs3EASHhDejYO+AhvSM/GAR7hDo9sUKPOAR/hDZm0cYBHuEUguBnhAI9wV7+yQSt8OOAj3DIQfOchB3yEuyoW1D5xwEe4q2NB7RMHfIRbBoLvReeAj3DLQPDNZRzwEc5I8s8BHuGMJP8c0BHOSPLPARzhjCT/HBa0cJL8c1jRwl1RGOrgOSxq4ST657OqFjtkGzQY4LCwxe0fQX0gh6Utbv8IPnlhcYvbP4LPMVjeYiEIMcdggYulILgP5LDExe0fQX0gB4SEu/0jqA/kgJBwt38Et6WAkHC3fwS3pYCQcLd/BPeBgJBwt38E94GAkHC3fwT3gYCQcLd/hKh0AuNmKQjhAwEh4ZaCED4QEBLu9o/gPhAQEu72j+A+EBAS7ipg8HEDhIS7Ghh83AAh4a4KBn3nASDhFoLg9gnwEW4ZCG6fAB7hFoHg9gnQEW4JCG6fABzhrhRmgyYKHNARLsmUjQM4wl05zAZNKjigI1w5I4lmFRzgEa5c9I+mFRzwEa6cmUS373EASLiFIE2DllxzQEi4pSBNgwcPAJFwi0GaBk0JOWAk3O0jaXCXASAJVzSU5ACScEVDSQ4gCXcbSRrxWjZfGAEaA0rC3U6SBp9EAJNw7Yqf8ZkBQAm3NKRp8JkBUAnXbvzwmQFgCddu/NCMkwNcwi0TaRiacXIATLiFIg3DZwYgJlzT5YIcEBOu6YJBDpAJN3TJIAfIhBt6AxcHzIS7ghq0rIMDZsItF8GL/DhgJtwkQhTATLhJhCiAmXCTCFEAM+EmEaIAZsJNIkQBzISbRIgCmAlvEyEKYCa8TYQogJnwNhGiAGTC20SIApAJbxMhCkAmvE2EKACZ8DYRogBkwttEiAKQCW8TIQpAJrxNhCgAmYgNHaIIgEzEhg5RBEAmYkOHKAIgE7EhQxQBiInYkCGKAMBEbMgQRQBeIjZkiCIALhEbMkQRgJYIS0Qahi4qCoBLxIYMUQSgJcISkYahR2YIgEuEO9yDofmWALxEuPM9GOoPBSAm4nLEB+oPBWAmwu0qYag/FICaCLethKH+UABuIty+Eob6QwHIiXDkhKP+UAByIiweaTjqDwVgJ8KxE45GSgLAE+HgCcdHEMATYQFJQxT7A3oiHD3Bwx8B8ImwiAQv9xMAnwh3EAjHpwbgJ8KdBcLxqQEAinAAhbg9MH4WkxCHFACEIiwnwaGTAAxFWFCCF7wKAFGEJSV4yasAFEVYUIIXvQoAUYTbYIKWvQpAUYTbYYIukQsAUUSiCEcAiCIsKMGLXwWAKMKCErz8VQCIIiwowQtgBYAowoISvARWAIgiLCjBi2AFPCnEghK8DFbAs0IEvTgg4HEhDqKgnlnAE0MsKME9s5gdGiJICCnguSEWlOBRqIBHh1hQgkehAh4eIujIUsDzQwQdWQp4goigI0sBIIqQdGQpAEQRko4sBYAoQtKLOgJAFCHpRR0BKIqQ9KKOABhFSHpRRwCOIiS9qCMASBGuEgeP6gBJERaWEFEdACnCgRT8vQAkRVhYgkd1gKMIi0rwqA5QFGFBCR7VAYYiLCbBozpAUISFJHhUB/iJcPyE45EM4CfCIhI8qgP0RDh6wvGgB9AT4cpwOB70AHwiXB2OwIMewE+E4ycCD3oAPxGOnwg86AH8RDh+IjgaDgN+Ihw/EXjYCviJcPxE4LEJ4CfC8ROBxyaAnwjHTwQ+2ICfCMdPBG6xAT8RlpE0hLsHAEVYSNJIFPAJQFCEpSQN4cQBQhGGfvMAQRGuJIc4IAoMn3GbF/DUByAUcUEoKDcUgKEIx1DG8ADrGQyfgygSnxiAoghHUSQ+MQBGEQ6jELEz4CjCuOHDX20AUoQ7qYR4TQBJEZaWNHi9vQAoRbjtJwq3A4CliMv2E3wWAZgi3P4TYjIDmiIsMSHmEaApwm1AUbg1AjhFuB0oeDW/ADxFtK6QEZ90AKiI1i2M49YIEBVpqUmDF/RLgFSkxSbE2V8AqUh3jAle/S8BU5GXc0xQyyUBVZHuIBOFTlAJuIp0J5ngZk4CsiI3bgDRCSoBW5EbTZs5CeiKdHQFn6AS0BVpEQp+niugK9LtRUGnpwRwRTq4gps5CeCKdHBFo6+fBHBFXip2UDMnAVyRDq7gZXoSwBV5qdlB3xIJ4Ip0J5oQDwOMnmMrGjVcErAV6diKJu4PjJ5jK3itngRsRVp8gtMSCdCKdGhF428UQCuSkZscJAAr0u1LwTfHSEBW5OWIVdSVSEBWpCMreMmgBGRFMvqUSAnIimRu9NAd+hKgFWnxCXG6IEArkrmTCPFpD9iK5K4MHH+pAVyRbouKwQ9jBHRFuiNODD47AV6RbpMKXr4iAV+Rjq9QOoPxu5xyQugMxs9tU8ErYyRALPKyTwWfy4CxSLqSRwLEIrkbP9yRAMYihRs/fHoCyCKFGz90jVsCyiIFS7wlALNIi1IoUwQ4i7QspcG3U0sAWqQDLfh+aglIi3SkhXinAGqR9EGtEpAW6UgL9eDA+Fmc0uC7uiU8r1VuEm8JPLJVNomJD09tlSwx8eHBra6qpyXUAONnmQr+4GaHt9Khp4THt7qqHnzXuoQnuLqyHnxJRsJDXN3WFXyPu4TnuLqDXPFN7hIgF3k5yxV/VwF0kSqxriABdpGWreDpjgTcRbq9K/j+eQnIi3R7V/AN9BKwF+mqe/AN9BKwF+nKe/BdshLQF+nqezb4WwLoi3RHvOJ7IyWgL9Kd8opveJSAvkh30Cu+q0kC+iK1O48XnxqAvsjLQSj41AD0RbqTUPCtShLQF+mOQtngIwjoi3RnoeBblSSgL9LRF3yZTAL6Ih19wVe+JKAv0h2Hgm+CkoC+SHceCr4JSgL6It1ZsPhLBeCLNPS2aAnoi3T7V9DVCwnoi3T7V/CXFcAX6Q6FRVeoJGAv0h0Li2b5EqAXaekKvkIlAXmRjrwQx1rDE7ANuUIlAXeR7nhY3OUA7CItWcFXqCSgLtIdEYuPMYAu0h0Si65QScBcpDsmFh9jgFxkSx+HLQFxkW7/CrpCJQFxkRaq4CtUEgAX6Y6LxUEA4C3S8Rb8OHSAW2RL1yFIQFvUhj44SgHYojb0wVEKwBa1oQ+OUoC1qA19cJQCqEVt6IOjFCAtapM4yByAFrVJHGUOOIvaJA4zB5hFbRLHmQPKojaJA80BZlENve9IAcyiGnrfkQKURTX0viMFIItqyH1HCiAW1ZD7jhQALKoh9x0pgFdUQ+47UoCuqIbcd6QAW1HuRBR8H64CbEVdjkRBwxMF2IpyZ6Lg+2UVgCvKHYqC75dVAK4odyoKvl9WAbyi6INjFYAryp2Kgm+tVQCuKHcsCr61VgG4oty5KPjWWgXoimLkab8KsBXFyNN+FUAripGn/SoAVhQnT/tVAKsoTp72qwBUUe5rNgw9YkMBqKI4PWoAqSj3RRuGRlwKIBXlPmrD8OkOkIpySAVP1BRAKsodHYvvnVMAqSh3diy+d04BqKIuh8eiJ4opAFWUq/7B984pAFWUgyp4gK0AVFFu6wq+0U4BqKIcVMHzRQWginJQBQ/dFYAqykEVPHRXAKooVwOE7/dTAKooVwSE7/dTAKsoVwWE7/dTAKsoh1XQeEYBqqIcVUHjGQWginJQBY2FFWAq6sJU8H7B6F2QCqovICrK7WDBYx+AVJTbwYLHPgCpKLeDBffjgKgoqcn4VgGgotxBKcQHX8C4uYNS8DgJfhnHHZSCx0nw2zjuoBQ8ToJfx3EHpeBxEvw+jjsoBY3dFfxCjsUleOyu4DdyLC0h4q/ZV3IUHX/B7+RYVkLEX/BLORaV4F4RfipHkQt4CjAUZTEJ7hUBQVEWkuBeEfATZREJ7hUBPVGOnuBbgRWgJ0qT9FIBdqIsHsHLaBRAJ0rTX59SgJwoTX9/SgFwojT9BSoFuInS9DeoFMAmyiS+QgWwiTKJ71ABbKJM4ktUAJsok/gWFcAmyiS+RgWwiTKJNA5gE2USaRzAJsok0jiATZRJfZUKjJtJpHEAm6iW/jKVAthEtfS3qRTAJqqlv06lADZRLf19KgWwiWrpL1QpgE1US36jSgFqolryK1UKQBPVkt+pUoCZqJb8UpUCyES15LeqFCAm2h2SwtF4WQNkojfkqUQaEBPttqfgJasaIBPtkAlHQ2sNmIl2zASvPdAAmmgHTfDaAw2oid7QZlIDaqI3tJnUgJroDW0mNaAmekObSQ2oiW5oM6kBNdENbSY1oCa6oc2kBtREN7SZ1ACb6IY2kxpwE93QZlIDcKIb2kxqQE50Q5tJDdCJbmgzqQE50Q1tJjUAJ5rRZlIDbqIZbSY1wCaa0WZSA2qiGW0mNcAmmtFmUgNqohlpJjVgJpqRZlIDYqIZaSY1ICaakWZSA2KiGWkmNSAm+vL1XzTr1oCZaE6bScBMtNuIghMIDZiJdh8BxjeFa0BNtKMm+KZwDaiJdtQE3xSuATXR7mvA+KZwDaiJdtQE3xSuATXRjprg307UgJpoR03wTeEaUBPtqAm+KVwDaqIvH93BnQagJtpRE3xTuAbURF+OTcFHEFAT7c5NEfgIAmqi3cEpEh9BQE20oyYSH0FATbSjJhIfQUBNtKMm+O5tDaiJdnU/Eh9BgE20TFRJasBNtOMmOEPSAJxoV/qD7wvXgJzoS+0PPjcAOtEOnUh8bgB2oh07wfeFawBPtIMnONjTgJ5oR0/wfeEa4BMt6aU5DfCJlvTSnAb4RLvdKHgQBPCJdptR8CAI4BPtDlLBgyCAT7TDJ3gQBPCJdufM4kEQwCfa7UTBnSnAJ9ptRMGdKcAn2u1DwYMggE+024aCB0GAn2i3CwUPguDHht0mFDwIgp8bdntQ8CAIfnBY04WSGn5yWNOFkhp+dNghFDwIgp8ddgwFHzf45WHLSYggaPbxYXKBR8PPD2tygUfDDxBrcoFHA4CiDbnAowE/0YZc4NEAn2iHT/CSEQ34iXZFP/h2Rw0AinYABa/s0ICgaEdQ8MoODRCKdggFr+zQgKFot/UE1xiMm0MoeBGIBgxFO4aCF4FoAFG0gyh4YYcGFEW3dKgJIIp2Z6fgNSAaUBTdkstzGkAU7fae4OUiGlAUfTk8BXdFgKNoC0vwHUYagBTtTk/B6yk0QCnaHZ+Cl0hoAFO0O3IWL5HQAKcYh1PwDxQZgFOMO3QW/0KRAUDFJD5bbABPMYnPFhuAU8yGPhDAAJpiXLEP6pcNgCnGwRTULxsAU4zbgoL6ZQNginFbUFC/bABMMW4LCmrfDYApxn22GLXvBsAU42AK6pcNgCnGwRTULxsAU4yDKahfNgCmGAdTUL9sAEwxDqagftkAmGIcTEH9sgEwxVhggvtlA2CKcSfPon7ZAJhiLDDB/bIBMMW4Ch983ABMMe7kWczXGcBSjPt0MeaXDUApxuIS1C8bQFKMpSWoXzYApBhLS1C/bABIMW7zCV4RZQBKMYysLDAApRhX2IPX9hkAU4yr7MGttQE4xTicgpdaGYBTDHdmEnVcBgAV4zah4CVRBgAV44AK/hk1A4CKcUAFL10yAKgYB1QM6mEMACqGk+cCGIBTjKvrwbfeG4BTDKdP5TOAphhHUwzq5QygKUYkjns2gKYYtweFmEWAphhX2EPMIkBTjKMpBne2gKYYR1PwKi4DaIq5fMYYf6MATTGCHj7AUoygTywyAKUY96EedIHXAJJi3DG06DmJBoAU446hRc9JNICjGHcMLXoupwEYxVhSgp/LaQBFMe4YWjTSNgCiGMtJ8PMXDWAoRtIn3xiAUIykT74xgKAYSe9JNwCgGEmXQxoAUMylngfXF4yb23+CB0kAoBi3/wQPkgBAMW7/Ce5sAUAxDqDgzhYAFOMACh4kAYBiHEDBgyQAUIwDKHiQBACKcQAFD5IAQDEOoOBBEgAoxgEUPEgCAMW4D/XgQRIAKMZ9qAcPkgBAMRaSEEESACjGARR83ABAMRaS4EES4CfGMhI8SAL4xFhEggdJgJ4Yi0jwIAnQE+O+1IM3BUPm6nbwilgD+Ilx586iJh3wE+P2n+AVsQYQFGPcqjhqpwFAMQ6goB+LM4CfGHdoCu6PAT4x7swUlKMbQE8M/SFjA9iJoT9kbAA7MfSHjA0gJ4b+kLEB3MTQHzI2gJoYd+QsXphsADcxFo3gX4MyAJsYGpsYgE2Mwyb4pl8DsIlxp6Tg/YIhc4ekEBEioCbmcuYsHgADamIuh87iATCgJsZRE7w02gBq0lowgs6dFjCT1lXt4KFnC5hJ65gJfq5EC6BJ6zah4KXRLaAmrduEgn/xqgXYpN3QFVctwCbthq64agE2aTf0uW4twCatwyZ4AXMLuEnrNqHgZ9W2AJy0l10oaHl2C8hJ68gJXiPQAnTSOnSCl0a3gJ20jp3gpdEtgCetgyd4aXQL6Enr6AlewdwCfNJe8An6RrWAn7QXfoK+US0AKK0DKHgFcwsISusICl7B3AKE0jqEglcwt4ChtJcNKfhEAhSldTtS8ArmFnCU1m1JwSuYW0BSWrcnBa9gbgFLaS0w4XgFcwtoSmuBCZqatICltI6l4MXOLaAprQUm6IJtC1hKe/nCMT4vAEtp3SeO8erlFrCU1m1NwauXW8BSWvchH7x0rAUspXUFPXjpWAtYSsvdIh0+LwBLabnbnI7PC8BSWsdS8NKxFtCUljsDis8LQFNaR1PwerAW4JSWO4KJjyDAKa1wHzzDRxDglFbQ7LkFNKUVLkXARxvQlNadRotXTrWAprSJb/q0AKa0wq2y4jMDwJSWhiktgCmtgyl4jVULaEoryDNuWgBTWgdT8KPMW0BTWrctBY3oW0BT2suuFLwtGDpXzYOHOYCmtK6aB43oW0BTWklmdy2AKa0ks7sWsJRWktldC1BKK8nsrgUkpZVkdtcCkNK6o2jxqrgWkJRWkdldC0BKq1yxMW4hAElpFZ3dtYCktIrO7lpAUlpFZ3ctICmtorO7FpCUVpHZXQtASqvI7K4FHKVVZHbXAozSKjK7awFFaTWZ3bUAorSujgdNrFoAUdoLRMGNOqAorSazuxZAlFYnjnFrAUZp3TYUvC6xBSClvexDwZ0FQCmtdvVXuAMAMKV1H/HBSwFagFNa9xUffMt+C3BK63AKvmW/vQCVf7y+G/af+uO5377db/vPd1/++uvdb7/9z+mw323vXv/77rfB/bN6bXu9+/Lfd+ruy3//5/Vdo91/BXf/1Zf/b5r28oe8/NIY4/5gXFz+0Jc/xq91uj/Ypc347TLX78b/oZj7Y6zdd3+wi4ixmsz90V6kjzuTL+pc2ozLge4PfdHceH1GM+n+UPZf/vPaPyD7f+MD+63b7Y7d/qE/hU9jPJNqeh7S9YJevN8fzt15OOyH7VP3HHYxnnxz7UKT8u8Pu11/P3YRa8ACDcaPiBCXb/uP3cvuvDvcd7s+6sC0gXzRuAcxHl1G9PTQn+2D+PDnEM2M8Syoa0dKJq4/H56xZ2nC6zl1PXYL4ZViQ1351O2Hj/3pDB6gDB8goy5+7o6nnhoEHrwW40c1Un3gWvBQCyaSPcyf3Xi0VvDsyHloLz8f+35/2EaPcCy1vr7Y9OAjohkLruSk5ufHl6cP+27YxVfzYOjGXfTU1fiMkeHbRyr9qdu9gAmjgwt5S1zY3d/3p9P58Hu/j64WwR2PR6sTV2+3s6fc8uuVI6gir5yr3IZvlyAv3T/E74YJLmMbUtfJPkXXBpaBGeq1ul774bD9M/IVwVNuSOMYX+8meKRF0AtzziXZC2JhWWhhydGeetgNp3P07MO3izd5FZ67h3jwNsG4j1/sJTo4Pff35+PYRWyhQvH0Ezif+6fn87E/HV6O9/0fw/lxNnVHnHCdgJwydt3L+bF7Hj71xxOYEuMxyNe5by5+eDwFme7p8bDbDvuH2UORockz5PR4OT8ejsO/7IP97WM37PrY7ehgfhj62V66iVQYEUHwOKiZ8QG8i2NId72MHBD4OrRN+DpRT+zDy7DbfjwensbYK3oPTPgeXCKXcQ0E7+e+e+qPXdRBMPaMU1q76479rjuPEwAxC2PcGdw+9dTuu/2nLrbXm2DEOWmv3YXQy/DQy1Ae9v6xv//9dO7OL9HVIyS8aszIW98N97+fH4+Hl4fHU3/8NNyDCRt6eUP2MsUI8UscOo2NDzw35NM77A6RGdSB8MZHuS3pfe4P+9P5+HJ/jnsJ7dAlKL9EzuwS+YlL1+by/40PmxvpA/uW+TDex/M+xmb+qvF79u4Pznw83/p43v+hLlH3eGa3+8N3KL0W47Gxl1D/oobi/g+fO+jNRajm/o92+sPH/D4dGPd0uT/ElAVs/LvkG7cXu9b6Nq3wA6Y2/slTL/D9YX8e/z+KcoI3ZiypTl45Briz6SM3YcxxeYLjQfyJrj5HSoSG24/oZSD807r8f+NTukb6SWCUH3I/9tqPa+P/YMqPNPcj7f/wT001fvD8eCh1ebLKP3TN/B8+kzR+bho/5Mbr0/r50ZJB7/2x78595EacF+mPR/ByNDp0B+kOkatVeDVpouzVw/7cH/fdbjQz/RHpKzRYnLSUtq9jfzofh/szekcm7IecLafYXPIwSiBT0m137uI5qkP76D0U96PYUg907OjlOMR9mbAvykr6rLb70O+iy3UY8jXUWNBJsQ4zSjKhu1w/JlTRmxa8aubydgj/dkgykN72p/44dLsBBMBjzc/VehjK4W8P4xy/f+wGEPKFwQoZH21fjnOjw8MBJTP6MeqMAp3xCMOrs26owev321haG0qjZt1sjo/f5wlMo3/eLfWYbQfb/nR/HJ5ndxwOnSBNfP/5udtvQRwahnfjHgvy0uHYnwYgNgyFNZXc9Z+d0fAhfvzCBMGdd6ee0G0u/9B4690o7b3+xSAzb7SZ94LcQ7rx29numQof77feaIsJwCnvjP0f0hsAL91IcgZ9vlrDWdAVzoqWmr4fh363PXz8NPR/RCFvYJKZIC8+HD8M222cKrHQBBgyVRojdWg+WWi8NXXlQ7/vj915wjHDFsSsYW5CJp0P/bm7vz88PXf7P4f9AxJ0tyHrUNRbMfaDEc7xHPbg8pQaED3oEB9sUoKvBAAyxRCLaRKYjH2cz8fhwwt8oUU4iBOo9pDTJDr80N3//nA8vOy3s1CchbhPb6hZPXbSP3afBmCvwmBQ+NBmPOX/8kpRVmfsD6aUId0hPcPlQh492pBcMzL7fujP993+sB/uu93w1D300E9vgtnFFfWGuW4+dafZAIvQt5FBU3i9vTDqogm7SN/JPLEMvY4m8eV0NXhLx6NAA26amOSXy8fL5g+BhTok3rGok1nUw0JPqMmocexnylGRBzp+7Tsg4qkxodYkwkSZZEOuA5DlBu97QwaM9sr9x+H4NH8GKhzPNqn8LE9rQk7AlV/Q2iRerFkQHAZrgqQz45VU7BqazYsz9flT49fCGj6tvjXek3uX7vN05ikB92k190G58Pms8rmz8v5f+XRYezKg/bqb8b7dSCq8ud4XDIrD5MArJnxSL1XyQaGxmgie03RfPsCRHk3q1CRCg95mE84Bjx/I4OGhP4/p5MuxJ/Qcy6KDGZl4uy/9PPbdFmQAOjRxbeLFpuKgMDpMWamPh+NTF70T0dKWX9H185H5GcE8KeF6iggvI2DI1aSH/ozda2gMyTjaXjs8PMaII1wj8djKv8bMcyfmb4MrvzQsE9Pv8fDUQ3Yd0hjjcZYHUzLlTYdh+Ojj9/OfzyDrDEfJd3Z3IYX+xffwxivPPMZhfsWceZTCfSbAvbngHpwIPgnwJMbDHuXhsvaYUvvxNhsPYGRiHttA4Z8v3W4AeWEYirZNwtfaHmKfEi6TczIXHa+d+bMwA+YkJ7KX9p+7e4QHsHBtuk25xGH/8QBipPGMgetsIdfg7MXnfn8CTy1c32hS7/5w7p8Abw8Ec3Jx9aFHnFC42DBlfd4J+SnIvTfSE0T29sDnnqz1M49NeaV3S1NAPtFeNrklDwyl3/Ph7Yr2r7H2EbPxTtGQSwr2Fk+X8AmJm0I8Sy4DXToZbQEShIaJSsrC7vr9w/kxzv7DkEGlxA/3/f4UW6KQ7nj2wSfWlOpsnOXDqZ+vNY8b6IPZnnhhMFTNwgBGkezMXv0QLXTKJhTr78XPPpMa3MPh99htmXCxzRMIJhJ23u/LQCPiEEKkHgixxSTkaCm75y+HnmH8/lewhJ14k5+6z9vhabQiMCgPu+CpeOup+4y41hADePdi/IKJTN7T5z+GbTzlw5RNTphp4kSp++u3Qzd7PG2I3lMJx1N/7mDIHi4CT8sSfuHDBziNt1qNJ4zML3Ex76NZOy16+QhjCg4mUObnoppWtvyamW78Hz5kMRvPzlPc5ulwHj7NXsNwbwwjFysf+vO++7TtzrFRiXYJ+BfRG2mSrI6d9Z8pAxkyk1Q0DW4jJHgpE3A4P/ZHLKcLtzzwFMAa9d4O++1wDxCB0KHqiTfn+XA690eMwanw7UkY5edj/4l4fuFGqRQjej4ePg4gfFHhxW3iZX0+Hp77IwhAgmsv78CURl4m7OX/G+ajVD+5G/8CMG/Hmc8LeDNFqf5t8UGD8G+d8G+C8oHF+ImcS0Dgw1X/1mkfPehpRddH0WZaSvT6tD5LblMO1z+O7nT48D/9fexhgqDucrP+ZZ9yT/9YvDXxlrPx4Tzzrpp5gM79nXJ/p9yrKrw5EFNa6pN+xafg3duX1sdJ/vFqb2iMj+jMdRuJX9ae8g2deMuJ/Z/BiybJ9Zvr5c9d7BRYGK7K1LBguxCD4VCpd9TubImXbsI9Ta1f65i2IpBrDraz/bY/DvuHOAAKTdZlNPzCix/CxvffaJ+f+unDfKDN/BBy4aeCHych/Wvg19iVn1vK+1HtV+a1ny7GJ3QmRWqnmwJPOLgr78ymPST+Zrzja/xKPfMmgfkckvvYnvt9B3wK9qYU1KcYypsE5WMN7VestPKz2GcEJhXVHPt/vgzHfjvuDuqfZhs0Ah/hn6zfWeDvzQ9C4y0Y8+818+EC9ziNC595T0H5tLW6ne7Nv7x+gU37XfDab40xHsIZckO0vbf5gmAYw7P0HHYXw/eZhyPepl8p10O8fhUuO/kRZ1Os529LpF5zbPNZyJbb1NUnmMTz0Ea0qTfgdN/vYQwQYmVy++14bd93u1Oc1wShmEczwr8pMsWIT/3I12NErgJr1bCEmT31/3zp93ZgZ9HEJgxIyE1kQSdgUTDceJ3yFMiKbliwMHkt7xf9q9z4t6XxfpF5lsW8LeU+lOa+9IRPweqEDTwbUN6xqYkM+/hD+8Vw4wNwM737qUD1cm9znKADa2JSC5+XHuJnG+6R9HfhkxBvDRpvXhof2DCPV5g3ytx7Bu7DND45twn2+0BLeZ+jPCDUPg7RfoeW8f7E+OFqky/CzCQpFs7cRBZ9OnfH8zyMZmFeolNYOehgPvdDeKtFgk+cXoZz92HXI/uD2jAdTlmhc3d86CNfE0JQlgI043buw7Hbjav7hz3wWJxFQUviLqbCizgjCMngZeinwi3/7vn3qvFxIvMGnPk3hHtPzX3UyycTN2W4PuhR0z5Aj/60D2D1xOK9fzcpUktUk4Q0TItErmevB9eGaywiJRuvRQnLqFTivTgfzt0OXYoO41CdnFS2C6oWKaSJqX0jtpc5NA43twty85a/nqhmasI+Ei+q7YPwMWEAkdhFcz4fu/vfh/3DzBCH+7U9hhY+ipNtIqAaM4zTuBYWma9wBzZPmHV79W4ORsNKFmMSngWunbKQP6rk3ARkLCyvmjbz+miV+feSiQnJew8oE/c3A8ZNSFulD6DltMQkE/dqO4tnjwmN67RZZwLBqcW6ceFz2D9shyOyBT/c1ip8XiJ9gKEmmpG8dyfgcYCUKYxq/HKImHbieTetJjaQeiYzXhpuUvGhTePjIOazL+ZX9fnksmkp466zSET4zraammOP3ekStfjlbrC7KTSjwof5wgdmckMZgzlybsKYW3gXJHwQY3wWasjcZCAr+EIlyfg1zofCkNePgB9m78O8A/Up4zRW3t8x72yZT/u593fcs2fu/abwvlX4N1b491P6QFn5lFFNqMF7UuVtnvbbSPTEe/zENNMqvdew3UwoyEd5JDQd/MZNu17r08DZlpiQnwpyZg3p7a3hu0vu25v1Md+eE75Jm2JdDs9zRxvu65Bk4fC44B89HrCsHe440lQYF+4aiNZRokyDujghPUw2yDTQrca7tx7sf2vCxRNOj60PEw7ogwy9B7k8Ngvko5Lpqdrg8g5N5sK/VWLaie/jU+mzKelfZOmnvPF0zpBBJL5WH7jbhty74os/fnPVH7/NtrSzcOusIRfuh5Ozb+Oqx3GMBuP99Co0cuQ2qOHUPX0YxrIjaH/DjTgNGS0NJ7x4OFzz9IGAd0uNzyQb73ObqYLMs2nmk0zuU3g+7TGagrmJeW4m4+eJgt8Spr0x1t4rG28yDW3YTomq5mDGNz4faqY1QG+zGZkbD6d5bWZoSxqf7jP/mBgZ8ox9zdLkcKHXPyDPVby3aXwg0ngfzbyXYF4+93SAT/HhtHNv4rKTI5pO5/BLLNoDbe2XaoxHLoZcHvA3ZO/l8HI+fLS5VpwnhXstUo8GrcRk0R7Pi4be5034ybty73CZtyPMp8ncR898Crs8KhY+IpDe1qhpIcsTfO0DUO1XbIw3Q8aPVkvuLR9OU4jb7eZvLg/fXHoefhyOJ5SzhGu15Gr8cLKOAVlv5OFKTstIv3IKPcssdQkhY8voYb7u7IlvIly3JDcoDKdd/6nfbehbCZNIRj8L201DdxNufSPP97h0w+huQoRN7q0ZTrMpEcY9jTetzJMeRuYJw2l36ECpU7jXyS9d8Kl+2Mehksxwh5MPB+J7CyMJb0Iur+FmAp/TErS3jV4e896Fe2fAp42e/r0WnmhJ70LUtJQ61Qz7O9E+RDceUpnJTtCR4+npsI0xRLj43nhxbKq7JrPN4fT0sjsP2NQOl/PJqqrL9Z6uxHAlDIPJgrPh9Nw9DPuHfj9i0Hi1N9wmLfWU1dLP5bk/2vMthk89cjZBWI1C7sAbTs+HYY+uirBwx6JKvGAzdxLmvT7s8ya58aFC42184yNM5tNP5q01966Q+/Uu4aetmJb6/LArNXlmnz36nExPVc4+dDH+PWjJgu/hdOxPz4f9qX/s9ttZKBgyPXIL+nCyK249Sr/C/bfTQoB/GK1nSy25TDmc7IIc3ncYafqXzluW1ifRLUlVx777PVjsC0bVxyE+9vFhSDNtaPfCmIdXzL/q3I8Y9/co/CKvmNaUvB1VPnRSHnhovy6jp0zbh0WGhJrDCXtpI3zlgwc/P33s0Pi51/h1LuYJGvOziHt1uX+0wi+liWkdqJnWnvzU9eBF+6BXTwep+VjGkFsTh9P48g8fh3ssj1XR5PKjM+2D8BkAI9c5xu4PSAoTrpWSxUDDKWLy/SdQCRqWoGpy4/twwud2GNn7ONg7r9aPVktuXbh0uyPfyzDWm45H8OjGL/S15I75+QJAuBlCTDnyZMGmmJmsiXWnBmLjHO4hIS7+fTicfscKgVWoFrkPfr6TPSxg5RP1nQ4DFJNLp8IV26XF1M/dEMPO8FAWSca5u27/8NI99OBcqiZ0epLM8ueTOnxZyJ0d9rL0MT5hfE3SozH8izBoGM1M2138Oyt8Qi9JL2PjSYDXxpMLxpPtQ68cakfWZVKdNXFfIdomV26wvk6YZmFyQw8b1RtQLazyZlTgM3aGxczBxX4akztCsFMuwh17PsiV5OZSVzHwL6RioAkLzCRZg4uWC4QEUZG7AnaHh2GPmoWwmppEbmOpwQu2G6VRoebkZg2kwCC0ZX6rBUs8u7ED9GifsNCfkbuBsOFvwvME5WTrG+oufB8oYQ8j8FwHsw34oRdS5ILvU7d/cYtG8cUynAGk7MP+8HDsnuM9o+GhO4q0wMge9yaMDaSPtFuy1nc8ogFgthDSkuZuP1ZU2jqbl+Pu9NSd7+OVvXDXbEve/NTLnJJERTPUk5+ufznu4svDTX7kav9h//HYPcBdk02Yc3Eyi8SQf7ir36fkPrP3L1Pj18oan9kzH+Awv0TGfFDKfVTNPfLkZvJJHu97dyU9D1DTNlq/QKs91dM++jReH0Mmt8/dsd+fcdwY1j1MGvncUZJnNrguZ9FMuJR2LeX0QQ15qKDrbX4caTj45LFk7uI5hg13ICny1AJ7oGf84kWL2ZPX8WFl6iZO/YfDduhP46krNnCFR3WGd8TIZUJwlm+8MSrcQmSoqDl1GjALI1VNFgPbLsabiK8N2Ta5O2y6FggOuS1ZpmMvhqdLsjAF0+knh7qiICr0A+lXlEmnTp+HzEK3rsm6H9vBadz7M9YNzU5HCQ+8TA/lJ4bENGFwn5jfoIoh3MCpyEM4nvvTaXgaTiPfCxfx4jcljE1I45xgYuHhJCRBRzhzE26kE57ySPJ4cV8nM3+IbVTpR40BYlzC86j9PtiWVADZkBeCe07Wzx1jUsZDCt2S6/F43UfInBRJQrDgKzoSaDoVc8pVqfdnynjQFdgmHH6e1efaCdgjED5HElldDyGMY6TwoAQyi7tejEbo4XtIxmcJdMnDV7IlV/RpPsnDxeyWrN+bQUgWIjtNJhfu3YXHyUVHTFBmBC0QCM/QIVNKdFkgLNrQZKKMbeoPz/rWZBJzQo8aCFcSEvqeERMd5j/T2S/kisrp8fDHmILbDRjdzPfz0Oi0ZBH/CZwizUIzbciXFaGeIbojTyU+PXf703l4AiMVZs30lE4w15BqNqRzsDvpY94Yng5F7qCYH8LcqKgiiDJH7sJ7GKqGpM2QMxPZbR8eZEGGRHY7eGy4wtMcyXPJ8L31JlofJa8ddyWi9i7cs0ueeWcvn50gE2YbgnRfqJELz3y4uyRglLudOpgf18/Cc8oNiSfTUJuFsZchjxg/H7vxjPq+228/DntQvRbm1SSWQb+FERZHKL94ZMh9FL6P+akEISgkN77C02JCsGTIpdCXM6x9CAv+W3I74tyGhufLyOnYIb+DpSXTemInNAuptiE3QX0aTsMHUKUeWnNDDtlsc3QTlsYLn8jL6VQYNu3lQyfjP17fPQ/P/W7Y93df/vqP//zn/wcBYWmo0+ECAA=="; \ No newline at end of file diff --git a/docs/classes/Annotation.html b/docs/classes/Annotation.html index ebfd6922..7ad2b134 100644 --- a/docs/classes/Annotation.html +++ b/docs/classes/Annotation.html @@ -1,4 +1,4 @@ -Annotation | manifesto.js

    Class Annotation

    Hierarchy (view full)

    Constructors

    constructor +Annotation | manifesto.js

    Class Annotation

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    • get LookAtLocation(): Vector3
    • A 3D point coordinate object for the location of an Annotation +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    • get LookAtLocation(): Vector3
    • 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)

      -

      Returns Vector3

    Methods

    Methods

    • 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.

      @@ -56,7 +56,7 @@

      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. *

      -

      Returns SpecificResource | AnnotationBody

    • Returns null | AnnotationMotivation

    • Returns null | AnnotationMotivation

    • 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 @@ -67,11 +67,11 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • rawbody: any

    Returns SpecificResource | AnnotationBody

    \ No newline at end of file diff --git a/docs/classes/AnnotationBody.html b/docs/classes/AnnotationBody.html index 7d53f125..255584e6 100644 --- a/docs/classes/AnnotationBody.html +++ b/docs/classes/AnnotationBody.html @@ -5,7 +5,7 @@ a light, camera, or model, or a SpecificResource object wrapping a light, camera, or model. *

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Methods

    • 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 @@ -50,4 +50,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/AnnotationBodyParser.html b/docs/classes/AnnotationBodyParser.html index 14de1cb9..b2553a9b 100644 --- a/docs/classes/AnnotationBodyParser.html +++ b/docs/classes/AnnotationBodyParser.html @@ -1,3 +1,3 @@ -AnnotationBodyParser | manifesto.js

    Class AnnotationBodyParser

    Constructors

    constructor +AnnotationBodyParser | manifesto.js

    Class AnnotationBodyParser

    Constructors

    Methods

    Constructors

    Methods

    \ No newline at end of file +

    Constructors

    Methods

    \ No newline at end of file diff --git a/docs/classes/AnnotationList.html b/docs/classes/AnnotationList.html index 85e4814c..9a19511a 100644 --- a/docs/classes/AnnotationList.html +++ b/docs/classes/AnnotationList.html @@ -1,4 +1,4 @@ -AnnotationList | manifesto.js

    Class AnnotationList

    Hierarchy (view full)

    Constructors

    constructor +AnnotationList | manifesto.js

    Class AnnotationList

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isLoaded: boolean
    label: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isLoaded: boolean
    label: string

    Methods

    • 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 @@ -22,4 +22,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/AnnotationPage.html b/docs/classes/AnnotationPage.html index 6158b360..10eb1994 100644 --- a/docs/classes/AnnotationPage.html +++ b/docs/classes/AnnotationPage.html @@ -1,4 +1,4 @@ -AnnotationPage | manifesto.js

    Class AnnotationPage

    Hierarchy (view full)

    Constructors

    constructor +AnnotationPage | manifesto.js

    Class AnnotationPage

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • 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 @@ -35,4 +35,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Camera.html b/docs/classes/Camera.html index 75d559af..5f534a2c 100644 --- a/docs/classes/Camera.html +++ b/docs/classes/Camera.html @@ -5,7 +5,7 @@ a light, camera, or model, or a SpecificResource object wrapping a light, camera, or model. *

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    • get FieldOfView(): undefined | number
    • Full angular size of perspective viewport in vertical direction. +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    • get FieldOfView(): undefined | number
    • Full angular size of perspective viewport in vertical direction. Angular unit is degrees *

      -

      Returns undefined | number

    Methods

    • Returns undefined | number

      full angular size of perspective viewport in vertical direction. +

      Returns undefined | number

    Methods

    • Returns undefined | number

      full angular size of perspective viewport in vertical direction. Angular unit is degrees *

      -
    • Returns null | object | PointSelector

      : if not null, is either a PointSelector, or an object with an id matching the id of an Annotation instance.

      -
    • A function that wraps the getProperty function, which client +

    • 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 @@ -63,4 +63,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Canvas.html b/docs/classes/Canvas.html index 7c45de0d..5c50a94c 100644 --- a/docs/classes/Canvas.html +++ b/docs/classes/Canvas.html @@ -1,4 +1,4 @@ -Canvas | manifesto.js

    Class Canvas

    Hierarchy (view full)

    Constructors

    constructor +Canvas | manifesto.js

    Class Canvas

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number
    ranges: Range[]

    Accessors

    Methods

    • Parameters

      • Optional w: number

      Returns string

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number
    ranges: Range[]

    Accessors

    Methods

    • Parameters

      • Optional w: number

      Returns string

    • 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 @@ -58,8 +58,8 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ViewingHint

    • Returns null | ViewingHint

    • Returns the fragment placement values if a resourceAnnotation is placed on a canvas somewhere besides the full extent

      -

      Parameters

      • id: any

      Returns any

    • Returns a given resource Annotation, based on a contained resource or body +

      Parameters

      • id: any

      Returns any

    • Returns a given resource Annotation, based on a contained resource or body id

      -

      Parameters

      • id: any

      Returns any

    \ No newline at end of file +

    Parameters

    • id: any

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Collection.html b/docs/classes/Collection.html index 1322e9d2..19535cb2 100644 --- a/docs/classes/Collection.html +++ b/docs/classes/Collection.html @@ -1,4 +1,4 @@ -Collection | manifesto.js

    Class Collection

    Hierarchy (view full)

    Constructors

    constructor +Collection | manifesto.js

    Class Collection

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    _collections: null | Collection[] = null
    _manifests: null | Manifest[] = null
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = -1
    isLoaded: boolean = false
    items: IIIFResource[] = []
    parentCollection: Collection
    parentLabel: string

    Methods

    • Note: this only will return the first behavior as per the manifesto convention +

    Constructors

    Properties

    __jsonld: any
    _collections: null | Collection[] = null
    _manifests: null | Manifest[] = null
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = -1
    isLoaded: boolean = false
    items: IIIFResource[] = []
    parentCollection: Collection
    parentLabel: string

    Methods

    • Note: this only will return the first behavior as per the manifesto convention IIIF v3 supports multiple behaviors

      -

      Returns null | Behavior

    • A function that wraps the getProperty function, which client +

      Returns null | Behavior

    • 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 @@ -68,4 +68,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Color.html b/docs/classes/Color.html index d01d8671..750dba25 100644 --- a/docs/classes/Color.html +++ b/docs/classes/Color.html @@ -1,7 +1,7 @@ Color | manifesto.js

    class structure with red, green, blue values in 0-255 range Uses the color-string library for conversion from and to string representations of color.

    -

    Constructors

    Constructors

    Properties

    Accessors

    CSS blue @@ -9,11 +9,11 @@ red

    Methods

    Constructors

    • Parameters

      • rgbValue: number[]

        Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red

        -

      Returns Color

    Properties

    value: number[]

    Returns

    Array of 3 integers in range 0-255

    -

    Accessors

    • get CSS(): string
    • Returns string

      hex string (as for CSS ) representation of r,g,b components

      -
    • get blue(): number
    • Returns number

      0 to 255 value of blue color component

      -
    • get green(): number
    • Returns number

      0 to 255 value of green color component

      -
    • get red(): number
    • Returns number

      0 to 255 value of red color component

      -

    Methods

    • Parameters

      • cssTerm: string

        hex representtion of color as used in CSS. Ex "#FF0000" as red

        +

      Returns Color

    Properties

    value: number[]

    Returns

    Array of 3 integers in range 0-255

    +

    Accessors

    • get CSS(): string
    • Returns string

      hex string (as for CSS ) representation of r,g,b components

      +
    • get blue(): number
    • Returns number

      0 to 255 value of blue color component

      +
    • get green(): number
    • Returns number

      0 to 255 value of green color component

      +
    • get red(): number
    • Returns number

      0 to 255 value of red color component

      +

    Methods

    • Parameters

      • cssTerm: string

        hex representtion of color as used in CSS. Ex "#FF0000" as red

      Returns Color

      Color instance.

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/Deserialiser.html b/docs/classes/Deserialiser.html index 5c81e37c..52d059a8 100644 --- a/docs/classes/Deserialiser.html +++ b/docs/classes/Deserialiser.html @@ -1,4 +1,4 @@ -Deserialiser | manifesto.js

    Class Deserialiser

    Constructors

    constructor +Deserialiser | manifesto.js

    Class Deserialiser

    Constructors

    Methods

    \ No newline at end of file +

    Constructors

    Methods

    \ No newline at end of file diff --git a/docs/classes/Duration.html b/docs/classes/Duration.html index 6a14c199..02dccbcd 100644 --- a/docs/classes/Duration.html +++ b/docs/classes/Duration.html @@ -1,5 +1,5 @@ -Duration | manifesto.js

    Class Duration

    Constructors

    constructor +Duration | manifesto.js

    Class Duration

    Constructors

    Properties

    Methods

    Constructors

    Properties

    end: number
    start: number

    Methods

    \ No newline at end of file +

    Constructors

    Properties

    end: number
    start: number

    Methods

    \ No newline at end of file diff --git a/docs/classes/IIIFResource.html b/docs/classes/IIIFResource.html index f17d8b67..1b555a4e 100644 --- a/docs/classes/IIIFResource.html +++ b/docs/classes/IIIFResource.html @@ -1,4 +1,4 @@ -IIIFResource | manifesto.js

    Class IIIFResource

    Hierarchy (view full)

    Constructors

    constructor +IIIFResource | manifesto.js

    Class IIIFResource

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = -1
    isLoaded: boolean = false
    parentCollection: Collection
    parentLabel: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = -1
    isLoaded: boolean = false
    parentCollection: Collection
    parentLabel: string

    Methods

    • 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 @@ -50,4 +50,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/JSONLDResource.html b/docs/classes/JSONLDResource.html index 84659ee7..e730949b 100644 --- a/docs/classes/JSONLDResource.html +++ b/docs/classes/JSONLDResource.html @@ -1,10 +1,10 @@ -JSONLDResource | manifesto.js

    Class JSONLDResource

    Hierarchy (view full)

    Constructors

    constructor +JSONLDResource | manifesto.js

    Class JSONLDResource

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string

    Methods

    • 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 @@ -15,4 +15,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/LabelValuePair.html b/docs/classes/LabelValuePair.html index a23c25a4..996102e3 100644 --- a/docs/classes/LabelValuePair.html +++ b/docs/classes/LabelValuePair.html @@ -1,4 +1,4 @@ -LabelValuePair | manifesto.js

    Class LabelValuePair

    Constructors

    constructor +LabelValuePair | manifesto.js

    Class LabelValuePair

    Constructors

    Properties

    Constructors

    Properties

    defaultLocale: string
    label: null | PropertyValue
    resource: any
    value: null | PropertyValue

    Methods

    • Parameters

      • Optional locale: string | string[]

      Returns null | string

    • Parameters

      • Optional locale: string | string[]
      • joinWith: string = "<br/>"

      Returns null | string

    • Parameters

      • Optional locale: string | string[]

      Returns (null | string)[]

    \ No newline at end of file +

    Constructors

    Properties

    defaultLocale: string
    label: null | PropertyValue
    resource: any
    value: null | PropertyValue

    Methods

    • Parameters

      • Optional locale: string | string[]

      Returns null | string

    • Parameters

      • Optional locale: string | string[]
      • joinWith: string = "<br/>"

      Returns null | string

    • Parameters

      • Optional locale: string | string[]

      Returns (null | string)[]

    \ No newline at end of file diff --git a/docs/classes/LanguageMap.html b/docs/classes/LanguageMap.html index 11bcb41a..054016bf 100644 --- a/docs/classes/LanguageMap.html +++ b/docs/classes/LanguageMap.html @@ -1,5 +1,5 @@ LanguageMap | manifesto.js

    Class LanguageMap

    Deprecated

    Use PropertyValue instead

    -

    Hierarchy

    • Array<Language>
      • LanguageMap

    Constructors

    Hierarchy

    • Array<Language>
      • LanguageMap

    Constructors

    Properties

    [unscopables] length [species] @@ -196,7 +196,7 @@
  • mapfn: ((v, k) => U)

    A mapping function to call on every element of the array.

      • (v, k): U
      • Parameters

        • v: T
        • k: number

        Returns U

  • Optional thisArg: any

    Value of 'this' used to invoke the mapfn.

  • Returns U[]

    • Parameters

      Returns null | string

      Deprecated

      Use the PropertyValue#getValue instance method instead

      -
    • Parameters

      Returns (null | string)[]

      Deprecated

      Use the PropertyValue#getValues instance method instead

      -
    • Parameters

      • arg: any

      Returns arg is any[]

    • Parameters

      Returns (null | string)[]

      Deprecated

      Use the PropertyValue#getValues instance method instead

      +
    • Parameters

      • arg: any

      Returns arg is any[]

    • Returns a new array from a set of elements.

      Type Parameters

      • T

      Parameters

      • Rest ...items: T[]

        A set of elements to include in the new array object.

      Returns T[]

    \ No newline at end of file diff --git a/docs/classes/Light.html b/docs/classes/Light.html index 4df682ad..27dd901f 100644 --- a/docs/classes/Light.html +++ b/docs/classes/Light.html @@ -5,7 +5,7 @@ a light, camera, or model, or a SpecificResource object wrapping a light, camera, or model. *

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    • get Angle(): undefined | number
    • Returns undefined | number

    Methods

    • As defined in the temp-draft-4.md ( +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = true
    isCamera: boolean = false
    isLight: boolean = false
    isModel: boolean = true
    isSpecificResource: boolean = false

    Accessors

    • get Angle(): undefined | number
    • Returns undefined | number

    Methods

    • 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 @@ -59,7 +59,7 @@

      provisional decision is to return undefined in case that this property is accessed in a light that is not a spotlight

      Returns undefined | number

      number

      -
    • The implementation of the intensity is based on +

    • The implementation of the intensity is based on temp-draft-4.md and the example 3D manifests lights @@ -69,9 +69,9 @@ 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

      -

      Returns number

    • Returns null | object | PointSelector

      : if not null, is either a PointSelector, or an object with an id matching the id of an Annotation instance.

      -
    • A function that wraps the getProperty function, which client +

    • 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 @@ -82,4 +82,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/LocalizedValue.html b/docs/classes/LocalizedValue.html index adf29193..3c0e941a 100644 --- a/docs/classes/LocalizedValue.html +++ b/docs/classes/LocalizedValue.html @@ -1,5 +1,5 @@ LocalizedValue | manifesto.js

    Class LocalizedValue

    Utility class to hold one or more values with their associated (optional) locale

    -

    Implements

    • default

    Constructors

    Implements

    • default

    Constructors

    Properties

    _defaultLocale _locale? _value @@ -7,15 +7,15 @@ value

    Methods

    Constructors

    Properties

    _defaultLocale: string
    _locale?: string
    _value: string | string[]

    Accessors

    • get locale(): string
      • +

    Constructors

    Properties

    _defaultLocale: string
    _locale?: string
    _value: string | string[]

    Accessors

    • get locale(): string

      Returns string

      Deprecated

      Don't use, only used for backwards compatibility reasons

      -
    • get value(): string

      Returns string

      Deprecated

      Use PropertyValue#getValue instead

      -

    Methods

    Methods

    • Parse a localized value from a IIIF v2 property value

      Parameters

      • rawVal: any

        value from IIIF resource

      • Optional defaultLocale: string

        deprecated: defaultLocale the default locale to use for this value

        -

      Returns null | LocalizedValue

    \ No newline at end of file +

    Returns null | LocalizedValue

    \ No newline at end of file diff --git a/docs/classes/Manifest.html b/docs/classes/Manifest.html index 442f5e71..15d843e0 100644 --- a/docs/classes/Manifest.html +++ b/docs/classes/Manifest.html @@ -3,7 +3,7 @@

    See

    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);
    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld _allRanges _annotationIdMap @@ -67,7 +67,7 @@

    Example

    varisScene
     isSequence
     load
    -

    Constructors

    Properties

    __jsonld: any
    _allRanges: null | Range[] = null
    _annotationIdMap: any
    _topRanges: Range[] = []
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = 0
    isLoaded: boolean = false
    items: Sequence[] = []
    parentCollection: Collection
    parentLabel: string

    Accessors

    • get annotationIdMap(): Object
    • Developer Note: The concept of the "id map" appear in the +

    Constructors

    Properties

    __jsonld: any
    _allRanges: null | Range[] = null
    _annotationIdMap: any
    _topRanges: Range[] = []
    context: string
    defaultTree: TreeNode
    externalResource: IExternalResource
    id: string
    index: number = 0
    isLoaded: boolean = false
    items: Sequence[] = []
    parentCollection: Collection
    parentLabel: string

    Accessors

    • get annotationIdMap(): Object
    • 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

      @@ -75,8 +75,8 @@

      Example

      var
       

      THe annotationIdMap is a Javascript object whose property names are IRI (id values) and property values are instances of the Annotation class

      -

      Returns Object

    Methods

    • Parameters

      • r: any
      • path: string
      • Optional parentRange: Range

      Returns void

    • A function that wraps the getProperty function, which client +

      Returns Object

    Methods

    • Parameters

      • r: any
      • path: string
      • Optional parentRange: Range

      Returns void

    • 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 @@ -87,5 +87,5 @@

      Example

      var
       
    -

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    \ No newline at end of file diff --git a/docs/classes/ManifestResource.html b/docs/classes/ManifestResource.html index c8c5369e..f2420cac 100644 --- a/docs/classes/ManifestResource.html +++ b/docs/classes/ManifestResource.html @@ -1,4 +1,4 @@ -ManifestResource | manifesto.js

    Class ManifestResource

    Hierarchy (view full)

    Constructors

    constructor +ManifestResource | manifesto.js

    Class ManifestResource

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • 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 @@ -34,4 +34,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/PointSelector.html b/docs/classes/PointSelector.html index cc760bdc..f175de02 100644 --- a/docs/classes/PointSelector.html +++ b/docs/classes/PointSelector.html @@ -1,12 +1,17 @@ -PointSelector | manifesto.js

    Class PointSelector

    Hierarchy (view full)

    Constructors

    constructor +PointSelector | manifesto.js

    Class PointSelector

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isPointSelector: boolean = true

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isPointSelector: boolean = true

    Accessors

    • get Location(): Vector3
    • Returns Vector3

      the 3D coordinates of the point as a Vector3 instance. +*

      +

    Methods

    • Returns Vector3

      the 3D coordinates of the point as a Vector3 instance. +*

      +
    • 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 @@ -17,4 +22,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/PropertyValue.html b/docs/classes/PropertyValue.html index c7fd0a8c..574343e3 100644 --- a/docs/classes/PropertyValue.html +++ b/docs/classes/PropertyValue.html @@ -1,7 +1,7 @@ PropertyValue | manifesto.js

    Class PropertyValue

    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

    -

    Hierarchy

    Constructors

    Hierarchy

    Constructors

    Properties

    Constructors

    Properties

    [unscopables]: {
        [unscopables]?: boolean;
        length?: boolean;
        [iterator]?: any;
        at?: any;
        concat?: any;
        copyWithin?: any;
        entries?: any;
        every?: any;
        fill?: any;
        filter?: any;
        find?: any;
        findIndex?: any;
        flat?: any;
        flatMap?: any;
        forEach?: any;
        includes?: any;
        indexOf?: any;
        join?: any;
        keys?: any;
        lastIndexOf?: any;
        map?: any;
        pop?: any;
        push?: any;
        reduce?: any;
        reduceRight?: any;
        reverse?: any;
        shift?: any;
        slice?: any;
        some?: any;
        sort?: any;
        splice?: any;
        toLocaleString?: any;
        toString?: any;
        unshift?: any;
        values?: any;
    }

    Is an object whose properties have the value 'true' +

    Constructors

    Properties

    [unscopables]: {
        [unscopables]?: boolean;
        length?: boolean;
        [iterator]?: any;
        at?: any;
        concat?: any;
        copyWithin?: any;
        entries?: any;
        every?: any;
        fill?: any;
        filter?: any;
        find?: any;
        findIndex?: any;
        flat?: any;
        flatMap?: any;
        forEach?: any;
        includes?: any;
        indexOf?: any;
        join?: any;
        keys?: any;
        lastIndexOf?: any;
        map?: any;
        pop?: any;
        push?: any;
        reduce?: any;
        reduceRight?: any;
        reverse?: any;
        shift?: any;
        slice?: any;
        some?: any;
        sort?: any;
        splice?: any;
        toLocaleString?: any;
        toString?: any;
        unshift?: any;
        values?: any;
    }

    Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

    Type declaration

    • Optional Readonly [unscopables]?: boolean

      Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

    • Optional length?: boolean

      Gets or sets the length of the array. This is a number one higher than the highest index in the array.

      -
    _defaultLocale?: string
    length: number

    Gets or sets the length of the array. This is a number one higher than the highest index in the array.

    +
    _defaultLocale?: string
    length: number

    Gets or sets the length of the array. This is a number one higher than the highest index in the array.

    [species]: ArrayConstructor

    Methods

    • Iterator

      Returns IterableIterator<LocalizedValue>

    • Takes an integer value and returns the item at that index, allowing for positive and negative integers. @@ -125,17 +125,17 @@

    Returns void

      • Try to find the available locale that best fit's the user's preferences.
      -

      Parameters

      • locales: string[]

      Returns undefined | string

    • Get a value in the most suitable locale.

      +

      Parameters

      • locales: string[]

      Returns undefined | string

    • Get a value in the most suitable locale.

      Parameters

      • Optional locales: string | string[]

        Desired locale, can be a list of locales sorted by descending priority.

      • Optional joinWith: string

        String to join multiple available values by, if undefined only the first available value will be returned

      Returns null | string

      the first value in the most suitable locale or null if none could be found

      -
    • Get all values available in the most suitable locale.

      +
    • Get all values available in the most suitable locale.

      Parameters

      • Optional userLocales: string | string[]

        Desired locale, can be a list of locales sorted by descending priority.

      Returns string[]

      the values for the most suitable locale, empty if none could be found

      -
    • Determines whether an array includes a certain element, returning true or false as appropriate.

      +
    • Determines whether an array includes a certain element, returning true or false as appropriate.

      Parameters

      • searchElement: LocalizedValue

        The element to search for.

      • Optional fromIndex: number

        The position in this array at which to begin searching for searchElement.

      Returns boolean

    • Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

      @@ -170,7 +170,7 @@

      If there's an existing locale that matches the given locale, it will be updated.

      Parameters

      • value: string | string[]

        value to set

      • Optional locale: string

        Locale to set the value for

        -

      Returns void

    • Removes the first element from an array and returns it. +

    Returns void

    • Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

      Returns undefined | LocalizedValue

    • Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. @@ -220,4 +220,4 @@

        • (v, k): U
        • Parameters

          • v: T
          • k: number

          Returns U

    • Optional thisArg: any

      Value of 'this' used to invoke the mapfn.

    Returns U[]

    • Parameters

      • arg: any

      Returns arg is any[]

    • Returns a new array from a set of elements.

      Type Parameters

      • T

      Parameters

      • Rest ...items: T[]

        A set of elements to include in the new array object.

        -

      Returns T[]

    \ No newline at end of file +

    Returns T[]

    \ No newline at end of file diff --git a/docs/classes/Range.html b/docs/classes/Range.html index e4552fb8..d7687dd2 100644 --- a/docs/classes/Range.html +++ b/docs/classes/Range.html @@ -1,4 +1,4 @@ -Range | manifesto.js

    Hierarchy (view full)

    Constructors

    constructor +Range | manifesto.js

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    _ranges: null | Range[] = null
    canvases: null | string[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: ManifestResource[] = []
    parentRange: undefined | Range
    path: string
    treeNode: TreeNode

    Methods

    • Returns null | Behavior

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    _ranges: null | Range[] = null
    canvases: null | string[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: ManifestResource[] = []
    parentRange: undefined | Range
    path: string
    treeNode: TreeNode

    Methods

    • Returns null | Behavior

    • 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 @@ -49,4 +49,4 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ViewingDirection

    • Returns null | ViewingHint

    • Parameters

      • time: number

      Returns boolean

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    • Returns null | ViewingHint

    • Parameters

      • time: number

      Returns boolean

    \ No newline at end of file diff --git a/docs/classes/Rendering.html b/docs/classes/Rendering.html index 44fe16ac..55161ccb 100644 --- a/docs/classes/Rendering.html +++ b/docs/classes/Rendering.html @@ -1,4 +1,4 @@ -Rendering | manifesto.js

    Class Rendering

    Hierarchy (view full)

    Constructors

    constructor +Rendering | manifesto.js

    Class Rendering

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • 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 @@ -35,4 +35,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Resource.html b/docs/classes/Resource.html index 2e20069f..b20abbec 100644 --- a/docs/classes/Resource.html +++ b/docs/classes/Resource.html @@ -1,4 +1,4 @@ -Resource | manifesto.js

    Class Resource

    Hierarchy (view full)

    Constructors

    constructor +Resource | manifesto.js

    Class Resource

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • 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 @@ -42,4 +42,4 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ExternalResourceType

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ExternalResourceType

    \ No newline at end of file diff --git a/docs/classes/RotateTransform.html b/docs/classes/RotateTransform.html index e250accd..a1418232 100644 --- a/docs/classes/RotateTransform.html +++ b/docs/classes/RotateTransform.html @@ -1,4 +1,4 @@ -RotateTransform | manifesto.js

    Class RotateTransform

    Hierarchy (view full)

    Constructors

    constructor +RotateTransform | manifesto.js

    Class RotateTransform

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -9,7 +9,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -20,4 +20,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/ScaleTransform.html b/docs/classes/ScaleTransform.html index 79196904..dc5e005e 100644 --- a/docs/classes/ScaleTransform.html +++ b/docs/classes/ScaleTransform.html @@ -1,4 +1,4 @@ -ScaleTransform | manifesto.js

    Class ScaleTransform

    Hierarchy (view full)

    Constructors

    constructor +ScaleTransform | manifesto.js

    Class ScaleTransform

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -9,7 +9,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -20,4 +20,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Scene.html b/docs/classes/Scene.html index 07e641c2..72884815 100644 --- a/docs/classes/Scene.html +++ b/docs/classes/Scene.html @@ -1,4 +1,4 @@ -Scene | manifesto.js

    Hierarchy (view full)

    Constructors

    constructor +Scene | manifesto.js

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Accessors

    Methods

    • 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 @@ -38,4 +38,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Sequence.html b/docs/classes/Sequence.html index dbed6ab2..5add96df 100644 --- a/docs/classes/Sequence.html +++ b/docs/classes/Sequence.html @@ -1,4 +1,4 @@ -Sequence | manifesto.js

    Class Sequence

    Hierarchy (view full)

    Constructors

    constructor +Sequence | manifesto.js

    Class Sequence

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    _thumbnails: null | Thumbnail[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: Canvas[] = []

    Methods

    • Parameters

      • canvasIndex: number

      Returns any

    • Parameters

      • id: string

      Returns null | number

    • Parameters

      • label: string
      • Optional foliated: boolean

      Returns number

    • Parameters

      • Optional alphanumeric: boolean

      Returns string

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number[]

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    _thumbnails: null | Thumbnail[] = null
    context: string
    externalResource: IExternalResource
    id: string
    items: Canvas[] = []

    Methods

    • Parameters

      • canvasIndex: number

      Returns any

    • Parameters

      • id: string

      Returns null | number

    • Parameters

      • label: string
      • Optional foliated: boolean

      Returns number

    • Parameters

      • Optional alphanumeric: boolean

      Returns string

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number[]

    • Parameters

      • canvasIndex: number
      • Optional pagingEnabled: boolean

      Returns number

    • 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 @@ -60,5 +60,5 @@

      -

      Parameters

      • name: string

      Returns any

    • Returns null | ViewingDirection

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    • Returns null | ViewingDirection

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    • Parameters

      • canvasIndex: number

      Returns boolean

    \ No newline at end of file diff --git a/docs/classes/Service.html b/docs/classes/Service.html index 6f25f05a..09dfe9ae 100644 --- a/docs/classes/Service.html +++ b/docs/classes/Service.html @@ -1,4 +1,4 @@ -Service | manifesto.js

    Class Service

    Hierarchy (view full)

    Constructors

    constructor +Service | manifesto.js

    Class Service

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • Returns null | string

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string

    Methods

    • Returns null | string

    • 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 @@ -42,4 +42,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Size.html b/docs/classes/Size.html index 622bf6ab..7c3318dc 100644 --- a/docs/classes/Size.html +++ b/docs/classes/Size.html @@ -1,4 +1,4 @@ -Size | manifesto.js

    Constructors

    constructor +Size | manifesto.js

    Constructors

    Properties

    Constructors

    Properties

    height: number
    width: number
    \ No newline at end of file +

    Constructors

    Properties

    height: number
    width: number
    \ No newline at end of file diff --git a/docs/classes/SpecificResource.html b/docs/classes/SpecificResource.html index ad660404..b9fb35da 100644 --- a/docs/classes/SpecificResource.html +++ b/docs/classes/SpecificResource.html @@ -4,7 +4,7 @@ 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.

    -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = false
    isSpecificResource: boolean = true

    Accessors

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    isAnnotationBody: boolean = false
    isSpecificResource: boolean = true

    Accessors

    Methods

    • 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 @@ -47,4 +48,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Thumb.html b/docs/classes/Thumb.html index 34549dc3..644e2c87 100644 --- a/docs/classes/Thumb.html +++ b/docs/classes/Thumb.html @@ -1,4 +1,4 @@ -Thumb | manifesto.js

    Constructors

    constructor +Thumb | manifesto.js

    Constructors

    Properties

    Constructors

    Properties

    data: any
    height: number
    index: number
    label: string
    uri: string
    viewingHint: null | ViewingHint
    visible: boolean
    width: number
    \ No newline at end of file +

    Constructors

    Properties

    data: any
    height: number
    index: number
    label: string
    uri: string
    viewingHint: null | ViewingHint
    visible: boolean
    width: number
    \ No newline at end of file diff --git a/docs/classes/Thumbnail.html b/docs/classes/Thumbnail.html index 14f4befb..c21046ac 100644 --- a/docs/classes/Thumbnail.html +++ b/docs/classes/Thumbnail.html @@ -1,4 +1,4 @@ -Thumbnail | manifesto.js

    Class Thumbnail

    Hierarchy (view full)

    Constructors

    constructor +Thumbnail | manifesto.js

    Class Thumbnail

    Hierarchy (view full)

    Constructors

    Properties

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    externalResource: IExternalResource
    id: string
    index: number

    Methods

    • 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 @@ -42,4 +42,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/Transform.html b/docs/classes/Transform.html index 9a549ce7..0cf92c4b 100644 --- a/docs/classes/Transform.html +++ b/docs/classes/Transform.html @@ -1,4 +1,4 @@ -Transform | manifesto.js

    Class TransformAbstract

    Hierarchy (view full)

    Constructors

    constructor +Transform | manifesto.js

    Class TransformAbstract

    Hierarchy (view full)

    Constructors

    Properties

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -19,4 +19,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/TransformParser.html b/docs/classes/TransformParser.html index 4170bb0b..f267aff8 100644 --- a/docs/classes/TransformParser.html +++ b/docs/classes/TransformParser.html @@ -1,3 +1,3 @@ -TransformParser | manifesto.js

    Class TransformParser

    Constructors

    constructor +TransformParser | manifesto.js

    Class TransformParser

    Constructors

    Methods

    Constructors

    Methods

    \ No newline at end of file +

    Constructors

    Methods

    \ No newline at end of file diff --git a/docs/classes/TranslateTransform.html b/docs/classes/TranslateTransform.html index ff6efd88..4c9a80cd 100644 --- a/docs/classes/TranslateTransform.html +++ b/docs/classes/TranslateTransform.html @@ -1,4 +1,4 @@ -TranslateTransform | manifesto.js

    Class TranslateTransform

    Hierarchy (view full)

    Constructors

    constructor +TranslateTransform | manifesto.js

    Class TranslateTransform

    Hierarchy (view full)

    Constructors

    Properties

    __jsonld context id @@ -9,7 +9,7 @@

    Methods

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • A function that wraps the getProperty function, which client +

    Constructors

    Properties

    __jsonld: any
    context: string
    id: string
    isRotateTransform: undefined | boolean
    isScaleTransform: undefined | boolean
    isTransform: boolean = true
    isTranslateTransform: undefined | boolean

    Methods

    • 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 @@ -20,4 +20,4 @@

      -

      Parameters

      • name: string

      Returns any

    \ No newline at end of file +

    Parameters

    • name: string

    Returns any

    \ No newline at end of file diff --git a/docs/classes/TreeNode.html b/docs/classes/TreeNode.html index 74138981..e9a2f0a1 100644 --- a/docs/classes/TreeNode.html +++ b/docs/classes/TreeNode.html @@ -1,4 +1,4 @@ -TreeNode | manifesto.js

    Class TreeNode

    Constructors

    constructor +TreeNode | manifesto.js

    Class TreeNode

    Constructors

    Properties

    Constructors

    Properties

    data: any
    expanded: boolean
    id: string
    label: string
    navDate: Date
    nodes: TreeNode[]
    parentNode: TreeNode
    selected: boolean

    Methods

    \ No newline at end of file +

    Constructors

    Properties

    data: any
    expanded: boolean
    id: string
    label: string
    navDate: Date
    nodes: TreeNode[]
    parentNode: TreeNode
    selected: boolean

    Methods

    \ No newline at end of file diff --git a/docs/classes/Utils.html b/docs/classes/Utils.html index bafbe5cc..27422b57 100644 --- a/docs/classes/Utils.html +++ b/docs/classes/Utils.html @@ -1,4 +1,4 @@ -Utils | manifesto.js

    Constructors

    constructor +Utils | manifesto.js

    Constructors

    Methods

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)

      Returns Promise<IExternalResource>

    • Parameters

      • response: any

      Returns any

    • Parameters

      • message: string

      Returns Error

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<void | IExternalResource>

    • Parameters

      Returns void

    • Parameters

      • profile: ServiceProfile

      Returns string

    • Parameters

      • locale: string

      Returns string

    • Parameters

      • resource: any
      • locale: string

      Returns null | string

    • Parameters

      • type: string

      Returns MediaType

    • Parameters

      • resource: any
      • __namedParameters: {
            onlyService?: boolean;
            onlyServices?: boolean;
            skipParentResources?: boolean;
        } = {}
        • Optional onlyService?: boolean
        • Optional onlyServices?: boolean
        • Optional skipParentResources?: boolean

      Returns Service[]

    • Parameters

      • target: string

      Returns null | number[]

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • type: null | string

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource>

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<void>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource>

    • Parameters

      • resources: IExternalResource[]
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource[]>

    • Parameters

      • resources: IExternalResource[]
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource[]>

    • Parameters

      • url: string

      Returns Promise<any>

    • Parameters

      • type: string

      Returns string

    • Parameters

      • url: string

      Returns string

    • Parameters

      • url1: string
      • url2: string

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: any
      • clickThrough: any
      • restricted: any
      • login: any
      • getAccessToken: any
      • storeAccessToken: any
      • resolve: any
      • reject: any

      Returns void

    • Does a depth first traversal of an Object, returning an Object that +

    Constructors

    Methods

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)

      Returns Promise<IExternalResource>

    • Parameters

      • response: any

      Returns any

    • Parameters

      • message: string

      Returns Error

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<void | IExternalResource>

    • Parameters

      Returns void

    • Parameters

      • profile: ServiceProfile

      Returns string

    • Parameters

      • locale: string

      Returns string

    • Parameters

      • resource: any
      • locale: string

      Returns null | string

    • Parameters

      • type: string

      Returns MediaType

    • Parameters

      • resource: any
      • __namedParameters: {
            onlyService?: boolean;
            onlyServices?: boolean;
            skipParentResources?: boolean;
        } = {}
        • Optional onlyService?: boolean
        • Optional onlyServices?: boolean
        • Optional skipParentResources?: boolean

      Returns Service[]

    • Parameters

      • target: string

      Returns null | number[]

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • type: null | string

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • profile: ServiceProfile

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource>

    • Parameters

      • resource: IExternalResource
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<void>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource>

    • Parameters

      • resources: IExternalResource[]
      • tokenStorageStrategy: string
      • clickThrough: ((resource) => Promise<any>)
      • restricted: ((resource) => Promise<any>)
      • login: ((resource) => Promise<any>)
      • getAccessToken: ((resource, rejectOnError) => Promise<IAccessToken>)
      • storeAccessToken: ((resource, token, tokenStorageStrategy) => Promise<any>)
          • (resource, token, tokenStorageStrategy): Promise<any>
          • Parameters

            Returns Promise<any>

      • getStoredAccessToken: ((resource, tokenStorageStrategy) => Promise<IAccessToken>)
      • handleResourceResponse: ((resource) => Promise<any>)
      • Optional options: IManifestoOptions

      Returns Promise<IExternalResource[]>

    • Parameters

      • resources: IExternalResource[]
      • openContentProviderInteraction: ((service) => any)
          • (service): any
          • Parameters

            Returns any

      • openTokenService: ((resource, tokenService) => Promise<any>)
      • getStoredAccessToken: ((resource) => Promise<null | IAccessToken>)
      • userInteractedWithContentProvider: ((contentProviderInteraction) => Promise<any>)
          • (contentProviderInteraction): Promise<any>
          • Parameters

            • contentProviderInteraction: any

            Returns Promise<any>

      • getContentProviderInteraction: ((resource, service) => Promise<any>)
      • handleMovedTemporarily: ((resource) => Promise<any>)
      • showOutOfOptionsMessages: ((resource, service) => void)

      Returns Promise<IExternalResource[]>

    • Parameters

      • url: string

      Returns Promise<any>

    • Parameters

      • type: string

      Returns string

    • Parameters

      • url: string

      Returns string

    • Parameters

      • url1: string
      • url2: string

      Returns boolean

    • Parameters

      • resource: IExternalResource
      • tokenStorageStrategy: any
      • clickThrough: any
      • restricted: any
      • login: any
      • getAccessToken: any
      • storeAccessToken: any
      • resolve: any
      • reject: any

      Returns void

    • Does a depth first traversal of an Object, returning an Object that matches provided k and v arguments

      Parameters

      • object: any
      • k: string
      • v: string

      Returns undefined | object

      Example

      Utils.traverseAndFind({foo: 'bar'}, 'foo', 'bar')
       
      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/enums/ManifestType.html b/docs/enums/ManifestType.html index b306e22a..7fefa8ab 100644 --- a/docs/enums/ManifestType.html +++ b/docs/enums/ManifestType.html @@ -1,4 +1,4 @@ -ManifestType | manifesto.js

    Enumeration ManifestType

    Enumeration Members

    EMPTY +ManifestType | manifesto.js

    Enumeration ManifestType

    Enumeration Members

    Enumeration Members

    EMPTY: ""
    MANUSCRIPT: "manuscript"
    MONOGRAPH: "monograph"
    \ No newline at end of file +

    Enumeration Members

    EMPTY: ""
    MANUSCRIPT: "manuscript"
    MONOGRAPH: "monograph"
    \ No newline at end of file diff --git a/docs/enums/StatusCode.html b/docs/enums/StatusCode.html index 8ae0e8a3..4f800954 100644 --- a/docs/enums/StatusCode.html +++ b/docs/enums/StatusCode.html @@ -1,5 +1,5 @@ -StatusCode | manifesto.js

    Enumeration StatusCode

    Enumeration Members

    AUTHORIZATION_FAILED +StatusCode | manifesto.js

    Enumeration StatusCode

    Enumeration Members

    AUTHORIZATION_FAILED: 1
    FORBIDDEN: 2
    INTERNAL_SERVER_ERROR: 3
    RESTRICTED: 4
    \ No newline at end of file +

    Enumeration Members

    AUTHORIZATION_FAILED: 1
    FORBIDDEN: 2
    INTERNAL_SERVER_ERROR: 3
    RESTRICTED: 4
    \ No newline at end of file diff --git a/docs/enums/TreeNodeType.html b/docs/enums/TreeNodeType.html index 02ab4202..165395bc 100644 --- a/docs/enums/TreeNodeType.html +++ b/docs/enums/TreeNodeType.html @@ -1,4 +1,4 @@ -TreeNodeType | manifesto.js

    Enumeration TreeNodeType

    Enumeration Members

    COLLECTION +TreeNodeType | manifesto.js

    Enumeration TreeNodeType

    Enumeration Members

    Enumeration Members

    COLLECTION: "collection"
    MANIFEST: "manifest"
    RANGE: "range"
    \ No newline at end of file +

    Enumeration Members

    COLLECTION: "collection"
    MANIFEST: "manifest"
    RANGE: "range"
    \ No newline at end of file diff --git a/docs/functions/cameraRelativeRotation.html b/docs/functions/cameraRelativeRotation.html index 13fc1ad2..f0822f44 100644 --- a/docs/functions/cameraRelativeRotation.html +++ b/docs/functions/cameraRelativeRotation.html @@ -12,4 +12,4 @@

    Parameters

    • direction: Vector3

      A vector interpreted as a direction. Client code responsible for not passing a 0-length vector, else a

    Returns Euler

    threejs-math.EulerAngle instance

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/functions/lightRelativeRotation.html b/docs/functions/lightRelativeRotation.html index c82899d5..9bf2e6a9 100644 --- a/docs/functions/lightRelativeRotation.html +++ b/docs/functions/lightRelativeRotation.html @@ -1 +1 @@ -lightRelativeRotation | manifesto.js

    Function lightRelativeRotation

    • Parameters

      • direction: Vector3

      Returns Euler

    \ No newline at end of file +lightRelativeRotation | manifesto.js

    Function lightRelativeRotation

    • Parameters

      • direction: Vector3

      Returns Euler

    \ No newline at end of file diff --git a/docs/functions/loadManifest.html b/docs/functions/loadManifest.html index bfd25f9a..6faeeb0f 100644 --- a/docs/functions/loadManifest.html +++ b/docs/functions/loadManifest.html @@ -3,4 +3,4 @@

    Parameters

    • url: string

      string containing the URL to Fetch

    Returns Promise<any>

    Promise The object returned through the Promise is the javascript object obtained by deserializing the json text. *

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/functions/parseManifest.html b/docs/functions/parseManifest.html index 7194ac32..95b21d5a 100644 --- a/docs/functions/parseManifest.html +++ b/docs/functions/parseManifest.html @@ -2,4 +2,4 @@

    Parameters

    • manifest: any

      Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file.

    • Optional options: IManifestoOptions

    Returns null | IIIFResource

    instance of Manifest class. *

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/IAccessToken.html b/docs/interfaces/IAccessToken.html index f8c35aab..4675a8a7 100644 --- a/docs/interfaces/IAccessToken.html +++ b/docs/interfaces/IAccessToken.html @@ -1,6 +1,6 @@ -IAccessToken | manifesto.js

    Interface IAccessToken

    interface IAccessToken {
        accessToken: string;
        error: string;
        errorDescription: string;
        expiresIn: number;
        tokenType: string;
    }

    Properties

    accessToken +IAccessToken | manifesto.js

    Interface IAccessToken

    interface IAccessToken {
        accessToken: string;
        error: string;
        errorDescription: string;
        expiresIn: number;
        tokenType: string;
    }

    Properties

    accessToken: string
    error: string
    errorDescription: string
    expiresIn: number
    tokenType: string
    \ No newline at end of file +

    Properties

    accessToken: string
    error: string
    errorDescription: string
    expiresIn: number
    tokenType: string
    \ No newline at end of file diff --git a/docs/interfaces/IExternalImageResourceData.html b/docs/interfaces/IExternalImageResourceData.html index 6e100c32..9e144085 100644 --- a/docs/interfaces/IExternalImageResourceData.html +++ b/docs/interfaces/IExternalImageResourceData.html @@ -1,8 +1,8 @@ -IExternalImageResourceData | manifesto.js

    Interface IExternalImageResourceData

    interface IExternalImageResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        height: number;
        id: string;
        index: number;
        profile: string | any[];
        width: number;
    }

    Hierarchy (view full)

    Properties

    contentLocation +IExternalImageResourceData | manifesto.js

    Interface IExternalImageResourceData

    interface IExternalImageResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        height: number;
        id: string;
        index: number;
        profile: string | any[];
        width: number;
    }

    Hierarchy (view full)

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    height: number
    id: string
    index: number
    profile: string | any[]
    width: number
    \ No newline at end of file +

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    height: number
    id: string
    index: number
    profile: string | any[]
    width: number
    \ No newline at end of file diff --git a/docs/interfaces/IExternalResource.html b/docs/interfaces/IExternalResource.html index d6bbc3f0..20d08e6a 100644 --- a/docs/interfaces/IExternalResource.html +++ b/docs/interfaces/IExternalResource.html @@ -1,4 +1,4 @@ -IExternalResource | manifesto.js

    Interface IExternalResource

    interface IExternalResource {
        authAPIVersion: number;
        authHoldingPage: any;
        clickThroughService: null | Service;
        data: IExternalResourceData;
        dataUri: null | string;
        error: any;
        externalService: null | Service;
        height: number;
        index: number;
        isResponseHandled: boolean;
        kioskService: null | Service;
        loginService: null | Service;
        logoutService: null | Service;
        options?: IManifestoOptions;
        restrictedService: null | Service;
        status: number;
        tokenService: null | Service;
        width: number;
        getData(accessToken?): Promise<IExternalResource>;
        hasServiceDescriptor(): boolean;
        isAccessControlled(): boolean;
    }

    Properties

    authAPIVersion +IExternalResource | manifesto.js

    Interface IExternalResource

    interface IExternalResource {
        authAPIVersion: number;
        authHoldingPage: any;
        clickThroughService: null | Service;
        data: IExternalResourceData;
        dataUri: null | string;
        error: any;
        externalService: null | Service;
        height: number;
        index: number;
        isResponseHandled: boolean;
        kioskService: null | Service;
        loginService: null | Service;
        logoutService: null | Service;
        options?: IManifestoOptions;
        restrictedService: null | Service;
        status: number;
        tokenService: null | Service;
        width: number;
        getData(accessToken?): Promise<IExternalResource>;
        hasServiceDescriptor(): boolean;
        isAccessControlled(): boolean;
    }

    Properties

    authAPIVersion: number
    authHoldingPage: any
    clickThroughService: null | Service
    dataUri: null | string
    error: any
    externalService: null | Service
    height: number
    index: number
    isResponseHandled: boolean
    kioskService: null | Service
    loginService: null | Service
    logoutService: null | Service
    restrictedService: null | Service
    status: number
    tokenService: null | Service
    width: number

    Methods

    \ No newline at end of file +

    Properties

    authAPIVersion: number
    authHoldingPage: any
    clickThroughService: null | Service
    dataUri: null | string
    error: any
    externalService: null | Service
    height: number
    index: number
    isResponseHandled: boolean
    kioskService: null | Service
    loginService: null | Service
    logoutService: null | Service
    restrictedService: null | Service
    status: number
    tokenService: null | Service
    width: number

    Methods

    \ No newline at end of file diff --git a/docs/interfaces/IExternalResourceData.html b/docs/interfaces/IExternalResourceData.html index c885c0fa..dd71bb7d 100644 --- a/docs/interfaces/IExternalResourceData.html +++ b/docs/interfaces/IExternalResourceData.html @@ -1,6 +1,6 @@ -IExternalResourceData | manifesto.js

    Interface IExternalResourceData

    interface IExternalResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        id: string;
        index: number;
        profile: string | any[];
    }

    Hierarchy (view full)

    Properties

    contentLocation +IExternalResourceData | manifesto.js

    Interface IExternalResourceData

    interface IExternalResourceData {
        contentLocation: string;
        hasServiceDescriptor: boolean;
        id: string;
        index: number;
        profile: string | any[];
    }

    Hierarchy (view full)

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    id: string
    index: number
    profile: string | any[]
    \ No newline at end of file +

    Properties

    contentLocation: string
    hasServiceDescriptor: boolean
    id: string
    index: number
    profile: string | any[]
    \ No newline at end of file diff --git a/docs/interfaces/IExternalResourceOptions.html b/docs/interfaces/IExternalResourceOptions.html index d88022e0..f80c1a20 100644 --- a/docs/interfaces/IExternalResourceOptions.html +++ b/docs/interfaces/IExternalResourceOptions.html @@ -1,2 +1,2 @@ -IExternalResourceOptions | manifesto.js

    Interface IExternalResourceOptions

    interface IExternalResourceOptions {
        authApiVersion: number;
    }

    Properties

    Properties

    authApiVersion: number
    \ No newline at end of file +IExternalResourceOptions | manifesto.js

    Interface IExternalResourceOptions

    interface IExternalResourceOptions {
        authApiVersion: number;
    }

    Properties

    Properties

    authApiVersion: number
    \ No newline at end of file diff --git a/docs/interfaces/IManifestoOptions.html b/docs/interfaces/IManifestoOptions.html index 4c899968..2f059684 100644 --- a/docs/interfaces/IManifestoOptions.html +++ b/docs/interfaces/IManifestoOptions.html @@ -1,7 +1,7 @@ -IManifestoOptions | manifesto.js

    Interface IManifestoOptions

    interface IManifestoOptions {
        defaultLabel: string;
        index?: number;
        locale: string;
        navDate?: Date;
        pessimisticAccessControl: boolean;
        resource: IIIFResource;
    }

    Properties

    defaultLabel +IManifestoOptions | manifesto.js

    Interface IManifestoOptions

    interface IManifestoOptions {
        defaultLabel: string;
        index?: number;
        locale: string;
        navDate?: Date;
        pessimisticAccessControl: boolean;
        resource: IIIFResource;
    }

    Properties

    defaultLabel: string
    index?: number
    locale: string
    navDate?: Date
    pessimisticAccessControl: boolean
    resource: IIIFResource
    \ No newline at end of file +

    Properties

    defaultLabel: string
    index?: number
    locale: string
    navDate?: Date
    pessimisticAccessControl: boolean
    resource: IIIFResource
    \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4d20ceb8..9dcbe300 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "manifesto.js", - "version": "4.3.0-draft3dapi.0.4.0", + "version": "4.3.0-draft3dapi.0.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "manifesto.js", - "version": "4.3.0-draft3dapi.0.4.0", + "version": "4.3.0-draft3dapi.0.5.0", "license": "MIT", "dependencies": { "@edsilv/http-status-codes": "^1.0.3", diff --git a/package.json b/package.json index 6c48954d..2db4a27a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "manifesto.js", - "version" : "4.3.0-draft3dapi.0.4.0", + "version" : "4.3.0-draft3dapi.0.5.0", "description": "IIIF Presentation API utility library for client and server with 3D extension", "main": "./dist-commonjs/index.js", "module": "./dist-esmodule/index.js", diff --git a/types/index.d.ts b/types/index.d.ts index 10ed3ea9..c07fec61 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -103,6 +103,7 @@ export declare class SpecificResource extends ManifestResource { isSpecificResource: boolean; constructor(jsonld: any, options?: IManifestoOptions); getSource(): object | AnnotationBody; + get Source(): object | AnnotationBody; getSelector(): PointSelector | null; get Selector(): PointSelector | null; getTransform(): Transform[]; @@ -526,7 +527,14 @@ export declare enum ManifestType { 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; } declare class Range$1 extends ManifestResource { private _ranges; From 0d15510e40f79cada52b44bb9bff0daa2c23728a Mon Sep 17 00:00:00 2001 From: Vincent Marchetti Date: Tue, 14 May 2024 16:48:29 -0400 Subject: [PATCH 16/16] Updated with links to example manifests and prototype viewers. --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c8a0dbb6..4a6c98fc 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,14 @@ This included in package.json will install manifesto modules into node_modules. +### 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) @@ -60,4 +68,8 @@ distributed from [vincentmarchetti/manifesto#3dtsg-main]() there were these chan #### To package.json version 4.3.0-draft3dapi.0.4.0 -1. Implemented Perspective Camera properties in the Camera class. \ No newline at end of file +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.