diff --git a/.dockerignore b/.dockerignore index b2e52e5e3..6cd921ac2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,4 @@ node_modules -docs Dockerfile .vscode .git diff --git a/.gitignore b/.gitignore index c2f41d22d..d52604f06 100644 --- a/.gitignore +++ b/.gitignore @@ -235,4 +235,7 @@ BundleArtifacts/ # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache -!*.[Cc]ache/ \ No newline at end of file +!*.[Cc]ache/ + +#specific files +docker-token.json \ No newline at end of file diff --git a/README.md b/README.md index b8afd376e..a06a845a6 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,41 @@ FS Website Solutions # **Fabio Sereno** - Software Developer -Highly Experienced Full Stack Web Developer of 10+ years (6+ in the FinTech sector). Highly self-motivated, enthusiastic, professional and a team player. Possesses strong analytical and problem solving skills, code proficiency, and an ability to follow through with projects from initiation to completion with innovation and creativity. +Highly experienced Full Stack Software Engineer with over 15 years of experience (6+ years in the FinTech sector). Self-motivated, enthusiastic, and professional team player with strong analytical and problem-solving skills. Demonstrates proficiency in coding and a proven ability to successfully complete projects with innovation and creativity. -Very keen on learning and using the latest technologies, with a real passion for software development. Areas of keen interest: Fin Tech, Health Tech, Commerce, ML/AI, Blockchain, XR(VR/AR), IoT. +Passionate about software development and constantly eager to learn and adopt the latest technologies. Keen interest in FinTech, HealthTech, Commerce, ML/AI, Blockchain, XR (VR/AR), and IoT. ## My Portfolio Repository The purpose of this repository is to demonstrate skills in various technologies, coding proficiency and knowledge. -To see a fully deployed version of this project go to: +To view a static version of this project with limited functionality, please visit: https://fsereno.github.io/portfolio/ +To see a fully containerised version of this project deployed to AWS (Amazon Web Services) EC2, please either raise an issue on this GitHub repository or contact me via LinkedIn. + +- Raise an issue on Github (https://github.com/fsereno/portfolio/issues) +- Contact me on LinkedIn (https://www.linkedin.com/in/fabio-sereno-6a97b986/) + This project is both built and deployed with continuous integration and deployment (CI/CD). Some of the technology used in this project and related projects: -- Azure Functions (https://azure.microsoft.com/en-gb/services/functions/) -- AWS Lambda (https://aws.amazon.com/lambda/) +- .NET (https://dotnet.microsoft.com) - Docker (https://www.docker.com/) -- Node JS (https://nodejs.org/en/) -- Gulp (https://gulpjs.com) +- Docker Hub (https://hub.docker.com/) +- NodeJS (https://nodejs.org/en/) - Webpack (https://webpack.js.org/) - Pug (https://pugjs.org/api/getting-started.html) - TypeScript (https://www.typescriptlang.org) +- A-Frame (https://aframe.io/) - Sass (https://sass-lang.com/) +- Three.js (https://threejs.org/) +- React (https://reactjs.org/) +- Vue (https://vuejs.org/) +- Taiko (https://www.npmjs.com/package/taiko) - Mocha (https://mochajs.org/) - Chai (https://www.chaijs.com/) -- A-Frame (https://aframe.io/) -- .NET (https://dotnet.microsoft.com) +- Enzyme (https://enzymejs.github.io/enzyme/) - NUnit (https://nunit.org/) -- ThreeJS (https://threejs.org/) -- React (https://reactjs.org/) -- Vue (https://vuejs.org/) - SOLID principles - TDD - Test driven development - DDD - Domain driven development @@ -45,10 +50,8 @@ Some of the technology used in this project and related projects: --- ## Prerequisites + - Docker (https://www.docker.com/) -- Node JS v ^14.17.5 (https://nodejs.org/en/) -- NPM (https://www.npmjs.com/) -> Tip - Node and NPM are not needed locally if running within a container. --- ## Installation @@ -62,75 +65,57 @@ Some of the technology used in this project and related projects: --- ### Run inside a Container using Docker + - Please ensure you have Docker installed and running. - Open your preferred command line: -> Launch the container +Launch the production environment ```shell $ docker compose up ``` - ->Attach a Bash command line interface. -From here you will be able to run all subsequent NPM commands - -```shell -$ docker exec -it node bash -``` -> You should now have a bash cmd connected to the container ---- - -### Run outside a Container -- Please ensure you have Node JS and NPM installed. -- Open your preferred command line: - -> install NPM packages - -```shell -$ npm install -$ npm install --global gulp-cli -``` ---- - -## Usage - -#### Run the initial build -> Run this first to ensure all resources build successfully +##### This will: +- Pull all images from Docker Hub. +- Spin up all services in containers. +- The application will be available at: http://localhost/ + +To run one of the following specific Docker tasks +- analysis +- create +- dev +- rel +- test +- test-e2e ```shell -$ npm run build +$ sh start ``` -#### Build a specific application +To stop one of the above tasks, excluding those which destroy themselves (create, test) ```shell -$ npm run build dir= +$ sh stop ``` - -##### This will: -- Build all initial development resources (pug, sass, ts, js). --- -#### Run the development server +### Tasks -```shell -$ npm run dev -``` -#### Serve a specific application +#### Serve a specific application via the development server ```shell -$ npm run dev dir= +$ sh start dev ``` ##### This will: - Start the development server. - Watch for any changes on development resources. -- Live Reload any changes straight to the browser. +- Hot-reload any changes straight to the browser. +- The default application is the root application - home - Open your browser and navigate to http://localhost:8080. --- #### Run analysis on a specific application ```shell -$ npm run analysis dir= +$ sh start analysis ``` ##### This will: - Start the analysis server. @@ -141,35 +126,35 @@ $ npm run analysis dir= #### Build for release ```shell -$ npm run release +$ sh start rel ``` ##### This will: -- Build the production directory. +- Build the production static assets directory. --- #### Run all unit tests ```shell -$ npm test +$ sh start test ``` ##### This will: - Run all application specific and global unit tests. --- -#### Run all functional tests (using a headless browser) +#### Run all functional end-to-end tests ```shell -$ npm run test-func +$ sh start test-e2e ``` ##### This will: -- Please ensure the development server is running - Run all functional tests from the ./app/tests/functional directory +- Currently this feature is a work in progress (WIP) and will not work on ARM architecture --- #### Create a new application ```shell -$ npm run create +$ sh create ``` ##### This will: - Build applications based on the config.json file. diff --git a/app/app_AzureDotNetCoreDataStructuresApi/tests/e2e/taiko.test.js b/app/app_AzureDotNetCoreDataStructuresApi/tests/e2e/taiko.test.js deleted file mode 100644 index 542da24ee..000000000 --- a/app/app_AzureDotNetCoreDataStructuresApi/tests/e2e/taiko.test.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @jest-environment jsdom - */ - - import { openBrowser, goto, write, click, closeBrowser, $, into, textBox, button, waitFor, evaluate, text } from 'taiko'; - - const APPLICATION = "app_AzureDotNetCoreDataStructuresApi"; - const URL = `http://localhost:8080/${APPLICATION}/index.html`; - - beforeAll(async () => { - await openBrowser({ - headless: true, - slowMo: 250, - args: ['--no-sandbox'] - }); - }); - - describe(APPLICATION, () => { - test('Should not add an item to the queue', async () => { - await goto(URL); - await write('5', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await click(button({id:'queueInput_submit'})); - const error = await $('.was-validated .form-control:invalid').exists(); - const result = await evaluate($('#queueList'), (element) => element.innerText); - expect(error).toBeTruthy(); - expect(result).toBe(""); - }, 100000); - test('Should not add an item to the stack', async () => { - await goto(URL); - await write('5', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await click(button({id:'stackInput_submit'})); - const error = await $('.was-validated .form-control:invalid').exists(); - const result = await evaluate($('#stackList'), (element) => element.innerText); - expect(error).toBeTruthy(); - expect(result).toBe(""); - }, 100000); - test('Should add an item to the queue', async () => { - await goto(URL); - await write('5', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await write('Item 1', into(textBox({id:'queueInput'}))); - await click(button({id:'queueInput_submit'})); - const result = await evaluate($('#queueList'), (element) => element.innerText); - expect(result).toBe('Item 1'); - }, 100000); - test('Should remove an item to the queue', async () => { - await goto(URL); - await write('5', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await write('Item 1', into(textBox({id:'queueInput'}))); - await click(button({id:'queueInput_submit'})); - await waitFor(2000); - await write('Item 2', into(textBox({id:'queueInput'}))); - await click(button({id:'queueInput_submit'})); - await waitFor(2000); - await click(button({id:'queueInput_remove'})); - const result = await evaluate($('#queueList'), (element) => element.innerText); - expect(result).toBe('Item 2'); - }, 100000); - test('Should add an item to the stack', async () => { - await goto(URL); - await write('5', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await write('Item 1', into(textBox({id:'stackInput'}))); - await click(button({id:'stackInput_submit'})); - const result = await evaluate($('#stackList'), (element) => element.innerText); - expect(result).toBe('Item 1'); - }, 100000); - test('Should remove an item to the queue', async () => { - await goto(URL); - await write('5', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await write('Item 1', into(textBox({id:'stackInput'}))); - await click(button({id:'stackInput_submit'})); - await waitFor(2000); - await write('Item 2', into(textBox({id:'stackInput'}))); - await click(button({id:'stackInput_submit'})); - await waitFor(2000); - await click(button({id:'stackInput_remove'})); - const result = await evaluate($('#stackList'), (element) => element.innerText); - expect(result).toBe('Item 1'); - }, 100000); - }); - - afterAll(() => { - closeBrowser(); - }); \ No newline at end of file diff --git a/app/app_AzureDotNetCoreUniqueDataEntryApi/tests/e2e/taiko.test.js b/app/app_AzureDotNetCoreUniqueDataEntryApi/tests/e2e/taiko.test.js deleted file mode 100644 index c9ee636b3..000000000 --- a/app/app_AzureDotNetCoreUniqueDataEntryApi/tests/e2e/taiko.test.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @jest-environment jsdom - */ - - import { openBrowser, goto, write, click, closeBrowser, $, into, textBox, button, waitFor, evaluate, text } from 'taiko'; - - const APPLICATION = "app_AzureDotNetCoreUniqueDataEntryApi"; - const URL = `http://localhost:8080/${APPLICATION}/index.html`; - - beforeAll(async () => { - await openBrowser({ - headless: true, - slowMo: 250, - args: ['--no-sandbox'] - }); - }); - - describe(APPLICATION, () => { - test('Should add an item to the table', async () => { - await goto(URL); - await write('14', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await write('James', into(textBox({id:'firstNameInput'}))); - await write('Brown', into(textBox({id:'secondNameInput'}))); - await write('(000) 111 222', into(textBox({id:'contactInput'}))); - await write('AB10 0CD', into(textBox({id:'postCodeInput'}))); - await click(button({id:'submit'})); - await waitFor(2000); - const result = await evaluate($('#itemTable'), (element) => element.innerText); - expect(result).toContain('James\tBrown\t(000) 111 222\tAB10 0CD\tDelete'); - }, 100000); - test('Should not add a duplicate item to the table', async () => { - await goto(URL); - await write('14', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await write('John', into(textBox({id:'firstNameInput'}))); - await write('Doe', into(textBox({id:'secondNameInput'}))); - await write('000000000', into(textBox({id:'contactInput'}))); - await write('AB101CD', into(textBox({id:'postCodeInput'}))); - await click(button({id:'submit'})); - await waitFor(2000); - await click($('#duplicateEntryErrorModule button')); - await waitFor(2000); - const exists = await $('#duplicateEntryErrorModule').exists(); - const result = await evaluate($('#itemTable'), (element) => element.innerText); - expect(exists).toBeFalsy(); - expect(result).toBe('First name\tSecond name\tContact\tPostcode\tAction\nJohn\tDoe\t000000000\tAB101CD\tDelete'); - }, 100000); - test('Should remove an item to the table', async () => { - await goto(URL); - await write('14', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await click($('a.delete[data-index="0"]')); - const result = await evaluate($('#itemTable'), (element) => element.innerText); - expect(result).toBe('First name\tSecond name\tContact\tPostcode\tAction'); - }, 100000); - }); - - afterAll(() => { - closeBrowser(); - }); \ No newline at end of file diff --git a/app/app_AzureDotNetCoreUniqueDataEntryApi/Readme.md b/app/app_UniqueDataEntry/Readme.md similarity index 56% rename from app/app_AzureDotNetCoreUniqueDataEntryApi/Readme.md rename to app/app_UniqueDataEntry/Readme.md index 2783d943d..60af5df89 100644 --- a/app/app_AzureDotNetCoreUniqueDataEntryApi/Readme.md +++ b/app/app_UniqueDataEntry/Readme.md @@ -1,9 +1,7 @@ -# Azure Functions, .NET Core, Unique Data Entry Api +# Unique Data Entry Application -With this application I have built a unique data entry form. A simple React frontend handles the UI and data entry logic is dealt with by .NET Core and IEqualityComparer. +With this application I have built a unique data entry form. A simple React frontend handles the UI and data entry logic is dealt with by .NET and IEqualityComparer. -Whilst this functionality could be achieved with JavaScript alone, I wanted to demonstrate knowledge of IEqualityComparer and the .NET Core framework. I also wanted to explore Azure Functions and the power of serverless compute. - -- Azure Functions Repository (https://github.com/fsereno/app_AzureDotNetCoreUniqueDataEntryApi) +Whilst this functionality could be achieved with JavaScript alone, I wanted to demonstrate knowledge of IEqualityComparer and the .NET framework. - IEqualityComparer (https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.iequalitycomparer-1?view=net-5.0) \ No newline at end of file diff --git a/app/app_UniqueDataEntry/backend/api/Controllers/ApiController.cs b/app/app_UniqueDataEntry/backend/api/Controllers/ApiController.cs new file mode 100644 index 000000000..40bf8b468 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/Controllers/ApiController.cs @@ -0,0 +1,54 @@ +using System; +using System.IO; +using System.Collections; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Portfolio.Core.Types; +using Portfolio.Core.Services; +using Portfolio.UniqueDataEntry.Interfaces; +using Portfolio.UniqueDataEntry.Utils; +using Portfolio.UniqueDataEntry.Models; + +namespace Portfolio.UniqueDataEntry.Controllers; + +/// +/// API controller for unique data entry operations. +/// +[ApiController] +[Route("[controller]")] +public class ApiController : ControllerBase +{ + private readonly ILogger _logger; + private IUniqueDataEntryUtil _uniqueDataEntryUtil; + + /// + /// Initializes a new instance of the ApiController class with the specified logger and unique data entry utility. + /// + /// The logger to use for logging messages. + /// The utility for unique data entry operations. + public ApiController(ILogger logger, IUniqueDataEntryUtil uniqueDataEntryUtil) + { + _logger = logger; + _uniqueDataEntryUtil = uniqueDataEntryUtil; + } + + /// + /// Checks if an item can be added based on uniqueness criteria. + /// + /// The request body containing the items and the item to be added. + /// A boolean indicating whether the item can be added. + [HttpPost("CanItemBeAddedAsync")] + public IActionResult CanItemBeAddedAsync([FromBody] RequestBody data) + { + _logger.LogInformation("CanItemBeAddedAsync endpoint hit."); + + var equalityComparer = new Item.ItemEqualityComparer(); + + var dictionary = data.Items.ToDictionary(x => x, x => x.FirstName, equalityComparer); + var result = _uniqueDataEntryUtil.CanItemBeAdded(dictionary, data.Item); + + _logger.LogInformation($"Result is: {result}"); + + return Ok(result); + } +} diff --git a/app/app_UniqueDataEntry/backend/api/Interfaces/IUniqueDataEntryUtil.cs b/app/app_UniqueDataEntry/backend/api/Interfaces/IUniqueDataEntryUtil.cs new file mode 100644 index 000000000..31173dfe9 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/Interfaces/IUniqueDataEntryUtil.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; +using Portfolio.UniqueDataEntry.Models; + +namespace Portfolio.UniqueDataEntry.Interfaces +{ + public interface IUniqueDataEntryUtil + { + /// + /// Testing to see if an item can be added by attempting to add the passed item to the dictionary + /// + /// A dictionary of exsiting collection + /// The item to be added + /// A bool, can the item be added or not ? + bool CanItemBeAdded(Dictionary dictionary, Item item); + } +} \ No newline at end of file diff --git a/app/app_UniqueDataEntry/backend/api/Models/Item.cs b/app/app_UniqueDataEntry/backend/api/Models/Item.cs new file mode 100644 index 000000000..2765fe116 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/Models/Item.cs @@ -0,0 +1,91 @@ +using System.Collections.Generic; + +namespace Portfolio.UniqueDataEntry.Models +{ + /// + /// Represents an item for unique data entry. + /// + public class Item + { + /// + /// Initializes a new instance of the Item class with default values. + /// + public Item() + { + this.FirstName = string.Empty; + this.SecondName = string.Empty; + this.Contact = string.Empty; + this.PostCode = string.Empty; + } + + /// + /// Gets or sets the first name of the item. + /// + public string FirstName { get; set; } + + /// + /// Gets or sets the second name of the item. + /// + public string SecondName { get; set; } + + /// + /// Gets or sets the contact information of the item. + /// + public string Contact { get; set; } + + /// + /// Gets or sets the post code of the item. + /// + public string PostCode { get; set; } + + /// + /// Equality comparer for comparing Item objects. + /// + public class ItemEqualityComparer : IEqualityComparer + { + /// + /// Determines whether two Item objects are equal. + /// + /// The first Item to compare. + /// The second Item to compare. + /// true if the Item objects are equal; otherwise, false. + public bool Equals(Item item1, Item item2) + { + if (item2 == null && item1 == null) + { + return true; + } + else if (item1 == null || item2 == null) + { + return false; + } + else if (Normalise(item1.SecondName) == Normalise(item2.SecondName) + && Normalise(item1.Contact) == Normalise(item2.Contact) + && Normalise(item1.PostCode) == Normalise(item2.PostCode)) + { + return true; + } + else + { + return false; + } + } + + /// + /// Gets the hash code for the Item object. + /// + /// The Item for which to get the hash code. + /// The hash code for the Item object. + public int GetHashCode(Item item) + { + var toHash = Normalise(item.SecondName) + Normalise(item.Contact) + Normalise(item.PostCode); + return toHash.GetHashCode(); + } + + private string Normalise(string value) + { + return value.Trim().ToUpper(); + } + } + } +} diff --git a/app/app_UniqueDataEntry/backend/api/Models/RequestBody.cs b/app/app_UniqueDataEntry/backend/api/Models/RequestBody.cs new file mode 100644 index 000000000..97abb12a0 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/Models/RequestBody.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; + +namespace Portfolio.UniqueDataEntry.Models +{ + /// + /// Represents the request body for unique data entry operations. + /// + public class RequestBody + { + /// + /// Initializes a new instance of the RequestBody class with default values. + /// + public RequestBody() + { + this.Items = new List(); + this.Item = new Item(); + } + + /// + /// Gets or sets the list of items. + /// + public List Items { get; set; } + + /// + /// Gets or sets the item to be added. + /// + public Item Item { get; set; } + } +} \ No newline at end of file diff --git a/app/app_UniqueDataEntry/backend/api/Program.cs b/app/app_UniqueDataEntry/backend/api/Program.cs new file mode 100644 index 000000000..9744c4c1d --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/Program.cs @@ -0,0 +1,38 @@ +using Portfolio.Core.Services; +using Portfolio.UniqueDataEntry.Interfaces; +using Portfolio.UniqueDataEntry.Utils; + +var builder = WebApplication.CreateBuilder(args); + +builder.WebHost.UseUrls("http://*:3003"); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +// Services +builder.Services.AddScoped(); + +builder.Services.AddHealthChecks(); + +var app = builder.Build(); + +app.MapHealthChecks("/healthcheck"); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/app/app_UniqueDataEntry/backend/api/Properties/launchSettings.json b/app/app_UniqueDataEntry/backend/api/Properties/launchSettings.json new file mode 100644 index 000000000..d58642981 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:4279", + "sslPort": 44379 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5065", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7114;http://localhost:5065", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/app/app_UniqueDataEntry/backend/api/Utils/UniqueDataEntryUtil.cs b/app/app_UniqueDataEntry/backend/api/Utils/UniqueDataEntryUtil.cs new file mode 100644 index 000000000..d8e28bd46 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/Utils/UniqueDataEntryUtil.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.Logging; +using Portfolio.UniqueDataEntry.Interfaces; +using Portfolio.UniqueDataEntry.Models; + +namespace Portfolio.UniqueDataEntry.Utils +{ + /// + /// Utility class for unique data entry operations. + /// + public class UniqueDataEntryUtil : IUniqueDataEntryUtil + { + private readonly ILogger _logger; + + /// + /// Initializes a new instance of the UniqueDataEntryUtil class with the specified logger. + /// + /// The logger to use for logging messages. + public UniqueDataEntryUtil(ILogger logger) + { + _logger = logger; + } + + /// + public bool CanItemBeAdded(Dictionary dict, Item item) + { + var result = false; + var currentCount = dict.Count; + + try + { + dict.Add(item, item.SecondName); + result = dict.Count == currentCount + 1; + } + catch (Exception exception) + { + _logger.LogWarning("You cannot add duplicate items."); + _logger.LogWarning(exception.Message); + } + + return result; + } + } +} diff --git a/app/app_UniqueDataEntry/backend/api/api.csproj b/app/app_UniqueDataEntry/backend/api/api.csproj new file mode 100644 index 000000000..19bfaa242 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/api.csproj @@ -0,0 +1,18 @@ + + + + net7.0 + enable + enable + + + + + + + + + + + + diff --git a/app/app_UniqueDataEntry/backend/api/appsettings.Development.json b/app/app_UniqueDataEntry/backend/api/appsettings.Development.json new file mode 100644 index 000000000..ff66ba6b2 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/app/app_UniqueDataEntry/backend/api/appsettings.json b/app/app_UniqueDataEntry/backend/api/appsettings.json new file mode 100644 index 000000000..4d566948d --- /dev/null +++ b/app/app_UniqueDataEntry/backend/api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/app/app_UniqueDataEntry/backend/test/UniqueDataEntryUtilTests.cs b/app/app_UniqueDataEntry/backend/test/UniqueDataEntryUtilTests.cs new file mode 100644 index 000000000..495ebb2de --- /dev/null +++ b/app/app_UniqueDataEntry/backend/test/UniqueDataEntryUtilTests.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.Extensions.Logging; +using Moq; +using Xunit; +using Portfolio.UniqueDataEntry.Interfaces; +using Portfolio.UniqueDataEntry.Utils; +using Portfolio.UniqueDataEntry.Models; + +namespace Portfolio.UniqueDataEntry.Test +{ + public class UniqueDataEntryUtilTests + { + private IUniqueDataEntryUtil _sut; + private Mock> _logger; + private Dictionary _dictionary; + + public UniqueDataEntryUtilTests() + { + _logger = new Mock>(); + _sut = new UniqueDataEntryUtil(_logger.Object); + + var initialCollection = new List() + { + new Item(){ FirstName = "James", SecondName = "Bond", Contact = "000 000 000", PostCode = "AB00 1AB" }, + new Item(){ FirstName = "Tom", SecondName = "Jones", Contact = "000 000 000", PostCode = "AB00 2AB"} + }; + _dictionary = initialCollection.ToDictionary(x => x, x => x.FirstName, new Item.ItemEqualityComparer()); + } + + [Fact] + public void TestCanItemBeAddedNotMatching() + { + var item = new Item(){ FirstName = "Tom", SecondName = "Smith", Contact = "000 000 000", PostCode = "AB00 3AB" }; + var result = _sut.CanItemBeAdded(_dictionary, item); + + Assert.True(result); + } + + [Fact] + public void TestCanItemBeAddedPartialMatch() + { + var item = new Item(){ FirstName = "Tommy", SecondName = "Jones", Contact = "000 000 000", PostCode = "AB00 2AB" }; + var result = _sut.CanItemBeAdded(_dictionary, item); + VerifyLogger(LogLevel.Warning, "You cannot add duplicate items."); + Assert.False(result); + } + + [Fact] + public void TestCanItemBeAddedMatchingSecondNameDifferentElse() + { + var item = new Item(){ FirstName = "Tommy", SecondName = "Jones", Contact = "111 111 111", PostCode = "AB00 4AB" }; + var result = _sut.CanItemBeAdded(_dictionary, item); + + Assert.True(result); + } + + [Fact] + public void TestCanItemBeAddedToEmptyDictionary() + { + var initialCollection = new List(); + var item = new Item(){ FirstName = "Karen", SecondName = "Jones", Contact = "000 000 000", PostCode = "AB00 1AB" }; + var dictionary = initialCollection.ToDictionary(x => x, x => x.FirstName, new Item.ItemEqualityComparer()); + var result = _sut.CanItemBeAdded(dictionary, item); + Assert.True(result); + } + + [Fact] + public void TestCanItemBeAddedCaseSensitive() + { + var item = new Item(){ FirstName = "JAMES", SecondName = "BOND", Contact = "000 000 000", PostCode = "AB00 1AB" }; + var result = _sut.CanItemBeAdded(_dictionary, item); + Assert.False(result); + } + + [Fact] + public void TestCanItemBeAddedSpaceSensitive() + { + var item = new Item(){ FirstName = "James", SecondName = "Bond ", Contact = " 000 000 000 ", PostCode = "AB00 1AB" }; + var result = _sut.CanItemBeAdded(_dictionary, item); + Assert.False(result); + } + + private void VerifyLogger(LogLevel expectedLogLevel, string expectedMessage = "") + { + _logger.Verify( + x => x.Log( + It.Is(l => l == expectedLogLevel), + It.IsAny(), + It.Is((v, t) => String.IsNullOrEmpty(expectedMessage) ? true : v.ToString() == expectedMessage), + It.IsAny(), + It.Is>((v, t) => true))); + } + } +} \ No newline at end of file diff --git a/app/app_UniqueDataEntry/backend/test/Usings.cs b/app/app_UniqueDataEntry/backend/test/Usings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/test/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/app/app_UniqueDataEntry/backend/test/test.csproj b/app/app_UniqueDataEntry/backend/test/test.csproj new file mode 100644 index 000000000..e485514e2 --- /dev/null +++ b/app/app_UniqueDataEntry/backend/test/test.csproj @@ -0,0 +1,29 @@ + + + + net7.0 + enable + enable + + false + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/app/app_AzureDotNetCoreDataStructuresApi/pug/index.pug b/app/app_UniqueDataEntry/pug/index.pug similarity index 100% rename from app/app_AzureDotNetCoreDataStructuresApi/pug/index.pug rename to app/app_UniqueDataEntry/pug/index.pug diff --git a/app/app_AzureDotNetCoreDataStructuresApi/sass/styles.scss b/app/app_UniqueDataEntry/sass/styles.scss similarity index 100% rename from app/app_AzureDotNetCoreDataStructuresApi/sass/styles.scss rename to app/app_UniqueDataEntry/sass/styles.scss diff --git a/app/app_AzureDotNetCoreUniqueDataEntryApi/src/app.js b/app/app_UniqueDataEntry/src/app.js similarity index 82% rename from app/app_AzureDotNetCoreUniqueDataEntryApi/src/app.js rename to app/app_UniqueDataEntry/src/app.js index 450e29983..849d57098 100644 --- a/app/app_AzureDotNetCoreUniqueDataEntryApi/src/app.js +++ b/app/app_UniqueDataEntry/src/app.js @@ -5,16 +5,17 @@ import '../sass/styles.scss'; import React from 'react'; import ReactDOM from 'react-dom'; import { KeyGeneratorUtil } from '../../typeScript/Utils/keyGeneratorUtil/dist/index'; -import { PuzzleModalComponent } from '../../js/modules/react/puzzleModalComponent.js'; import { SpinnerComponent } from '../../js/modules/react/spinnerComponent.js' import { ErrorModalComponent } from '../../js/modules/react/errorModalComponent.js'; import { ConfigUtil } from '../../js/modules/utils/configUtil'; import { FormComponent } from './formComponent'; import { jQueryAjaxUtil } from '../../js/modules/utils/jQueryAjaxUtil'; +import { DeploymentModalComponent } from '../../js/modules/react/deploymentModalComponent.js'; +import { DeploymentUtil } from '../../js/modules/utils/deploymentUtil'; -const PUZZLE = "4 x 4 - 2 ="; -const APP_CONFIG = ConfigUtil.get("AzureDotNetCoreUniqueDataEntryApi"); -const CAN_IT_BE_ADDED_ASYNC_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.canItemBeAddedAsync}`; +const CONFIG = ConfigUtil.get(); +const APP_CONFIG = ConfigUtil.get("uniqueDataEntry"); +const CAN_IT_BE_ADDED_ASYNC_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.canItemBeAddedAsync}`; const FIRST_NAME_INPUT = "firstNameInput"; const SECOND_NAME_INPUT = "secondNameInput"; const CONTACT_INPUT = "contactInput"; @@ -33,20 +34,17 @@ class UniqueDataEntryApp extends React.Component { counterLimit: 10, counter: 1, showSpinner: false, - showPuzzleModal: true, - showErrorModal: false, showDuplicateErrorModal: false, - isPuzzleValid: false + showDeploymentModal: DeploymentUtil.isNotCloud() }; this.handleSubmit = this.handleSubmit.bind(this); this.handleDelete = this.handleDelete.bind(this); - this.handleIsPuzzleValid = this.handleIsPuzzleValid.bind(this); - this.handlePuzzleModalClose = this.handlePuzzleModalClose.bind(this); - this.handlePuzzleModalShow = this.handlePuzzleModalShow.bind(this); this.handleErrorModalClose = this.handleErrorModalClose.bind(this); this.handleDuplicateErrorModalClose = this.handleDuplicateErrorModalClose.bind(this); this.handleBeforeAjax = this.handleBeforeAjax.bind(this); this.handleFailedAjax = this.handleFailedAjax.bind(this); + this.handleDeploymentModalClose = this.handleDeploymentModalClose.bind(this); + this.handleDeploymentModalShow = this.handleDeploymentModalShow.bind(this); } handleBeforeAjax() { @@ -64,7 +62,7 @@ class UniqueDataEntryApp extends React.Component { } handleAjax(request) { - jQueryAjaxUtil.handleAjax(request, this.state.isPuzzleValid, this.handleBeforeAjax, this.handleFailedAjax, this.handlePuzzleModalShow); + jQueryAjaxUtil.handleAjax(request, DeploymentUtil.isCloud(), this.handleBeforeAjax, this.handleFailedAjax, this.handleDeploymentModalShow); } handleSubmit(event) { @@ -90,6 +88,7 @@ class UniqueDataEntryApp extends React.Component { url: CAN_IT_BE_ADDED_ASYNC_ENDPOINT, data: JSON.stringify(data), type: "POST", + contentType: "application/json", success: (response) => { if (response === true) { let items = [...this.state.items]; @@ -139,35 +138,24 @@ class UniqueDataEntryApp extends React.Component { }) } - handleIsPuzzleValid() { + handleDeploymentModalClose() { this.setState({ - isPuzzleValid: true, - showPuzzleModal: false - }) - } - - handlePuzzleModalClose() { - this.setState({ - showPuzzleModal: false + showDeploymentModal: false }) } - handlePuzzleModalShow() { + handleDeploymentModalShow() { this.setState({ - showPuzzleModal: true + showDeploymentModal: true }) } render() { return (
- { + await openBrowser({ + headless: true, + slowMo: 250, + args: ['--no-sandbox'] + }); +}); + +describe(APPLICATION, () => { + test('Should add an item to the table', async () => { + await goto(URL); + await write('14', into(textBox({ id: 'answerInput' }), { force: true })); + await click(button({ id: 'submitPuzzle' })); + await waitFor(2000); + await write('James', into(textBox({ id: 'firstNameInput' }))); + await write('Brown', into(textBox({ id: 'secondNameInput' }))); + await write('(000) 111 222', into(textBox({ id: 'contactInput' }))); + await write('AB10 0CD', into(textBox({ id: 'postCodeInput' }))); + await click(button({ id: 'submit' })); + await waitFor(2000); + const result = await evaluate($('#itemTable'), (element) => element.innerText); + expect(result).toContain('James\tBrown\t(000) 111 222\tAB10 0CD\tDelete'); + }, 100000); + test('Should not add a duplicate item to the table', async () => { + await goto(URL); + await write('14', into(textBox({ id: 'answerInput' }), { force: true })); + await click(button({ id: 'submitPuzzle' })); + await waitFor(2000); + await write('John', into(textBox({ id: 'firstNameInput' }))); + await write('Doe', into(textBox({ id: 'secondNameInput' }))); + await write('000000000', into(textBox({ id: 'contactInput' }))); + await write('AB101CD', into(textBox({ id: 'postCodeInput' }))); + await click(button({ id: 'submit' })); + await waitFor(2000); + await click($('#duplicateEntryErrorModule button')); + await waitFor(2000); + const exists = await $('#duplicateEntryErrorModule').exists(); + const result = await evaluate($('#itemTable'), (element) => element.innerText); + expect(exists).toBeFalsy(); + expect(result).toBe('First name\tSecond name\tContact\tPostcode\tAction\nJohn\tDoe\t000000000\tAB101CD\tDelete'); + }, 100000); + test('Should remove an item to the table', async () => { + await goto(URL); + await write('14', into(textBox({ id: 'answerInput' }), { force: true })); + await click(button({ id: 'submitPuzzle' })); + await waitFor(2000); + await click($('a.delete[data-index="0"]')); + const result = await evaluate($('#itemTable'), (element) => element.innerText); + expect(result).toBe('First name\tSecond name\tContact\tPostcode\tAction'); + }, 100000); +}); + +afterAll(() => { + closeBrowser(); +}); \ No newline at end of file diff --git a/app/app_aframe/Readme.md b/app/app_aframe/Readme.md deleted file mode 100644 index f04533d5a..000000000 --- a/app/app_aframe/Readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# AFrame React (Basic) - -With this application I have built a simple 'Hello World' AFrame application, coupled with React as a means of managing state. - -### Explanation ### - -I have used Webpack to bundle JS dependancies and Babel to transpile to the correct ES version. - -The interest in this application is to explore WebXR prototyping using AFrame, with the aim of allowing user input via React in a follow up application. - -This application is intended for use in any modern WebXR enabled web browser or headset. - -This is one in a series of applications experimenting with WebXR. Currently only supporting 3 degrees of freedom and no controller input. \ No newline at end of file diff --git a/app/app_aframe/pug/index.pug b/app/app_aframe/pug/index.pug deleted file mode 100644 index 35e40a083..000000000 --- a/app/app_aframe/pug/index.pug +++ /dev/null @@ -1,6 +0,0 @@ -extends ../../pug/layouts/main.pug - -block content - p Compatible with any WebXR enabled browser and any WebXR enabled VR headset. - p Click below to launch the AFrame scene. - a(class="btn btn-dark", href="scene.html") Launch scene \ No newline at end of file diff --git a/app/app_aframe/pug/scene.pug b/app/app_aframe/pug/scene.pug deleted file mode 100644 index d10a49f6f..000000000 --- a/app/app_aframe/pug/scene.pug +++ /dev/null @@ -1,4 +0,0 @@ -extends ../../pug/layouts/raw.pug - -block content - div#result \ No newline at end of file diff --git a/app/app_aframe/src/app.js b/app/app_aframe/src/app.js deleted file mode 100644 index c132d9e72..000000000 --- a/app/app_aframe/src/app.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict;" - -import "../sass/styles.scss"; - -import 'aframe'; -import React from 'react'; -import ReactDOM from 'react-dom'; -class Scene extends React.Component { - constructor(props) { - super(props); - this.state = { - message: "Hello World!" - }; - } - - render() { - let text = `value: ${this.state.message}; color: #ee1111; height: 13.53; lineHeight: 0.54; width: 2.71; wrapCount: 36.5; xOffset: 1.02; zOffset: 0.51`; - return ( - - - - - - - - ); - } -} - -ReactDOM.render(, document.getElementById('result')); \ No newline at end of file diff --git a/app/app_awsDotNetCoreAsyncCoffeeMachine/pug/index.pug b/app/app_awsDotNetCoreAsyncCoffeeMachine/pug/index.pug deleted file mode 100644 index b7a4cb2c3..000000000 --- a/app/app_awsDotNetCoreAsyncCoffeeMachine/pug/index.pug +++ /dev/null @@ -1,20 +0,0 @@ -extends ../../pug/layouts/main.pug - -block content - div - p - | Think about how a cup of coffee is made. - | Typically tasks are carried out while the kettle is boiling. - | Why wait for a process to complete, when it could be run as a background task ? - h2 How ? - p - | Technically, when calling the Sync method, a series of actions are run in order of - | execution, synchronously. With each action completing before the next is run. - | When calling the Async method, however async / await are being used, spawning - | a State Machine object, with Task acting as the interface between code and state. - | The threadpool is free to use new threads if needed and return execution instead - | of blocking execution as with a synchronous program. - p - | Run the process of making a cup of coffee both synchronously and asynchronously. - | Notice the difference in the order of tasks ? - div#result.mt-2 \ No newline at end of file diff --git a/app/app_awsDotNetCoreEntitySortApi/Readme.md b/app/app_awsDotNetCoreEntitySortApi/Readme.md deleted file mode 100644 index 6ac76f5b9..000000000 --- a/app/app_awsDotNetCoreEntitySortApi/Readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# ASP.NET Core Entity Sorting API. A Serverless Application with React Interface - -With this application I have built a complex type sorting interface, using .NET Core served via an AWS Serverless Application (SAM). A basic React user interface handles user input and application state. - -Whilst this functionality could be achieved with JavaScript alone, I wanted to demonstrate knowledge of two key .NET Core interfaces: ICompareable and IComparer. - -- AWS Lambda Repository (https://github.com/fsereno/app_awsDotNetCoreEntitySortApi) - -- ICompareable (https://docs.microsoft.com/en-us/dotnet/api/system.icomparable?view=netcore-3.1) - -- IComparer (https://docs.microsoft.com/en-us/dotnet/api/system.collections.icomparer?view=netcore-3.1) - -### Explanation ### - -This project shows how to run an ASP.NET Core Web API project as an AWS Lambda exposed through Amazon API Gateway. The NuGet package [Amazon.Lambda.AspNetCoreServer](https://www.nuget.org/packages/Amazon.Lambda.AspNetCoreServer) contains a Lambda function that is used to translate requests from API Gateway into the ASP.NET Core framework and then the responses from ASP.NET Core back to API Gateway. \ No newline at end of file diff --git a/app/app_awsDotNetCoreShoppingCart/Readme.md b/app/app_awsDotNetCoreShoppingCart/Readme.md deleted file mode 100644 index 707dd83f2..000000000 --- a/app/app_awsDotNetCoreShoppingCart/Readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# ASP.NET Core Shopping Basket API. A Serverless Application with React Interface - -With this application I have built a simple shopping basket, each item consisting only of a primitive string value. - -The basket can be modified using the individual request inputs. The user interface and application state are React driven with data modification being processed via .NET Core running on AWS Lambda. - -Whilst this functionality could be achieved with JavaScript alone, I wanted to explore AWS Lambda and .NET Core and the use of List collections. So the decision was made to go serverless compute. - -- AWS Lambda Repository (https://github.com/fsereno/app_awsDotNetCoreShoppingCart) - -### Explanation ### - -This project shows how to run an ASP.NET Core Web API project as an AWS Lambda exposed through Amazon API Gateway. The NuGet package [Amazon.Lambda.AspNetCoreServer](https://www.nuget.org/packages/Amazon.Lambda.AspNetCoreServer) contains a Lambda function that is used to translate requests from API Gateway into the ASP.NET Core framework and then the responses from ASP.NET Core back to API Gateway. \ No newline at end of file diff --git a/app/app_awsDotNetCoreShoppingCart/sass/styles.scss b/app/app_awsDotNetCoreShoppingCart/sass/styles.scss deleted file mode 100644 index 52c550e33..000000000 --- a/app/app_awsDotNetCoreShoppingCart/sass/styles.scss +++ /dev/null @@ -1,5 +0,0 @@ -@import "../../sass/includes/colours.scss"; - -.api-submit { - width: 5rem; -} \ No newline at end of file diff --git a/app/app_awsDotNetCoreShoppingCart/src/app.js b/app/app_awsDotNetCoreShoppingCart/src/app.js deleted file mode 100644 index 7b17707f4..000000000 --- a/app/app_awsDotNetCoreShoppingCart/src/app.js +++ /dev/null @@ -1,284 +0,0 @@ -"use strict;" - -import '../sass/styles.scss'; - -import React from 'react'; -import ReactDOM from 'react-dom'; -import { PuzzleModalComponent } from '../../js/modules/react/puzzleModalComponent.js'; -import { SpinnerComponent } from '../../js/modules/react/spinnerComponent.js' -import { ErrorModalComponent } from '../../js/modules/react/errorModalComponent.js'; -import { ConfigUtil } from '../../js/modules/utils/configUtil'; -import { FormComponent } from './formComponent'; -import { jQueryAjaxUtil } from '../../js/modules/utils/jQueryAjaxUtil'; - -const APP_CONFIG = ConfigUtil.get("awsDotNetCoreShoppingCart"); -const GET_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.get}`; -const ADD_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.add}`; -const DELETE_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.delete}`; -const UPDATE_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.update}`; -const PUZZLE = "4 x 4 - 1 ="; -const DEFAULT_COLLECTION = [ - { name: "Apple" }, - { name: "Banana" } -] -class ShoppingListApp extends React.Component { - constructor(props) { - super(props); - this.state = { - items: DEFAULT_COLLECTION, - resultSet: DEFAULT_COLLECTION, - isValid: false, - showSpinner: false, - showPuzzleModal: true, - showErrorModal: false, - isPuzzleValid: false - }; - this.handleGetSubmit = this.handleGetSubmit.bind(this); - this.handleAddSubmit = this.handleAddSubmit.bind(this); - this.handleUpdateSubmit = this.handleUpdateSubmit.bind(this); - this.handleDeleteSubmit = this.handleDeleteSubmit.bind(this); - this.handleIsPuzzleValid = this.handleIsPuzzleValid.bind(this); - this.handlePuzzleModalClose = this.handlePuzzleModalClose.bind(this); - this.handlePuzzleModalShow = this.handlePuzzleModalShow.bind(this); - this.handleErrorModalClose = this.handleErrorModalClose.bind(this); - this.handleBeforeAjax = this.handleBeforeAjax.bind(this); - this.handleFailedAjax = this.handleFailedAjax.bind(this); - } - - handleBeforeAjax() { - this.setState({ - showSpinner: true, - showPuzzleModal: false - }); - } - - handleFailedAjax() { - this.setState({ - showErrorModal: true, - showSpinner: false - }); - } - - handleAjax(request) { - jQueryAjaxUtil.handleAjax(request, this.state.isPuzzleValid, this.handleBeforeAjax, this.handleFailedAjax, this.handlePuzzleModalShow); - } - - handleGetSubmit(event) { - event.preventDefault(); - let input = event.target.elements[0].value; - let index = Number(input); - let isValid = response => typeof response !== "undefined" && response.length > 0; - let request = { - url: GET_ENDPOINT, - type: "POST", - contentType: 'application/json;', - data: JSON.stringify({ - "index": index, - "items":this.state.items - }), - success: (response) => { - if (isValid(response)) { - this.setState({ - resultSet: response, - showSpinner: false - }); - } - } - } - this.handleAjax(request); - } - - handleAddSubmit(event) { - event.preventDefault(); - let input = event.target.elements[0].value; - let request = { - url: ADD_ENDPOINT, - type: "POST", - contentType: 'application/json;', - data: JSON.stringify({ - "item":{ - "name":input - }, - "items":this.state.items - }), - success: (response) => { - this.setState({ - resultSet: response, - items: response, - showSpinner: false - }); - } - } - this.handleAjax(request); - } - - handleUpdateSubmit(event) { - event.preventDefault(); - let index = Number(event.target.elements[0].value); - let value = event.target.elements[1].value; - let request = { - url: UPDATE_ENDPOINT, - type: "POST", - contentType: 'application/json;', - data: JSON.stringify({ - "index":index, - "item":{ - "name":value - }, - "items":this.state.items - }), - success: (response) => { - this.setState({ - resultSet: response, - items: response, - showSpinner: false - }); - } - } - this.handleAjax(request); - } - - handleDeleteSubmit(event) { - event.preventDefault(); - let index = Number(event.target.elements[0].value); - let request = { - url: DELETE_ENDPOINT, - type: "POST", - contentType: 'application/json;', - data: JSON.stringify({ - "index":index, - "items":this.state.items - }), - success: (response) => { - this.setState({ - resultSet: response, - items: response, - showSpinner: false - }); - } - } - this.handleAjax(request); - } - - handleIsPuzzleValid() { - this.setState({ - isPuzzleValid: true, - showPuzzleModal: false - }) - } - - handlePuzzleModalClose() { - this.setState({ - showPuzzleModal: false - }) - } - - handlePuzzleModalShow() { - this.setState({ - showPuzzleModal: true - }) - } - - handleErrorModalClose() { - this.setState({ - showErrorModal: false - }) - } - - render() { - return ( -
- - - -
-
-

- Basket: -

-
    - {this.state.resultSet.map((item) => { - return
  • {item.name}
  • - })} -
-

- Use the below interface to alter the basket's contents: -

-
-
-
-
- - - - -
-
-
- ); - } -} - -ReactDOM.render( - , - document.getElementById('result') -); \ No newline at end of file diff --git a/app/app_awsDotNetCoreShoppingCart/src/formComponent.js b/app/app_awsDotNetCoreShoppingCart/src/formComponent.js deleted file mode 100644 index 18300a8a3..000000000 --- a/app/app_awsDotNetCoreShoppingCart/src/formComponent.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict;" - -import React, { useState } from 'react'; -import Button from 'react-bootstrap/Button'; -import Form from 'react-bootstrap/Form'; -import Row from 'react-bootstrap/Row'; -import Col from 'react-bootstrap/Col'; -import InputGroup from 'react-bootstrap/InputGroup'; - -export function FormComponent(props) { - - const [validated, setValidated] = useState(false); - - const handleSubmit = (event) => { - event.preventDefault(); - const form = event.currentTarget; - - if (form.checkValidity() === false) { - - event.stopPropagation(); - - } else { - - props.handleSubmit(event); - - } - - setValidated(true); - }; - - return ( - <> - - -
- - - {props.label} - - - {props.children.map(item => { - return () - })} - - - - - {props.error || "Please enter a valid value."} - - - -
- -
- - ) -} \ No newline at end of file diff --git a/app/app_awsDotNetCoreShoppingCart/tests/e2e/taiko.test.js b/app/app_awsDotNetCoreShoppingCart/tests/e2e/taiko.test.js deleted file mode 100644 index 2855435d5..000000000 --- a/app/app_awsDotNetCoreShoppingCart/tests/e2e/taiko.test.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @jest-environment jsdom - */ - -import { openBrowser, goto, write, click, closeBrowser, $, into, textBox, button, waitFor, evaluate } from 'taiko'; - -const APPLICATION = "app_awsDotNetCoreShoppingCart"; -const URL = `http://localhost:8080/${APPLICATION}/index.html`; - -beforeAll(async () => { - await openBrowser({ - headless: true, - slowMo: 250, - args: ['--no-sandbox'] - }); -}); - -describe(APPLICATION, () => { - test('Should get all items when no value is passed', async () => { - await goto(URL); - await write('15', into(textBox({ id: 'answerInput' }), { force: true })); - await click(button({ id: 'submitPuzzle' })); - await waitFor(2000); - await click(button({ id: 'get_submit' })); - await waitFor(2000); - const result = await evaluate($('#basketItems'), (element) => element.innerText); - expect(result).toBe("Apple\nBanana"); - }, 100000); - test('Should get the correct single item when a position is passed', async () => { - await goto(URL); - await write('15', into(textBox({ id: 'answerInput' }), { force: true })); - await click(button({ id: 'submitPuzzle' })); - await waitFor(2000); - await write('2', into(textBox({id:'get'}))); - await click(button({ id: 'get_submit' })); - await waitFor(2000); - const result = await evaluate($('#basketItems'), (element) => element.innerText); - expect(result).toBe("Banana"); - }, 100000); - test('Should add a single item to the existing collection', async () => { - await goto(URL); - await write('15', into(textBox({ id: 'answerInput' }), { force: true })); - await click(button({ id: 'submitPuzzle' })); - await waitFor(2000); - await write('Bread', into(textBox({id:'add'}))); - await click(button({ id: 'add_submit' })); - await waitFor(2000); - const result = await evaluate($('#basketItems'), (element) => element.innerText); - expect(result).toBe("Apple\nBanana\nBread"); - }, 100000); - test('Should delete the correct item when a position is passed', async () => { - await goto(URL); - await write('15', into(textBox({ id: 'answerInput' }), { force: true })); - await click(button({ id: 'submitPuzzle' })); - await waitFor(2000); - await write('2', into(textBox({id:'delete'}))); - await click(button({ id: 'delete_submit' })); - await waitFor(2000); - const result = await evaluate($('#basketItems'), (element) => element.innerText); - expect(result).toBe("Apple"); - }, 100000); - test('Should update a single item in the existing collection', async () => { - await goto(URL); - await write('15', into(textBox({ id: 'answerInput' }), { force: true })); - await click(button({ id: 'submitPuzzle' })); - await waitFor(2000); - await write('2', into(textBox({id:'update_position'}))); - await write('Wine', into(textBox({id:'update_value'}))); - await click(button({ id: 'update_submit' })); - await waitFor(2000); - const result = await evaluate($('#basketItems'), (element) => element.innerText); - expect(result).toBe("Apple\nWine"); - }, 100000); -}); -afterAll(() => { - closeBrowser(); -}); \ No newline at end of file diff --git a/app/app_awsDotNetCoreStringSortApi/Readme.md b/app/app_awsDotNetCoreStringSortApi/Readme.md deleted file mode 100644 index 5b9dc024f..000000000 --- a/app/app_awsDotNetCoreStringSortApi/Readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# ASP.NET Core Natural String Sorting API. A Serverless Application with React Interface - -With this application I have built a natural string sorting algorithm, using .NET Core served via an AWS Serverless Application (SAM). A basic React user interface handles user input and application state. - -With this application I have implemented IComparer to handle the sorting logic, comparing chunks of alpha and numeric values in order to achieve a natural sort order. - -Whilst this functionality could be achieved with JavaScript alone, I wanted to demonstrate knowledge of IComparer and the .NET Core framework along with AWS Lambda. - -A lot of research was undertaken for this application, with many permutations in order to overcome this simple, yet complex task. Made for a very enjoyable project! - -- AWS Lambda Repository (https://github.com/fsereno/app_awsDotNetCoreStringSortApi) - -- IComparer (https://docs.microsoft.com/en-us/dotnet/api/system.collections.icomparer?view=netcore-3.1) - -### Explanation ### - -This project shows how to run an ASP.NET Core Web API project as an AWS Lambda exposed through Amazon API Gateway. The NuGet package [Amazon.Lambda.AspNetCoreServer](https://www.nuget.org/packages/Amazon.Lambda.AspNetCoreServer) contains a Lambda function that is used to translate requests from API Gateway into the ASP.NET Core framework and then the responses from ASP.NET Core back to API Gateway. \ No newline at end of file diff --git a/app/app_awsDotNetCoreStringSortApi/sass/styles.scss b/app/app_awsDotNetCoreStringSortApi/sass/styles.scss deleted file mode 100644 index bfe962e64..000000000 --- a/app/app_awsDotNetCoreStringSortApi/sass/styles.scss +++ /dev/null @@ -1,11 +0,0 @@ -@import "../../sass/includes/colours.scss"; - -body { - - h1 { - - color: $black; - - } - -} \ No newline at end of file diff --git a/app/app_awsDotNetCoreStringSortApi/tests/e2e/taiko.test.js b/app/app_awsDotNetCoreStringSortApi/tests/e2e/taiko.test.js deleted file mode 100644 index ffa58fb7f..000000000 --- a/app/app_awsDotNetCoreStringSortApi/tests/e2e/taiko.test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @jest-environment jsdom - */ - - import { openBrowser, goto, write, click, closeBrowser, $, into, textBox, button, waitFor, evaluate } from 'taiko'; - - const APPLICATION = "app_awsDotNetCoreStringSortApi"; - const URL = `http://localhost:8080/${APPLICATION}/index.html`; - - beforeAll(async () => { - await openBrowser({ - headless: true, - slowMo: 250, - args: ['--no-sandbox'] - }); - }); - - describe(APPLICATION, () => { - test('Should add an item', async () => { - await goto(URL); - await write('11', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); - await write('C,B,A,10,1', into(textBox({id:'valuesInput'}))); - await click(button({id:'sort_submit'})); - const result = await evaluate($('#resultOutput'), (element) => element.innerText); - expect(result).toBe('1,10,A,B,C'); - }, 100000); - }); - - afterAll(() => { - closeBrowser(); - }); \ No newline at end of file diff --git a/app/app_awsNodeToDoApi/Readme.md b/app/app_awsNodeToDoApi/Readme.md deleted file mode 100644 index ff7c8b67e..000000000 --- a/app/app_awsNodeToDoApi/Readme.md +++ /dev/null @@ -1,21 +0,0 @@ -# AWS driven, B2C API, To-Do List SPA - -With this application I have extended previous To-Do concepts. This application is driven by AWS with Node.js and is authenticated by Cognito. Data is persisted with Dynamo DB and an AWS HTTP API Gateway serves all client requests, protected by an "authorizor". - -I have used the Serverless Framework architecture to build this application. This has allowed for a great, zero friction, workflow. - -The frontend is using React with React Router, state is manage by a combination of React Context and the Context Provider Pattern. - -- AWS Repository (https://github.com/fsereno/app_awsNodeToDoApi) -- Serverless (https://www.serverless.com/) -- AWS Cognito (https://aws.amazon.com/cognito/) -- AWS Dynamo (https://aws.amazon.com/dynamodb) -- AWS API Gateway (https://aws.amazon.com/api-gateway/) -- Node.js (https://nodejs.org/en/) -- React Hooks (https://reactjs.org/docs/hooks-reference.html) -- React Router (https://reactrouter.com/web/guides/quick-start) -- React Context (https://reactjs.org/docs/context.html) - -### Explanation ### - -The interest in this application has come from a great deal of research and the need to demonstrate a full, end to end application, covering frontend, authentication, backend business logic and data store. \ No newline at end of file diff --git a/app/app_awsNodeToDoApi/pug/index.pug b/app/app_awsNodeToDoApi/pug/index.pug deleted file mode 100644 index da50e2869..000000000 --- a/app/app_awsNodeToDoApi/pug/index.pug +++ /dev/null @@ -1,4 +0,0 @@ -extends ../../pug/layouts/main.pug - -block content - div#result \ No newline at end of file diff --git a/app/app_awsNodeToDoApi/src/components/contextProviders/loginContextProvider.js b/app/app_awsNodeToDoApi/src/components/contextProviders/loginContextProvider.js deleted file mode 100644 index 8d9b38e29..000000000 --- a/app/app_awsNodeToDoApi/src/components/contextProviders/loginContextProvider.js +++ /dev/null @@ -1,115 +0,0 @@ -"use strict;" - -import React, { useState, useLayoutEffect, useRef } from 'react'; -import { CognitoUser, AuthenticationDetails, CognitoUserPool } from 'amazon-cognito-identity-js'; -import { LoginContext } from '../../contexts'; -import { SUCCESS } from "../../constants"; - -export const LoginContextProvider = ({ children, poolData }) => { - - const [authenticated, setAuthenticated] = useState(false); - - const userPool = new CognitoUserPool(poolData); - - const token = useRef(); - const username = useRef(); - - const getCurrentUser = () => new Promise((resolve, reject) => { - - const currentUser = userPool.getCurrentUser(); - - if (currentUser != null) { - - currentUser.getSession(err => { - - if (err != null && currentUser.signInUserSession != null) { - reject(undefined); - console.error(err.message); - } else { - resolve(currentUser); - } - }); - } else { - reject(undefined); - } - }); - - const logoutUser = () => new Promise((resolve, reject) => { - getCurrentUser().then(currentUser => { - if (currentUser) { - currentUser.globalSignOut({ - onSuccess: function (result) { - if (result === SUCCESS) { - setAuthenticated(false); - resolve({ success: true }); - } - }, - onFailure: function (error) { - reject({ success: false, error }); - }, - }); - } - - }).catch((error) => { - reject({ success: false, error }); - }); - }); - - const loginUser = (username, password) => new Promise((resolve, reject) => { - - const authenticationData = { - Username: username, - Password: password, - }; - - const authenticationDetails = new AuthenticationDetails(authenticationData); - - const userData = { - Username: username, - Pool: new CognitoUserPool(poolData), - }; - - const cognitoUser = new CognitoUser(userData); - - cognitoUser.authenticateUser(authenticationDetails, { - onSuccess: function (result) { - setAuthenticated(true); - resolve({ success: true }); - }, - onFailure: function (error) { - reject({ success: false, error }); - }, - }); - }); - - useLayoutEffect(() => { - getCurrentUser() - .then(currentUser => { - if (currentUser) { - - token.current = currentUser.signInUserSession.idToken.jwtToken; - username.current = currentUser.username; - - if (!authenticated) { - setAuthenticated(true); - } - } - }) - .catch(() => setAuthenticated(false)); - }, [authenticated]); - - const context = { - authenticated, - setAuthenticated, - loginUser, - logoutUser, - token, - username - }; - - return ( - - {children} - - ) -} \ No newline at end of file diff --git a/app/app_awsNodeToDoApi/src/components/protectedRoute.js b/app/app_awsNodeToDoApi/src/components/protectedRoute.js deleted file mode 100644 index e331108a9..000000000 --- a/app/app_awsNodeToDoApi/src/components/protectedRoute.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict;" - -import React from 'react'; -import { LoginContext } from '../contexts'; -import { Unauthorised } from './pages/unauthorised'; - -export const ProtectedRoute = ({Component}) => { - - const loginContext = React.useContext(LoginContext); - - return ( - <> - {loginContext.authenticated && - - } - {!loginContext.authenticated && - - } - - ); -} \ No newline at end of file diff --git a/app/app_awsDotNetCoreAsyncCoffeeMachine/Readme.md b/app/app_coffeeMachine/Readme.md similarity index 59% rename from app/app_awsDotNetCoreAsyncCoffeeMachine/Readme.md rename to app/app_coffeeMachine/Readme.md index 941ea7c9b..7334511bf 100644 --- a/app/app_awsDotNetCoreAsyncCoffeeMachine/Readme.md +++ b/app/app_coffeeMachine/Readme.md @@ -1,15 +1,9 @@ -# AWS .NET Core Asynchronous Coffee Maker. A Serverless Application with React Interface +# .NET Asynchronous Coffee Maker This application demonstrates knowledge of multithreading with use of the async, await, Task and the State Machine. The process of making a cup of coffee can be either run synchronously or asynchronously. The order in which the steps are carried out depends on available threads. Synchronously, with only a single thread, every task must finish before the next. Asynchronously, we are able to run background tasks, such as boiling the kettle while we get cups out of a cupboard using multiple threads. Each step is entered into a Log, which is updated by reference during the process. I have also implemented IEnumerable and IEnumorator to demonstrate the iterator pattern. Keeping the Log structure hidden and allowing indirect, readonly iteration of the Log collection. -- AWS Lambda Repository (https://github.com/fsereno/app_awsDotNetCoreAsyncCoffeeMachine) - - IEnumerable (https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerable?view=netcore-3.1) -- IEnumorator (https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerator?view=netcore-3.1) - -### Explanation ### - -This project shows how to run an ASP.NET Core Web API project as an AWS Lambda exposed through Amazon API Gateway. The NuGet package [Amazon.Lambda.AspNetCoreServer](https://www.nuget.org/packages/Amazon.Lambda.AspNetCoreServer) contains a Lambda function that is used to translate requests from API Gateway into the ASP.NET Core framework and then the responses from ASP.NET Core back to API Gateway. \ No newline at end of file +- IEnumorator (https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerator?view=netcore-3.1) \ No newline at end of file diff --git a/app/app_coffeeMachine/backend/api/Controllers/ApiController.cs b/app/app_coffeeMachine/backend/api/Controllers/ApiController.cs new file mode 100644 index 000000000..4fd761d45 --- /dev/null +++ b/app/app_coffeeMachine/backend/api/Controllers/ApiController.cs @@ -0,0 +1,70 @@ +using Microsoft.AspNetCore.Mvc; +using Portfolio.Core.Types; +using Portfolio.Core.Services; +using Portfolio.CoffeeMachine.Interfaces; +using Portfolio.CoffeeMachine.Utils; +using Portfolio.CoffeeMachine.Models; + +namespace Portfolio.CoffeeMachine.Controllers; + +/// +/// API controller for Coffee Machine operations. +/// +[ApiController] +[Route("[controller]")] +public class ApiController : ControllerBase +{ + private readonly ILogger _logger; + private readonly TestService _testService; + private readonly ITaskRunner _coffeeMakerUtil; + + public ApiController( + ILogger logger, + TestService testService, + ITaskRunner coffeeMakerUtil) + { + _logger = logger; + _testService = testService; + _coffeeMakerUtil = coffeeMakerUtil; + } + + /// + /// Executes the Coffee Maker process asynchronously and returns the log items. + /// + /// A list of log items generated during the process. + [HttpGet("RunAsync")] + public async Task> RunAsync() + { + Log log; + + try + { + log = await _coffeeMakerUtil.RunAsync(); + } + catch (Exception exception) + { + throw new Exception("Unable to run process: " + exception.Message); + } + return log?.Get(); + } + + /// + /// Executes the Coffee Maker process synchronously and returns the log items. + /// + /// A list of log items generated during the process. + [HttpGet("Run")] + public List Run() + { + Log log; + + try + { + log = _coffeeMakerUtil.Run(); + } + catch (Exception exception) + { + throw new Exception("Unable to run process: " + exception.Message); + } + return log?.Get(); + } +} diff --git a/app/app_coffeeMachine/backend/api/Interfaces/ITaskRunner.cs b/app/app_coffeeMachine/backend/api/Interfaces/ITaskRunner.cs new file mode 100644 index 000000000..c47d8999d --- /dev/null +++ b/app/app_coffeeMachine/backend/api/Interfaces/ITaskRunner.cs @@ -0,0 +1,41 @@ +using System.Threading.Tasks; +using Portfolio.CoffeeMachine.Models; + +namespace Portfolio.CoffeeMachine.Interfaces +{ + public interface ITaskRunner + { + /// + /// Run tasks synchronously + /// + /// A Log of taks run + Log Run(); + + /// + /// Run tasks Asynchronously + /// + /// A Log of taks run + Task RunAsync(); + + /// + /// Carry out the singular instruction immediately with no waiting + /// + /// An instruction as string + void Do(string instruction); + + /// + /// Carry out the specified instruction synchronously waiting for a specified delay + /// + /// An instruction as string + /// A delay in seconds + void Start(string instruction, int seconds); + + /// + /// Carry out the specified instruction Asynchronously awaiting for a specified delay + /// + /// An instruction as string + /// A delay in seconds + /// A Task boolean when the task is complete + Task StartAsync(string instruction, int seconds); + } +} \ No newline at end of file diff --git a/app/app_coffeeMachine/backend/api/Models/Log.cs b/app/app_coffeeMachine/backend/api/Models/Log.cs new file mode 100644 index 000000000..7f046301b --- /dev/null +++ b/app/app_coffeeMachine/backend/api/Models/Log.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Portfolio.CoffeeMachine.Models +{ + /// + /// Represents a log of coffee machine activities. + /// + public class Log : IEnumerable + { + private List _log; + + /// + /// Initializes a new instance of the Log class. + /// + public Log() + { + _log = new List(); + } + + /// + /// Gets the log items in the log. + /// + /// A list of log items. + public List Get() + { + var log = new List(); + foreach(var item in _log) + { + log.Add(item); + } + return log; + } + + /// + /// Gets the number of log items in the log. + /// + /// The number of log items. + public int Count() + { + return _log.Count; + } + + /// + /// Adds a log item to the log. + /// + /// The log item to add. + public void Add(LogItem logItem) + { + _log.Add(logItem); + } + + /// + /// Returns an enumerator that iterates through the log. + /// + /// An enumerator for the log. + IEnumerator IEnumerable.GetEnumerator() + { + return (IEnumerator) GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the log. + /// + /// An enumerator for the log. + public LogEnumerator GetEnumerator() + { + return new LogEnumerator(_log); + } + + /// + /// Represents an enumerator for the Log class. + /// + public class LogEnumerator : IEnumerator + { + private int _position = -1; + private List _log; + + /// + /// Initializes a new instance of the LogEnumerator class with the specified log. + /// + /// The log to enumerate. + public LogEnumerator(List log) + { + _log = log; + } + + /// + /// Advances the enumerator to the next log item. + /// + /// true if the enumerator was successfully advanced to the next log item; false if the enumerator has reached the end of the log. + public bool MoveNext() + { + _position++; + return (_position < _log.Count); + } + + /// + /// Resets the enumerator to its initial position, before the first log item. + /// + public void Reset() + { + _position = -1; + } + + object IEnumerator.Current + { + get + { + return Current; + } + } + + /// + /// Gets the current log item in the log. + /// + public LogItem Current + { + get + { + try + { + return _log[_position]; + } + catch (IndexOutOfRangeException) + { + throw new InvalidOperationException(); + } + } + } + } + } +} \ No newline at end of file diff --git a/app/app_coffeeMachine/backend/api/Models/LogItem.cs b/app/app_coffeeMachine/backend/api/Models/LogItem.cs new file mode 100644 index 000000000..69e86565c --- /dev/null +++ b/app/app_coffeeMachine/backend/api/Models/LogItem.cs @@ -0,0 +1,29 @@ +namespace Portfolio.CoffeeMachine.Models +{ + /// + /// Represents a single log item in the coffee machine log. + /// + public class LogItem + { + /// + /// Initializes a new instance of the LogItem class with the specified detail and thread. + /// + /// The detail of the log item. + /// The thread associated with the log item. + public LogItem(string detail, int thread) + { + this.Detail = detail; + this.Thread = thread; + } + + /// + /// Gets or sets the detail of the log item. + /// + public string Detail { get; set; } + + /// + /// Gets or sets the thread associated with the log item. + /// + public int Thread { get; set; } + } +} diff --git a/app/app_coffeeMachine/backend/api/Program.cs b/app/app_coffeeMachine/backend/api/Program.cs new file mode 100644 index 000000000..c5e1fc218 --- /dev/null +++ b/app/app_coffeeMachine/backend/api/Program.cs @@ -0,0 +1,40 @@ +using Portfolio.Core.Services; +using Portfolio.CoffeeMachine.Interfaces; +using Portfolio.CoffeeMachine.Utils; + +var builder = WebApplication.CreateBuilder(args); + +builder.WebHost.UseUrls("http://*:3001"); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +builder.Services.AddTransient(); + +// Services +builder.Services.AddScoped(); + +builder.Services.AddHealthChecks(); + +var app = builder.Build(); + +app.MapHealthChecks("/healthcheck"); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/app/app_coffeeMachine/backend/api/Properties/launchSettings.json b/app/app_coffeeMachine/backend/api/Properties/launchSettings.json new file mode 100644 index 000000000..d58642981 --- /dev/null +++ b/app/app_coffeeMachine/backend/api/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:4279", + "sslPort": 44379 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5065", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7114;http://localhost:5065", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/app/app_coffeeMachine/backend/api/Utils/CoffeeMakerUtil.cs b/app/app_coffeeMachine/backend/api/Utils/CoffeeMakerUtil.cs new file mode 100644 index 000000000..7b39f0072 --- /dev/null +++ b/app/app_coffeeMachine/backend/api/Utils/CoffeeMakerUtil.cs @@ -0,0 +1,106 @@ +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Portfolio.CoffeeMachine.Interfaces; +using Portfolio.CoffeeMachine.Models; + +namespace Portfolio.CoffeeMachine.Utils +{ + /// + /// Utility class for running coffee machine tasks. + /// + public class CoffeeMakerUtil : ITaskRunner + { + private Log _log; + private readonly ILogger _logger; + + /// + /// Initializes a new instance of the CoffeeMakerUtil class with the specified logger. + /// + /// The logger to use for logging messages. + public CoffeeMakerUtil(ILogger logger) + { + _logger = logger; + } + + /// + public Log Run() + { + _log = new Log(); + _logger.LogInformation("Starting synchronous process"); + + this.Start("boiling the kettle", 3000); + this.Do("get coffee from cupboard"); + this.Do("pack coffee into cafetiere"); + this.Do("get cup from cupboard"); + this.Do("get milk from fridge"); + this.Do("pour milk into cup"); + this.Do("put cup in microwave"); + this.Start("microwaving cup", 3500); + this.Do("pour boiling water into cafetiere"); + this.Do("brew the coffee"); + this.Do("get cup from microwave"); + this.Do("plunge cafetiere"); + this.Do("pour coffee into cup"); + this.Do("stir coffee"); + this.Do("drink coffee"); + + _logger.LogInformation("Ending synchronous process"); + + return _log; + } + + /// + public async Task RunAsync() + { + _log = new Log(); + _logger.LogInformation("Starting asynchronous process"); + + var boilingWaterTask = this.StartAsync("boiling the kettle", 3000); + this.Do("get coffee from cupboard"); + this.Do("pack coffee into cafetiere"); + this.Do("get cup from cupboard"); + this.Do("get milk from fridge"); + this.Do("pour milk into cup"); + this.Do("put cup in microwave"); + var microwavingCupTask = this.StartAsync("microwaving cup", 3500); + var waterBoild = await boilingWaterTask; + this.Do("pour boiling water into cafetiere"); + this.Do("brew the coffee"); + var cupMicrowaved = await microwavingCupTask; + this.Do("get cup from microwave"); + this.Do("plunge cafetiere"); + this.Do("pour coffee into cup"); + this.Do("stir coffee"); + this.Do("drink coffee"); + + _logger.LogInformation("Ending asynchronous process"); + + return _log; + } + + /// + public async Task StartAsync(string instruction, int seconds) + { + _log.Add(new LogItem($"Start {instruction.ToLower()}", Thread.CurrentThread.ManagedThreadId)); + await Task.Delay(seconds); + _log.Add(new LogItem($"Finished {instruction.ToLower()}", Thread.CurrentThread.ManagedThreadId)); + return true; + } + + /// + public void Start(string instruction, int seconds) + { + _log.Add(new LogItem($"Start {instruction.ToLower()}", Thread.CurrentThread.ManagedThreadId)); + Thread.Sleep(seconds); + _log.Add(new LogItem($"Finished {instruction.ToLower()}", Thread.CurrentThread.ManagedThreadId)); + } + + /// + public void Do(string instruction) + { + var detail = char.ToUpper(instruction[0])+instruction.Substring(1); + _log.Add(new LogItem(detail, Thread.CurrentThread.ManagedThreadId)); + } + } +} \ No newline at end of file diff --git a/app/app_coffeeMachine/backend/api/api.csproj b/app/app_coffeeMachine/backend/api/api.csproj new file mode 100644 index 000000000..19bfaa242 --- /dev/null +++ b/app/app_coffeeMachine/backend/api/api.csproj @@ -0,0 +1,18 @@ + + + + net7.0 + enable + enable + + + + + + + + + + + + diff --git a/app/app_coffeeMachine/backend/api/appsettings.Development.json b/app/app_coffeeMachine/backend/api/appsettings.Development.json new file mode 100644 index 000000000..ff66ba6b2 --- /dev/null +++ b/app/app_coffeeMachine/backend/api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/app/app_coffeeMachine/backend/api/appsettings.json b/app/app_coffeeMachine/backend/api/appsettings.json new file mode 100644 index 000000000..4d566948d --- /dev/null +++ b/app/app_coffeeMachine/backend/api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/app/app_coffeeMachine/backend/test/CoffeeMakerUtilTests.cs b/app/app_coffeeMachine/backend/test/CoffeeMakerUtilTests.cs new file mode 100644 index 000000000..76a7b142a --- /dev/null +++ b/app/app_coffeeMachine/backend/test/CoffeeMakerUtilTests.cs @@ -0,0 +1,115 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Moq; +using Portfolio.CoffeeMachine.Utils; +using Portfolio.CoffeeMachine.Models; +using Xunit; + +namespace Portfolio.CoffeeMachine.Tests +{ + public class CoffeeMakerUtilTests + { + private readonly CoffeeMakerUtil _sut; + + private readonly Mock> _logger; + public CoffeeMakerUtilTests() + { + _logger = new Mock>(); + _sut = new CoffeeMakerUtil(_logger.Object); + } + + [Fact] + public void Test_Run_Has_Correct_Numer_Of_Steps() + { + var log = _sut.Run(); + var result = log.Get().Count == 17; + Assert.True(result); + } + + [Fact] + public void Test_Run_All_Steps_On_Same_Thread() + { + var log = _sut.Run(); + var threads = log.Get().Select(x => x.Thread); + var result = threads.Distinct().Count() == 1; + Assert.True(result); + } + + [Fact] + public async Task Test_RunAsync_Has_Correct_Numer_Of_Steps() + { + var log = await _sut.RunAsync(); + var result = log.Get().Count == 17; + Assert.True(result); + } + + [Fact] + public async Task Test_RunAsync_Has_The_Correct_Order_For_Kettle() + { + var log = await _sut.RunAsync(); + var indexes = GetIndexOfOrderedTasks(log, "finished boiling the kettle", "pour boiling water into cafetiere"); + var result = indexes.IndexOfFirstTask < indexes.IndexOfSecondTask; + Assert.True(true); + } + + [Fact] + public async Task Test_RunAsync_Has_The_Correct_Order_For_Microwave() + { + var log = await _sut.RunAsync(); + var indexes = GetIndexOfOrderedTasks(log, "finished microwaving cup", "get cup from microwave"); + var result = indexes.IndexOfFirstTask < indexes.IndexOfSecondTask; + Assert.True(true); + } + + [Fact] + public void Test_Run_Verify_Logging() + { + var log = _sut.Run(); + VerifyLogger(LogLevel.Information, "Starting synchronous process"); + VerifyLogger(LogLevel.Information, "Ending synchronous process"); + } + + [Fact] + public async Task Test_Run_Async_Verify_Logging() + { + var log = await _sut.RunAsync(); + VerifyLogger(LogLevel.Information, "Starting asynchronous process"); + VerifyLogger(LogLevel.Information, "Ending asynchronous process"); + } + + private (int IndexOfFirstTask, int IndexOfSecondTask) GetIndexOfOrderedTasks(Log log, string detailOfFirstItem, string detailOfSecondItem) + { + var indexOfFirstTask = 0; + var indexOfSecondTask = 0; + + var i = 0; + foreach (var item in log) + { + if (item.Detail.ToLower() == detailOfFirstItem.ToLower()) + { + indexOfFirstTask = i; + } + + if (item.Detail.ToLower() == detailOfSecondItem.ToLower()) + { + indexOfSecondTask = i; + } + i++; + } + return (indexOfFirstTask, indexOfSecondTask); + } + + private void VerifyLogger(LogLevel expectedLogLevel, string expectedMessage = "") + { + _logger.Verify( + x => x.Log( + It.Is(l => l == expectedLogLevel), + It.IsAny(), + It.Is((v, t) => String.IsNullOrEmpty(expectedMessage) ? true : v.ToString() == expectedMessage), + It.IsAny(), + It.Is>((v, t) => true))); + } + } +} \ No newline at end of file diff --git a/app/app_coffeeMachine/backend/test/LogTests.cs b/app/app_coffeeMachine/backend/test/LogTests.cs new file mode 100644 index 000000000..273a457c1 --- /dev/null +++ b/app/app_coffeeMachine/backend/test/LogTests.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using Portfolio.CoffeeMachine.Models; +using Xunit; + +namespace Portfolio.CoffeeMachine.Tests +{ + public class LogTests + { + private readonly Log _sut; + public LogTests() + { + _sut = new Log(); + } + + [Fact] + public void Test_Log() + { + _sut.Add(new LogItem("Instruct 1", 10)); + _sut.Add(new LogItem("Instruct 2", 20)); + _sut.Add(new LogItem("Instruct 3", 30)); + + var result = new List(); + + foreach(var item in _sut) + { + result.Add(item.Detail); + } + + Assert.True(result.Count == 3); + } + } +} \ No newline at end of file diff --git a/app/app_coffeeMachine/backend/test/Usings.cs b/app/app_coffeeMachine/backend/test/Usings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/app/app_coffeeMachine/backend/test/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/app/app_coffeeMachine/backend/test/appsettings.json b/app/app_coffeeMachine/backend/test/appsettings.json new file mode 100644 index 000000000..6ba3a30b2 --- /dev/null +++ b/app/app_coffeeMachine/backend/test/appsettings.json @@ -0,0 +1,14 @@ +{ + "Lambda.Logging": { + "IncludeCategory": false, + "IncludeLogLevel": false, + "IncludeNewline": true, + "LogLevel": { + "Default": "Debug", + "Microsoft": "Information" + } + }, + "AWS": { + "Region": "" + } +} \ No newline at end of file diff --git a/app/app_coffeeMachine/backend/test/test.csproj b/app/app_coffeeMachine/backend/test/test.csproj new file mode 100644 index 000000000..a3869e69e --- /dev/null +++ b/app/app_coffeeMachine/backend/test/test.csproj @@ -0,0 +1,29 @@ + + + + net7.0 + enable + enable + + false + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/app/app_coffeeMachine/pug/index.pug b/app/app_coffeeMachine/pug/index.pug new file mode 100644 index 000000000..ad0fb8610 --- /dev/null +++ b/app/app_coffeeMachine/pug/index.pug @@ -0,0 +1,20 @@ +extends ../../pug/layouts/main.pug + +block content + div + p + | Think about how a cup of coffee is made. + | Typically tasks are carried out while the kettle is boiling. + | Why wait for a process to complete, when it could be run as a background task ? + h2 How ? + p + | Technically, when calling the 'Sync' method in .NET, a series of actions is executed + | synchronously in the order they are called. Each action completes before the next one is + | executed. On the other hand, when calling the 'Async' method, the async/await + | keywords are used, which create a state machine object. The 'Task' type serves as the + | interface between the code and the state machine. The thread pool in .NET is free to use new + | threads if necessary and allows execution to continue without blocking, unlike in a synchronous program. + p + | Run the process of making a cup of coffee both synchronously and asynchronously. + | Notice the difference in the order of tasks ? + div#result.mt-2 \ No newline at end of file diff --git a/app/app_awsDotNetCoreAsyncCoffeeMachine/sass/styles.scss b/app/app_coffeeMachine/sass/styles.scss similarity index 100% rename from app/app_awsDotNetCoreAsyncCoffeeMachine/sass/styles.scss rename to app/app_coffeeMachine/sass/styles.scss diff --git a/app/app_awsDotNetCoreAsyncCoffeeMachine/src/app.js b/app/app_coffeeMachine/src/app.js similarity index 100% rename from app/app_awsDotNetCoreAsyncCoffeeMachine/src/app.js rename to app/app_coffeeMachine/src/app.js diff --git a/app/app_awsDotNetCoreAsyncCoffeeMachine/src/coffeeMakerApp.js b/app/app_coffeeMachine/src/coffeeMakerApp.js similarity index 64% rename from app/app_awsDotNetCoreAsyncCoffeeMachine/src/coffeeMakerApp.js rename to app/app_coffeeMachine/src/coffeeMakerApp.js index 0301d9bc7..517cf72fa 100644 --- a/app/app_awsDotNetCoreAsyncCoffeeMachine/src/coffeeMakerApp.js +++ b/app/app_coffeeMachine/src/coffeeMakerApp.js @@ -1,30 +1,28 @@ "use strict;" import React from 'react'; -import { PuzzleModalComponent } from '../../js/modules/react/puzzleModalComponent.js'; import { SpinnerComponent } from '../../js/modules/react/spinnerComponent.js' import { ErrorModalComponent } from '../../js/modules/react/errorModalComponent.js'; import CoffeeMakerComponent from './coffeeMakerComponent'; import { ConfigUtil } from "../../js/modules/utils/configUtil"; import { jQueryAjaxUtil } from '../../js/modules/utils/jQueryAjaxUtil'; +import { DeploymentModalComponent } from '../../js/modules/react/deploymentModalComponent.js'; +import { DeploymentUtil } from '../../js/modules/utils/deploymentUtil'; + +const CONFIG = ConfigUtil.get(); +const APP_CONFIG = ConfigUtil.get("coffeeMachine"); +const RUN_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.run}`; +const RUN_ASYNC_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.runAsync}`; -const PUZZLE = "3 + 1 + 1 ="; -const APP_CONFIG = ConfigUtil.get("awsDotNetCoreAsyncCoffeeMachine"); -const RUN_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.run}`; -const RUN_ASYNC_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.runAsync}`; export default class CoffeeMakerApp extends React.Component { constructor(props) { super(props); this.state = { log: [], showSpinner: false, - showPuzzleModal: true, - showErrorModal: false, - isPuzzleValid: false + showDeploymentModal: DeploymentUtil.isNotCloud(), + showErrorModal: false }; - this.handleIsPuzzleValid = this.handleIsPuzzleValid.bind(this); - this.handlePuzzleModalClose = this.handlePuzzleModalClose.bind(this); - this.handlePuzzleModalShow = this.handlePuzzleModalShow.bind(this); this.handleErrorModalClose = this.handleErrorModalClose.bind(this); this.handleBeforeAjax = this.handleBeforeAjax.bind(this); this.handleFailedAjax = this.handleFailedAjax.bind(this); @@ -32,6 +30,8 @@ export default class CoffeeMakerApp extends React.Component { this.handleRunAsync = this.handleRunAsync.bind(this); this.handleAjax = this.handleAjax.bind(this); this.handleRequest = this.handleRequest.bind(this); + this.handleDeploymentModalClose = this.handleDeploymentModalClose.bind(this); + this.handleDeploymentModalShow = this.handleDeploymentModalShow.bind(this); } handleRun() { @@ -60,16 +60,15 @@ export default class CoffeeMakerApp extends React.Component { handleAjax(request) { jQueryAjaxUtil.handleAjax( request, - this.state.isPuzzleValid, + DeploymentUtil.isCloud(), this.handleBeforeAjax, this.handleFailedAjax, - this.handlePuzzleModalShow); + this.handleDeploymentModalShow); } handleBeforeAjax() { this.setState({ - showSpinner: true, - showPuzzleModal: false + showSpinner: true }); } @@ -80,28 +79,21 @@ export default class CoffeeMakerApp extends React.Component { }); } - handleIsPuzzleValid() { - this.setState({ - isPuzzleValid: true, - showPuzzleModal: false - }) - } - - handlePuzzleModalClose() { + handleErrorModalClose() { this.setState({ - showPuzzleModal: false + showErrorModal: false }) } - handlePuzzleModalShow() { + handleDeploymentModalClose() { this.setState({ - showPuzzleModal: true + showDeploymentModal: false }) } - handleErrorModalClose() { + handleDeploymentModalShow() { this.setState({ - showErrorModal: false + showDeploymentModal: true }) } @@ -116,13 +108,9 @@ export default class CoffeeMakerApp extends React.Component { - { await openBrowser({ @@ -18,9 +20,6 @@ beforeAll(async () => { describe(APPLICATION, () => { test('Should run the process asynchronously', async () => { await goto(URL); - await write('5', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); await click(button({id:'runAsync'})); const result = await text("Log of tasks carried out").exists(); const item = await text("Start boiling the kettle").exists(); @@ -28,9 +27,6 @@ describe(APPLICATION, () => { }, 100000) test('Should run the process synchronously', async () => { await goto(URL); - await write('5', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); await click(button({id:'runSync'})); const result = await text("Log of tasks carried out").exists(); const item = await text("Start boiling the kettle").exists(); diff --git a/app/app_AzureDotNetCoreDataStructuresApi/Readme.md b/app/app_dataStructures/Readme.md similarity index 81% rename from app/app_AzureDotNetCoreDataStructuresApi/Readme.md rename to app/app_dataStructures/Readme.md index dbf42b89e..0bacafc70 100644 --- a/app/app_AzureDotNetCoreDataStructuresApi/Readme.md +++ b/app/app_dataStructures/Readme.md @@ -1,4 +1,4 @@ -# Azure Functions, .NET Core, Data Structures Api +# .NET Data Structures With this application I am demonstrating knowledge of data the structures, Queue and Stack. With Queue being first in, first out and Stack being last in, first out. @@ -6,8 +6,6 @@ With this application I am demonstrating knowledge of data the structures, Queue Using Generics in .NET I have implemented an interface, which acts as the contract using polymorphism when instructing the Queue and Stack structures to add and remove items. -- Azure Functions Repository (https://github.com/fsereno/app_AzureDotNetCoreDataStructuresApi) - - Queue in .NET (https://docs.microsoft.com/en-us/dotnet/api/system.collections.queue?view=net-5.0) - Stack in .NET (https://docs.microsoft.com/en-us/dotnet/api/system.collections.stack?view=net-5.0) diff --git a/app/app_dataStructures/backend/api/Controllers/ApiController.cs b/app/app_dataStructures/backend/api/Controllers/ApiController.cs new file mode 100644 index 000000000..b98b0ad10 --- /dev/null +++ b/app/app_dataStructures/backend/api/Controllers/ApiController.cs @@ -0,0 +1,125 @@ +using System; +using System.IO; +using System.Collections; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Portfolio.Core.Types; +using Portfolio.Core.Services; +using Portfolio.DataStructures.Interfaces; +using Portfolio.DataStructures.Utils; +using Portfolio.DataStructures.Models; + +namespace Portfolio.DataStructures.Controllers; + +/// +/// API controller for data structure operations. +/// +[ApiController] +[Route("[controller]")] +public class ApiController : ControllerBase +{ + private readonly ILogger _logger; + private readonly ICollectionUtil> _queueUtil; + private readonly ICollectionUtil> _stackUtil; + + /// + /// Initializes a new instance of the ApiController class with the specified logger, queue utility, and stack utility. + /// + /// The logger to use for logging messages. + /// The utility for operating on queues. + /// The utility for operating on stacks. + public ApiController(ILogger logger, ICollectionUtil> queueUtil, ICollectionUtil> stackUtil) + { + _logger = logger; + _queueUtil = queueUtil; + _stackUtil = stackUtil; + } + + /// + /// Adds an item to the queue asynchronously. + /// + /// The request body containing the collection name and item to add. + /// An IActionResult representing the result of the operation. + [HttpPost("AddQueueItemAsync")] + public IActionResult AddQueueItemAsync([FromBody] AddRequestBody data) + { + _logger.LogInformation("AddQueueItemAsync endpoint hit"); + + string result = string.Empty; + + _logger.LogInformation("Adding item to the queue"); + + var queue = _queueUtil.Create(data.Collection); + _queueUtil.Add(queue, data.Item); + + _logger.LogInformation("Added item to the queue"); + + return Ok(queue); + } + + /// + /// Removes an item from the queue asynchronously. + /// + /// The request body containing the collection name. + /// An IActionResult representing the result of the operation. + [HttpPost("RemoveQueueItemAsync")] + public IActionResult RemoveQueueItemAsync([FromBody] RemoveRequestBody data) + { + _logger.LogInformation("RemoveQueueItemAsync endpoint hit"); + + string result = string.Empty; + + _logger.LogInformation("Removing item from the queue"); + + var queue = _queueUtil.Create(data.Collection); + _queueUtil.Remove(queue); + + _logger.LogInformation("Removed item from the queue"); + + return Ok(queue); + } + + /// + /// Adds an item to the stack asynchronously. + /// + /// The request body containing the collection name and item to add. + /// An IActionResult representing the result of the operation. + [HttpPost("AddStackItemAsync")] + public IActionResult AddStackItemAsync([FromBody] AddRequestBody data) + { + _logger.LogInformation("AddStackItemAsync endpoint hit"); + + string result = string.Empty; + + _logger.LogInformation("Adding item to the stack"); + + var stack = _stackUtil.Create(data.Collection); + _stackUtil.Add(stack, data.Item); + + _logger.LogInformation("Added item to the stack"); + + return Ok(stack); + } + + /// + /// Removes an item from the stack asynchronously. + /// + /// The request body containing the collection name. + /// An IActionResult representing the result of the operation. + [HttpPost("RemoveStackItemAsync")] + public IActionResult RemoveStackItemAsync([FromBody] RemoveRequestBody data) + { + _logger.LogInformation("RemoveStackItemAsync endpoint hit"); + + string result = string.Empty; + + _logger.LogInformation("Removing item from the stack"); + + var stack = _stackUtil.Create(data.Collection); + _stackUtil.Remove(stack); + + _logger.LogInformation("Removed item from the stack"); + + return Ok(stack); + } +} diff --git a/app/app_dataStructures/backend/api/Interfaces/ICollectionUtil.cs b/app/app_dataStructures/backend/api/Interfaces/ICollectionUtil.cs new file mode 100644 index 000000000..64f0054b1 --- /dev/null +++ b/app/app_dataStructures/backend/api/Interfaces/ICollectionUtil.cs @@ -0,0 +1,25 @@ +namespace Portfolio.DataStructures.Interfaces +{ + public interface ICollectionUtil + { + /// + /// Adds an item to the collection + /// + /// + /// Takes a collection of type T + void Add(T collection, string value); + + /// + /// Removes an item to the collection + /// + /// Takes a collection of type T + void Remove(T collection); + + /// + /// Creates a collection of type T + /// + /// The primitive array to create the collection from if not null + /// Returns the collection of type T + T Create(string[] array = null); + } +} \ No newline at end of file diff --git a/app/app_dataStructures/backend/api/Models/AddRequestBody.cs b/app/app_dataStructures/backend/api/Models/AddRequestBody.cs new file mode 100644 index 000000000..03265ee77 --- /dev/null +++ b/app/app_dataStructures/backend/api/Models/AddRequestBody.cs @@ -0,0 +1,18 @@ +namespace Portfolio.DataStructures.Models +{ + /// + /// Represents the request body for adding an item to a data structure. + /// + public class AddRequestBody + { + /// + /// Gets or sets the collection name or identifier. + /// + public string[] Collection { get; set; } + + /// + /// Gets or sets the item to add. + /// + public string Item { get; set; } + } +} \ No newline at end of file diff --git a/app/app_dataStructures/backend/api/Models/RemoveRequestBody.cs b/app/app_dataStructures/backend/api/Models/RemoveRequestBody.cs new file mode 100644 index 000000000..9f1f31c0b --- /dev/null +++ b/app/app_dataStructures/backend/api/Models/RemoveRequestBody.cs @@ -0,0 +1,13 @@ +namespace Portfolio.DataStructures.Models +{ + /// + /// Represents the request body for removing an item from a data structure. + /// + public class RemoveRequestBody + { + /// + /// Gets or sets the collection name or identifier. + /// + public string[] Collection { get; set; } + } +} \ No newline at end of file diff --git a/app/app_dataStructures/backend/api/Program.cs b/app/app_dataStructures/backend/api/Program.cs new file mode 100644 index 000000000..c3d9092de --- /dev/null +++ b/app/app_dataStructures/backend/api/Program.cs @@ -0,0 +1,39 @@ +using Portfolio.Core.Services; +using Portfolio.DataStructures.Interfaces; +using Portfolio.DataStructures.Utils; + +var builder = WebApplication.CreateBuilder(args); + +builder.WebHost.UseUrls("http://*:3002"); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +// Services +builder.Services.AddScoped>, QueueUtil>(); +builder.Services.AddScoped>, StackUtil>(); + +builder.Services.AddHealthChecks(); + +var app = builder.Build(); + +app.MapHealthChecks("/healthcheck"); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/app/app_dataStructures/backend/api/Properties/launchSettings.json b/app/app_dataStructures/backend/api/Properties/launchSettings.json new file mode 100644 index 000000000..81cd75977 --- /dev/null +++ b/app/app_dataStructures/backend/api/Properties/launchSettings.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:4279", + "sslPort": 44379 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5065", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7114;http://localhost:5065", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/app/app_dataStructures/backend/api/Utils/QueueUtil.cs b/app/app_dataStructures/backend/api/Utils/QueueUtil.cs new file mode 100644 index 000000000..b500b1ea1 --- /dev/null +++ b/app/app_dataStructures/backend/api/Utils/QueueUtil.cs @@ -0,0 +1,28 @@ +using System.Collections; +using Portfolio.DataStructures.Interfaces; + +namespace Portfolio.DataStructures.Utils +{ + public class QueueUtil : ICollectionUtil> + { + /// + public void Add(Queue collection, string value) + { + collection?.Enqueue(value); + } + + /// + public void Remove(Queue collection) + { + collection?.Dequeue(); + } + + /// + public Queue Create(string[] array = null) + { + var collection = array != null ? new Queue(array) : new Queue(); + + return collection; + } + } +} \ No newline at end of file diff --git a/app/app_dataStructures/backend/api/Utils/StackUtil.cs b/app/app_dataStructures/backend/api/Utils/StackUtil.cs new file mode 100644 index 000000000..8300642d5 --- /dev/null +++ b/app/app_dataStructures/backend/api/Utils/StackUtil.cs @@ -0,0 +1,36 @@ +using System.Collections; +using Portfolio.DataStructures.Interfaces; + +namespace Portfolio.DataStructures.Utils +{ + public class StackUtil : ICollectionUtil> + { + /// + public void Add(Stack collection, string value) + { + collection?.Push(value); + } + + /// + public void Remove(Stack collection) + { + collection?.Pop(); + } + + /// + public Stack Create(string[] array = null) + { + var collection = new Stack(); + + if (array != null) + { + for (var i = array.Length - 1; i >= 0; i--) + { + Add(collection, array[i]); + } + } + + return collection; + } + } +} \ No newline at end of file diff --git a/app/app_dataStructures/backend/api/api.csproj b/app/app_dataStructures/backend/api/api.csproj new file mode 100644 index 000000000..552ccdcdf --- /dev/null +++ b/app/app_dataStructures/backend/api/api.csproj @@ -0,0 +1,20 @@ + + + + net7.0 + enable + enable + + + + + + + + + + + + + + diff --git a/app/app_dataStructures/backend/api/api.sln b/app/app_dataStructures/backend/api/api.sln new file mode 100644 index 000000000..8652f95ce --- /dev/null +++ b/app/app_dataStructures/backend/api/api.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 25.0.1704.4 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "api.csproj", "{760951DE-23EF-4490-9F08-BAFE9D4CDF29}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {760951DE-23EF-4490-9F08-BAFE9D4CDF29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {760951DE-23EF-4490-9F08-BAFE9D4CDF29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {760951DE-23EF-4490-9F08-BAFE9D4CDF29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {760951DE-23EF-4490-9F08-BAFE9D4CDF29}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2D6EF111-100D-42C9-B9FD-BD3C5E8D14A3} + EndGlobalSection +EndGlobal diff --git a/app/app_dataStructures/backend/api/appsettings.Development.json b/app/app_dataStructures/backend/api/appsettings.Development.json new file mode 100644 index 000000000..ff66ba6b2 --- /dev/null +++ b/app/app_dataStructures/backend/api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/app/app_dataStructures/backend/api/appsettings.json b/app/app_dataStructures/backend/api/appsettings.json new file mode 100644 index 000000000..4d566948d --- /dev/null +++ b/app/app_dataStructures/backend/api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/app/app_dataStructures/backend/test/QueueUtilTest.cs b/app/app_dataStructures/backend/test/QueueUtilTest.cs new file mode 100644 index 000000000..0d0df2214 --- /dev/null +++ b/app/app_dataStructures/backend/test/QueueUtilTest.cs @@ -0,0 +1,75 @@ +using System.Collections; +using Portfolio.DataStructures.Interfaces; +using Portfolio.DataStructures.Utils; +using Xunit; + +namespace Portfolio.DataStructures.Test +{ + public class QueueUtilTest + { + private readonly Queue _queue; + private readonly ICollectionUtil> _queueUtil; + + public QueueUtilTest() + { + _queueUtil = new QueueUtil(); + _queue = _queueUtil.Create(); + } + + [Fact] + public void Add_ShouldAddItemToQueue() + { + _queueUtil.Add(_queue, "Item 1"); + + var result = _queue.Count; + Assert.Equal(1, result); + } + + [Fact] + public void Add_ShouldNotErrorWhenNullIsPassedForQueue() + { + _queueUtil.Add(null, "Item 1"); + + var result = _queue.Count; + Assert.Equal(0, result); + } + + [Fact] + public void Remove_ShouldRemoveItemFromQueue() + { + _queueUtil.Add(_queue, "Item 1"); + _queueUtil.Remove(_queue); + + var result = _queue.Count; + Assert.Equal(0, result); + } + + [Fact] + public void Remove_ShouldNotRemoveIfQueueIsNull() + { + _queueUtil.Remove(null); + + var result = _queue.Count; + Assert.Equal(0, result); + } + + [Fact] + public void Create_ShouldCreateQueueWhenCollectionPassedIsNull() + { + Assert.IsType>(_queue); + } + + [Fact] + public void Create_ShouldCreateAQueueAndRemoveInTheCorrectOrder_FIFO() + { + var array = new string[] { "1", "2" }; + var queue = _queueUtil.Create(array); + + _queueUtil.Add(queue, "3"); + _queueUtil.Remove(queue); + + var result = queue.Peek(); + Assert.Equal("2", result); + } + } +} \ No newline at end of file diff --git a/app/app_dataStructures/backend/test/StackUtilTest.cs b/app/app_dataStructures/backend/test/StackUtilTest.cs new file mode 100644 index 000000000..b6dfbb129 --- /dev/null +++ b/app/app_dataStructures/backend/test/StackUtilTest.cs @@ -0,0 +1,107 @@ +using System.Collections; +using Portfolio.DataStructures.Interfaces; +using Portfolio.DataStructures.Utils; +using Xunit; + +namespace Portfolio.DataStructures.Test +{ + public class StackUtilTest + { + private readonly Stack _stack; + private readonly ICollectionUtil> _stackUtil; + + public StackUtilTest() + { + _stackUtil = new StackUtil(); + _stack = _stackUtil.Create(); + } + + [Fact] + public void Add_ShouldAddItemToStack() + { + _stackUtil.Add(_stack, "Item 1"); + + var result = _stack.Count; + Assert.Equal(1, result); + } + + [Fact] + public void Add_ShouldNotErrorWhenNullIsPassedForStack() + { + _stackUtil.Add(null, "Item 1"); + + var result = _stack.Count; + Assert.Equal(0, result); + } + + [Fact] + public void Add_ShouldAddItemToStackInCorrectOrder() + { + var stack = new Stack(new string[] { "1", "2" }); + + _stackUtil.Add(stack, "3"); // this results in 321 + + var result = stack.Peek(); + Assert.Equal("3", result); + } + + [Fact] + public void Add_ShouldAddItemToStackInCorrectOrderWhenOrderIsReversedAlready() + { + var stack = new Stack(new string[] { "2", "1" }); + + _stackUtil.Add(stack, "3"); + + var result = stack.Peek(); + Assert.Equal("3", result); + } + + [Fact] + public void Remove_ShouldRemoveItemFromStack() + { + _stackUtil.Add(_stack, "Item 1"); + _stackUtil.Remove(_stack); + + var result = _stack.Count; + Assert.Equal(0, result); + } + + [Fact] + public void Remove_ShouldNotRemoveIfStackIsNull() + { + _stackUtil.Remove(null); + + var result = _stack.Count; + Assert.Equal(0, result); + } + + [Fact] + public void Remove_ShouldRemoveItemFromStackInCorrectOrder() + { + var stack = new Stack(new string[] { "1", "2", "3" }); + _stackUtil.Remove(stack); + + var result = stack.Peek(); + Assert.Equal("2", result); + } + + [Fact] + public void Create_ShouldCreateStackWhenCollectionPassedIsNull() + { + Assert.IsType>(_stack); + } + + [Fact] + public void Create_ShouldCreateAStackAndRemoveInCorrectOrderIfInitialOrderIsReversed_LIFO() + { + var array = new string[] { "2", "1" }; + var stack = _stackUtil.Create(array); + + _stackUtil.Add(stack, "3"); + _stackUtil.Remove(stack); + + var result = stack.Peek(); + Assert.Equal("2", result); + } + } +} \ No newline at end of file diff --git a/app/app_dataStructures/backend/test/Usings.cs b/app/app_dataStructures/backend/test/Usings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/app/app_dataStructures/backend/test/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/app/app_dataStructures/backend/test/test.csproj b/app/app_dataStructures/backend/test/test.csproj new file mode 100644 index 000000000..e2ca563c1 --- /dev/null +++ b/app/app_dataStructures/backend/test/test.csproj @@ -0,0 +1,28 @@ + + + + net7.0 + enable + enable + + false + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/app/app_AzureDotNetCoreUniqueDataEntryApi/pug/index.pug b/app/app_dataStructures/pug/index.pug similarity index 100% rename from app/app_AzureDotNetCoreUniqueDataEntryApi/pug/index.pug rename to app/app_dataStructures/pug/index.pug diff --git a/app/app_AzureDotNetCoreUniqueDataEntryApi/sass/styles.scss b/app/app_dataStructures/sass/styles.scss similarity index 100% rename from app/app_AzureDotNetCoreUniqueDataEntryApi/sass/styles.scss rename to app/app_dataStructures/sass/styles.scss diff --git a/app/app_AzureDotNetCoreDataStructuresApi/src/app.js b/app/app_dataStructures/src/app.js similarity index 73% rename from app/app_AzureDotNetCoreDataStructuresApi/src/app.js rename to app/app_dataStructures/src/app.js index b102c4c39..9020b4011 100644 --- a/app/app_AzureDotNetCoreDataStructuresApi/src/app.js +++ b/app/app_dataStructures/src/app.js @@ -6,19 +6,23 @@ import React from 'react'; import ReactDOM from 'react-dom'; import Col from 'react-bootstrap/Col'; import Row from 'react-bootstrap/Row'; -import { PuzzleModalComponent } from '../../js/modules/react/puzzleModalComponent.js'; import { SpinnerComponent } from '../../js/modules/react/spinnerComponent.js' import { ErrorModalComponent } from '../../js/modules/react/errorModalComponent.js'; import { ConfigUtil } from "../../js/modules/utils/configUtil"; import { FormComponent } from './formComponent'; import { jQueryAjaxUtil } from '../../js/modules/utils/jQueryAjaxUtil'; +import { DeploymentModalComponent } from '../../js/modules/react/deploymentModalComponent.js'; +import { DeploymentUtil } from '../../js/modules/utils/deploymentUtil'; + +const CONFIG = ConfigUtil.get(); +const APP_CONFIG = ConfigUtil.get("dataStructures"); +const ADD_QUEUE_ITEM_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.addQueueItem}`; +const REMOVE_QUEUE_ITEM_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.removeQueueItem}`; +const ADD_STACK_ITEM_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.addStackItem}`; +const REMOVE_STACK_ITEM_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.removeStackItem}`; + +console.log(DeploymentUtil.isNotCloud()); -const PUZZLE = "3 x 2 - 1 ="; -const APP_CONFIG = ConfigUtil.get("azureDotNetCoreDataStructuresApi"); -const ADD_QUEUE_ITEM_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.addQueueItem}`; -const REMOVE_QUEUE_ITEM_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.removeQueueItem}`; -const ADD_STACK_ITEM_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.addStackItem}`; -const REMOVE_STACK_ITEM_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.removeStackItem}`; class DataStructuresApp extends React.Component { constructor(props) { super(props); @@ -26,18 +30,16 @@ class DataStructuresApp extends React.Component { queue: [], stack: [], showSpinner: false, - showPuzzleModal: true, - showErrorModal: false, - isPuzzleValid: false + showDeploymentModal: DeploymentUtil.isNotCloud(), + showErrorModal: false }; this.handleQueueAdd = this.handleQueueAdd.bind(this); this.handleQueueRemove= this.handleQueueRemove.bind(this); this.handleStackAdd = this.handleStackAdd.bind(this); this.handleStackRemove = this.handleStackRemove.bind(this); - this.handleIsPuzzleValid = this.handleIsPuzzleValid.bind(this); - this.handlePuzzleModalClose = this.handlePuzzleModalClose.bind(this); - this.handlePuzzleModalShow = this.handlePuzzleModalShow.bind(this); + this.handleDeploymentModalClose = this.handleDeploymentModalClose.bind(this); + this.handleDeploymentModalShow = this.handleDeploymentModalShow.bind(this); this.handleErrorModalClose = this.handleErrorModalClose.bind(this); this.handleBeforeAjax = this.handleBeforeAjax.bind(this); this.handleFailedAjax = this.handleFailedAjax.bind(this); @@ -45,8 +47,7 @@ class DataStructuresApp extends React.Component { handleBeforeAjax() { this.setState({ - showSpinner: true, - showPuzzleModal: false + showSpinner: true }); } @@ -58,7 +59,7 @@ class DataStructuresApp extends React.Component { } handleAjax(request) { - jQueryAjaxUtil.handleAjax(request, this.state.isPuzzleValid, this.handleBeforeAjax, this.handleFailedAjax, this.handlePuzzleModalShow); + jQueryAjaxUtil.handleAjax(request, DeploymentUtil.isCloud(), this.handleBeforeAjax, this.handleFailedAjax, this.handleDeploymentModalShow); } handleQueueAdd(event, item) { @@ -71,10 +72,11 @@ class DataStructuresApp extends React.Component { url: ADD_QUEUE_ITEM_ENDPOINT, data: JSON.stringify(data), type: "POST", + contentType: "application/json", success: (response) => { if (response) { this.setState({ - queue: JSON.parse(response), + queue: response, showSpinner: false }); } else { @@ -98,10 +100,11 @@ class DataStructuresApp extends React.Component { url: ADD_STACK_ITEM_ENDPOINT, data: JSON.stringify(data), type: "POST", + contentType: "application/json", success: (response) => { if (response) { this.setState({ - stack: JSON.parse(response), + stack: response, showSpinner: false }); } else { @@ -124,10 +127,11 @@ class DataStructuresApp extends React.Component { url: REMOVE_QUEUE_ITEM_ENDPOINT, data: JSON.stringify(data), type: "POST", + contentType: "application/json", success: (response) => { if (response) { this.setState({ - queue: JSON.parse(response), + queue: response, showSpinner: false }); } else { @@ -150,10 +154,11 @@ class DataStructuresApp extends React.Component { url: REMOVE_STACK_ITEM_ENDPOINT, data: JSON.stringify(data), type: "POST", + contentType: "application/json", success: (response) => { if (response) { this.setState({ - stack: JSON.parse(response), + stack: response, showSpinner: false }); } else { @@ -173,35 +178,24 @@ class DataStructuresApp extends React.Component { }) } - handleIsPuzzleValid() { - this.setState({ - isPuzzleValid: true, - showPuzzleModal: false - }) - } - - handlePuzzleModalClose() { + handleDeploymentModalClose() { this.setState({ - showPuzzleModal: false + showDeploymentModal: false }) } - handlePuzzleModalShow() { + handleDeploymentModalShow() { this.setState({ - showPuzzleModal: true + showDeploymentModal: true }) } render() { return ( <> - { + await openBrowser({ + headless: true, + slowMo: 250, + args: ['--no-sandbox'] + }); +}); + +describe(APPLICATION, () => { + test('Should not add an item to the queue', async () => { + await goto(URL); + await click(button({ id: 'queueInput_submit' })); + const error = await $('.was-validated .form-control:invalid').exists(); + const result = await evaluate($('#queueList'), (element) => element.innerText); + expect(error).toBeTruthy(); + expect(result).toBe(""); + }, 100000); + test('Should not add an item to the stack', async () => { + await goto(URL); + await click(button({ id: 'stackInput_submit' })); + const error = await $('.was-validated .form-control:invalid').exists(); + const result = await evaluate($('#stackList'), (element) => element.innerText); + expect(error).toBeTruthy(); + expect(result).toBe(""); + }, 100000); + test('Should add an item to the queue', async () => { + await goto(URL); + await write('Item 1', into(textBox({ id: 'queueInput' }))); + await click(button({ id: 'queueInput_submit' })); + const result = await evaluate($('#queueList'), (element) => element.innerText); + expect(result).toBe('Item 1'); + }, 100000); + test('Should remove an item to the queue', async () => { + await goto(URL); + await write('Item 1', into(textBox({ id: 'queueInput' }))); + await click(button({ id: 'queueInput_submit' })); + await waitFor(2000); + await write('Item 2', into(textBox({ id: 'queueInput' }))); + await click(button({ id: 'queueInput_submit' })); + await waitFor(2000); + await click(button({ id: 'queueInput_remove' })); + const result = await evaluate($('#queueList'), (element) => element.innerText); + expect(result).toBe('Item 2'); + }, 100000); + test('Should add an item to the stack', async () => { + await goto(URL); + await write('Item 1', into(textBox({ id: 'stackInput' }))); + await click(button({ id: 'stackInput_submit' })); + const result = await evaluate($('#stackList'), (element) => element.innerText); + expect(result).toBe('Item 1'); + }, 100000); + test('Should remove an item to the queue', async () => { + await goto(URL); + await write('Item 1', into(textBox({ id: 'stackInput' }))); + await click(button({ id: 'stackInput_submit' })); + await waitFor(2000); + await write('Item 2', into(textBox({ id: 'stackInput' }))); + await click(button({ id: 'stackInput_submit' })); + await waitFor(2000); + await click(button({ id: 'stackInput_remove' })); + const result = await evaluate($('#stackList'), (element) => element.innerText); + expect(result).toBe('Item 1'); + }, 100000); +}); + +afterAll(() => { + closeBrowser(); +}); \ No newline at end of file diff --git a/app/app_entitySort/Readme.md b/app/app_entitySort/Readme.md new file mode 100644 index 000000000..4d69d0638 --- /dev/null +++ b/app/app_entitySort/Readme.md @@ -0,0 +1,9 @@ +# .NET, Complex Entity Sorting Algorithm + +With this application I have built a complex type sorting interface, using .NET. A basic React user interface handles user input and application state. + +Whilst this functionality could be achieved with JavaScript alone, I wanted to demonstrate knowledge of two key .NET interfaces: ICompareable and IComparer. + +- ICompareable (https://docs.microsoft.com/en-us/dotnet/api/system.icomparable?view=netcore-3.1) + +- IComparer (https://docs.microsoft.com/en-us/dotnet/api/system.collections.icomparer?view=netcore-3.1) \ No newline at end of file diff --git a/app/app_entitySort/backend/api/Controllers/ApiController.cs b/app/app_entitySort/backend/api/Controllers/ApiController.cs new file mode 100644 index 000000000..0586c1312 --- /dev/null +++ b/app/app_entitySort/backend/api/Controllers/ApiController.cs @@ -0,0 +1,48 @@ +using Microsoft.AspNetCore.Mvc; +using Portfolio.EntitySort.Interfaces; +using Portfolio.EntitySort.Models; + +namespace Portfolio.EntitySort.Controllers +{ + /// + /// API controller for sorting employee entities. + /// + [Route("[controller]")] + public class ApiController : ControllerBase + { + private readonly IEmployeeSortUtil _employeeSortUtil; + + /// + /// Initializes a new instance of the ApiController class with the specified employee sort utility. + /// + /// The utility for sorting employee entities. + public ApiController(IEmployeeSortUtil employeeSortUtil) + { + _employeeSortUtil = employeeSortUtil; + } + + /// + /// Sorts the employee entities by salary in descending order. + /// + /// The request containing the employees to sort. + /// A list of employee entities sorted by salary in descending order. + [HttpPost("sort/salary/desc")] + public IList SortBySalaryDesc([FromBody]GetRequest request) + { + var employees = _employeeSortUtil.SortBySalaryDesc(request?.Employees); + return employees; + } + + /// + /// Sorts the employee entities by salary in ascending order. + /// + /// The request containing the employees to sort. + /// A list of employee entities sorted by salary in ascending order. + [HttpPost("sort/salary/asc")] + public IList SortBySalaryAsc([FromBody]GetRequest request) + { + var employees = _employeeSortUtil.SortBySalaryAsc(request?.Employees); + return employees; + } + } +} diff --git a/app/app_entitySort/backend/api/Interfaces/IEmployeeSortUtil.cs b/app/app_entitySort/backend/api/Interfaces/IEmployeeSortUtil.cs new file mode 100644 index 000000000..11cf8fdb8 --- /dev/null +++ b/app/app_entitySort/backend/api/Interfaces/IEmployeeSortUtil.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using Portfolio.EntitySort.Models; + +namespace Portfolio.EntitySort.Interfaces +{ + public interface IEmployeeSortUtil + { + /// + /// Default entity sort method, relies on the Employee's IComparable implementation + /// + /// A List of Employee types to sort + /// Returns the sorted List of Employees + List SortBySalaryDefault(List employees); + + /// + /// Sorts by Employee Salary descending, relies an IComparer implementation being passed in to the Sort method + /// + /// A List of Employee types to sort + /// Returns the sorted List of Employees + List SortBySalaryDesc(List employees); + + /// + /// Sorts by Employee Salary ascending, relies an IComparer implementation being passed in to the Sort method + /// + /// A List of Employee types to sort + /// Returns the sorted List of Employees + List SortBySalaryAsc(List employees); + } +} diff --git a/app/app_entitySort/backend/api/Models/Employee.cs b/app/app_entitySort/backend/api/Models/Employee.cs new file mode 100644 index 000000000..9b1b1554d --- /dev/null +++ b/app/app_entitySort/backend/api/Models/Employee.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; + +namespace Portfolio.EntitySort.Models +{ + /// + /// Represents an employee entity. + /// + public class Employee : IComparable + { + /// + /// Initializes a new instance of the Employee class. + /// + public Employee() + { + this.Name = string.Empty; + this.Salary = 0; + } + + /// + /// Gets or sets the name of the employee. + /// + public string Name { get; set; } + + /// + /// Gets or sets the salary of the employee. + /// + public decimal Salary { get; set; } + + /// + /// Gets or sets the display salary of the employee. + /// + public string DisplaySalary { get; set; } + + /// + /// Compares the current employee with another employee based on salary. + /// + /// The other employee to compare with. + /// An integer indicating the relative order of the employees based on salary. + public int CompareTo(Employee otherEmployee) + { + var result = 0; + if (this.Salary < otherEmployee.Salary) + { + result = 1; + + } else if (this.Salary > otherEmployee.Salary) + { + result = -1; + } + return result; + } + + /// + /// Comparer for sorting employees by salary in descending order. + /// + public class SortBySalaryDesc : IComparer + { + /// + /// Compares two employees based on salary in descending order. + /// + /// The first employee to compare. + /// The second employee to compare. + /// An integer indicating the relative order of the employees based on salary. + public int Compare(Employee current, Employee next) + { + return Decimal.Compare(next.Salary, current.Salary); + } + } + + /// + /// Comparer for sorting employees by salary in ascending order. + /// + public class SortBySalaryAsc : IComparer + { + /// + /// Compares two employees based on salary in ascending order. + /// + /// The first employee to compare. + /// The second employee to compare. + /// An integer indicating the relative order of the employees based on salary. + public int Compare(Employee current, Employee next) + { + return Decimal.Compare(current.Salary, next.Salary); + } + } + } +} diff --git a/app/app_entitySort/backend/api/Models/GetRequest.cs b/app/app_entitySort/backend/api/Models/GetRequest.cs new file mode 100644 index 000000000..d3bd07ae0 --- /dev/null +++ b/app/app_entitySort/backend/api/Models/GetRequest.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; + +namespace Portfolio.EntitySort.Models +{ + /// + /// Represents the request body for sorting employees. + /// + public class GetRequest + { + /// + /// Gets or sets the list of employees to sort. + /// + public List Employees { get; set; } + } +} \ No newline at end of file diff --git a/app/app_entitySort/backend/api/Program.cs b/app/app_entitySort/backend/api/Program.cs new file mode 100644 index 000000000..8eabc4895 --- /dev/null +++ b/app/app_entitySort/backend/api/Program.cs @@ -0,0 +1,40 @@ +using Portfolio.Core.Services; +using Portfolio.EntitySort.Interfaces; +using Portfolio.EntitySort.Utils; + +var builder = WebApplication.CreateBuilder(args); + +builder.WebHost.UseUrls("http://*:3005"); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +builder.Services.AddTransient(); + +// Services +builder.Services.AddScoped(); + +builder.Services.AddHealthChecks(); + +var app = builder.Build(); + +app.MapHealthChecks("/healthcheck"); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/app/app_entitySort/backend/api/Properties/launchSettings.json b/app/app_entitySort/backend/api/Properties/launchSettings.json new file mode 100644 index 000000000..4bb0ac730 --- /dev/null +++ b/app/app_entitySort/backend/api/Properties/launchSettings.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:22985", + "sslPort": 44310 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5186", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7280;http://localhost:5186", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/app/app_entitySort/backend/api/Utils/EmployeeSortUtil.cs b/app/app_entitySort/backend/api/Utils/EmployeeSortUtil.cs new file mode 100644 index 000000000..241f80b61 --- /dev/null +++ b/app/app_entitySort/backend/api/Utils/EmployeeSortUtil.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using Microsoft.Extensions.Logging; +using Portfolio.EntitySort.Interfaces; +using Portfolio.EntitySort.Models; + +namespace Portfolio.EntitySort.Utils +{ + public class EmployeeSortUtil : IEmployeeSortUtil + { + private readonly ILogger _logger; + + // + /// Initializes a new instance of the EmployeeSortUtil class with the specified logger. + /// + /// The logger to use for logging messages. + public EmployeeSortUtil(ILogger logger) + { + _logger = logger; + } + + /// + public List SortBySalaryDefault(List employees) + { + _logger.LogInformation("Sort by defaut started"); + + employees?.Sort(); + + _logger.LogInformation("Sort by defaut finished"); + + return employees ?? new List(); + } + + /// + public List SortBySalaryDesc(List employees) + { + _logger.LogInformation("Sort by salary descending started"); + + employees?.Sort(new Employee.SortBySalaryDesc()); + + _logger.LogInformation("Sort by salary descending finished"); + + return employees ?? new List(); + } + + /// + public List SortBySalaryAsc(List employees) + { + _logger.LogInformation("Sort by salary ascending started"); + + employees?.Sort(new Employee.SortBySalaryAsc()); + + _logger.LogInformation("Sort by salary ascending finished"); + + return employees ?? new List(); + } + } +} diff --git a/app/app_entitySort/backend/api/api.csproj b/app/app_entitySort/backend/api/api.csproj new file mode 100644 index 000000000..40910a9f8 --- /dev/null +++ b/app/app_entitySort/backend/api/api.csproj @@ -0,0 +1,20 @@ + + + + net7.0 + enable + enable + + + + + + + + + + + + + + diff --git a/app/app_entitySort/backend/api/api.sln b/app/app_entitySort/backend/api/api.sln new file mode 100644 index 000000000..10b393040 --- /dev/null +++ b/app/app_entitySort/backend/api/api.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 25.0.1704.4 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "api.csproj", "{2A5C2652-B3B9-4423-BD9F-81EBA9F9AA11}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2A5C2652-B3B9-4423-BD9F-81EBA9F9AA11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A5C2652-B3B9-4423-BD9F-81EBA9F9AA11}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A5C2652-B3B9-4423-BD9F-81EBA9F9AA11}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A5C2652-B3B9-4423-BD9F-81EBA9F9AA11}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {977E6672-F301-41FC-8D11-429E088E5C4D} + EndGlobalSection +EndGlobal diff --git a/app/app_entitySort/backend/api/appsettings.Development.json b/app/app_entitySort/backend/api/appsettings.Development.json new file mode 100644 index 000000000..ff66ba6b2 --- /dev/null +++ b/app/app_entitySort/backend/api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/app/app_entitySort/backend/api/appsettings.json b/app/app_entitySort/backend/api/appsettings.json new file mode 100644 index 000000000..4d566948d --- /dev/null +++ b/app/app_entitySort/backend/api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/app/app_entitySort/backend/test/EmployeeSortUtilTests.cs b/app/app_entitySort/backend/test/EmployeeSortUtilTests.cs new file mode 100644 index 000000000..bf66800c7 --- /dev/null +++ b/app/app_entitySort/backend/test/EmployeeSortUtilTests.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.Logging; +using Moq; +using Xunit; +using Portfolio.EntitySort.Utils; +using Portfolio.EntitySort.Models; +using Portfolio.EntitySort.Interfaces; + +namespace Portfolio.EntitySort.Tests +{ + public class EmployeeSortUtilTests + { + private readonly IEmployeeSortUtil _sut; + private readonly List _employees; + private readonly Mock> _logger; + public EmployeeSortUtilTests() + { + _logger = new Mock>(); + + _sut = new EmployeeSortUtil(_logger.Object); + + _employees = new List() { + new Employee() + { + Name = "John Doe", + Salary = 5000, + DisplaySalary = "£5,000.00" + }, + new Employee() + { + Name = "Joe Bloggs", + Salary = 10000, + DisplaySalary = "£10,000.00" + } + }; + } + + [Fact] + public void Test_Sort_Salary_Default() + { + var result = _sut.SortBySalaryDefault(_employees); + + VerifyLogger(LogLevel.Information, "Sort by defaut started"); + VerifyLogger(LogLevel.Information, "Sort by defaut finished"); + + Assert.Equal("Joe Bloggs", result[0].Name); + } + + [Fact] + public void Test_Sort_Salary_Default_Null() + { + var result = _sut.SortBySalaryDefault(null); + + VerifyLogger(LogLevel.Information, "Sort by defaut started"); + VerifyLogger(LogLevel.Information, "Sort by defaut finished"); + + Assert.Empty(result); + } + [Fact] + public void Test_Sort_Salary_Desc() + { + var result = _sut.SortBySalaryDesc(_employees); + + VerifyLogger(LogLevel.Information, "Sort by salary descending started"); + VerifyLogger(LogLevel.Information, "Sort by salary descending finished"); + + Assert.Equal("Joe Bloggs", result[0].Name); + } + [Fact] + public void Test_Sort_Salary_Asc() + { + var result = _sut.SortBySalaryAsc(_employees); + + VerifyLogger(LogLevel.Information, "Sort by salary ascending started"); + VerifyLogger(LogLevel.Information, "Sort by salary ascending finished"); + + Assert.Equal("John Doe", result[0].Name); + } + + private void VerifyLogger(LogLevel expectedLogLevel, string expectedMessage = "") + { + _logger.Verify( + x => x.Log( + It.Is(l => l == expectedLogLevel), + It.IsAny(), + It.Is((v, t) => String.IsNullOrEmpty(expectedMessage) ? true : v.ToString() == expectedMessage), + It.IsAny(), + It.Is>((v, t) => true))); + } + } +} \ No newline at end of file diff --git a/app/app_entitySort/backend/test/Usings.cs b/app/app_entitySort/backend/test/Usings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/app/app_entitySort/backend/test/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/app/app_entitySort/backend/test/test.csproj b/app/app_entitySort/backend/test/test.csproj new file mode 100644 index 000000000..c17ceb13c --- /dev/null +++ b/app/app_entitySort/backend/test/test.csproj @@ -0,0 +1,29 @@ + + + + net7.0 + enable + enable + + false + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/app/app_awsDotNetCoreEntitySortApi/pug/index.pug b/app/app_entitySort/pug/index.pug similarity index 100% rename from app/app_awsDotNetCoreEntitySortApi/pug/index.pug rename to app/app_entitySort/pug/index.pug diff --git a/app/app_awsDotNetCoreEntitySortApi/sass/styles.scss b/app/app_entitySort/sass/styles.scss similarity index 100% rename from app/app_awsDotNetCoreEntitySortApi/sass/styles.scss rename to app/app_entitySort/sass/styles.scss diff --git a/app/app_awsDotNetCoreEntitySortApi/src/app.js b/app/app_entitySort/src/app.js similarity index 80% rename from app/app_awsDotNetCoreEntitySortApi/src/app.js rename to app/app_entitySort/src/app.js index 1be33ed5b..4784fc036 100644 --- a/app/app_awsDotNetCoreEntitySortApi/src/app.js +++ b/app/app_entitySort/src/app.js @@ -5,7 +5,6 @@ import '../sass/styles.scss'; import React from 'react'; import ReactDOM from 'react-dom'; import { KeyGeneratorUtil } from '../../typeScript/Utils/keyGeneratorUtil/dist/index'; -import { PuzzleModalComponent } from '../../js/modules/react/puzzleModalComponent.js'; import { SpinnerComponent } from '../../js/modules/react/spinnerComponent.js' import { ErrorModalComponent } from '../../js/modules/react/errorModalComponent.js'; import { ConfigUtil } from "../../js/modules/utils/configUtil"; @@ -13,11 +12,13 @@ import { FormComponent } from "./formComponent"; import { jQueryAjaxUtil } from '../../js/modules/utils/jQueryAjaxUtil'; import { FilterUtil } from '../../typeScript/Utils/filterUtil/dist/index'; import { EmployeeTableComponent } from './employeeTableComponent'; +import { DeploymentModalComponent } from '../../js/modules/react/deploymentModalComponent.js'; +import { DeploymentUtil } from '../../js/modules/utils/deploymentUtil'; -const PUZZLE = "7 x 2 + 1 ="; -const APP_CONFIG = ConfigUtil.get("awsDotNetCoreEntitySortApi"); -const SORT_SALARY_ASC_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.sortSalaryAsc}`; -const SORT_SALARY_DESC_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.sortSalaryDesc}`; +const CONFIG = ConfigUtil.get(); +const APP_CONFIG = ConfigUtil.get("entitySort"); +const SORT_SALARY_ASC_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.sortSalaryAsc}`; +const SORT_SALARY_DESC_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.sortSalaryDesc}`; class EntitySort extends React.Component { constructor(props) { @@ -29,9 +30,8 @@ class EntitySort extends React.Component { counterLimit: 10, counter: 1, showSpinner: false, - showPuzzleModal: true, showErrorModal: false, - isPuzzleValid: false + showDeploymentModal: DeploymentUtil.isNotCloud() }; this.handleNameChange = this.handleNameChange.bind(this); @@ -40,12 +40,11 @@ class EntitySort extends React.Component { this.handleDelete= this.handleDelete.bind(this); this.handleSortSalaryAsc = this.handleSortSalaryAsc.bind(this); this.handleSortSalaryDesc = this.handleSortSalaryDesc.bind(this); - this.handleIsPuzzleValid = this.handleIsPuzzleValid.bind(this); - this.handlePuzzleModalClose = this.handlePuzzleModalClose.bind(this); - this.handlePuzzleModalShow = this.handlePuzzleModalShow.bind(this); this.handleErrorModalClose = this.handleErrorModalClose.bind(this); this.handleBeforeAjax = this.handleBeforeAjax.bind(this); this.handleFailedAjax = this.handleFailedAjax.bind(this); + this.handleDeploymentModalClose = this.handleDeploymentModalClose.bind(this); + this.handleDeploymentModalShow = this.handleDeploymentModalShow.bind(this); } formatCurrency(value) { @@ -62,8 +61,7 @@ class EntitySort extends React.Component { handleBeforeAjax() { this.setState({ - showSpinner: true, - showPuzzleModal: false + showSpinner: true }); } @@ -75,7 +73,7 @@ class EntitySort extends React.Component { } handleAjax(request) { - jQueryAjaxUtil.handleAjax(request, this.state.isPuzzleValid, this.handleBeforeAjax, this.handleFailedAjax, this.handlePuzzleModalShow); + jQueryAjaxUtil.handleAjax(request, DeploymentUtil.isCloud(), this.handleBeforeAjax, this.handleFailedAjax, this.handleDeploymentModalShow); } handleSortSalaryAsc() { @@ -154,35 +152,28 @@ class EntitySort extends React.Component { }); } - handleIsPuzzleValid() { + handleErrorModalClose() { this.setState({ - isPuzzleValid: true, - showPuzzleModal: false + showErrorModal: false }) } - handlePuzzleModalClose() { - this.setState({ - showPuzzleModal: false - }) + handleGenerateKey(employee) { + return KeyGeneratorUtil.generate(`${employee.name}_${employee.salary}`); } - handlePuzzleModalShow() { + handleDeploymentModalClose() { this.setState({ - showPuzzleModal: true + showDeploymentModal: false }) } - handleErrorModalClose() { + handleDeploymentModalShow() { this.setState({ - showErrorModal: false + showDeploymentModal: true }) } - handleGenerateKey(employee) { - return KeyGeneratorUtil.generate(`${employee.name}_${employee.salary}`); - } - componentDidMount() { let employee = { @@ -210,17 +201,13 @@ class EntitySort extends React.Component { show={this.state.showErrorModal} handleClose={this.handleErrorModalClose} /> + - { await openBrowser({ @@ -18,9 +20,6 @@ beforeAll(async () => { describe(APPLICATION, () => { test('Should add an item', async () => { await goto(URL); - await write('15', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); await write('James Bond', into(textBox({id:'nameInput'}))); await write('95000', into(textBox({id:'salaryInput'}))); await click(button({id:'addEmployee_submit'})); @@ -35,18 +34,12 @@ describe(APPLICATION, () => { }, 100000); test('Should remove an item', async () => { await goto(URL); - await write('15', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); await click(link('delete')); const result = await tableCell({row:1, col:1}).exists(); expect(result).toBeFalsy(); }, 100000); test('Shold sort table ascending', async () => { await goto(URL); - await write('15', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); await write('James Bond', into(textBox({id:'nameInput'}))); await write('95000', into(textBox({id:'salaryInput'}))); await click(button({id:'addEmployee_submit'})); @@ -62,9 +55,6 @@ describe(APPLICATION, () => { }, 100000); test('Shold sort table ascending', async () => { await goto(URL); - await write('15', into(textBox({id:'answerInput'}),{force:true})); - await click(button({id:'submitPuzzle'})); - await waitFor(2000); await write('James Bond', into(textBox({id:'nameInput'}))); await write('95000', into(textBox({id:'salaryInput'}))); await click(button({id:'addEmployee_submit'})); diff --git a/app/app_home/Readme.md b/app/app_home/Readme.md index cbea019b1..949520e20 100644 --- a/app/app_home/Readme.md +++ b/app/app_home/Readme.md @@ -1,22 +1,15 @@ -# To-Do React +# Welcome -With this application I have built a simple To-Do list using React to handle user input and manage state. +## The 3D Introduction -### Explanation ### +The Home application serves as the entry point to my Portfolio. It showcases an interactive 3D scene utilising Three.js and demonstrates my understanding of programming complex 3D applications. -I have used Webpack to bundle JS dependancies and Babel to transpile to the correct ES version. +A physics engine, Connon.js, has been incorporated to enable collision detection and simulate forces like gravity. -The interest in this application is to explore how React can be used for 2 way data binding between the DOM and application state. With a particular interest in Reacts use of a virtual DOM. +I've added texture mapping and written a number of 'randomness' generators to ensure a unique experience with each load. The particles constantly evolve in the background. -### Project commands ### +## The Applications -Build JavaScript by running the default Gulp task from within this directory -``` - gulp -``` +Below the introduction, you will find a collection of applications available for demonstration within the Portfolio. The search bar allows you to filter through the applications. Additionally, there is a search bar in the top navigation available on every page. -Run the application from within the route directory, using the master Gulp file and the default Gulp task -``` - cd ../../ - gulp -``` +I hope you enjoy exploring and feel free to view the code on GitHub or contact me with any queries. diff --git a/app/app_home/src/components/applicationCard.js b/app/app_home/src/components/applicationCard.js index 0acc3e3b8..21fdd2c44 100644 --- a/app/app_home/src/components/applicationCard.js +++ b/app/app_home/src/components/applicationCard.js @@ -26,9 +26,9 @@ export const ApplicationCard = React.memo(({application, condition}) => { {application.labels ? application.labels.map(x => { - const label = configContext.config.labels[x]; + const className = configContext.config.labels[x]; return ( - {label.name} + {x} ) }) : null} diff --git a/app/app_home/src/components/contentContainer.js b/app/app_home/src/components/contentContainer.js index 0f9482b5a..02e7b843a 100644 --- a/app/app_home/src/components/contentContainer.js +++ b/app/app_home/src/components/contentContainer.js @@ -10,20 +10,14 @@ import { TopScrollComponent } from '../../../js/modules/react/topScrollComponent export function ContentContainer() { const context = React.useContext(ConfigContext); - const topScrollComponentThreshold = 270; return (
-

{context.appConfig.name}

-
-
-
-
-
{context.appConfig.subHeading}
-

{context.appConfig.description}

+
{context.config.title}
+

{context.config.author} - {context.config.role}


diff --git a/app/app_jsCodingStandards/Readme.md b/app/app_jsCodingStandards/Readme.md index fa825b893..639a4b69e 100644 --- a/app/app_jsCodingStandards/Readme.md +++ b/app/app_jsCodingStandards/Readme.md @@ -4,10 +4,4 @@ With this application I have built... ### Explanation ### -The interest in this application... - -Run the application from within the route directory, using the master Gulp file and the default Gulp task. -``` - cd ../../ - gulp -``` \ No newline at end of file +The interest in this application... \ No newline at end of file diff --git a/app/app_master_react/Readme.md b/app/app_master_react/Readme.md index cbea019b1..090fd303f 100644 --- a/app/app_master_react/Readme.md +++ b/app/app_master_react/Readme.md @@ -6,17 +6,4 @@ With this application I have built a simple To-Do list using React to handle use I have used Webpack to bundle JS dependancies and Babel to transpile to the correct ES version. -The interest in this application is to explore how React can be used for 2 way data binding between the DOM and application state. With a particular interest in Reacts use of a virtual DOM. - -### Project commands ### - -Build JavaScript by running the default Gulp task from within this directory -``` - gulp -``` - -Run the application from within the route directory, using the master Gulp file and the default Gulp task -``` - cd ../../ - gulp -``` +The interest in this application is to explore how React can be used for 2 way data binding between the DOM and application state. With a particular interest in Reacts use of a virtual DOM. \ No newline at end of file diff --git a/app/app_nodeToDo/Readme.md b/app/app_nodeToDo/Readme.md new file mode 100644 index 000000000..68e0c3354 --- /dev/null +++ b/app/app_nodeToDo/Readme.md @@ -0,0 +1,13 @@ +# NodeJS, To-Do List SPA + +With this application, I have extended previous To-Do concepts. This application is driven by Node.js and Express and is authenticated using JWT tokens. + +Please note that data is only stored in memory for the purpose of this example. I may use MongoDB or a similar solution in the near future. + +The frontend is built with React and React Router. State is managed using a combination of React Context and the Context Provider Pattern. + +- NodeJS (https://nodejs.org/en/) +- Express (https://www.npmjs.com/package/express) +- React Hooks (https://reactjs.org/docs/hooks-reference.html) +- React Router (https://reactrouter.com/web/guides/quick-start) +- React Context (https://reactjs.org/docs/context.html) \ No newline at end of file diff --git a/app/app_nodeToDo/backend/api/controllers/healthcheckController.js b/app/app_nodeToDo/backend/api/controllers/healthcheckController.js new file mode 100644 index 000000000..b7a31ad3c --- /dev/null +++ b/app/app_nodeToDo/backend/api/controllers/healthcheckController.js @@ -0,0 +1,12 @@ +/** + * Responds with a 200 status for the healthcheck. + * @param {object} req - The HTTP request object. + * @param {object} res - The HTTP response object. + */ +const handleHealthcheck = (req, res) => { + res.status(200).send(); +}; + +module.exports = { + handleHealthcheck +}; diff --git a/app/app_nodeToDo/backend/api/controllers/itemsController.js b/app/app_nodeToDo/backend/api/controllers/itemsController.js new file mode 100644 index 000000000..19c35b34e --- /dev/null +++ b/app/app_nodeToDo/backend/api/controllers/itemsController.js @@ -0,0 +1,121 @@ +const itemsService = require('../services/itemsService'); +const userService = require('../services/userService'); + +/** +* Retrieves all items belonging to the current user and sends them as a response +* @param {Object} req - Express request object +* @param {Object} res - Express response object +* @returns {Array} The updated list of items for the current user +*/ +const getAllItems = (req, res) => { + + try { + const { username } = userService.getCurrentUser(req, res); + const items = itemsService.getItems(username); + + res.send({ items }); + } catch (error) { + res.status(400).send(error.message); + } +}; + +/** +* Get an item with the given ID and associated with the current user. +* @param {Object} req - The request object. +* @param {Object} res - The response object. +* @returns {Object} The object +*/ +const getItem = (req, res) => { + + try { + const { username } = userService.getCurrentUser(req, res); + + const id = req.params.id; + + const item = itemsService.getItem(id, username); + + res.send({ item }); + } catch (error) { + res.status(400).send(error.message); + } +}; + +/** + * Deletes an item with the specified ID for the current user and returns the updated list of items + * @param {Object} req - The request object + * @param {Object} res - The response object + * @returns {Array} The updated list of items for the current user + */ +const deleteItem = (req, res) => { + + try { + const { username } = userService.getCurrentUser(req, res); + + const id = req.params.id; + + itemsService.deleteItem(id, username); + + const itmes = itemsService.getItems(username); + + res.send({ itmes }); + } catch (error) { + res.status(400).send(error.message); + } +}; + +/** + * Create a new item for the current user and return the updated list of items. + * @param {Object} req - Express request object. + * @param {Object} res - Express response object. + * @returns {void} + */ +const addItem = (req, res) => { + + try { + const { username } = userService.getCurrentUser(req, res); + + const { id, description, done } = req.body; + const item = { id, description, done }; + + itemsService.createItem(item, username); + + const itmes = itemsService.getItems(username); + + res.send({ itmes }); + } catch (error) { + console.error(error.message); + res.status(400).send(error.message); + } +}; + +/** + * Updates an item for the authenticated user. + * @param {Object} req - The request object from the client. + * @param {Object} res - The response object returned to the client. + * @returns {Object} - The updated items list for the authenticated user. + */ +const updateItem = (req, res) => { + + try { + const { username } = userService.getCurrentUser(req, res); + + const { id, description, done } = req.body; + const item = { id, description, done }; + + itemsService.updateItem(item, username); + + const items = itemsService.getItems(username); + + res.send({ items }); + } catch (error) { + res.status(400).send(error.message); + } +}; + +module.exports = { + getAllItems, + getItem, + deleteItem, + addItem, + updateItem +} diff --git a/app/app_nodeToDo/backend/api/controllers/userController.js b/app/app_nodeToDo/backend/api/controllers/userController.js new file mode 100644 index 000000000..838383f8a --- /dev/null +++ b/app/app_nodeToDo/backend/api/controllers/userController.js @@ -0,0 +1,83 @@ +const userService = require('../services/userService'); + +/** + * Handles user login. + * @param {object} req - The HTTP request object. + * @param {object} res - The HTTP response object. + */ +const login = (req, res) => { + + try { + const { username, password } = req.body; + const token = userService.handleLogin(username, password, req); + + res.send({ token }); + + } catch (error) { + console.error(error.message); + res.status(400).send(error.message); + } +}; + +/** + * Handles user logout. + * @param {object} req - The HTTP request object. + * @param {object} res - The HTTP response object. + */ +const logout = (req, res) => { + + try { + userService.handleLogout(req); + + res.status(200).send(); + + } catch (error) { + console.error(error.message); + res.status(400).send(error.message); + } +}; + +/** + * Handles user registration. + * @param {object} req - The HTTP request object. + * @param {object} res - The HTTP response object. + */ +const register = (req, res) => { + + try { + const { username, password } = req.body; + + userService.registerUser(username, password); + + res.send({ username }); + + } catch (error) { + console.error(error.message); + res.status(400).send(error.message); + } +}; + +/** + * Gets the current user. + * @param {object} req - The HTTP request object. + * @param {object} res - The HTTP response object. + */ +const getUser = (req, res) => { + + try { + const user = userService.getCurrentUser(req); + + res.send({ user }); + + } catch (error) { + console.error(error.message); + res.status(400).send(error.message); + } +}; + +module.exports = { + login, + logout, + register, + getUser +}; diff --git a/app/app_nodeToDo/backend/api/index.js b/app/app_nodeToDo/backend/api/index.js new file mode 100644 index 000000000..7ea892810 --- /dev/null +++ b/app/app_nodeToDo/backend/api/index.js @@ -0,0 +1,66 @@ +const express = require('express'); +const bodyParser = require('body-parser'); +const cors = require('cors'); + +const { isAuthenticated } = require('./services/userService'); +const { handleHealthcheck } = require('./controllers/healthcheckController'); + +const { + login, + logout, + register, + getUser +} = require('./controllers/userController'); + +const { + getAllItems, + getItem, + deleteItem, + addItem, + updateItem +} = require('./controllers/itemsController'); + +const PORT = process.env.PORT || 3006; + +// Middleware +const app = express(); + +// Please note that in production, only specific origins would be allowed for CORS, most likely configured through an environment variable. +app.use(cors({ origin: true })); + +app.use(bodyParser.json()); + +// Routing +// healthcheck +app.get('/healthcheck', handleHealthcheck) + +// login +app.post('/login', login); + +// logout +app.get('/logout', isAuthenticated, logout); + +// register +app.post('/register', register); + +// get user +app.get('/user', isAuthenticated, getUser); + +// get items +app.get('/', isAuthenticated, getAllItems); + +// get item +app.get('/:id', isAuthenticated, getItem); + +//delete item +app.delete('/:id', isAuthenticated, deleteItem); + +// create item +app.post('/', isAuthenticated, addItem); + +// update item +app.put('/', isAuthenticated, updateItem); + +app.listen(PORT, () => { + console.log(`Server listening on port ${PORT}.`); +}); \ No newline at end of file diff --git a/app/app_nodeToDo/backend/api/package-lock.json b/app/app_nodeToDo/backend/api/package-lock.json new file mode 100644 index 000000000..bda73b3f6 --- /dev/null +++ b/app/app_nodeToDo/backend/api/package-lock.json @@ -0,0 +1,755 @@ +{ + "name": "node-todo-api", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "node-todo-api", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "body-parser": "^1.20.2", + "cors": "^2.8.5", + "crypto": "^1.0.1", + "express": "^4.18.2", + "jsonwebtoken": "^9.0.0", + "uuid": "^9.0.0" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/crypto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz", + "integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==", + "deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in." + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/express/node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", + "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", + "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", + "dependencies": { + "jws": "^3.2.2", + "lodash": "^4.17.21", + "ms": "^2.1.1", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/app/app_nodeToDo/backend/api/package.json b/app/app_nodeToDo/backend/api/package.json new file mode 100644 index 000000000..993ba440e --- /dev/null +++ b/app/app_nodeToDo/backend/api/package.json @@ -0,0 +1,19 @@ +{ + "name": "node-todo-api", + "version": "1.0.0", + "description": "The api for the node-todo application", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Fabio Sereno", + "license": "MIT", + "dependencies": { + "body-parser": "^1.20.2", + "cors": "^2.8.5", + "crypto": "^1.0.1", + "express": "^4.18.2", + "jsonwebtoken": "^9.0.0", + "uuid": "^9.0.0" + } +} diff --git a/app/app_nodeToDo/backend/api/services/itemsService.js b/app/app_nodeToDo/backend/api/services/itemsService.js new file mode 100644 index 000000000..deaa9f18e --- /dev/null +++ b/app/app_nodeToDo/backend/api/services/itemsService.js @@ -0,0 +1,128 @@ +const { v4: uuidv4 } = require('uuid'); + +/** + * The items array +*/ +const items = [ + { + id: "example", + username: "user1", + description: "some item to do 1", + done: false, + modifiedOn: new Date(), + createdOn: new Date() + } +] + +/** +* Returns an array of items filtered by the provided username. +* @param {string} username - The username to filter items by. +* @returns {Array} An array of items filtered by the provided username. +*/ +const getItems = (username) => { + + if (!username) throw new Error("Invalid username provided"); + + const filteredItems = items.filter(x => x.username === username); + + if (!filteredItems || filteredItems.length === 0) return []; + + return filteredItems; +}; + +/** + * Get a specific item by its ID and the associated username + * @param {string} id - The ID of the item to get + * @param {string} username - The associated username for the item + * @returns {object} - The item object that matches the given ID and username + * @throws {Error} - Throws an error if the provided item ID or username is invalid, or if the item is not found + */ +const getItem = (id, username) => { + + if (!id) throw new Error("Invalid item ID provided"); + if (!username) throw new Error("Invalid username provided"); + + const filteredItems = items.find(x => x.id === id && x.username === username); + + if (!filteredItems) throw new Error("Item not found for the given ID and username"); + + return filteredItems; +}; + +/** +* Deletes an item from the list of items with the specified ID and username. +* @param {string} id - The ID of the item to delete. +* @param {string} username - The username associated with the item to delete. +* @throws {Error} If the ID or username provided are invalid or if the item is not found. +*/ +const deleteItem = (id, username) => { + + if (!id) throw new Error("Invalid item ID provided"); + if (!username) throw new Error("Invalid username provided"); + + const index = items.findIndex(x => x.id === id && x.username === username); + + if (index !== -1) { + items.splice(index, 1); + } else { + throw new Error("Item not found for the given ID and username"); + } +}; + +/** +* Creates a new item and adds it to the list of items. +* @param {object} item - The item object to be created. It should have an 'id', 'description' and 'done' property. +* @param {string} username - The username of the item owner. +* @throws {Error} If the 'item' parameter is not a valid object or if it's missing the 'id', 'description' or 'done' properties. +* @throws {Error} If the 'username' parameter is not provided. +*/ +const createItem = (item, username) => { + + if (!item || typeof item !== 'object') throw new Error('Invalid item'); + if (!item.description) throw new Error('Item id and description are required'); + if (typeof item.done !== 'boolean') throw new Error('Item done must be a boolean'); + + item.id = uuidv4(); + item.username = username; + item.modifiedOn = new Date(); + item.createdOn = new Date(); + + items.push(item); +}; + +/** +* Updates an existing item for the given username. +* @param {object} item - The item object to update. +* @param {string} username - The username of the user updating the item. +* @throws {Error} If the item object is invalid, item ID is missing, or username is missing. +* @throws {Error} If the item cannot be found for the given ID and username. +* @returns {void} +*/ +const updateItem = (item, username) => { + + if (!item || typeof item !== 'object' || Array.isArray(item)) throw new Error("Invalid item object provided"); + if (!item.id) throw new Error("Invalid item ID provided"); + if (!username) throw new Error("Invalid username provided"); + + const index = items.findIndex(x => x.id === item.id && x.username === username); + + if (index !== -1) { + const existing = items.find(x => x.id === item.id && x.username === username); + if (existing) { + item.modifiedOn = new Date(); + items.splice(index, 1, { ...existing, ...item }); + } else { + throw new Error("Item not found for the given ID and username"); + } + } else { + throw new Error("Item not found for the given ID and username"); + } +}; + +module.exports = { + getItems, + getItem, + deleteItem, + createItem, + updateItem +} diff --git a/app/app_nodeToDo/backend/api/services/userService.js b/app/app_nodeToDo/backend/api/services/userService.js new file mode 100644 index 000000000..1a812987d --- /dev/null +++ b/app/app_nodeToDo/backend/api/services/userService.js @@ -0,0 +1,275 @@ +const jwt = require('jsonwebtoken'); +const crypto = require("crypto"); +const { v4: uuidv4 } = require('uuid'); + +// public members +/** + * The registered users. +*/ +const users = []; + +// private members +/** + * JWT Whitelisted tokens. These are the logged in tokens. +*/ +const _tokenWhitelist = []; + +/** + * The System Secret Key +*/ +const secretKey = process.env.SECRET_KEY || 'secret_key'; + +/** + * Middleware to check if user is authenticated + * @param {Object} req - Request object + * @param {Object} res - Response object + * @param {Function} next - Next function + */ +const isAuthenticated = (req, res, next) => { + const authHeader = req.headers.authorization; + + if (!authHeader || !authHeader.startsWith('Bearer ')) { + return res.status(401).json({ message: 'Unauthorized' }); + } + + const bearerToken = extractBearerToken(req); + + if (bearerToken) { + + const isWhitelisted = _tokenWhitelist.some(x => x === bearerToken); + + if (!isWhitelisted) { + return res.status(401).json({ message: 'Unauthorized' }); + } + + jwt.verify(bearerToken, secretKey, (err, decodedToken) => { + + if (err) { + return res.sendStatus(403); + } + + getUser(decodedToken.username); + + next(); + }); + } else { + next(); + } +}; + +/** + * Get current authenticated user + * @param {Object} req - Request object + * @param {Object} res - Response object + * @returns {Object} User object + */ +const getCurrentUser = (req) => { + + const bearerToken = extractBearerToken(req); + + if (bearerToken) { + + return jwt.verify(bearerToken, secretKey, (err, decodedToken) => { + + if (err) { + throw new Error('No user found!'); + } + + const user = getUser(decodedToken.username); + + return user; + + }); + + } else { + throw new Error('Unauthorized.'); + } +}; + +/** + * Handles user login + * @param {string} username - User's username + * @param {string} password - User's password + * @param {Object} req - Request object + * @param {Object} res - Response object + * @returns {string} JWT token + */ +const handleLogin = (username, password, req) => { + + const users = getUsers(); + + const user = users.find(x => x.username === username); + + if (!user) { + throw new Error('Username or password does not match.'); + } + + const reHashedPassword = createHash(password); + + if (user.password !== reHashedPassword) { + throw new Error('Username or password does not match.'); + } + + const payload = { + username: username + }; + + const token = jwt.sign(payload, secretKey, { expiresIn: '1h' }); + + removeDuplicateUserToken(username); + + _tokenWhitelist.push(token); + + return token; +}; + +/** + * Handles user logout + * @param {Object} req - Request object + * @returns {string} - The hashed password. + */ +const handleLogout = (req) => { + + const bearerToken = extractBearerToken(req); + + removeToken(bearerToken); + + return true; +}; + +/** + * Removes a duplicate whitelisted user token + * There should only be one JWT per user, per login + * @param {string} username - The username to check already whitelisted + */ +const removeDuplicateUserToken = (username) => { + + _tokenWhitelist.forEach((existingToken) => { + + jwt.verify(existingToken, secretKey, (err, decodedToken) => { + if (username === decodedToken.username) { + removeToken(existingToken); + } + }); + }) +} + +/** + * Removes a token form the whitelist + * @param {string} token - The token to remove + */ +const removeToken = (token) => { + + const index = _tokenWhitelist.findIndex(x => x === token); + + if (index !== -1) { + _tokenWhitelist.splice(index, 1); + } else { + throw new Error("Token not found. User not logged in."); + } +} + +/** + * Register new user + * @param {string} username - User's username + * @param {string} password - User's password + * @param {Object} res - Response object + */ +const registerUser = (username, password) => { + + const users = getUsers(); + + if (users.find(u => u.username === username)) { + throw new Error('User already exists.'); + } + + const id = uuidv4(); + const hashedPassword = createHash(password); + const user = { id, username, password: hashedPassword }; + + users.push(user); +}; + +/** + * Retrieves all users. + * @returns {array} - Returns and array of all users + */ +const getUsers = () => users; + +/** + * Gets a specific user. + * @param {string} username - User's username + * @returns {} - Returns a user object +*/ +const getUser = (username) => { + + if (isUserExists(username)) { + + return users.find(x => x.username === username); + + } else { + + throw new Error('User not found!'); + } +} + +/** + * Retrieves a user with the given username from the users array. + * @param {string} username - The username to retrieve. + * @returns {boolean} - True if the user exists, False is not found. + */ +const isUserExists = (username) => { + + try { + + return users.find(x => x.username === username) !== undefined; + + } catch (err) { + + throw new Error(`Failed to get user with username ${username}: ${err.message}`); + } +}; + +/** + * Creates a SHA512 hash of the given password. + * @param {string} password - The password to hash. + * @returns {string} - The hashed password. + */ +const createHash = (password) => { + + try { + const hash = crypto.createHash("sha512"); + + hash.update(password); + + return hash.digest("hex"); + + } catch (err) { + + throw new Error(`Failed to create hash for password: ${err.message}`); + } +}; + +/** + * Extracts a JWT bearer token from the Authorization header of a request. + * @param {Object} req - The request object. + * @returns {string|null} - The bearer token, or null if no token was found. + */ +const extractBearerToken = (req) => { + try { + if (req.headers.authorization && req.headers.authorization.split(' ')[0] === 'Bearer') { + return req.headers.authorization.split(' ')[1]; + } + return null; + } catch (err) { + throw new Error(`Failed to extract bearer token from request: ${err.message}`); + } +}; + +module.exports = { + isAuthenticated, + getCurrentUser, + handleLogin, + handleLogout, + registerUser +}; \ No newline at end of file diff --git a/app/app_awsDotNetCoreShoppingCart/pug/index.pug b/app/app_nodeToDo/pug/index.pug similarity index 100% rename from app/app_awsDotNetCoreShoppingCart/pug/index.pug rename to app/app_nodeToDo/pug/index.pug diff --git a/app/app_awsNodeToDoApi/sass/styles.scss b/app/app_nodeToDo/sass/styles.scss similarity index 100% rename from app/app_awsNodeToDoApi/sass/styles.scss rename to app/app_nodeToDo/sass/styles.scss diff --git a/app/app_awsNodeToDoApi/src/app.js b/app/app_nodeToDo/src/app.js similarity index 87% rename from app/app_awsNodeToDoApi/src/app.js rename to app/app_nodeToDo/src/app.js index fe6ec8b8c..23af9a9d8 100644 --- a/app/app_awsNodeToDoApi/src/app.js +++ b/app/app_nodeToDo/src/app.js @@ -11,13 +11,12 @@ import { SpinnerContextProvider } from '../../js/modules/react/spinnerComponent' import { ToasterContextProvider } from '../../js/modules/react/toasterComponent'; import { ConfigContextProvider } from '../../js/modules/react/configContextProvider'; import { ItemsContextProvider } from './components/contextProviders/itemsContextProvider'; -import { POOL_DATA } from './constants'; function App() { return ( - + - + diff --git a/app/app_awsNodeToDoApi/src/components/content.js b/app/app_nodeToDo/src/components/content.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/content.js rename to app/app_nodeToDo/src/components/content.js diff --git a/app/app_awsNodeToDoApi/src/components/contentContainer.js b/app/app_nodeToDo/src/components/contentContainer.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/contentContainer.js rename to app/app_nodeToDo/src/components/contentContainer.js diff --git a/app/app_awsNodeToDoApi/src/components/contextProviders/itemsContextProvider.js b/app/app_nodeToDo/src/components/contextProviders/itemsContextProvider.js similarity index 91% rename from app/app_awsNodeToDoApi/src/components/contextProviders/itemsContextProvider.js rename to app/app_nodeToDo/src/components/contextProviders/itemsContextProvider.js index 346b3050f..b43d55c30 100644 --- a/app/app_awsNodeToDoApi/src/components/contextProviders/itemsContextProvider.js +++ b/app/app_nodeToDo/src/components/contextProviders/itemsContextProvider.js @@ -9,16 +9,11 @@ export function ItemsContextProvider({ children }) { const configContext = React.useContext(ConfigContext); const loginContext = React.useContext(LoginContext); - const endpoints = configContext.appConfig.endpoints; - const API_ENDPOINT = `${endpoints.base}/${endpoints.api}`; - + const API_ENDPOINT = `${configContext.config.apiRoot}${endpoints.base}/`; const selectedId = useRef(); - const ver = useRef(0); - const [ version, setVersion ] = useState(ver.current); - const [items, setItems] = useState([]); const incrementVersion = () => { @@ -32,7 +27,7 @@ export function ItemsContextProvider({ children }) { return XMLHttpRequestUtil.request({ type: "GET", request: API_ENDPOINT, - headers: [{ key: "Authorization", value: loginContext.token.current }] + headers: [{ key: "Authorization", value: loginContext.prepareToken() }] }); } @@ -40,7 +35,7 @@ export function ItemsContextProvider({ children }) { return XMLHttpRequestUtil.request({ type: "GET", request: `${API_ENDPOINT}/${selectedId.current}`, - headers: [{ key: "Authorization", value: loginContext.token.current }] + headers: [{ key: "Authorization", value: loginContext.prepareToken() }] }); } @@ -48,7 +43,7 @@ export function ItemsContextProvider({ children }) { return XMLHttpRequestUtil.request({ type: "DELETE", request: `${API_ENDPOINT}/${id}`, - headers: [{ key: "Authorization", value: loginContext.token.current }] + headers: [{ key: "Authorization", value: loginContext.prepareToken() }] }); } @@ -68,9 +63,9 @@ export function ItemsContextProvider({ children }) { return XMLHttpRequestUtil.request({ type: "PUT", - request: `${API_ENDPOINT}/${selectedId.current}`, + request: `${API_ENDPOINT}`, payload: JSON.stringify(item), - headers: [{ key: "Authorization", value: loginContext.token.current }] + headers: [{ key: "Authorization", value: loginContext.prepareToken() }] }); } @@ -78,14 +73,13 @@ export function ItemsContextProvider({ children }) { const newItem = {...item}; - newItem.username = loginContext.username.current; newItem.modifiedOn = _getModifiedOnTime(); return XMLHttpRequestUtil.request({ type: "POST", request: API_ENDPOINT, payload: JSON.stringify(newItem), - headers: [{ key: "Authorization", value: loginContext.token.current }] + headers: [{ key: "Authorization", value: loginContext.prepareToken() }] }); } diff --git a/app/app_nodeToDo/src/components/contextProviders/loginContextProvider.js b/app/app_nodeToDo/src/components/contextProviders/loginContextProvider.js new file mode 100644 index 000000000..ee9095994 --- /dev/null +++ b/app/app_nodeToDo/src/components/contextProviders/loginContextProvider.js @@ -0,0 +1,133 @@ +"use strict;" + +import React, { useState, useLayoutEffect, useRef } from 'react'; +import { LoginContext } from '../../contexts'; +import { ConfigContext } from '../../../../js/modules/react/configContextProvider'; +import { XMLHttpRequestUtil } from '../../../../js/modules/utils/xmlHttpRequestUtil'; +import { DeploymentModalComponent } from '../../../../js/modules/react/deploymentModalComponent.js'; +import { DeploymentUtil } from '../../../../js/modules/utils/deploymentUtil'; + +const TOKEN_KEY = 'NODE_TODO_TOKEN'; + +export const LoginContextProvider = ({ children }) => { + + const configContext = React.useContext(ConfigContext); + const endpoints = configContext.appConfig.endpoints; + const API_ENDPOINT = `${configContext.config.apiRoot}${endpoints.base}/`; + const [ authenticated, setAuthenticated ] = useState(false); + const token = useRef(sessionStorage.getItem(TOKEN_KEY)); + const [ showDeploymentModal, setShowDeploymentModal ] = useState(DeploymentUtil.isNotCloud()); + + const registerUser = (username, password) => { + + const authenticationData = { + username, + password, + }; + + return XMLHttpRequestUtil.request({ + type: "POST", + request: `${API_ENDPOINT}/register`, + payload: JSON.stringify(authenticationData), + headers: [] + }); + }; + + const getCurrentUser = (_token) => { + return XMLHttpRequestUtil.request({ + type: "GET", + request: `${API_ENDPOINT}/user`, + headers: [{ key: "Authorization", value: prepareToken(_token) }] + }); + }; + + const logoutUser = () => new Promise((resolve, reject) => { + XMLHttpRequestUtil.request({ + type: "GET", + request: `${API_ENDPOINT}/logout`, + headers: [{ key: "Authorization", value: prepareToken() }] + }).then((response) => { + setAuthenticated(false) + sessionStorage.removeItem(TOKEN_KEY) + resolve(response); + }).catch(() => { + setAuthenticated(false) + reject(); + } ); + }); + + const loginUser = (username, password) => new Promise((resolve, reject) => { + + const authenticationData = { + username, + password, + }; + + XMLHttpRequestUtil.request({ + type: "POST", + request: `${API_ENDPOINT}/login`, + payload: JSON.stringify(authenticationData), + headers: [] + }).then((response) => { + sessionStorage.setItem(TOKEN_KEY, response.data.token); + token.current = response.data.token; + + setAuthenticated(true) + + resolve(response); + }).catch((response) => { + setAuthenticated(false) + reject(response); + } ); + }); + + useLayoutEffect(() => { + const _token = sessionStorage.getItem(TOKEN_KEY); + + if(_token) { + getCurrentUser(_token) + .then(response => { + if (response.success) { + token.current = _token; + setAuthenticated(true); + } + }) + .catch(() => setAuthenticated(false)); + } + }, []); + + const prepareToken = (_token) => `Bearer ${_token ? _token : token.current}`; + + const handleDeploymentModalClose = () => { + setShowDeploymentModal(false); + } + + const handleDeploymentModalShow = () => { + setShowDeploymentModal(true); + } + + const context = { + authenticated, + setAuthenticated, + registerUser, + loginUser, + logoutUser, + token, + prepareToken, + showDeploymentModal, + isCloud: DeploymentUtil.isCloud(), + isNotCloud: DeploymentUtil.isNotCloud(), + handleDeploymentModalClose, + handleDeploymentModalShow + }; + + return ( + + {children} + + + ) +} \ No newline at end of file diff --git a/app/app_awsNodeToDoApi/src/components/contextProviders/manageContextProvider.js b/app/app_nodeToDo/src/components/contextProviders/manageContextProvider.js similarity index 99% rename from app/app_awsNodeToDoApi/src/components/contextProviders/manageContextProvider.js rename to app/app_nodeToDo/src/components/contextProviders/manageContextProvider.js index 70070f37a..8aabf4798 100644 --- a/app/app_awsNodeToDoApi/src/components/contextProviders/manageContextProvider.js +++ b/app/app_nodeToDo/src/components/contextProviders/manageContextProvider.js @@ -10,9 +10,7 @@ export const ManageContextProvider = ({ children }) => { const spinnerContext = React.useContext(SpinnerContext); const itemsContext = React.useContext(ItemsContext); - const [ showError, setShowError ] = useState(false); - const [ state, dispatch ] = useReducer(itemReducer, ITEM); const doneCallback = () => { diff --git a/app/app_awsNodeToDoApi/src/components/doneItem.js b/app/app_nodeToDo/src/components/doneItem.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/doneItem.js rename to app/app_nodeToDo/src/components/doneItem.js diff --git a/app/app_awsNodeToDoApi/src/components/item.js b/app/app_nodeToDo/src/components/item.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/item.js rename to app/app_nodeToDo/src/components/item.js diff --git a/app/app_awsNodeToDoApi/src/components/itemForm.js b/app/app_nodeToDo/src/components/itemForm.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/itemForm.js rename to app/app_nodeToDo/src/components/itemForm.js diff --git a/app/app_awsNodeToDoApi/src/components/itemToDo.js b/app/app_nodeToDo/src/components/itemToDo.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/itemToDo.js rename to app/app_nodeToDo/src/components/itemToDo.js diff --git a/app/app_awsNodeToDoApi/src/components/listContainer.js b/app/app_nodeToDo/src/components/listContainer.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/listContainer.js rename to app/app_nodeToDo/src/components/listContainer.js diff --git a/app/app_awsNodeToDoApi/src/components/listItems.js b/app/app_nodeToDo/src/components/listItems.js similarity index 95% rename from app/app_awsNodeToDoApi/src/components/listItems.js rename to app/app_nodeToDo/src/components/listItems.js index a613a3531..b50bb7313 100644 --- a/app/app_awsNodeToDoApi/src/components/listItems.js +++ b/app/app_nodeToDo/src/components/listItems.js @@ -37,13 +37,14 @@ export const ListItems = React.memo(({version}) => { itemsContext.getItems() .then(response => { - const items = response.data || []; + const items = response.data.items || []; items.sort(modifiedOnComparerDesc); itemsContext.setItems(items); spinnerContext.hideSpinner(); setHideItems(false); - }).catch(() => manageContext.failCallback()); + }).catch((err) => { + manageContext.failCallback()}); }, [version]); return ( diff --git a/app/app_awsNodeToDoApi/src/components/loginForm.js b/app/app_nodeToDo/src/components/loginForm.js similarity index 92% rename from app/app_awsNodeToDoApi/src/components/loginForm.js rename to app/app_nodeToDo/src/components/loginForm.js index 6303c2394..65a0d913f 100644 --- a/app/app_awsNodeToDoApi/src/components/loginForm.js +++ b/app/app_nodeToDo/src/components/loginForm.js @@ -43,13 +43,17 @@ export function LoginForm() { setShowValidation(true); event.stopPropagation(); - } else { + } else if (loginContext.isCloud) { spinnerContext.setShow(true); loginContext.loginUser(username, password) - .then(result => result.success ? loginDoneCallback() : loginFailCallback({ message: "Login failed!"})) - .catch(result => loginFailCallback(result.error)); + .then(response => response.success ? loginDoneCallback() : loginFailCallback({ message: "Login failed!"})) + .catch(response => loginFailCallback({ message: response.data.response })); + } else { + + loginContext.handleDeploymentModalShow(); + } }; diff --git a/app/app_awsNodeToDoApi/src/components/logoutForm.js b/app/app_nodeToDo/src/components/logoutForm.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/logoutForm.js rename to app/app_nodeToDo/src/components/logoutForm.js diff --git a/app/app_awsNodeToDoApi/src/components/manageContainer.js b/app/app_nodeToDo/src/components/manageContainer.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/manageContainer.js rename to app/app_nodeToDo/src/components/manageContainer.js diff --git a/app/app_awsNodeToDoApi/src/components/pages/edit.js b/app/app_nodeToDo/src/components/pages/edit.js similarity index 96% rename from app/app_awsNodeToDoApi/src/components/pages/edit.js rename to app/app_nodeToDo/src/components/pages/edit.js index a61416597..357a2b4cb 100644 --- a/app/app_awsNodeToDoApi/src/components/pages/edit.js +++ b/app/app_nodeToDo/src/components/pages/edit.js @@ -17,13 +17,9 @@ export function Edit() { const spinnerContext = React.useContext(SpinnerContext); const history = useHistory(); - const [state, dispatch] = useReducer(itemReducer, ITEM); - const doneCallback = () => history.push(MANAGE); - const failCallback = () => spinnerContext.hideSpinner(); - const onBackClick = () => history.goBack(); useEffect(() => { @@ -32,7 +28,7 @@ export function Edit() { itemsContext.getItem() .then(response => { spinnerContext.hideSpinner(); - dispatch({ type: COPY, value: response.data }); + dispatch({ type: COPY, value: response.data.item }); }).catch(() => failCallback()); } else { history.push(MANAGE); diff --git a/app/app_awsNodeToDoApi/src/components/pages/login.js b/app/app_nodeToDo/src/components/pages/login.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/pages/login.js rename to app/app_nodeToDo/src/components/pages/login.js diff --git a/app/app_awsNodeToDoApi/src/components/pages/logout.js b/app/app_nodeToDo/src/components/pages/logout.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/pages/logout.js rename to app/app_nodeToDo/src/components/pages/logout.js diff --git a/app/app_awsNodeToDoApi/src/components/pages/manage.js b/app/app_nodeToDo/src/components/pages/manage.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/pages/manage.js rename to app/app_nodeToDo/src/components/pages/manage.js diff --git a/app/app_awsNodeToDoApi/src/components/pages/register.js b/app/app_nodeToDo/src/components/pages/register.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/pages/register.js rename to app/app_nodeToDo/src/components/pages/register.js diff --git a/app/app_awsNodeToDoApi/src/components/pages/unauthorised.js b/app/app_nodeToDo/src/components/pages/unauthorised.js similarity index 94% rename from app/app_awsNodeToDoApi/src/components/pages/unauthorised.js rename to app/app_nodeToDo/src/components/pages/unauthorised.js index 52a5813e6..2da9565de 100644 --- a/app/app_awsNodeToDoApi/src/components/pages/unauthorised.js +++ b/app/app_nodeToDo/src/components/pages/unauthorised.js @@ -4,15 +4,12 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; import { ContentContainer } from '../contentContainer'; import { Content } from '../content'; -import { Button } from 'react-bootstrap'; import { LOGIN, REGISTER } from '../../constants'; export function Unauthorised() { const history = useHistory(); - const onLoginClick = (e) => { e.preventDefault(); history.push(LOGIN)} - const onRegisterClick = (e) => { e.preventDefault(); history.push(REGISTER)} return ( diff --git a/app/app_nodeToDo/src/components/protectedRoute.js b/app/app_nodeToDo/src/components/protectedRoute.js new file mode 100644 index 000000000..3d928a9f7 --- /dev/null +++ b/app/app_nodeToDo/src/components/protectedRoute.js @@ -0,0 +1,39 @@ +"use strict;" + +import React, { useEffect, useState} from 'react'; +import { LoginContext } from '../contexts'; +import { Unauthorised } from './pages/unauthorised'; +import { SpinnerContext } from '../../../js/modules/react/spinnerComponent'; + +export const ProtectedRoute = ({Component}) => { + + const loginContext = React.useContext(LoginContext); + const spinnerContext = React.useContext(SpinnerContext); + const [ show, setShow ] = useState(false); + + useEffect(() => { + + spinnerContext.showSpinner(); + + const timeout = setTimeout(() => { + + setShow(true) + spinnerContext.hideSpinner(); + + }, 500); + + return () => clearTimeout(timeout); + + }, []); + + return ( + <> + {show && loginContext.authenticated && + + } + {show && !loginContext.authenticated && + + } + + ); +} \ No newline at end of file diff --git a/app/app_awsNodeToDoApi/src/components/registerForm.js b/app/app_nodeToDo/src/components/registerForm.js similarity index 56% rename from app/app_awsNodeToDoApi/src/components/registerForm.js rename to app/app_nodeToDo/src/components/registerForm.js index af7dfea33..84c81438d 100644 --- a/app/app_awsNodeToDoApi/src/components/registerForm.js +++ b/app/app_nodeToDo/src/components/registerForm.js @@ -1,64 +1,47 @@ "use strict;" -import React, { useState, useLayoutEffect } from 'react'; +import React, { useState } from 'react'; import { useHistory } from 'react-router-dom'; import Col from 'react-bootstrap/Col'; import Button from 'react-bootstrap/Button'; import Form from 'react-bootstrap/Form'; -import { COMPLETE_CHALLENGE_ERROR, LOGIN, POOL_DATA, STANDARD_ERROR } from '../constants'; -import { CognitoUserPool, CognitoUserAttribute } from 'amazon-cognito-identity-js'; +import { LOGIN, STANDARD_ERROR } from '../constants'; import { SpinnerContext } from '../../../js/modules/react/spinnerComponent'; import { Row } from 'react-bootstrap'; import { ToasterContext, ENQUEUE_TOAST } from '../../../js/modules/react/toasterComponent'; import { ToolTip } from './tooltip'; -import ReCAPTCHA from "react-google-recaptcha"; -import { RecaptchaContext } from '../../../js/modules/react/recaptchaContextProvider'; +import { LoginContext } from '../contexts'; export function RegisterForm() { + const loginContext = React.useContext(LoginContext); const spinnerContext = React.useContext(SpinnerContext); const toasterContext = React.useContext(ToasterContext); - const recaptchaContext = React.useContext(RecaptchaContext); const [ showValidation, setShowValidation ] = useState(false); const [ showFeedback, setShowFeedback ] = useState(false); const [ feedbackErrors, setFeedbackErrors ] = useState([]); const [ username, setUsername ] = useState(""); const [ password, setPassword ] = useState(""); - const [ name, setName ] = useState(""); const history = useHistory(); - useLayoutEffect(() => { - - if (recaptchaContext.recaptureIsActive && recaptchaContext.isRecaptchValid()) { - hideErrors(); - } - - },[recaptchaContext.recaptchaToken]) - const handleSubmit = (event) => { event.preventDefault(); - if (!event.currentTarget.checkValidity() || (recaptchaContext.recaptureIsActive && !recaptchaContext.isRecaptchValid())) { - setShowValidation(true); - - if (recaptchaContext.recaptureIsActive && !recaptchaContext.isRecaptchValid()) { - showErrors(COMPLETE_CHALLENGE_ERROR); - } + if (!event.currentTarget.checkValidity()) { + setShowValidation(true); event.stopPropagation(); - } else { + } else if (loginContext.isCloud) { spinnerContext.setShow(true); + register(); - if (recaptchaContext.recaptureIsActive) { + } else { - recaptchaContext.verify(register, showErrors); + loginContext.handleDeploymentModalShow(); - } else { - register(); - } } }; @@ -73,11 +56,6 @@ export function RegisterForm() { setFeedbackErrors(errors); setShowFeedback(true); - if (recaptchaContext.recaptureIsActive) { - recaptchaContext.setRecaptchaToken(null); - recaptchaContext.recaptchaRef.current.reset(); - } - spinnerContext.setShow(false); } @@ -88,30 +66,18 @@ export function RegisterForm() { const register = () => { - const userPool = new CognitoUserPool(POOL_DATA); - - const attributeList = [ - new CognitoUserAttribute({ - Name: "name", - Value: name - }) - ]; - - userPool.signUp(username, password, attributeList, null, (err, result) => { - - if (err != null) { + loginContext.registerUser(username, password).then(() => { - showErrors(err.message); - - } else { + setShowValidation(false); + hideErrors(); - setShowValidation(false); - hideErrors(); + spinnerContext.setShow(false); + toasterContext.dispatch( { type: ENQUEUE_TOAST, item: { heading: "Registration Successful!", body: `You can now login using your credentials.` } } ); + history.push(LOGIN); - spinnerContext.setShow(false); - toasterContext.dispatch( { type: ENQUEUE_TOAST, item: { heading: "Registration Successful!", body: `${name}, you can now login using your credentials.` } } ); - history.push(LOGIN); - } + }).catch((err) => { + debugger; + showErrors(err.message) }); } @@ -119,23 +85,6 @@ export function RegisterForm() {
- - - - Name - - setName(event.target.value)} - required - /> - - Please enter a valid value - - - @@ -170,16 +119,6 @@ export function RegisterForm() { - {recaptchaContext.recaptureIsActive && - - - - Are you a robot ? - - - - - } diff --git a/app/app_awsNodeToDoApi/src/components/router.js b/app/app_nodeToDo/src/components/router.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/router.js rename to app/app_nodeToDo/src/components/router.js diff --git a/app/app_awsNodeToDoApi/src/components/tooltip.js b/app/app_nodeToDo/src/components/tooltip.js similarity index 100% rename from app/app_awsNodeToDoApi/src/components/tooltip.js rename to app/app_nodeToDo/src/components/tooltip.js diff --git a/app/app_awsNodeToDoApi/src/constants.js b/app/app_nodeToDo/src/constants.js similarity index 75% rename from app/app_awsNodeToDoApi/src/constants.js rename to app/app_nodeToDo/src/constants.js index 611856941..148d6e454 100644 --- a/app/app_awsNodeToDoApi/src/constants.js +++ b/app/app_nodeToDo/src/constants.js @@ -1,16 +1,10 @@ "use strict;" -export const POOL_DATA = { - UserPoolId: 'eu-west-2_s4syVYS6n', - ClientId: '60jvm1avgd6t55k4uc15dgu6iq' -}; - export const ITEM = { - username: "", description: "", done: false, - targetDate: "", - modifiedOn: 0 + modifiedOn: 0, + createdOn: 0 } export const COLLAPSE_STATE_SHOW = { @@ -39,5 +33,4 @@ export const TOKEN = 'token'; export const USERNAME = 'username'; export const SUCCESS = "SUCCESS"; export const USER = "cognitoUser"; -export const STANDARD_ERROR = "Sorry, there was an error. Please try again."; -export const COMPLETE_CHALLENGE_ERROR = "Please complete the challenge."; \ No newline at end of file +export const STANDARD_ERROR = "Sorry, there was an error. Please try again."; \ No newline at end of file diff --git a/app/app_awsNodeToDoApi/src/contexts.js b/app/app_nodeToDo/src/contexts.js similarity index 100% rename from app/app_awsNodeToDoApi/src/contexts.js rename to app/app_nodeToDo/src/contexts.js diff --git a/app/app_awsNodeToDoApi/src/reducers/collapseReducer.js b/app/app_nodeToDo/src/reducers/collapseReducer.js similarity index 100% rename from app/app_awsNodeToDoApi/src/reducers/collapseReducer.js rename to app/app_nodeToDo/src/reducers/collapseReducer.js diff --git a/app/app_awsNodeToDoApi/src/reducers/itemReducer.js b/app/app_nodeToDo/src/reducers/itemReducer.js similarity index 100% rename from app/app_awsNodeToDoApi/src/reducers/itemReducer.js rename to app/app_nodeToDo/src/reducers/itemReducer.js diff --git a/app/app_awsNodeToDoApi/src/utils/modifiedOnComparerDesc.js b/app/app_nodeToDo/src/utils/modifiedOnComparerDesc.js similarity index 100% rename from app/app_awsNodeToDoApi/src/utils/modifiedOnComparerDesc.js rename to app/app_nodeToDo/src/utils/modifiedOnComparerDesc.js diff --git a/app/app_awsNodeToDoApi/tests/collapseReducer.test.js b/app/app_nodeToDo/tests/collapseReducer.test.js similarity index 100% rename from app/app_awsNodeToDoApi/tests/collapseReducer.test.js rename to app/app_nodeToDo/tests/collapseReducer.test.js diff --git a/app/app_awsNodeToDoApi/tests/e2e/taiko.test.js b/app/app_nodeToDo/tests/e2e/taiko.test.js similarity index 82% rename from app/app_awsNodeToDoApi/tests/e2e/taiko.test.js rename to app/app_nodeToDo/tests/e2e/taiko.test.js index d4c99c0d8..626e68e5d 100644 --- a/app/app_awsNodeToDoApi/tests/e2e/taiko.test.js +++ b/app/app_nodeToDo/tests/e2e/taiko.test.js @@ -1,18 +1,33 @@ -/** - * @jest-environment jsdom - */ import { openBrowser, near, link, goto, write, click, closeBrowser, $, text, into, textBox, button, waitFor, evaluate } from 'taiko'; +import { ConfigUtil } from '../../../js/modules/utils/configUtil'; -const APPLICATION = "app_awsNodeToDoApi"; -const URL = `http://localhost:8080/${APPLICATION}/index.html`; +// This is a WIP - it appears running these tests on an ARM machine will alwasys fail - need to wait for some deps to be released. + +const APPLICATION = "app_nodeToDo"; +const CONFIG = ConfigUtil.get(); +const URL = `http://${CONFIG.dockerHost}/${APPLICATION}/index.html`; +const browserPath = '/usr/bin/chromium'; beforeAll(async () => { - await openBrowser({ - headless: true, - slowMo: 250, - args: ['--no-sandbox'] - }); + try { + await openBrowser({ + //executablePath: browserPath, + //headless: true, + //slowMo: 250, + args: [ + //'--disable-gpu', + //'--disable-dev-shm-usage', + //'--disable-setuid-sandbox', + //'--no-first-run', + //'--no-sandbox', + //'--no-zygote' + ] + }); + console.log("AFTER") + } catch (error) { + console.error(error); + } }); describe(APPLICATION, () => { diff --git a/app/app_awsNodeToDoApi/tests/modifiedOnComparerAsc.test.js b/app/app_nodeToDo/tests/modifiedOnComparerAsc.test.js similarity index 100% rename from app/app_awsNodeToDoApi/tests/modifiedOnComparerAsc.test.js rename to app/app_nodeToDo/tests/modifiedOnComparerAsc.test.js diff --git a/app/app_stringSort/Readme.md b/app/app_stringSort/Readme.md new file mode 100644 index 000000000..f9d645f73 --- /dev/null +++ b/app/app_stringSort/Readme.md @@ -0,0 +1,14 @@ +# Natural Sorting Algorithm + +With this application I have built a natural string sorting algorithm, using .NET. + +A basic React user interface handles user input and application state. + +With this application I have implemented IComparer to handle the sorting logic, comparing chunks of alpha and numeric values in order to achieve a natural sort order. + +Whilst this functionality could be achieved with JavaScript alone, I wanted to demonstrate knowledge of IComparer and +.NET. + +A lot of research was undertaken for this application, with many permutations in order to overcome this simple, yet complex task. Made for a very enjoyable project! + +- IComparer (https://docs.microsoft.com/en-us/dotnet/api/system.collections.icomparer?view=netcore-3.1) \ No newline at end of file diff --git a/app/app_stringSort/backend/api/Controllers/ApiController.cs b/app/app_stringSort/backend/api/Controllers/ApiController.cs new file mode 100644 index 000000000..032decf22 --- /dev/null +++ b/app/app_stringSort/backend/api/Controllers/ApiController.cs @@ -0,0 +1,43 @@ +using Microsoft.AspNetCore.Mvc; +using Portfolio.Core.Types; +using Portfolio.Core.Services; +using Portfolio.StringSort.Models; +using Portfolio.StringSort.Interfaces; +using Portfolio.StringSort.Utils; + +namespace Portfolio.StringSort.Controllers; + +/// +/// API controller for string sorting operations. +/// +[ApiController] +[Route("[controller]")] +public class ApiController : ControllerBase +{ + private readonly ILogger _logger; + private readonly IStringSortUtil _stringSortUtil; + + /// + /// Initializes a new instance of the ApiController class with the specified logger and string sort utility. + /// + /// The logger to use for logging messages. + /// The utility for sorting strings. + public ApiController( + ILogger logger, IStringSortUtil stringSortUtil) + { + _logger = logger; + _stringSortUtil = stringSortUtil; + } + + /// + /// Sorts the comma-separated string. + /// + /// The request containing the comma-separated string to sort. + /// A SortResult object containing the sorted result. + [HttpPost("sort")] + public SortResult Sort([FromBody] SortRequest request) + { + var result = _stringSortUtil.Sort(request.CommaSeperatedString); + return new SortResult(){ Result = result }; + } +} diff --git a/app/app_stringSort/backend/api/Interfaces/IStringSortUtil.cs b/app/app_stringSort/backend/api/Interfaces/IStringSortUtil.cs new file mode 100644 index 000000000..e726cb9bc --- /dev/null +++ b/app/app_stringSort/backend/api/Interfaces/IStringSortUtil.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using Portfolio.StringSort.Models; + +namespace Portfolio.StringSort.Interfaces +{ + public interface IStringSortUtil + { + /// + /// Main Sort method taking and returning a strin + /// + /// A comma seperated string of value to sort + /// A sorted comma seperated string + string Sort(string commaSeperatedString); + + /// + /// Extracts each item into a complex type ready for sorting + /// + /// A comma seperated string of value to split + /// A List of SortItems ready to sort + List GetSortItems(string commaSeperatedString); + + /// + /// Join back together from complex List type into a comma seperated string + /// + /// Sorted items + /// A sorted comma seperated string + string Join(List sortedItems); + } +} diff --git a/app/app_stringSort/backend/api/Models/SortItem.cs b/app/app_stringSort/backend/api/Models/SortItem.cs new file mode 100644 index 000000000..3803a9280 --- /dev/null +++ b/app/app_stringSort/backend/api/Models/SortItem.cs @@ -0,0 +1,97 @@ +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; + +namespace Portfolio.StringSort.Models +{ + /// + /// Represents an item to be sorted. + /// + public class SortItem + { + /// + /// Initializes a new instance of the SortItem class with the specified value. + /// + /// The value of the sort item. + public SortItem(string value = "") + { + this.Value = value; + } + + /// + /// Gets or sets the value of the sort item. + /// + public string Value { get; set; } + + /// + /// Comparer for natural sorting of SortItem objects. + /// + public class NaturalSorter : IComparer + { + /// + /// Compares two SortItem objects using natural sorting. + /// + /// The first SortItem to compare. + /// The second SortItem to compare. + /// An integer indicating the relative order of the SortItem objects. + public int Compare(SortItem a, SortItem b) + { + const string _numericRegex = "([0-9]+)"; + var outcome = 0; + + if (a.Value == b.Value) + { + return 0; + } + + var chunkA = Regex.Split(a.Value, _numericRegex); + var chunkB = Regex.Split(b.Value, _numericRegex); + + var digitChunkA = chunkA.Where( x => int.TryParse(x, out var i)); + var digitChunkB = chunkB.Where( x => int.TryParse(x, out var i)); + + for (var i = 0; i < chunkA.Length && i < chunkB.Length; i++) + { + var itemA = chunkA[i]; + var itemB = chunkB[i]; + + if (itemA != itemB) + { + if (!int.TryParse(itemA, out var integerA)) + { + outcome = itemA.CompareTo(itemB); + break; + } + if (!int.TryParse(itemB, out var integerB)) + { + outcome = itemA.CompareTo(itemB); + break; + } + outcome = integerA.CompareTo(integerB); + break; + } + } + + if (outcome == 1 && digitChunkA.Any() && digitChunkB.Any()) + { + outcome = digitChunkA.Count() < digitChunkB.Count() ? -1 : outcome; + } + + if (outcome != 0) + { + return outcome; + } + + if (chunkA.Length > chunkB.Length) + { + outcome = 1; + } + else if (chunkA.Length < chunkB.Length) + { + outcome = -1; + } + return outcome; + } + } + } +} \ No newline at end of file diff --git a/app/app_stringSort/backend/api/Models/SortRequest.cs b/app/app_stringSort/backend/api/Models/SortRequest.cs new file mode 100644 index 000000000..cbc10e9aa --- /dev/null +++ b/app/app_stringSort/backend/api/Models/SortRequest.cs @@ -0,0 +1,13 @@ +namespace Portfolio.StringSort.Models +{ + /// + /// Represents the request body for sorting a comma-separated string. + /// + public class SortRequest + { + /// + /// Gets or sets the comma-separated string to sort. + /// + public string CommaSeperatedString { get; set; } + } +} \ No newline at end of file diff --git a/app/app_stringSort/backend/api/Models/SortResult.cs b/app/app_stringSort/backend/api/Models/SortResult.cs new file mode 100644 index 000000000..b05681b94 --- /dev/null +++ b/app/app_stringSort/backend/api/Models/SortResult.cs @@ -0,0 +1,13 @@ +namespace Portfolio.StringSort.Models +{ + /// + /// Represents the result of a string sorting operation. + /// + public class SortResult + { + /// + /// Gets or sets the sorted result. + /// + public string Result { get; set; } + } +} \ No newline at end of file diff --git a/app/app_stringSort/backend/api/Program.cs b/app/app_stringSort/backend/api/Program.cs new file mode 100644 index 000000000..a7ecd300e --- /dev/null +++ b/app/app_stringSort/backend/api/Program.cs @@ -0,0 +1,38 @@ +using Portfolio.Core.Services; +using Portfolio.StringSort.Interfaces; +using Portfolio.StringSort.Utils; + +var builder = WebApplication.CreateBuilder(args); + +builder.WebHost.UseUrls("http://*:3004"); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +// Services +builder.Services.AddScoped(); + +builder.Services.AddHealthChecks(); + +var app = builder.Build(); + +app.MapHealthChecks("/healthcheck"); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); \ No newline at end of file diff --git a/app/app_stringSort/backend/api/Properties/launchSettings.json b/app/app_stringSort/backend/api/Properties/launchSettings.json new file mode 100644 index 000000000..531806343 --- /dev/null +++ b/app/app_stringSort/backend/api/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:31220", + "sslPort": 44341 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5178", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7074;http://localhost:5178", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/app/app_stringSort/backend/api/Utils/StringSortUtil.cs b/app/app_stringSort/backend/api/Utils/StringSortUtil.cs new file mode 100644 index 000000000..a469ff264 --- /dev/null +++ b/app/app_stringSort/backend/api/Utils/StringSortUtil.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.Logging; +using Portfolio.StringSort.Interfaces; +using Portfolio.StringSort.Models; + +namespace Portfolio.StringSort.Utils +{ + /// + /// Utility class for sorting strings. + /// + public class StringSortUtil : IStringSortUtil + { + private readonly ILogger _logger; + + /// + /// Initializes a new instance of the StringSortUtil class with the specified logger. + /// + /// The logger to use for logging messages. + public StringSortUtil(ILogger logger) + { + _logger = logger; + } + + /// + public string Sort(string commaSeperatedString) + { + _logger.LogInformation("Starting Sort process"); + + var itemsToSort = GetSortItems(commaSeperatedString); + Sort(itemsToSort); + + var result = Join(itemsToSort); + + _logger.LogInformation("Finished Sort process"); + + return result; + } + + /// + public List GetSortItems(string commaSeperatedString) + { + _logger.LogInformation("Started splitting items"); + + var itemsToSort = new List(); + if (String.IsNullOrEmpty(commaSeperatedString)) + { + return itemsToSort; + } + + var characterGroups = commaSeperatedString.Split(','); + + foreach (var characterGroup in characterGroups) + { + itemsToSort.Add( new SortItem() { Value = characterGroup.Trim() }); + } + + _logger.LogInformation("Finished splitting items"); + + return itemsToSort; + } + + /// + public string Join(List sortedItems) + { + _logger.LogInformation("Started Join process of sorted items"); + + var result = string.Empty; + + if (sortedItems == null || sortedItems?.Count == 0) { + return result; + } + + foreach (var item in sortedItems) + { + if (!String.IsNullOrEmpty(result)) + { + result = $"{result},{item.Value}"; + } + else + { + result = $"{item.Value}"; + } + } + + _logger.LogInformation("Finished Join process of sorted items"); + + return result; + } + + /// + /// Sorts the items using the natural sorting logic. + /// + /// The list of SortItems to sort. + private void Sort(List itemsToSort) + { + _logger.LogInformation("Sort the items"); + itemsToSort?.Sort(new SortItem.NaturalSorter()); + } + } +} \ No newline at end of file diff --git a/app/app_stringSort/backend/api/api.csproj b/app/app_stringSort/backend/api/api.csproj new file mode 100644 index 000000000..ac62cca32 --- /dev/null +++ b/app/app_stringSort/backend/api/api.csproj @@ -0,0 +1,18 @@ + + + + net7.0 + enable + enable + + + + + + + + + + + + diff --git a/app/app_stringSort/backend/api/appsettings.Development.json b/app/app_stringSort/backend/api/appsettings.Development.json new file mode 100644 index 000000000..ff66ba6b2 --- /dev/null +++ b/app/app_stringSort/backend/api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/app/app_stringSort/backend/api/appsettings.json b/app/app_stringSort/backend/api/appsettings.json new file mode 100644 index 000000000..4d566948d --- /dev/null +++ b/app/app_stringSort/backend/api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/app/app_stringSort/backend/test/StringSortUtilTests.cs b/app/app_stringSort/backend/test/StringSortUtilTests.cs new file mode 100644 index 000000000..7c503f497 --- /dev/null +++ b/app/app_stringSort/backend/test/StringSortUtilTests.cs @@ -0,0 +1,195 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.Logging; +using Moq; +using Xunit; +using Portfolio.StringSort.Interfaces; +using Portfolio.StringSort.Utils; +using Portfolio.StringSort.Models; + +namespace FabioSereno.App_awsDotNetCoreStringSortApi.Tests +{ + public class StringSortUtilTests + { + private readonly IStringSortUtil _sut; + private readonly Mock> _logger; + public StringSortUtilTests() + { + _logger = new Mock>(); + _sut = new StringSortUtil(_logger.Object); + } + + [Fact] + public void Test_Sort_Should_Not_Error_On_Empty_String() + { + var commaSeperatedString = string.Empty; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal(string.Empty, result); + } + + [Fact] + public void Test_Sort_Should_Not_Error_With_Null_Value() + { + var result = _sut.Sort(null); + Assert.Equal(string.Empty, result); + } + + [Fact] + public void Test_Sort_Should_Return_Same_String_If_In_Order() + { + var commaSeperatedString = "A,B,C"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("A,B,C", result); + } + + [Fact] + public void Test_Sort_Should_Return_A_Sorted_Alpha_String() + { + var commaSeperatedString = "B,A,C"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("A,B,C", result); + } + + [Fact] + public void Test_Sort_Should_Return_A_Sorted_String_Ignoring_Spaces() + { + var commaSeperatedString = "B , A,C, 1 "; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("1,A,B,C", result); + } + + [Fact] + public void Test_Sort_Should_Return_A_Sorted_Numeric_String() + { + var commaSeperatedString = "2,3,1,4,10"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("1,2,3,4,10", result); + } + + [Fact] + public void Test_Sort_Should_Return_A_Sorted_AlphaNumeric_String() + { + var commaSeperatedString = "a2,c3,1,4,b10"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("1,4,a2,b10,c3", result); + } + + [Fact] + public void Test_Sort_Should_Sort_Complex_Names() + { + var commaSeperatedString = "ToDoList10,ToDoList1,ToDoListB,ToDoListA,ToDoList5"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("ToDoList1,ToDoList5,ToDoList10,ToDoListA,ToDoListB", result); + } + + [Fact] + public void Test_Sort_Should_Sort_File_Names_With_Extensions() + { + var commaSeperatedString = "ToDoList10.txt,ToDoList1.txt,ToDoListB.txt,ToDoListA.txt,ToDoList5.txt"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("ToDoList1.txt,ToDoList5.txt,ToDoList10.txt,ToDoListA.txt,ToDoListB.txt", result); + } + + [Fact] + public void Test_Sort_Should_Sort_File_Names_With_Alpha_Numeric_Alpaha_Characters() + { + var commaSeperatedString = "ToDo_List-10.txt,ToDo_List-1.txt,ToDo_List-B.txt,ToDo_List-A.txt,ToDo_List-5.txt,ToDo_List-1A.txt"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("ToDo_List-1.txt,ToDo_List-1A.txt,ToDo_List-5.txt,ToDo_List-10.txt,ToDo_List-A.txt,ToDo_List-B.txt", result); + } + + [Fact] + public void Test_Sort_Should_Sort_On_Numerics_First_When_They_Exist() + { + var commaSeperatedString = "C,5A,B2,10A,A5,1A,A1,A,1,10,4,20A,B10"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("1,1A,4,5A,10,10A,20A,A,A1,A5,B2,B10,C", result); + } + + [Fact] + public void Test_Sort_Should_Manage_With_Mixed_Formats() + { + var commaSeperatedString = "C,A,10,ToDo_List-11,1A,B,ToDo_List-1,2,Basket-2,3,1,0,B1,0-Version-Documents,ToDo_List-10"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("0,0-Version-Documents,1,1A,2,3,10,A,B,B1,Basket-2,C,ToDo_List-1,ToDo_List-10,ToDo_List-11", result); + } + + [Fact] + public void Test_Sort_Should_Manage_With_Multi_Numerical_Values() + { + var commaSeperatedString = "document_1A1.txt,document_1A2.txt,document_1B1.txt,document_A.txt,document_1A.txt"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("document_1A.txt,document_1A1.txt,document_1A2.txt,document_1B1.txt,document_A.txt", result); + } + + [Fact] + public void Test_Sort_Should_Manage_With_Multi_Alpha_Numeric_Values() + { + var commaSeperatedString = "document_A2A.txt,document_A1.txt,document_A1B.txt,document_A10A.txt,document_A1A.txt"; + var result = _sut.Sort(commaSeperatedString); + Assert.Equal("document_A1.txt,document_A1A.txt,document_A1B.txt,document_A2A.txt,document_A10A.txt", result); + } + + + [Fact] + public void Test_Sort_Verify_Logging_Occurs() + { + var commaSeperatedString = "B,A,C"; + var result = _sut.Sort(commaSeperatedString); + VerifyLogger(LogLevel.Information, "Starting Sort process"); + VerifyLogger(LogLevel.Information, "Started splitting items"); + VerifyLogger(LogLevel.Information, "Finished splitting items"); + VerifyLogger(LogLevel.Information, "Sort the items"); + VerifyLogger(LogLevel.Information, "Started Join process of sorted items"); + VerifyLogger(LogLevel.Information, "Finished Join process of sorted items"); + VerifyLogger(LogLevel.Information, "Finished Sort process"); + } + + [Fact] + public void Test_Join_Should_Return_String_Of_Single_Item() + { + var sortedCharacters = new List(){ new SortItem("A") }; + var result = _sut.Join(sortedCharacters); + Assert.Equal("A", result); + } + + [Fact] + public void Test_Join_Should_Return_String_Of_Multiple_Items_Comma_Seperated() + { + var sortedCharacters = new List() + { + new SortItem("A"), + new SortItem("B"), + new SortItem("C") + }; + var result = _sut.Join(sortedCharacters); + Assert.Equal("A,B,C", result); + } + + [Fact] + public void Test_Join_Should_Return_Empty_String_When_Collection_Is_Empty() + { + var sortedCharacters = new List(); + var result = _sut.Join(sortedCharacters); + Assert.Equal(string.Empty, result); + } + + [Fact] + public void Test_Join_Should_Return_Empty_String_When_Collection_Is_Null() + { + var result = _sut.Join(null); + Assert.Equal(string.Empty, result); + } + + private void VerifyLogger(LogLevel expectedLogLevel, string expectedMessage = "") + { + _logger.Verify( + x => x.Log( + It.Is(l => l == expectedLogLevel), + It.IsAny(), + It.Is((v, t) => String.IsNullOrEmpty(expectedMessage) ? true : v.ToString() == expectedMessage), + It.IsAny(), + It.Is>((v, t) => true))); + } + } +} \ No newline at end of file diff --git a/app/app_stringSort/backend/test/Usings.cs b/app/app_stringSort/backend/test/Usings.cs new file mode 100644 index 000000000..8c927eb74 --- /dev/null +++ b/app/app_stringSort/backend/test/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/app/app_stringSort/backend/test/test.csproj b/app/app_stringSort/backend/test/test.csproj new file mode 100644 index 000000000..c17ceb13c --- /dev/null +++ b/app/app_stringSort/backend/test/test.csproj @@ -0,0 +1,29 @@ + + + + net7.0 + enable + enable + + false + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/app/app_awsDotNetCoreStringSortApi/pug/index.pug b/app/app_stringSort/pug/index.pug similarity index 100% rename from app/app_awsDotNetCoreStringSortApi/pug/index.pug rename to app/app_stringSort/pug/index.pug diff --git a/app/app_aframe/sass/styles.scss b/app/app_stringSort/sass/styles.scss similarity index 100% rename from app/app_aframe/sass/styles.scss rename to app/app_stringSort/sass/styles.scss diff --git a/app/app_awsDotNetCoreStringSortApi/src/app.js b/app/app_stringSort/src/app.js similarity index 72% rename from app/app_awsDotNetCoreStringSortApi/src/app.js rename to app/app_stringSort/src/app.js index c2ac92c2b..7e19d14bf 100644 --- a/app/app_awsDotNetCoreStringSortApi/src/app.js +++ b/app/app_stringSort/src/app.js @@ -4,16 +4,17 @@ import '../sass/styles.scss'; import React from 'react'; import ReactDOM from 'react-dom'; -import { PuzzleModalComponent } from '../../js/modules/react/puzzleModalComponent.js'; import { SpinnerComponent } from '../../js/modules/react/spinnerComponent.js' import { ErrorModalComponent } from '../../js/modules/react/errorModalComponent.js'; import { ConfigUtil } from "../../js/modules/utils/configUtil"; import { FormComponent } from "./formComponent"; import { jQueryAjaxUtil } from '../../js/modules/utils/jQueryAjaxUtil'; +import { DeploymentModalComponent } from '../../js/modules/react/deploymentModalComponent.js'; +import { DeploymentUtil } from '../../js/modules/utils/deploymentUtil'; -const PUZZLE = "4 x 4 - 5 ="; -const APP_CONFIG = ConfigUtil.get("awsDotNetCoreStringSortApi"); -const SORT_ENDPOINT = `${APP_CONFIG.endpoints.api}/${APP_CONFIG.endpoints.sort}`; +const CONFIG = ConfigUtil.get(); +const APP_CONFIG = ConfigUtil.get("stringSort"); +const SORT_ENDPOINT = `${CONFIG.apiRoot}${APP_CONFIG.endpoints.sort}`; class StringSort extends React.Component { constructor(props) { @@ -22,17 +23,16 @@ class StringSort extends React.Component { values: '', result: '', showSpinner: false, - showPuzzleModal: true, showErrorModal: false, + showDeploymentModal: DeploymentUtil.isNotCloud() }; this.handleValuesChange = this.handleValuesChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); - this.handleIsPuzzleValid = this.handleIsPuzzleValid.bind(this); - this.handlePuzzleModalClose = this.handlePuzzleModalClose.bind(this); - this.handlePuzzleModalShow = this.handlePuzzleModalShow.bind(this); this.handleErrorModalClose = this.handleErrorModalClose.bind(this); this.handleBeforeAjax = this.handleBeforeAjax.bind(this); this.handleFailedAjax = this.handleFailedAjax.bind(this); + this.handleDeploymentModalClose = this.handleDeploymentModalClose.bind(this); + this.handleDeploymentModalShow = this.handleDeploymentModalShow.bind(this); } handleBeforeAjax() { @@ -50,7 +50,7 @@ class StringSort extends React.Component { } handleAjax(request) { - jQueryAjaxUtil.handleAjax(request, this.state.isPuzzleValid, this.handleBeforeAjax, this.handleFailedAjax, this.handlePuzzleModalShow); + jQueryAjaxUtil.handleAjax(request, DeploymentUtil.isCloud(), this.handleBeforeAjax, this.handleFailedAjax, this.handleDeploymentModalShow); } handleValuesChange(event) { @@ -83,22 +83,15 @@ class StringSort extends React.Component { } } - handleIsPuzzleValid() { + handleDeploymentModalClose() { this.setState({ - isPuzzleValid: true, - showPuzzleModal: false - }) - } - - handlePuzzleModalClose() { - this.setState({ - showPuzzleModal: false + showDeploymentModal: false }) } - handlePuzzleModalShow() { + handleDeploymentModalShow() { this.setState({ - showPuzzleModal: true + showDeploymentModal: true }) } @@ -119,13 +112,9 @@ class StringSort extends React.Component { -
diff --git a/app/app_awsDotNetCoreStringSortApi/src/formComponent.js b/app/app_stringSort/src/formComponent.js similarity index 100% rename from app/app_awsDotNetCoreStringSortApi/src/formComponent.js rename to app/app_stringSort/src/formComponent.js diff --git a/app/app_stringSort/tests/e2e/taiko.test.js b/app/app_stringSort/tests/e2e/taiko.test.js new file mode 100644 index 000000000..c86ad4950 --- /dev/null +++ b/app/app_stringSort/tests/e2e/taiko.test.js @@ -0,0 +1,35 @@ +/** + * @jest-environment jsdom + */ + +import { openBrowser, goto, write, click, closeBrowser, $, into, textBox, button, waitFor, evaluate } from 'taiko'; +import { ConfigUtil } from '../../../js/modules/utils/configUtil'; + +const APPLICATION = "app_awsDotNetCoreStringSortApi"; +const CONFIG = ConfigUtil.get(); +const URL = `http://${CONFIG.dockerHost}/${APPLICATION}/index.html`; + +beforeAll(async () => { + await openBrowser({ + headless: true, + slowMo: 250, + args: ['--no-sandbox'] + }); +}); + +describe(APPLICATION, () => { + test('Should add an item', async () => { + await goto(URL); + await write('11', into(textBox({ id: 'answerInput' }), { force: true })); + await click(button({ id: 'submitPuzzle' })); + await waitFor(2000); + await write('C,B,A,10,1', into(textBox({ id: 'valuesInput' }))); + await click(button({ id: 'sort_submit' })); + const result = await evaluate($('#resultOutput'), (element) => element.innerText); + expect(result).toBe('1,10,A,B,C'); + }, 100000); +}); + +afterAll(() => { + closeBrowser(); +}); \ No newline at end of file diff --git a/app/app_threeJSScene/Readme.md b/app/app_threeJSScene/Readme.md deleted file mode 100644 index 86e4e82de..000000000 --- a/app/app_threeJSScene/Readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# Three JS Scene (Basic) - -With this application I have built a simple 'Hello World' Three JS application. - -### Explanation ### - -I have used Webpack to bundle JS dependancies and Babel to transpile to the correct ES version. - -The interest in this application is to explore the power of Three JS for building web friendly, 3D graphics applications using WebGL. Hover of a cube to trigger an animation. - -This application is intended for use in any modern web browsers. - -This is one in a series of applications experimenting with WebGL and WebXR. \ No newline at end of file diff --git a/app/app_threeJSScene/pug/index.pug b/app/app_threeJSScene/pug/index.pug deleted file mode 100644 index da50e2869..000000000 --- a/app/app_threeJSScene/pug/index.pug +++ /dev/null @@ -1,4 +0,0 @@ -extends ../../pug/layouts/main.pug - -block content - div#result \ No newline at end of file diff --git a/app/app_threeJSScene/sass/styles.scss b/app/app_threeJSScene/sass/styles.scss deleted file mode 100644 index 364996093..000000000 --- a/app/app_threeJSScene/sass/styles.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import "../../sass/includes/colours.scss"; - -body { - - margin: 0; - height: 100vh; - - h1 { - color: $black; - } - -} - -canvas { - display: block; -} \ No newline at end of file diff --git a/app/app_threeJSScene/src/app.js b/app/app_threeJSScene/src/app.js deleted file mode 100644 index c825e54c5..000000000 --- a/app/app_threeJSScene/src/app.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict;" - -import '../sass/styles.scss'; - -import * as THREE from 'three'; - -import {TimelineMax, TweenMax, CSSPlugin, ScrollToPlugin, Draggable, Elastic, Expo} from "gsap/all"; - -const helper = function() { - - let scene = new THREE.Scene(); - let camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); - let renderer = new THREE.WebGLRenderer({antialias: true}); - let cubeGeometry = new THREE.BoxGeometry(1, 1, 1); - let cubeMaterial = new THREE.MeshLambertMaterial({ color: 0xF7F7F7 }); - let raycaster = new THREE.Raycaster(); - let mouse = new THREE.Vector2(); - - let setCameraPosition = (x = 0, y = 0, z = 0) => { - camera.position.x = x; - camera.position.y = y; - camera.position.z = z; - } - - let setRenderer = () => { - let container = document.getElementById("mainContainer"); - renderer.setClearColor("#e5e5e5"); - renderer.setSize( window.innerWidth, window.innerHeight ); - renderer.shadowMap.enabled = true; - renderer.shadowMap.type = THREE.PCFSoftShadowMap; - container.appendChild( renderer.domElement ); - } - - let setResizeEventHandler = () => { - window.addEventListener("resize", () => { - renderer.setSize(window.innerWidth, window.innerHeight); - camera.aspect = window.innerWidth / window.innerHeight; - camera.updateProjectionMatrix(); - }); - } - - let createCubes = (numberOfCubes = 1) => { - for(var i = 0; i < numberOfCubes; i++) { - var cube = new THREE.Mesh( cubeGeometry, cubeMaterial ); - cube.position.x = (Math.random() - 0.5) * 10; - cube.position.y = (Math.random() - 0.5) * 10; - cube.position.z = (Math.random() - 0.5) * 10; - scene.add(cube); - } - } - - let addLight = (color = 0xFFFFFF, intensity = 1, distance = 1000, x = 0, y = 0, z = 0) => { - var light = new THREE.PointLight(color, intensity, distance); - light.position.set(x, y, z); - scene.add( light ); - } - - let cubeReact = (event) => { - event.preventDefault(); - - mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1; - mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1; - - raycaster.setFromCamera(mouse, camera); - - let intersects = raycaster.intersectObjects(scene.children, true); - - for (let i = 0; i < intersects.length; i++) { - let tl = new TimelineMax(); - tl.to(intersects[i].object.scale, 1, {x: 2, ease: Expo.easeOut}); - tl.to(intersects[i].object.scale, .5, {y: .5, ease: Expo.easeOut}); - tl.to(intersects[i].object.position, .5, {x: 2, ease: Expo.easeOut}); - tl.to(intersects[i].object.position, .5, {y: Math.PI*.5, ease: Expo.easeOut}, "=-1.5"); - } - } - - let setAnimationLoop = () => { - renderer.setAnimationLoop( function() { - renderer.render( scene, camera ); - }); - } - - let setCubeReactEventListener = () => { - window.addEventListener("mousemove", cubeReact); - } - - let init = () => { - setCameraPosition(0, 0, 5); - setRenderer(); - setResizeEventHandler(); - createCubes(15); - addLight(); - addLight(0xFFFFFF, 2, 1000, 0, 0, 25); - setAnimationLoop(); - setCubeReactEventListener(); - } - - return { - init: init - } -}; - -let app = helper(); -app.init(); \ No newline at end of file diff --git a/app/app_ticTacToeReact/sass/styles.scss b/app/app_ticTacToeReact/sass/styles.scss index 0e556f73e..715af9ce2 100644 --- a/app/app_ticTacToeReact/sass/styles.scss +++ b/app/app_ticTacToeReact/sass/styles.scss @@ -1,47 +1,58 @@ @import "../../sass/includes/colours.scss"; -.test { - background: orange -} - -.board-row:after { - clear: both; - content: ""; - display: table; -} - .status { margin-bottom: 10px; } +.border-row { + display: flex; + flex-wrap: wrap; + border: 1px solid $black; + border-top: none; + border-left: none; +} + .square { - background: #fff; - border: 1px solid #999; - float: left; + background: $darkGrey; font-size: 24px; font-weight: bold; line-height: 34px; - height: 34px; - margin-right: -1px; - margin-top: -1px; padding: 0; text-align: center; - width: 34px; + flex-basis: 33.33%; + height: 100px; + border: 1px solid $white; + border-radius: 0; + border-bottom: none; + border-right: none; + outline: none; + box-shadow: none; } -.square:focus { +.square.btn-dark:focus, .square.btn-dark:hover, .square.btn-dark:active, .square.btn-dark:not(:disabled):not(.disabled):active { outline: none; + border: 1px solid $white; + border-bottom: none; + border-right: none; + box-shadow: none; } .kbd-navigation .square:focus { background: #ddd; } +.outer { + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; +} + .game { display: flex; - flex-direction: row; } .game-info { margin-left: 20px; + flex: 1; } \ No newline at end of file diff --git a/app/app_ticTacToeReact/src/app.js b/app/app_ticTacToeReact/src/app.js index 074e9b64b..94d5dbcbe 100644 --- a/app/app_ticTacToeReact/src/app.js +++ b/app/app_ticTacToeReact/src/app.js @@ -8,7 +8,7 @@ import ReactDOM from 'react-dom'; function Square(props) { return ( @@ -26,18 +26,18 @@ class Board extends React.Component { } render() { return ( -
-
+
+
{this.renderSquare(0)} {this.renderSquare(1)} {this.renderSquare(2)}
-
+
{this.renderSquare(3)} {this.renderSquare(4)} {this.renderSquare(5)}
-
+
{this.renderSquare(6)} {this.renderSquare(7)} {this.renderSquare(8)} @@ -90,7 +90,7 @@ class Game extends React.Component { "Go to game start"; return (
  • - + this.jumpTo(move)}>{desc}
  • ); }); @@ -103,17 +103,20 @@ class Game extends React.Component { } return ( -
    -
    - this.handleClick(i)} - /> -
    -
    -
    {status}
    -
      {moves}
    -
    +
    +
    +
    + this.handleClick(i)} + /> +
    +
    +
    {status}
    +
      {moves}
    +
    +
    +
    ); } diff --git a/app/app_toDoReact/Readme.md b/app/app_toDoReact/Readme.md index cbea019b1..090fd303f 100644 --- a/app/app_toDoReact/Readme.md +++ b/app/app_toDoReact/Readme.md @@ -6,17 +6,4 @@ With this application I have built a simple To-Do list using React to handle use I have used Webpack to bundle JS dependancies and Babel to transpile to the correct ES version. -The interest in this application is to explore how React can be used for 2 way data binding between the DOM and application state. With a particular interest in Reacts use of a virtual DOM. - -### Project commands ### - -Build JavaScript by running the default Gulp task from within this directory -``` - gulp -``` - -Run the application from within the route directory, using the master Gulp file and the default Gulp task -``` - cd ../../ - gulp -``` +The interest in this application is to explore how React can be used for 2 way data binding between the DOM and application state. With a particular interest in Reacts use of a virtual DOM. \ No newline at end of file diff --git a/app/js/modules/react/cookieBannerComponent/app.js b/app/js/modules/react/cookieBannerComponent/app.js new file mode 100644 index 000000000..738c4fdf3 --- /dev/null +++ b/app/js/modules/react/cookieBannerComponent/app.js @@ -0,0 +1,16 @@ + +import React from 'react'; +import ReactDOM from 'react-dom'; +import { CookieBannerComponent } from './cookieBannerComponent'; + +function App() { + const isHomeActive = document.head.querySelector('[name="isRoot"]') !== null; + return( + + ) +} + +ReactDOM.render( + , + document.getElementById('cookieBanner') +); \ No newline at end of file diff --git a/app/js/modules/react/cookieBannerComponent/cookieBannerComponent.js b/app/js/modules/react/cookieBannerComponent/cookieBannerComponent.js new file mode 100644 index 000000000..e7b6b5222 --- /dev/null +++ b/app/js/modules/react/cookieBannerComponent/cookieBannerComponent.js @@ -0,0 +1,58 @@ +"use strict;" + +import React, { useState, useEffect } from 'react'; +import { getElementFadeClass } from "../../utils/getElementFadeClass"; +import { DeploymentUtil } from '../../utils/deploymentUtil'; +import './cookieBannerComponent.scss'; + +const SHOW_COOKIE_BANNER_THRESHOLD = 270; +const COOKIE_BANNER_ACCEPTED_KEY = "Cookie_banner_message_accepted"; +const STORAGE = sessionStorage; + +export function CookieBannerComponent({isHomeActive}) { + + const [ fadeClass, setFadeClass ] = useState(getElementFadeClass(false)); + + useEffect(() => { + if (isHomeActive) { + window.addEventListener('scroll', handleFade); + } else { + handleFade(); + } + return () => window.removeEventListener('scroll', handleFade); + },[fadeClass]); + + const handleOnClick = () => { + STORAGE.setItem(COOKIE_BANNER_ACCEPTED_KEY, true); + setFadeClass(getElementFadeClass(false)); + } + + const handleFade = () => { + const scrollPosition = document.documentElement.scrollTop; + const shouldShow = DeploymentUtil.isCloud(); + const alreadyAccepted = STORAGE.getItem(COOKIE_BANNER_ACCEPTED_KEY); + + if (alreadyAccepted || !shouldShow) { + return; + } + + if ((isHomeActive && scrollPosition >= SHOW_COOKIE_BANNER_THRESHOLD)) { + setFadeClass(getElementFadeClass(true)); + } else { + setFadeClass(getElementFadeClass(false)); + } + + if (!isHomeActive) { + setFadeClass(getElementFadeClass(true)); + } + } + + return ( + <> +
    +

    This application uses cookies to determine which services are deployed and do not store any personal data.

    + +
    + + ); +} \ No newline at end of file diff --git a/app/js/modules/react/cookieBannerComponent/cookieBannerComponent.scss b/app/js/modules/react/cookieBannerComponent/cookieBannerComponent.scss new file mode 100644 index 000000000..f91ae69ef --- /dev/null +++ b/app/js/modules/react/cookieBannerComponent/cookieBannerComponent.scss @@ -0,0 +1,20 @@ +@import "../../../../sass/includes/colours.scss"; +@import "../../../../sass//includes/constants.scss"; + +.cookie-banner-container { + backdrop-filter: blur(10px); + background: transparent; + padding: .5rem; + position: fixed; + bottom: 0; + left: 0; + right: 0; + display: flex; + justify-content: space-between; + align-items: center; + z-index: 9999; + border-top: $lightGrey solid; + p { + margin-bottom: 0; + } + } diff --git a/app/js/modules/react/cookieBannerComponent/tests/cookieBannerComponent.test.js b/app/js/modules/react/cookieBannerComponent/tests/cookieBannerComponent.test.js new file mode 100644 index 000000000..8fc55d95c --- /dev/null +++ b/app/js/modules/react/cookieBannerComponent/tests/cookieBannerComponent.test.js @@ -0,0 +1,33 @@ +/** + * @jest-environment jsdom + */ + +import React from 'react'; +import { mount } from 'enzyme'; +import { CookieBannerComponent } from '../cookieBannerComponent'; + +jest.mock('../../cookieBannerComponent/cookieBannerComponent.scss', () => ''); + +jest.mock('../../../../../../config.json', () => { + return { + "deploymentTargetCookie": "fs_portfolio_deployment_target", + "deploymentTargets": { + "cloud": "cloud", + "static": "static" + } + } +}); + +beforeEach(() => { }); +afterEach(() => { }); + +const App = () => { + return ( + + ) +} + +it('can render', () => { + const wrapper = mount(); + expect(wrapper.find('#cookieBannerComponent')).toBeTruthy(); +}); \ No newline at end of file diff --git a/app/js/modules/react/deploymentModalComponent.js b/app/js/modules/react/deploymentModalComponent.js new file mode 100644 index 000000000..0deedd16c --- /dev/null +++ b/app/js/modules/react/deploymentModalComponent.js @@ -0,0 +1,45 @@ +import React from 'react'; +import Modal from 'react-bootstrap/Modal'; +import { ConfigUtil } from '../utils/configUtil'; +import Button from 'react-bootstrap/Button'; + +/** + * DeploymentModalComponent displays a modal detailing how to request a deployment. + * If the endpoint is not available, the modal is shown to the user. + * + * @param {string} id - The ID of the modal element. + * @param {string} title - The title of the modal. + * @param {string} endpoint - The endpoint URL to check. + */ +export function DeploymentModalComponent({id, title, show, handleClose}) { + + const config = ConfigUtil.get(); + const linkedInUrl = config.linkedInUrl; + const gitHubIssueUrl = config.gitHubIssuesUrl; + + return ( + <> + + + {title || "Request Deployment"} + + + +

    To conserve resources, services are not always available. To proceed, please request a full deployment of the portfolio. This will create a fully containerised environment in the cloud. Once you request the deployment, you will receive a unique URL to access the complete portfolio.

    + + + Raise an Issue on GitHub + + + Make Contact on LinkedIn + + +
    +
    + + ); +} diff --git a/app/js/modules/utils/cookieUtil.js b/app/js/modules/utils/cookieUtil.js new file mode 100644 index 000000000..eb7201a17 --- /dev/null +++ b/app/js/modules/utils/cookieUtil.js @@ -0,0 +1,26 @@ +"use strict;" + +/** + * Utility class for handling cookies. + */ +export class CookieUtil { + + /** + * Retrieves the value of a cookie by its name. + * @param {string} name - The name of the cookie. + * @returns {string|null} The value of the cookie, or null if not found. + */ + static get(name) { + + const cookies = document.cookie; + const cookieString = cookies.split('; '); + + for (let i = 0; i < cookieString.length; i++) { + const cookie = cookieString[i].split('='); + if (cookie[0] === name) { + return cookie[1]; + } + } + return null; + } +} \ No newline at end of file diff --git a/app/js/modules/utils/deploymentUtil.js b/app/js/modules/utils/deploymentUtil.js new file mode 100644 index 000000000..4ad08ae16 --- /dev/null +++ b/app/js/modules/utils/deploymentUtil.js @@ -0,0 +1,34 @@ +"use strict;" + +import { ConfigUtil } from './configUtil'; +import { CookieUtil } from './cookieUtil'; + +const CONFIG = ConfigUtil.get(); +const COOKIE = CONFIG.deploymentTargetCookie; +const DEPLOYMENT_TARGET_CLOUD = CONFIG.deploymentTargets.cloud; + +/** + * Utility class for deployment-related operations. + */ +export class DeploymentUtil { + + /** + * Checks if the deployment is not on the cloud. + * @returns {boolean} Returns true if the deployment is not on the cloud, false otherwise. + */ + static isNotCloud() { + + return CookieUtil.get(COOKIE) !== DEPLOYMENT_TARGET_CLOUD; + + } + + /** + * Checks if the deployment is on the cloud. + * @returns {boolean} Returns true if the deployment is on the cloud, false otherwise. + */ + static isCloud() { + + return CookieUtil.get(COOKIE) === DEPLOYMENT_TARGET_CLOUD; + + } +} \ No newline at end of file diff --git a/app/pug/includes/_cookieBanner.pug b/app/pug/includes/_cookieBanner.pug new file mode 100644 index 000000000..12afb6706 --- /dev/null +++ b/app/pug/includes/_cookieBanner.pug @@ -0,0 +1 @@ +#cookieBanner \ No newline at end of file diff --git a/app/pug/includes/_footer.pug b/app/pug/includes/_footer.pug index 6945db772..41b01ffc6 100644 --- a/app/pug/includes/_footer.pug +++ b/app/pug/includes/_footer.pug @@ -8,7 +8,7 @@ footer#footer.bg-dark.mt-5 a.btn-floating.btn-tw.mx-1(href=htmlWebpackPlugin.options.locals.config.linkedInUrl target="_blank") i.fa.fa-linkedin.fa-2x .footer-copyright.text-center.pb-3 - | Copyright © 2020. + | Copyright © 2023. =htmlWebpackPlugin.options.locals.config.author |. | All rights reserved. \ No newline at end of file diff --git a/app/pug/layouts/main.pug b/app/pug/layouts/main.pug index f03a50b0c..2df1b5f44 100644 --- a/app/pug/layouts/main.pug +++ b/app/pug/layouts/main.pug @@ -17,4 +17,5 @@ html(lang="en") block content block footer include ../includes/_footer.pug + include ../includes/_cookieBanner.pug block scripts \ No newline at end of file diff --git a/app/pug/layouts/mainRoot.pug b/app/pug/layouts/mainRoot.pug index 6eb940ebc..148120632 100644 --- a/app/pug/layouts/mainRoot.pug +++ b/app/pug/layouts/mainRoot.pug @@ -9,4 +9,5 @@ html(lang="en") block content block footer include ../includes/_footer.pug + include ../includes/_cookieBanner.pug block scripts \ No newline at end of file diff --git a/app/pug/layouts/raw.pug b/app/pug/layouts/raw.pug index 924eea984..40f5f4dc4 100644 --- a/app/pug/layouts/raw.pug +++ b/app/pug/layouts/raw.pug @@ -7,4 +7,5 @@ html(lang="en") body#body block content block footer + include ../includes/_cookieBanner.pug block scripts \ No newline at end of file diff --git a/app/sass/includes/footer.scss b/app/sass/includes/footer.scss index 70ea08790..bc451419f 100644 --- a/app/sass/includes/footer.scss +++ b/app/sass/includes/footer.scss @@ -2,4 +2,7 @@ h3, h5, h4, h5 { font-size: 2rem; } + .footer-copyright { + font-weight: 100; + } } \ No newline at end of file diff --git a/app/sass/includes/navbar.scss b/app/sass/includes/navbar.scss index 8b88a21f1..b79602aca 100644 --- a/app/sass/includes/navbar.scss +++ b/app/sass/includes/navbar.scss @@ -8,7 +8,7 @@ padding: 0 0.3em; .navbar-collapse { a { - font-weight: 300; + font-weight: 100; } .dropdown-menu { min-width: 380px; @@ -43,7 +43,9 @@ font-size: 1.5rem; } #titleSubHeading { - line-height: 20px; + line-height: 16px; + font-size: 1rem; + font-weight: 100; } #navbarImage { margin: 0 .25rem 0 0; diff --git a/backend/Portfolio.Core/Portfolio.Core.csproj b/backend/Portfolio.Core/Portfolio.Core.csproj new file mode 100644 index 000000000..4658cbfed --- /dev/null +++ b/backend/Portfolio.Core/Portfolio.Core.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/backend/Portfolio.Core/Services/TestService.cs b/backend/Portfolio.Core/Services/TestService.cs new file mode 100644 index 000000000..609cd4e89 --- /dev/null +++ b/backend/Portfolio.Core/Services/TestService.cs @@ -0,0 +1,22 @@ +using Portfolio.Core.Types; + +namespace Portfolio.Core.Services; + +public class TestService +{ + private static readonly string[] Summaries = new[] + { + "Freezing TESTING Core change", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } +} diff --git a/backend/Portfolio.Core/Types/WeatherForecast.cs b/backend/Portfolio.Core/Types/WeatherForecast.cs new file mode 100644 index 000000000..dc5029f49 --- /dev/null +++ b/backend/Portfolio.Core/Types/WeatherForecast.cs @@ -0,0 +1,12 @@ +namespace Portfolio.Core.Types; + +public class WeatherForecast +{ + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } +} diff --git a/build-image b/build-image new file mode 100644 index 000000000..668ca70de --- /dev/null +++ b/build-image @@ -0,0 +1,8 @@ +#!/bin/bash + +# Docker image build script runner + +DOCKER_DIR=$1 +TAG=$2 + +docker image build -f "docker/$DOCKER_DIR/Dockerfile" -t $TAG . \ No newline at end of file diff --git a/build/create.js b/build/create.js index 8e5a65ff5..eed446e05 100644 --- a/build/create.js +++ b/build/create.js @@ -7,7 +7,7 @@ const config = require('../config.json'); function create(application) { const destination = path.resolve(__dirname, '../', config.developmentDir, `${config.prefix}${application.folder}`); - const templateDirectory = typeof application.masterTemplateDir !== "undefined" + const templateDirectory = typeof application.masterTemplateDir !== 'undefined' && application.masterTemplateDir.length > 0 ? application.masterTemplateDir : config.masterTemplateDir; diff --git a/build/webpack.config.vendor.js b/build/webpack.config.vendor.js index 66e2f6f1b..03bfbfc9c 100644 --- a/build/webpack.config.vendor.js +++ b/build/webpack.config.vendor.js @@ -12,7 +12,8 @@ module.exports = (env) => { vendor: [ 'bootstrap', './app/sass/includes/styleDeps.scss', - './app/js/modules/react/navFilterComponent/app.js' + './app/js/modules/react/navFilterComponent/app.js', + './app/js/modules/react/cookieBannerComponent/app.js' ] }, output: { diff --git a/build/webpackBuilder.js b/build/webpackBuilder.js index c7701e44c..dbefea36c 100644 --- a/build/webpackBuilder.js +++ b/build/webpackBuilder.js @@ -1,5 +1,6 @@ const webpackHelper = require("./webpackHelper"); const masterWebpackConfig = require("./webpack.config.master"); +const chalk = require('chalk'); const webpack = require('webpack'); module.exports = { @@ -66,7 +67,13 @@ module.exports = { plugins = webpackHelper.getAnalysisConfig(plugins, env); - const htmlWebpackPluginConfigs = webpackHelper.getHtmlWebpackPluginObjects(application); + let htmlWebpackPluginConfigs = []; + + try { + htmlWebpackPluginConfigs = webpackHelper.getHtmlWebpackPluginObjects(application); + } catch (error) { + console.log(chalk.redBright(`ERROR: unable to get plugin objects for ${application.name}`)); + } webpackConfig = { ...webpackConfig, diff --git a/config.json b/config.json index ed52fb1c4..3aee96e83 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,12 @@ { "host": "localhost", + "apiRoot": "/backend/", + "deploymentTargetCookie": "fs_portfolio_deployment_target", + "deploymentTargets": { + "cloud": "cloud", + "static": "static" + }, + "dockerHost": "nginx", "port": 8080, "prefix": "app_", "entry": "home", @@ -11,26 +18,28 @@ "repoRootUrl": "https://github.com/fsereno/portfolio", "linkedInUrl": "https://www.linkedin.com/in/fabio-sereno-6a97b986/", "gitHubUrl": "https://github.com/fsereno", + "gitHubIssuesUrl": "https://github.com/fsereno/portfolio/issues", "title": "Portfolio", "author": "Fabio Sereno", - "role": "Software developer", - "description": "Portfolio website for Fabio Sereno - Software Developer.", + "role": "Software Engineer", + "description": "Portfolio By Fabio Sereno - Software Engineer", "thumbnail": "PortfolioThumbnail.png", - "labels": [ - { "name": "JavaScript", "class": "warning" }, - { "name": "C#", "class": "info" }, - { "name": "Cloud", "class": "danger" } - ], + "labels": { + "JavaScript" : "warning", + "NodeJS": "success", + "C#": "info", + "Cloud": "danger" + }, "quickSearch": [ "React", ".NET", "Cloud" ], "grecaptcha": { - "active": true, - "key": "6LdFJsIaAAAAAGltxQjmncdNsjOtxAshDewjKCS3", + "active": false, + "key": "", "endpoints": { - "base": "https://7pq7bx3nt6.execute-api.eu-west-2.amazonaws.com", + "base": "", "verify": "verify" } }, @@ -38,7 +47,7 @@ { "name": "Portfolio", "subHeading": "By Fabio Sereno", - "description": "Highly experienced, highly self-motivated, enthusiastic, professional Full Stack Web Developer.", + "description": "Highly experienced, highly self-motivated, enthusiastic, professional Full Stack Software Engineer.", "folder": "home", "active": true, "include": false, @@ -60,241 +69,206 @@ "name": "To-Do List (React)", "subHeading": "A basic list builder using React", "description": "Using React, with Babel and Webpack.", - "searchTerms": "JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "searchTerms": "Docker,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", "folder": "toDoReact", "active": true, "include": true, "useWebpack": true, - "labels": [0] + "labels": ["JavaScript"] }, { "name": "To-Do List (React Redux)", "subHeading": "A basic list builder using React and Redux", "description": "Using Redux with React to manage application state, implementing Undo and Redo functionality.", - "searchTerms": "JavaScript,React,Redux,Babel,Webpack,PUG,HTML,CSS,SASS", + "searchTerms": "Docker,JavaScript,React,Redux,Babel,Webpack,PUG,HTML,CSS,SASS", "folder": "reactRedux", "active": true, "include": true, "useWebpack": true, - "labels": [0] + "labels": ["JavaScript"] }, { "name": "To-Do List (Vue)", "subHeading": "A basic list builder using Vue", "description": "Experimenting with Vue, Babel and Webpack.", - "searchTerms": "JavaScript,Vue,Babel,Webpack,PUG,HTML,CSS,SASS", + "searchTerms": "Docker,JavaScript,Vue,Babel,Webpack,PUG,HTML,CSS,SASS", "folder": "toDoVue", "active": true, "include": true, "useWebpack": true, - "labels": [0] + "labels": ["JavaScript"] }, { - "name": "Tic-Tac-Toe (React)", + "name": "Tic-Tac-Toe", "subHeading": "A Tic-Tac-Toe game built using React", - "description": "Experimenting with more complex aspects of React, Babel and Webpack.", - "searchTerms": "JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "description": "Demonstrating React state management with immutability, allowing for 'time travel' or 'versioned' data.", + "searchTerms": "Docker,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", "folder": "ticTacToeReact", "active": true, "include": true, "useWebpack": true, - "labels": [0] + "labels": ["JavaScript"] }, { - "name": "Azure Functions .NET, Unique Data Entry", + "name": "Unique Data Entry Application", "subHeading": "Unique data entry implementing IEqualityComparer to manage illegal duplicate data entries, with a React UI", - "description": "Using Azure Functions serverless compute and .NET, with a React user interface.", - "searchTerms": "Cloud,Azure,Azure Functions,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", - "folder": "AzureDotNetCoreUniqueDataEntryApi", + "description": ".NET Web API with a React UI.", + "searchTerms": "Docker,Cloud,C#,dotnet,.net,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "folder": "uniqueDataEntry", "active": true, "include": true, "useWebpack": true, "masterTemplateDir": "master_react", "endpoints" : { - "api": "https://app-azure-dotnetcore-unique-data-entry-api.azurewebsites.net/api", - "canItemBeAddedAsync": "canItemBeAddedAsync" + "canItemBeAddedAsync": "uniqueDataEntry/api/canItemBeAddedAsync" }, - "labels": [0, 1, 2], + "labels": ["JavaScript", "C#", "Cloud"], "featured": false }, { - "name": "Azure Functions .NET, Data Structures", - "subHeading": "First in, first out (FIFO) and last in, first out (LIFO) data structures implementing Queue and Stack in .NET, with a React UI", - "description": "Using Azure Functions serverless compute and .NET, with a React user interface.", - "searchTerms": "Cloud,Azure,Azure Functions,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", - "folder": "AzureDotNetCoreDataStructuresApi", + "name": "Data Structures", + "subHeading": "First in, first out (FIFO) and last in, first out (LIFO) data structures implementing Queue and Stack", + "description": ".NET Web API with a React UI.", + "searchTerms": "Docker,Cloud,C#,dotnet,.net,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "folder": "dataStructures", "active": true, "include": true, "useWebpack": true, "masterTemplateDir": "master_react", "endpoints" : { - "api": "https://app-azure-dotnetcore-data-structures-api.azurewebsites.net/api", - "addQueueItem": "addQueueItemAsync", - "removeQueueItem": "removeQueueItemAsync", - "addStackItem": "addStackItemAsync", - "removeStackItem": "removeStackItemAsync" + "addQueueItem": "dataStructures/api/addQueueItemAsync", + "removeQueueItem": "dataStructures/api/removeQueueItemAsync", + "addStackItem": "dataStructures/api/addStackItemAsync", + "removeStackItem": "dataStructures/api/removeStackItemAsync" }, - "labels": [0, 1, 2], + "labels": ["JavaScript", "C#", "Cloud"], "featured": false }, { - "name": "AWS .NET, Complex Entity Sorting Algorithm", - "subHeading": "A sorting mechanism, implementing IComparable and IComparer to sort complex types, with a React UI", - "description": "AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.", - "searchTerms": "Cloud,AWS,Amazon Web Services,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", - "folder": "awsDotNetCoreEntitySortApi", + "name": "Complex Entity Sorting Algorithm", + "subHeading": "A sorting mechanism, implementing IComparable and IComparer to sort complex types", + "description": ".NET Web API with a React UI.", + "searchTerms": "Docker,Cloud,C#,dotnet,.net,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "folder": "entitySort", "active": true, "include": true, "useWebpack": true, "masterTemplateDir": "master_react", "endpoints" : { - "api": "https://lni2f3xvgc.execute-api.eu-west-2.amazonaws.com/Prod/api/employees", - "sortSalaryAsc": "sort/salary/asc", - "sortSalaryDesc": "sort/salary/desc" + "sortSalaryAsc": "entitySort/api/sort/salary/asc", + "sortSalaryDesc": "entitySort/api/sort/salary/desc" }, - "labels": [0, 1, 2], + "labels": ["JavaScript", "C#", "Cloud"], "featured": false }, { - "name": "AWS .NET, Natural Sorting Algorithm", - "subHeading": "A natural string sorting algorithm, implementing IComparer in .NET, passing in a custom comparer, with a React UI", - "description": "AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.", - "searchTerms": "Cloud,AWS,Amazon Web Services,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", - "folder": "awsDotNetCoreStringSortApi", + "name": "Natural Sorting Algorithm", + "subHeading": "A natural string sorting algorithm, implementing IComparer in .NET, passing in a custom comparer", + "description": ".NET Web API with a React UI.", + "searchTerms": "Docker,Cloud,C#,dotnet,.net,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "folder": "stringSort", "active": true, "include": true, "useWebpack": true, "masterTemplateDir": "master_react", "endpoints" : { - "api": "https://t8txttdaee.execute-api.eu-west-2.amazonaws.com/Prod/api/values", - "sort": "sort" + "sort": "stringSort/api/sort" }, - "labels": [0, 1, 2], + "labels": ["JavaScript", "C#", "Cloud"], "featured": false }, { - "name": "AWS .NET, Shopping Basket List Builder", - "subHeading": "A basic shopping basket application, with data processing handled by a Serverless .NET RESTful API, with a React UI", - "description": "AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.", - "searchTerms": "Cloud,AWS,Amazon Web Services,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", - "folder": "awsDotNetCoreShoppingCart", - "active": true, - "include": true, - "useWebpack": true, - "endpoints" : { - "api": "https://6pzl3f4421.execute-api.eu-west-2.amazonaws.com/Prod/api/basket", - "get": "get", - "add": "add", - "delete": "delete", - "update": "update" - }, - "labels": [0, 1, 2], - "order": 2 - }, - { - "name": "AWS .NET, Asynchronous Coffee Maker", - "subHeading": "Demonstraiting knowledge of asynchrony, multithreading and the State Machine in .NET, with a React UI", - "description": "AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.", - "searchTerms": "Cloud,AWS,Amazon Web Services,C#,dotnet,.net core,.netcore,Multithreading,Async,Asynchronous,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", - "folder": "awsDotNetCoreAsyncCoffeeMachine", + "name": "Coffee Machine", + "subHeading": "Demonstraiting knowledge of asynchrony, multithreading and the State Machine in .NET", + "description": ".NET Web API with a React UI.", + "searchTerms": "Docker,Cloud,C#,dotnet,.net,Multithreading,Async,Asynchronous,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "folder": "coffeeMachine", "active": true, "include": true, "useWebpack": true, "masterTemplateDir": "master_react", "endpoints" : { - "api": "https://ro5qqsplje.execute-api.eu-west-2.amazonaws.com/Prod/api/values", - "run": "run", - "runAsync": "runasync" + "run": "coffeeMachine/api/run", + "runAsync": "coffeeMachine/api/runasync" }, - "labels": [0, 1, 2], + "labels": ["JavaScript", "C#", "Cloud"], "order": 3 }, { - "name": "Three JS Scene (Basic)", - "subHeading": "A basic THREE JS scene", - "description": "An interactive Three JS scene, using Babel and Webpack.", - "searchTerms": "JavaScript,Three JS,Babel,Webpack,PUG,HTML,CSS,SASS", - "folder": "threeJSScene", - "active": true, - "include": true, - "useWebpack": true, - "labels": [0] - }, - { - "name": "AFrame React (Basic)", - "subHeading": "An AFrame Hello World application with React", + "name": "AFrame React Example", + "subHeading": "An example AFrame application with React, allowing for user input", "description": "Exploring WebXR applications using AFrame and React. Compiled with Babel and Webpack.", - "searchTerms": "JavaScript,AFrame,Babel,Webpack,PUG,HTML,CSS,SASS,VR,Virtual Reality", - "folder": "aframe", - "active": true, - "include": true, - "useWebpack": true, - "labels": [0] - }, - { - "name": "AFrame React (Complex)", - "subHeading": "A slightly more complex AFrame application with React, allowing user input", - "description": "Exploring WebXR applications using AFrame and React. Compiled with Babel and Webpack.", - "searchTerms": "JavaScript,AFrame,Babel,Webpack,PUG,HTML,CSS,SASS,VR,Virtual Reality", + "searchTerms": "Docker,JavaScript,AFrame,Babel,Webpack,PUG,HTML,CSS,SASS,VR,Virtual Reality", "folder": "aframeComplex", "active": true, "include": true, "useWebpack": true, - "labels": [0] + "labels": ["JavaScript"] }, { "name": "JS Coding Standards", "subHeading": "A JavaScript Code Style Guide", "description": "By Fabio Sereno", - "searchTerms": "JavaScript,SOLID Principles,YAGNI,DRY,KISS", + "searchTerms": "Docker,JavaScript,SOLID Principles,YAGNI,DRY,KISS", "folder": "jsCodingStandards", "active": false, "include": false, - "labels": [0] + "labels": ["JavaScript"] }, { "name": "Basic React Email Client", "subHeading": "An SPA using React and React Router. React Context and useReducer handle state. Optimised with useCallback, useMemo and React.memo", "description": "Using React, Babel and Webpack.", - "searchTerms": "JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "searchTerms": "Docker,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", "folder": "basicEmailClientReactSpa", "active": true, "include": true, "useWebpack": true, "masterTemplateDir": "basicSpaReact", - "labels": [0], + "labels": ["JavaScript"], "order": 2, "featured": false }, { - "name": "AWS Node.js, B2C API, To-Do List", - "subHeading": "Authenticated with Cognito, data stored using Dynamo DB, driven by Lambda Functions and with a React UI", - "description": "Built with Node.js, the AWS Serverless Framework and managed by an HTTP API Gateway.", - "searchTerms": "Cloud,AWS,Amazon Web Services,Serverless Framework,Node.js,Cognito,Dynamo DB,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", - "folder": "awsNodeToDoApi", + "name": "NodeJS, To-Do List SPA", + "subHeading": "A simple To-Do list application, with user registration and authentication", + "description": "NodeJS Web API with a React UI.", + "searchTerms": "Docker,NodeJS,Express,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "folder": "nodeToDo", "active": true, "include": true, "useWebpack": true, "masterTemplateDir": "basicEmailClientReactSpa", - "labels": [0,2], + "labels": ["JavaScript","Cloud", "NodeJS"], "order": 1, "featured": false, "endpoints": { - "base": "https://7pq7bx3nt6.execute-api.eu-west-2.amazonaws.com", - "api": "todos" + "base": "nodeToDo" } }, { "name": "Master React Template", "subHeading": "Subheading", "description": "Description", - "searchTerms": "JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "searchTerms": "Docker,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", "folder": "master_react", "masterTemplateDir": "toDoReact", "active": true, "include": false, "useWebpack": true, - "labels": [0] + "labels": ["JavaScript"] + }, + { + "name": "Test React Template", + "subHeading": "Subheading", + "description": "Description", + "searchTerms": "Docker,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS", + "folder": "new_react", + "masterTemplateDir": "toDoReact", + "active": true, + "include": false, + "useWebpack": true, + "labels": ["JavaScript"] } ] } \ No newline at end of file diff --git a/create b/create new file mode 100644 index 000000000..068ac9261 --- /dev/null +++ b/create @@ -0,0 +1,7 @@ +#!/bin/bash + +# Docker compose script runner + +cd docker/create + +sh start \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b233c7986..f72ecaa89 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,84 @@ version: '3.9' services: - node: - tty: true - image: 'fabiosereno/portfolio:3.2.0' + nginx: + image: 'fabiosereno/portfolio.nginx:0.5.0' + x-aws-pull_credentials: 'arn:aws:secretsmanager:eu-west-2:523190279095:secret:dockerhubAccessToken-1JuRZX' ports: - - '8080:8080' - volumes: - - './config.json:/usr/src/app/config.json' - - './babel.config.json:/usr/src/app/babel.config.json' - - './setupTests.js:/usr/src/app/setupTests.js' - - './app:/usr/src/app/app' - - './docs:/usr/src/app/docs' - - './build:/usr/src/app/build' - container_name: node + - '80:80' + container_name: frontend + networks: + - frontend + - backend + depends_on: + - "coffeeMachine" + - "dataStructures" + - "uniqueDataEntry" + - "stringSort" + - "entitySort" + - "nodeToDo" + mem_limit: 500M + cpus: 0.2 + coffeeMachine: + image: 'fabiosereno/portfolio.coffee-machine:0.0.15' + x-aws-pull_credentials: 'arn:aws:secretsmanager:eu-west-2:523190279095:secret:dockerhubAccessToken-1JuRZX' + ports: + - '3001:3001' + container_name: coffeeMachine + networks: + - backend + mem_limit: 500M + cpus: 0.2 + dataStructures: + image: 'fabiosereno/portfolio.data-structures:0.0.5' + x-aws-pull_credentials: 'arn:aws:secretsmanager:eu-west-2:523190279095:secret:dockerhubAccessToken-1JuRZX' + ports: + - '3002:3002' + container_name: dataStructures + networks: + - backend + mem_limit: 500M + cpus: 0.2 + uniqueDataEntry: + image: 'fabiosereno/portfolio.unique-data-entry:0.0.2' + x-aws-pull_credentials: 'arn:aws:secretsmanager:eu-west-2:523190279095:secret:dockerhubAccessToken-1JuRZX' + ports: + - '3003:3003' + container_name: uniqueDataEntry + networks: + - backend + mem_limit: 500M + cpus: 0.2 + stringSort: + image: 'fabiosereno/portfolio.string-sort:0.0.1' + x-aws-pull_credentials: 'arn:aws:secretsmanager:eu-west-2:523190279095:secret:dockerhubAccessToken-1JuRZX' + ports: + - '3004:3004' + container_name: stringSort + networks: + - backend + mem_limit: 500M + cpus: 0.2 + entitySort: + image: 'fabiosereno/portfolio.entity-sort:0.0.4' + x-aws-pull_credentials: 'arn:aws:secretsmanager:eu-west-2:523190279095:secret:dockerhubAccessToken-1JuRZX' + ports: + - '3005:3005' + container_name: entitySort + networks: + - backend + mem_limit: 500M + cpus: 0.2 + nodeToDo: + image: 'fabiosereno/portfolio.node-to-do:0.0.1' + x-aws-pull_credentials: 'arn:aws:secretsmanager:eu-west-2:523190279095:secret:dockerhubAccessToken-1JuRZX' + ports: + - '3006:3006' + container_name: nodeToDo + networks: + - backend + mem_limit: 500M + cpus: 0.2 +networks: + frontend: + backend: \ No newline at end of file diff --git a/docker/analysis/Dockerfile b/docker/analysis/Dockerfile new file mode 100644 index 000000000..3323913bb --- /dev/null +++ b/docker/analysis/Dockerfile @@ -0,0 +1,8 @@ +FROM fabiosereno/portfolio.npm:0.0.1 + +EXPOSE 8080 + +HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \ + CMD node healthcheck.js + +CMD ["sh", "-c", "npm run analysis dir=${dir}"] \ No newline at end of file diff --git a/docker/analysis/docker-compose.yml b/docker/analysis/docker-compose.yml new file mode 100644 index 000000000..d1cfae079 --- /dev/null +++ b/docker/analysis/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3.9' + +services: + node: + tty: true + image: 'fabiosereno/portfolio.analysis:0.0.3' + environment: + - dir=${DIR:-home} + ports: + - '8080:8080' + volumes: + - '../../config.json:/usr/src/app/config.json' + - '../../babel.config.json:/usr/src/app/babel.config.json' + - '../../setupTests.js:/usr/src/app/setupTests.js' + - '../../app:/usr/src/app/app' + - '../../docs:/usr/src/app/docs' + - '../../build:/usr/src/app/build' + container_name: node diff --git a/docker/analysis/start b/docker/analysis/start new file mode 100644 index 000000000..0ce55885a --- /dev/null +++ b/docker/analysis/start @@ -0,0 +1,3 @@ +#!/bin/bash + +DIR=$1 docker compose up \ No newline at end of file diff --git a/docker/analysis/stop b/docker/analysis/stop new file mode 100644 index 000000000..a986179d7 --- /dev/null +++ b/docker/analysis/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose down \ No newline at end of file diff --git a/docker/coffeeMachine/Dockerfile b/docker/coffeeMachine/Dockerfile new file mode 100644 index 000000000..cf0fd8602 --- /dev/null +++ b/docker/coffeeMachine/Dockerfile @@ -0,0 +1,38 @@ +FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:7.0 AS base + +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build + +WORKDIR /src + +ENV APP_DIR="app_coffeeMachine" + +COPY ["/app/${APP_DIR}/backend/api/api.csproj", "./app/${APP_DIR}/backend/api/api.csproj"] + +RUN dotnet restore "./app/${APP_DIR}/backend/api/api.csproj" + +COPY . . + +COPY ../../backend/Portfolio.Core ./backend + +WORKDIR "/src/." + +RUN dotnet build "./app/${APP_DIR}/backend/api/api.csproj" -c Release -o /app/build + +FROM build AS publish + +RUN dotnet publish "./app/${APP_DIR}/backend/api/api.csproj" -c Release -o /app/publish + +FROM base AS final + +WORKDIR /app + +COPY --from=publish /app/publish . + +RUN apt-get update \ + && apt-get install -y curl + +HEALTHCHECK --interval=5s --timeout=10s --retries=3 CMD curl --fail curl http://localhost:3001/healthcheck || exit 1 + +ENTRYPOINT ["dotnet", "api.dll"] \ No newline at end of file diff --git a/docker/coffeeMachine/docker-compose.yml b/docker/coffeeMachine/docker-compose.yml new file mode 100644 index 000000000..aead3789b --- /dev/null +++ b/docker/coffeeMachine/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.9' + +services: + coffeeMachine: + image: 'fabiosereno/portfolio.coffee-machine:0.0.15' + ports: + - '3001:3001' + container_name: coffeeMachine + networks: + - backend +networks: + frontend: + backend: \ No newline at end of file diff --git a/docker/coffeeMachine/start b/docker/coffeeMachine/start new file mode 100644 index 000000000..1d1f2f76a --- /dev/null +++ b/docker/coffeeMachine/start @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose up \ No newline at end of file diff --git a/docker/coffeeMachine/stop b/docker/coffeeMachine/stop new file mode 100644 index 000000000..a986179d7 --- /dev/null +++ b/docker/coffeeMachine/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose down \ No newline at end of file diff --git a/docker/create/Dockerfile b/docker/create/Dockerfile new file mode 100644 index 000000000..27323a188 --- /dev/null +++ b/docker/create/Dockerfile @@ -0,0 +1,6 @@ +FROM fabiosereno/portfolio.npm:0.0.1 + +HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \ + CMD node healthcheck.js + +CMD ["sh", "-c", "npm run create"] \ No newline at end of file diff --git a/docker/create/docker-compose.yml b/docker/create/docker-compose.yml new file mode 100644 index 000000000..74e9913a5 --- /dev/null +++ b/docker/create/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3.9' + +services: + node: + tty: true + image: 'fabiosereno/portfolio.create:0.0.2' + volumes: + - '../../config.json:/usr/src/app/config.json' + - '../../app:/usr/src/app/app' + - '../../build:/usr/src/app/build' + container_name: node diff --git a/docker/create/start b/docker/create/start new file mode 100644 index 000000000..8f3c2e2be --- /dev/null +++ b/docker/create/start @@ -0,0 +1,3 @@ +#!/bin/bash + +docker-compose run --rm node \ No newline at end of file diff --git a/docker/dataStructures/Dockerfile b/docker/dataStructures/Dockerfile new file mode 100644 index 000000000..7cfc7eba9 --- /dev/null +++ b/docker/dataStructures/Dockerfile @@ -0,0 +1,36 @@ +FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:7.0 AS base + +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build + +WORKDIR /src + +COPY ["/app/app_dataStructures/backend/api/api.csproj", "./app/app_dataStructures/backend/api/api.csproj"] + +RUN dotnet restore "./app/app_dataStructures/backend/api/api.csproj" + +COPY . . + +COPY ../../backend/Portfolio.Core ./backend + +WORKDIR "/src/." + +RUN dotnet build "./app/app_dataStructures/backend/api/api.csproj" -c Release -o /app/build + +FROM build AS publish + +RUN dotnet publish "./app/app_dataStructures/backend/api/api.csproj" -c Release -o /app/publish + +FROM base AS final + +WORKDIR /app + +COPY --from=publish /app/publish . + +RUN apt-get update \ + && apt-get install -y curl + +HEALTHCHECK --interval=5s --timeout=10s --retries=3 CMD curl --fail curl http://localhost:3002/healthcheck || exit 1 + +ENTRYPOINT ["dotnet", "api.dll"] \ No newline at end of file diff --git a/docker/dataStructures/docker-compose.yml b/docker/dataStructures/docker-compose.yml new file mode 100644 index 000000000..036b4e6bf --- /dev/null +++ b/docker/dataStructures/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.9' + +services: + dataStructures: + image: 'fabiosereno/portfolio.data-structures:0.0.5' + ports: + - '3002:3002' + container_name: dataStructures + networks: + - backend +networks: + frontend: + backend: \ No newline at end of file diff --git a/docker/dataStructures/start b/docker/dataStructures/start new file mode 100644 index 000000000..1d1f2f76a --- /dev/null +++ b/docker/dataStructures/start @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose up \ No newline at end of file diff --git a/docker/dataStructures/stop b/docker/dataStructures/stop new file mode 100644 index 000000000..a986179d7 --- /dev/null +++ b/docker/dataStructures/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose down \ No newline at end of file diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile new file mode 100644 index 000000000..7c9b119d9 --- /dev/null +++ b/docker/dev/Dockerfile @@ -0,0 +1,8 @@ +FROM fabiosereno/portfolio.npm:0.0.1 + +EXPOSE 8080 + +HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \ + CMD node healthcheck.js + +CMD ["sh", "-c", "npm run dev dir=${dir}"] \ No newline at end of file diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml new file mode 100644 index 000000000..325b1a779 --- /dev/null +++ b/docker/dev/docker-compose.yml @@ -0,0 +1,102 @@ +version: '3.9' + +services: + node: + image: 'fabiosereno/portfolio.dev:0.0.2' + environment: + - dir=${DIR:-home} + ports: + - '8080:8080' + volumes: + - '../../config.json:/usr/src/app/config.json' + - '../../babel.config.json:/usr/src/app/babel.config.json' + - '../../setupTests.js:/usr/src/app/setupTests.js' + - '../../app:/usr/src/app/app' + - '../../docs:/usr/src/app/docs' + - '../../build:/usr/src/app/build' + container_name: node + networks: + - frontend + - backend + depends_on: + - "coffeeMachine" + - "dataStructures" + - "uniqueDataEntry" + - "stringSort" + - "entitySort" + mem_limit: 500M + cpus: 0.2 + nginx: + image: 'fabiosereno/portfolio.nginx.dev:0.2.6' + ports: + - '80:80' + container_name: frontend + networks: + - frontend + - backend + depends_on: + - "coffeeMachine" + - "dataStructures" + - "uniqueDataEntry" + - "stringSort" + - "entitySort" + - "nodeToDo" + mem_limit: 500M + cpus: 0.2 + coffeeMachine: + image: 'fabiosereno/portfolio.coffee-machine:0.0.15' + ports: + - '3001:3001' + container_name: coffeeMachine + networks: + - backend + mem_limit: 500M + cpus: 0.2 + dataStructures: + image: 'fabiosereno/portfolio.data-structures:0.0.5' + ports: + - '3002:3002' + container_name: dataStructures + networks: + - backend + mem_limit: 500M + cpus: 0.2 + uniqueDataEntry: + image: 'fabiosereno/portfolio.unique-data-entry:0.0.2' + ports: + - '3003:3003' + container_name: uniqueDataEntry + networks: + - backend + mem_limit: 500M + cpus: 0.2 + stringSort: + image: 'fabiosereno/portfolio.string-sort:0.0.1' + ports: + - '3004:3004' + container_name: stringSort + networks: + - backend + mem_limit: 500M + cpus: 0.2 + entitySort: + image: 'fabiosereno/portfolio.entity-sort:0.0.4' + ports: + - '3005:3005' + container_name: entitySort + networks: + - backend + mem_limit: 500M + cpus: 0.2 + nodeToDo: + image: 'fabiosereno/portfolio.node-to-do:0.0.1' + ports: + - '3006:3006' + container_name: nodeToDo + networks: + - backend + mem_limit: 500M + cpus: 0.2 +networks: + frontend: + backend: \ No newline at end of file diff --git a/docker/dev/start b/docker/dev/start new file mode 100644 index 000000000..0ce55885a --- /dev/null +++ b/docker/dev/start @@ -0,0 +1,3 @@ +#!/bin/bash + +DIR=$1 docker compose up \ No newline at end of file diff --git a/docker/dev/stop b/docker/dev/stop new file mode 100644 index 000000000..a986179d7 --- /dev/null +++ b/docker/dev/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose down \ No newline at end of file diff --git a/docker/entitySort/Dockerfile b/docker/entitySort/Dockerfile new file mode 100644 index 000000000..9c99f2023 --- /dev/null +++ b/docker/entitySort/Dockerfile @@ -0,0 +1,36 @@ +FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:7.0 AS base + +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build + +WORKDIR /src + +COPY ["/app/app_entitySort/backend/api/api.csproj", "./app/app_entitySort/backend/api/api.csproj"] + +RUN dotnet restore "./app/app_entitySort/backend/api/api.csproj" + +COPY . . + +COPY ../../backend/Portfolio.Core ./backend + +WORKDIR "/src/." + +RUN dotnet build "./app/app_entitySort/backend/api/api.csproj" -c Release -o /app/build + +FROM build AS publish + +RUN dotnet publish "./app/app_entitySort/backend/api/api.csproj" -c Release -o /app/publish + +FROM base AS final + +WORKDIR /app + +COPY --from=publish /app/publish . + +RUN apt-get update \ + && apt-get install -y curl + +HEALTHCHECK --interval=5s --timeout=10s --retries=3 CMD curl --fail curl http://localhost:3005/healthcheck || exit 1 + +ENTRYPOINT ["dotnet", "api.dll"] \ No newline at end of file diff --git a/docker/entitySort/docker-compose.yml b/docker/entitySort/docker-compose.yml new file mode 100644 index 000000000..214e114a3 --- /dev/null +++ b/docker/entitySort/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.9' + +services: + entitySort: + image: 'fabiosereno/portfolio.entity-sort:0.0.4' + ports: + - '3005:3005' + container_name: entitySort + networks: + - backend +networks: + frontend: + backend: \ No newline at end of file diff --git a/docker/entitySort/start b/docker/entitySort/start new file mode 100644 index 000000000..1d1f2f76a --- /dev/null +++ b/docker/entitySort/start @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose up \ No newline at end of file diff --git a/docker/entitySort/stop b/docker/entitySort/stop new file mode 100644 index 000000000..a986179d7 --- /dev/null +++ b/docker/entitySort/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose down \ No newline at end of file diff --git a/docker/nginx-dev/Dockerfile b/docker/nginx-dev/Dockerfile new file mode 100644 index 000000000..b77e9f1f3 --- /dev/null +++ b/docker/nginx-dev/Dockerfile @@ -0,0 +1,3 @@ +FROM --platform=linux/amd64 nginx:1.23.1 + +COPY ./nginx.dev.conf ./etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile new file mode 100644 index 000000000..98c8dce77 --- /dev/null +++ b/docker/nginx/Dockerfile @@ -0,0 +1,5 @@ +FROM --platform=linux/amd64 nginx:1.23.1 + +COPY ./nginx.conf ./etc/nginx/conf.d/default.conf + +COPY ./docs ./usr/share/nginx/html \ No newline at end of file diff --git a/docker/nodeToDo/Dockerfile b/docker/nodeToDo/Dockerfile new file mode 100644 index 000000000..8a79d4154 --- /dev/null +++ b/docker/nodeToDo/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=linux/amd64 node:18.14.2 AS base + +WORKDIR /app + +ENV APP_DIR="app_nodeToDo" + +COPY ["/app/${APP_DIR}/backend/api", "./"] + +RUN npm install + +FROM base AS final + +RUN apt-get update \ + && apt-get install -y curl + +HEALTHCHECK --interval=5s --timeout=10s --retries=3 CMD curl --fail curl http://localhost:3006/healthcheck || exit 1 + +ENTRYPOINT ["node", "index.js"] \ No newline at end of file diff --git a/docker/nodeToDo/docker-compose.yml b/docker/nodeToDo/docker-compose.yml new file mode 100644 index 000000000..f41d3eaae --- /dev/null +++ b/docker/nodeToDo/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.9' + +services: + nodeToDo: + image: 'fabiosereno/portfolio.node-to-do:0.0.1' + ports: + - '3006:3006' + container_name: nodeToDo + networks: + - backend +networks: + frontend: + backend: \ No newline at end of file diff --git a/docker/nodeToDo/start b/docker/nodeToDo/start new file mode 100644 index 000000000..1d1f2f76a --- /dev/null +++ b/docker/nodeToDo/start @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose up \ No newline at end of file diff --git a/docker/nodeToDo/stop b/docker/nodeToDo/stop new file mode 100644 index 000000000..a986179d7 --- /dev/null +++ b/docker/nodeToDo/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose down \ No newline at end of file diff --git a/docker/npm/Dockerfile b/docker/npm/Dockerfile new file mode 100644 index 000000000..1eee81e96 --- /dev/null +++ b/docker/npm/Dockerfile @@ -0,0 +1,7 @@ +FROM node:14.17.5 + +WORKDIR /usr/src/app + +COPY ./package.json ./package-lock.json ./healthcheck.js ./ + +RUN npm install \ No newline at end of file diff --git a/docker/rel/Dockerfile b/docker/rel/Dockerfile new file mode 100644 index 000000000..7c6697e2c --- /dev/null +++ b/docker/rel/Dockerfile @@ -0,0 +1,6 @@ +FROM fabiosereno/portfolio.npm:0.0.1 + +HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \ + CMD node healthcheck.js + +CMD ["sh", "-c", "npm run release"] \ No newline at end of file diff --git a/docker/rel/docker-compose.yml b/docker/rel/docker-compose.yml new file mode 100644 index 000000000..ef2208aca --- /dev/null +++ b/docker/rel/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.9' + +services: + node: + tty: true + image: 'fabiosereno/portfolio.release:0.0.2' + volumes: + - '../../config.json:/usr/src/app/config.json' + - '../../babel.config.json:/usr/src/app/babel.config.json' + - '../../setupTests.js:/usr/src/app/setupTests.js' + - '../../app:/usr/src/app/app' + - '../../docs:/usr/src/app/docs' + - '../../build:/usr/src/app/build' + container_name: node diff --git a/docker/rel/start b/docker/rel/start new file mode 100644 index 000000000..8f3c2e2be --- /dev/null +++ b/docker/rel/start @@ -0,0 +1,3 @@ +#!/bin/bash + +docker-compose run --rm node \ No newline at end of file diff --git a/docker/stringSort/Dockerfile b/docker/stringSort/Dockerfile new file mode 100644 index 000000000..c5c857e6f --- /dev/null +++ b/docker/stringSort/Dockerfile @@ -0,0 +1,36 @@ +FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:7.0 AS base + +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build + +WORKDIR /src + +COPY ["/app/app_stringSort/backend/api/api.csproj", "./app/app_stringSort/backend/api/api.csproj"] + +RUN dotnet restore "./app/app_stringSort/backend/api/api.csproj" + +COPY . . + +COPY ../../backend/Portfolio.Core ./backend + +WORKDIR "/src/." + +RUN dotnet build "./app/app_stringSort/backend/api/api.csproj" -c Release -o /app/build + +FROM build AS publish + +RUN dotnet publish "./app/app_stringSort/backend/api/api.csproj" -c Release -o /app/publish + +FROM base AS final + +WORKDIR /app + +COPY --from=publish /app/publish . + +RUN apt-get update \ + && apt-get install -y curl + +HEALTHCHECK --interval=5s --timeout=10s --retries=3 CMD curl --fail curl http://localhost:3004/healthcheck || exit 1 + +ENTRYPOINT ["dotnet", "api.dll"] \ No newline at end of file diff --git a/docker/stringSort/docker-compose.yml b/docker/stringSort/docker-compose.yml new file mode 100644 index 000000000..73bcf82a8 --- /dev/null +++ b/docker/stringSort/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.9' + +services: + stringSort: + image: 'fabiosereno/portfolio.string-sort:0.0.1' + ports: + - '3004:3004' + container_name: stringSort + networks: + - backend +networks: + frontend: + backend: \ No newline at end of file diff --git a/docker/stringSort/start b/docker/stringSort/start new file mode 100644 index 000000000..1d1f2f76a --- /dev/null +++ b/docker/stringSort/start @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose up \ No newline at end of file diff --git a/docker/stringSort/stop b/docker/stringSort/stop new file mode 100644 index 000000000..a986179d7 --- /dev/null +++ b/docker/stringSort/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose down \ No newline at end of file diff --git a/Dockerfile b/docker/test-e2e/Dockerfile similarity index 56% rename from Dockerfile rename to docker/test-e2e/Dockerfile index 5c64e5443..9caf75869 100644 --- a/Dockerfile +++ b/docker/test-e2e/Dockerfile @@ -1,28 +1,38 @@ -FROM node:14.17.5 - -WORKDIR /usr/src/app - -COPY package.json package-lock.json healthcheck.js ./ +FROM --platform=linux/amd64 node:16.0.0 RUN apt-get update && apt-get install -y \ - fonts-liberation \ + libglib2.0-0 \ + libnss3 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxi6 \ + libxrandr2 \ + libxrender1 \ + libxss1 \ + libxtst6 \ gconf-service \ - libappindicator1 \ libasound2 \ libatk1.0-0 \ + libc6 \ libcairo2 \ libcups2 \ + libdbus-1-3 \ + libexpat1 \ libfontconfig1 \ - libgbm-dev \ + libgcc1 \ libgdk-pixbuf2.0-0 \ + libglib2.0-0 \ libgtk-3-0 \ - libicu-dev \ - libjpeg-dev \ libnspr4 \ - libnss3 \ libpango-1.0-0 \ libpangocairo-1.0-0 \ - libpng-dev \ + libstdc++6 \ libx11-6 \ libx11-xcb1 \ libxcb1 \ @@ -36,11 +46,20 @@ RUN apt-get update && apt-get install -y \ libxrender1 \ libxss1 \ libxtst6 \ - xdg-utils + ca-certificates \ + fonts-liberation \ + libappindicator1 \ + libnss3 \ + lsb-release \ + xdg-utils \ + wget \ + xvfb -RUN npm install -g jest && npm install +WORKDIR /usr/src/app + +COPY ./package.json ./package-lock.json ./healthcheck.js ./ -EXPOSE 8080 +RUN npm install -g jest && npm install HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \ CMD node healthcheck.js \ No newline at end of file diff --git a/docker/test-e2e/Dockerfile copy b/docker/test-e2e/Dockerfile copy new file mode 100644 index 000000000..46298bcca --- /dev/null +++ b/docker/test-e2e/Dockerfile copy @@ -0,0 +1,65 @@ +FROM --platform=linux/arm/v8 arm64v8/node:16.0.0 + +WORKDIR /usr/src/app + +COPY ./package.json ./package-lock.json ./healthcheck.js ./ + +RUN apt-get update && apt-get install -y \ + libglib2.0-0 \ + libnss3 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxi6 \ + libxrandr2 \ + libxrender1 \ + libxss1 \ + libxtst6 \ + gconf-service \ + libasound2 \ + libatk1.0-0 \ + libc6 \ + libcairo2 \ + libcups2 \ + libdbus-1-3 \ + libexpat1 \ + libfontconfig1 \ + libgcc1 \ + libgdk-pixbuf2.0-0 \ + libglib2.0-0 \ + libgtk-3-0 \ + libnspr4 \ + libpango-1.0-0 \ + libpangocairo-1.0-0 \ + libstdc++6 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxi6 \ + libxrandr2 \ + libxrender1 \ + libxss1 \ + libxtst6 \ + ca-certificates \ + fonts-liberation \ + libappindicator1 \ + libnss3 \ + lsb-release \ + xdg-utils \ + wget \ + xvfb + +RUN npm install -g jest && npm install + +HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \ + CMD node healthcheck.js \ No newline at end of file diff --git a/docker/test-e2e/docker-compose copy.yml b/docker/test-e2e/docker-compose copy.yml new file mode 100644 index 000000000..fa42d6d29 --- /dev/null +++ b/docker/test-e2e/docker-compose copy.yml @@ -0,0 +1,94 @@ +version: '3.9' + +services: + nginx: + image: 'fabiosereno/portfolio.nginx.dev:0.2.6' + ports: + - '80:80' + container_name: frontend + networks: + - frontend + - backend + depends_on: + - "coffeeMachine" + - "dataStructures" + - "uniqueDataEntry" + - "stringSort" + - "entitySort" + - "nodeToDo" + mem_limit: 500M + cpus: 0.2 + coffeeMachine: + image: 'fabiosereno/portfolio.coffee-machine:0.0.15' + ports: + - '3001:3001' + container_name: coffeeMachine + networks: + - backend + mem_limit: 500M + cpus: 0.2 + dataStructures: + image: 'fabiosereno/portfolio.data-structures:0.0.5' + ports: + - '3002:3002' + container_name: dataStructures + networks: + - backend + mem_limit: 500M + cpus: 0.2 + uniqueDataEntry: + image: 'fabiosereno/portfolio.unique-data-entry:0.0.2' + ports: + - '3003:3003' + container_name: uniqueDataEntry + networks: + - backend + mem_limit: 500M + cpus: 0.2 + stringSort: + image: 'fabiosereno/portfolio.string-sort:0.0.1' + ports: + - '3004:3004' + container_name: stringSort + networks: + - backend + mem_limit: 500M + cpus: 0.2 + entitySort: + image: 'fabiosereno/portfolio.entity-sort:0.0.4' + ports: + - '3005:3005' + container_name: entitySort + networks: + - backend + mem_limit: 500M + cpus: 0.2 + nodeToDo: + image: 'fabiosereno/portfolio.node-to-do:0.0.1' + ports: + - '3006:3006' + container_name: nodeToDo + networks: + - backend + mem_limit: 500M + cpus: 0.2 + node: + tty: true + image: 'fabiosereno/portfolio.test-e2e:0.0.5' + volumes: + - '../../config.json:/usr/src/app/config.json' + - '../../babel.config.json:/usr/src/app/babel.config.json' + - '../../setupTests.js:/usr/src/app/setupTests.js' + - '../../app:/usr/src/app/app' + container_name: node + depends_on: + - "nginx" + - "coffeeMachine" + - "dataStructures" + - "uniqueDataEntry" + - "stringSort" + - "entitySort" + - "nodeToDo" +networks: + frontend: + backend: diff --git a/docker/test-e2e/docker-compose.yml b/docker/test-e2e/docker-compose.yml new file mode 100644 index 000000000..966c155a8 --- /dev/null +++ b/docker/test-e2e/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.9' + +services: + node: + tty: true + image: 'fabiosereno/portfolio.test-e2e:0.9.0' + volumes: + - '../../config.json:/usr/src/app/config.json' + - '../../babel.config.json:/usr/src/app/babel.config.json' + - '../../setupTests.js:/usr/src/app/setupTests.js' + - '../../app:/usr/src/app/app' + container_name: node +networks: + frontend: + backend: diff --git a/docker/test-e2e/start b/docker/test-e2e/start new file mode 100644 index 000000000..2d00e1c6a --- /dev/null +++ b/docker/test-e2e/start @@ -0,0 +1,5 @@ +#!/bin/bash + +# Test docker compose up script + +docker compose up \ No newline at end of file diff --git a/docker/test-e2e/stop b/docker/test-e2e/stop new file mode 100644 index 000000000..df23319f7 --- /dev/null +++ b/docker/test-e2e/stop @@ -0,0 +1,5 @@ +#!/bin/bash + +# Test docker compose down script + +docker compose down \ No newline at end of file diff --git a/docker/test/Dockerfile b/docker/test/Dockerfile new file mode 100644 index 000000000..a03b91cb6 --- /dev/null +++ b/docker/test/Dockerfile @@ -0,0 +1,6 @@ +FROM fabiosereno/portfolio.npm:0.0.1 + +HEALTHCHECK --interval=12s --timeout=12s --start-period=30s \ + CMD node healthcheck.js + +CMD ["sh", "-c", "npm run test"] \ No newline at end of file diff --git a/docker/test/docker-compose.yml b/docker/test/docker-compose.yml new file mode 100644 index 000000000..6b2323906 --- /dev/null +++ b/docker/test/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3.9' + +services: + node: + tty: true + image: 'fabiosereno/portfolio.test:0.0.2' + volumes: + - '../../config.json:/usr/src/app/config.json' + - '../../babel.config.json:/usr/src/app/babel.config.json' + - '../../setupTests.js:/usr/src/app/setupTests.js' + - '../../app:/usr/src/app/app' + - '../../docs:/usr/src/app/docs' + - '../../build:/usr/src/app/build' + container_name: node diff --git a/docker/test/start b/docker/test/start new file mode 100644 index 000000000..8f3c2e2be --- /dev/null +++ b/docker/test/start @@ -0,0 +1,3 @@ +#!/bin/bash + +docker-compose run --rm node \ No newline at end of file diff --git a/docker/uniqueDataEntry/Dockerfile b/docker/uniqueDataEntry/Dockerfile new file mode 100644 index 000000000..425525297 --- /dev/null +++ b/docker/uniqueDataEntry/Dockerfile @@ -0,0 +1,36 @@ +FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:7.0 AS base + +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build + +WORKDIR /src + +COPY ["/app/app_uniqueDataEntry/backend/api/api.csproj", "./app/app_uniqueDataEntry/backend/api/api.csproj"] + +RUN dotnet restore "./app/app_uniqueDataEntry/backend/api/api.csproj" + +COPY . . + +COPY ../../backend/Portfolio.Core ./backend + +WORKDIR "/src/." + +RUN dotnet build "./app/app_uniqueDataEntry/backend/api/api.csproj" -c Release -o /app/build + +FROM build AS publish + +RUN dotnet publish "./app/app_uniqueDataEntry/backend/api/api.csproj" -c Release -o /app/publish + +FROM base AS final + +WORKDIR /app + +COPY --from=publish /app/publish . + +RUN apt-get update \ + && apt-get install -y curl + +HEALTHCHECK --interval=5s --timeout=10s --retries=3 CMD curl --fail curl http://localhost:3003/healthcheck || exit 1 + +ENTRYPOINT ["dotnet", "api.dll"] \ No newline at end of file diff --git a/docker/uniqueDataEntry/docker-compose.yml b/docker/uniqueDataEntry/docker-compose.yml new file mode 100644 index 000000000..9441ad3fc --- /dev/null +++ b/docker/uniqueDataEntry/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.9' + +services: + uniqueDataEntry: + image: 'fabiosereno/portfolio.unique-data-entry:0.0.2' + ports: + - '3003:3003' + container_name: uniqueDataEntry + networks: + - backend +networks: + frontend: + backend: \ No newline at end of file diff --git a/docker/uniqueDataEntry/start b/docker/uniqueDataEntry/start new file mode 100644 index 000000000..1d1f2f76a --- /dev/null +++ b/docker/uniqueDataEntry/start @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose up \ No newline at end of file diff --git a/docker/uniqueDataEntry/stop b/docker/uniqueDataEntry/stop new file mode 100644 index 000000000..a986179d7 --- /dev/null +++ b/docker/uniqueDataEntry/stop @@ -0,0 +1,3 @@ +#!/bin/bash + +docker compose down \ No newline at end of file diff --git a/docs/app_AzureDotNetCoreDataStructuresApi/index.html b/docs/app_AzureDotNetCoreDataStructuresApi/index.html deleted file mode 100644 index 9e2094ae3..000000000 --- a/docs/app_AzureDotNetCoreDataStructuresApi/index.html +++ /dev/null @@ -1 +0,0 @@ -Portfolio

    Azure Functions .NET, Data Structures

    First in, first out (FIFO) and last in, first out (LIFO) data structures implementing Queue and Stack in .NET, with a React UI

    Using Azure Functions serverless compute and .NET, with a React user interface.


    \ No newline at end of file diff --git a/docs/app_AzureDotNetCoreDataStructuresApi/main.js b/docs/app_AzureDotNetCoreDataStructuresApi/main.js deleted file mode 100644 index e4caf59a1..000000000 --- a/docs/app_AzureDotNetCoreDataStructuresApi/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={198:(e,t,a)=>{var n=a(294),r=a(935),l=a(555),o=a(51),i=a(625),s=a(754),c=a(151);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a0?t[0]:f}}],null&&S(t.prototype,null),a&&S(t,a),e}();function v(e,t){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25,a=void 0!==e?e.substring(0,t).split(" ").join(""):"";return a}}],null&&v(t.prototype,null),a&&v(t,a),e}();function A(e,t){for(var a=0;ae.length)&&(t=e.length);for(var a=0,n=new Array(t);a{if(!a){var o=1/0;for(u=0;u=l)&&Object.keys(n.O).every((e=>n.O[e](a[s])))?a.splice(s--,1):(i=!1,l0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[a,r,l]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={179:0};n.O.j=t=>0===e[t];var t=(t,a)=>{var r,l,[o,i,s]=a,c=0;for(r in i)n.o(i,r)&&(n.m[r]=i[r]);if(s)var u=s(n);for(t&&t(a);cn(198)));r=n.O(r)})(); \ No newline at end of file diff --git a/docs/app_AzureDotNetCoreUniqueDataEntryApi/index.html b/docs/app_AzureDotNetCoreUniqueDataEntryApi/index.html deleted file mode 100644 index 052a27844..000000000 --- a/docs/app_AzureDotNetCoreUniqueDataEntryApi/index.html +++ /dev/null @@ -1 +0,0 @@ -Portfolio

    Azure Functions .NET, Unique Data Entry

    Unique data entry implementing IEqualityComparer to manage illegal duplicate data entries, with a React UI

    Using Azure Functions serverless compute and .NET, with a React user interface.


    \ No newline at end of file diff --git a/docs/app_AzureDotNetCoreUniqueDataEntryApi/main.js b/docs/app_AzureDotNetCoreUniqueDataEntryApi/main.js deleted file mode 100644 index 76f624e75..000000000 --- a/docs/app_AzureDotNetCoreUniqueDataEntryApi/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={387:(e,t,a)=>{var n=a(294),r=a(935);function o(e,t){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25,a=void 0!==e?e.substring(0,t).split(" ").join(""):"";return a}}],null&&o(t.prototype,null),a&&o(t,a),e}(),i=a(625),c=a(754),s=a(151),u=a(555);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a0?t[0]:b}}],null&&S(t.prototype,null),a&&S(t,a),e}();function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);ae.length)&&(t=e.length);for(var a=0,n=new Array(t);a{if(!a){var l=1/0;for(u=0;u=o)&&Object.keys(n.O).every((e=>n.O[e](a[c])))?a.splice(c--,1):(i=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[a,r,o]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={179:0};n.O.j=t=>0===e[t];var t=(t,a)=>{var r,o,[l,i,c]=a,s=0;for(r in i)n.o(i,r)&&(n.m[r]=i[r]);if(c)var u=c(n);for(t&&t(a);sn(387)));r=n.O(r)})(); \ No newline at end of file diff --git a/docs/app_aframe/index.html b/docs/app_aframe/index.html deleted file mode 100644 index 98120c5c5..000000000 --- a/docs/app_aframe/index.html +++ /dev/null @@ -1 +0,0 @@ -Portfolio

    AFrame React (Basic)

    An AFrame Hello World application with React

    Exploring WebXR applications using AFrame and React. Compiled with Babel and Webpack.


    Compatible with any WebXR enabled browser and any WebXR enabled VR headset.

    Click below to launch the AFrame scene.

    Launch scene
    \ No newline at end of file diff --git a/docs/app_aframe/main.js b/docs/app_aframe/main.js deleted file mode 100644 index 7a635439f..000000000 --- a/docs/app_aframe/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={856:(e,t,r)=>{r(569);var o=r(294),n=r(935);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var r=0;r{if(!r){var c=1/0;for(f=0;f=i)&&Object.keys(o.O).every((e=>o.O[e](r[a])))?r.splice(a--,1):(u=!1,i0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[r,n,i]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={179:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var n,i,[c,u,a]=r,l=0;for(n in u)o.o(u,n)&&(o.m[n]=u[n]);if(a)var f=a(o);for(t&&t(r);lo(856)));n=o.O(n)})(); \ No newline at end of file diff --git a/docs/app_aframe/scene.html b/docs/app_aframe/scene.html deleted file mode 100644 index c45ba6356..000000000 --- a/docs/app_aframe/scene.html +++ /dev/null @@ -1 +0,0 @@ -Portfolio
    \ No newline at end of file diff --git a/docs/app_aframe/vendor.js b/docs/app_aframe/vendor.js deleted file mode 100644 index ef9da0016..000000000 --- a/docs/app_aframe/vendor.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.js.LICENSE.txt */ -(self.webpackChunkportfolio=self.webpackChunkportfolio||[]).push([[736],{569:(t,n,r)=>{t.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return i(t[a][1][e]||e)}),u,u.exports,e,t,n,r)}return n[a].exports}for(var o=void 0,a=0;a0?r-4:r,h=0;h>16&255,s[l++]=t>>8&255,s[l++]=255&t;return 2===a&&(t=i[e.charCodeAt(h)]<<2|i[e.charCodeAt(h+1)]>>4,s[l++]=255&t),1===a&&(t=i[e.charCodeAt(h)]<<10|i[e.charCodeAt(h+1)]<<4|i[e.charCodeAt(h+2)]>>2,s[l++]=t>>8&255,s[l++]=255&t),s},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,l=n-i;sl?l:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o=[],a=t;a>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);var s;return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],4:[function(e,t,n){"use strict";t.exports={createLink:function(e,t){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("link");for(var i in r.href=e,r.rel="stylesheet",t)if(t.hasOwnProperty(i)){var o=t[i];r.setAttribute("data-"+i,o)}n.appendChild(r)},createStyle:function(e,t){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");for(var i in r.type="text/css",t)if(t.hasOwnProperty(i)){var o=t[i];r.setAttribute("data-"+i,o)}r.sheet?(r.innerHTML=e,r.sheet.cssText=e,n.appendChild(r)):r.styleSheet?(n.appendChild(r),r.styleSheet.cssText=e):(r.appendChild(document.createTextNode(e)),n.appendChild(r))}}},{}],5:[function(e,t,n){var r=e("buffer").Buffer;t.exports=function(e,t){if(r.isBuffer(e)&&r.isBuffer(t)){if("function"==typeof e.equals)return e.equals(t);if(e.length!==t.length)return!1;for(var n=0;n=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function f(e,t){if(r.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(i)return H(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=r.from(t,i)),r.isBuffer(t))return 0===t.length?-1:y(e,t,n,i,o);if("number"==typeof t)return t&=255,r.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-l),o=n;o>=0;o--){for(var h=!0,d=0;di&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function _(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);for(var n="",r=0;r0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},r.prototype.compare=function(e,t,n,i,o){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(n>>>=0)-(t>>>=0),l=Math.min(a,s),u=this.slice(i,o),c=e.slice(t,n),h=0;hi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return A(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ii)&&(n=i);for(var o="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,i,o,a){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function k(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function I(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,i){return i||B(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,i){return i||B(e,0,n,8),o.write(e,t,n,r,52,8),n+8}r.prototype.slice=function(e,t){var n,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t0&&(i*=256);)r+=this[e+--t]*i;return r},r.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},r.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},r.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),o.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),o.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),o.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),o.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},r.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},r.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},r.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},r.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},r.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},r.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},r.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},r.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},r.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},r.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},r.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},r.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(a<1e3||!r.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"base64-js":3,buffer:6,ieee754:29,isarray:35}],7:[function(e,t,n){!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,r;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}()},{}],8:[function(e,t,n){function r(){var e;try{e=n.storage.debug}catch(e){}return e}(n=t.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},n.formatArgs=function(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" "),!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var r=0,i=0;return e[0].replace(/%[a-z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(i=r))})),e.splice(i,0,n),e},n.save=function(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(e){}},n.load=r,n.useColors=function(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31},n.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(r())},{"./debug":9}],9:[function(e,t,n){(n=t.exports=function(e){function t(){}function r(){var e=r;null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=i());var t=Array.prototype.slice.call(arguments);t[0]=n.coerce(t[0]),"string"!=typeof t[0]&&(t=["%o"].concat(t));var o=0;t[0]=t[0].replace(/%([a-z%])/g,(function(r,i){if("%%"===r)return r;o++;var a=n.formatters[i];if("function"==typeof a){var s=t[o];r=a.call(e,s),t.splice(o,1),o--}return r})),"function"==typeof n.formatArgs&&(t=n.formatArgs.apply(e,t)),(r.log||n.log||console.log.bind(console)).apply(e,t)}t.enabled=!1,r.enabled=!0;var o=n.enabled(e)?r:t;return o.namespace=e,o}).coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){n.enable("")},n.enable=function(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,i=0;i2?arguments[2]:{},o=r(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s>0),M="attached",_="detached",T="extends",S="ADDITION",C="MODIFICATION",L="REMOVAL",R="DOMAttrModified",P="DOMContentLoaded",D="DOMSubtreeModified",O="<",k="=",I=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,B=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],F=[],N=[],U="",H=n.documentElement,z=F.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},j=r.prototype,G=j.hasOwnProperty,V=j.isPrototypeOf,W=r.defineProperty,q=r.getOwnPropertyDescriptor,X=r.getOwnPropertyNames,Y=r.getPrototypeOf,Q=r.setPrototypeOf,K=!!r.__proto__,Z=r.create||function e(t){return t?(e.prototype=t,new e):this},J=Q||(K?function(e,t){return e.__proto__=t,e}:X&&q?function(){function e(e,t){for(var n,r=X(t),i=0,o=r.length;i1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');var n="$ "+e;if(!(n in d))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===d[n]&&!t)throw new TypeError("intrinsic "+e+" exists, but is not available. Please file an issue!");return d[n]}},{}],15:[function(e,t,n){"use strict";var r=e("./GetIntrinsic"),i=r("%Object%"),o=r("%TypeError%"),a=r("%String%"),s=e("./helpers/assertRecord"),l=e("./helpers/isNaN"),u=e("./helpers/isFinite"),c=e("./helpers/sign"),h=e("./helpers/mod"),d=e("is-callable"),p=e("es-to-primitive/es5"),f=e("has"),m={ToPrimitive:p,ToBoolean:function(e){return!!e},ToNumber:function(e){return+e},ToInteger:function(e){var t=this.ToNumber(e);return l(t)?0:0!==t&&u(t)?c(t)*Math.floor(Math.abs(t)):t},ToInt32:function(e){return this.ToNumber(e)>>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);if(l(t)||0===t||!u(t))return 0;var n=c(t)*Math.floor(Math.abs(t));return h(n,65536)},ToString:function(e){return a(e)},ToObject:function(e){return this.CheckObjectCoercible(e),i(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new o(t||"Cannot call method on "+e);return e},IsCallable:d,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:l(e)&&l(t)},Type:function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){if("Object"!==this.Type(e))return!1;var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(f(e,n)&&!t[n])return!1;var r=f(e,"[[Value]]"),i=f(e,"[[Get]]")||f(e,"[[Set]]");if(r&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){return void 0!==e&&(s(this,"Property Descriptor","Desc",e),!(!f(e,"[[Get]]")&&!f(e,"[[Set]]")))},IsDataDescriptor:function(e){return void 0!==e&&(s(this,"Property Descriptor","Desc",e),!(!f(e,"[[Value]]")&&!f(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return void 0!==e&&(s(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(s(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new o("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new o("ToPropertyDescriptor requires an object");var t={};if(f(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),f(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),f(e,"value")&&(t["[[Value]]"]=e.value),f(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),f(e,"get")){var n=e.get;if(void 0!==n&&!this.IsCallable(n))throw new TypeError("getter must be a function");t["[[Get]]"]=n}if(f(e,"set")){var r=e.set;if(void 0!==r&&!this.IsCallable(r))throw new o("setter must be a function");t["[[Set]]"]=r}if((f(t,"[[Get]]")||f(t,"[[Set]]"))&&(f(t,"[[Value]]")||f(t,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}};t.exports=m},{"./GetIntrinsic":14,"./helpers/assertRecord":16,"./helpers/isFinite":17,"./helpers/isNaN":18,"./helpers/mod":19,"./helpers/sign":20,"es-to-primitive/es5":21,has:28,"is-callable":32}],16:[function(e,t,n){"use strict";var r=e("../GetIntrinsic"),i=r("%TypeError%"),o=r("%SyntaxError%"),a=e("has"),s={"Property Descriptor":function(e,t){if("Object"!==e.Type(t))return!1;var n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if(a(t,r)&&!n[r])return!1;var o=a(t,"[[Value]]"),s=a(t,"[[Get]]")||a(t,"[[Set]]");if(o&&s)throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}};t.exports=function(e,t,n,r){var a=s[t];if("function"!=typeof a)throw new o("unknown record type: "+t);if(!a(e,r))throw new i(n+" must be a "+t);console.log(a(e,r),r)}},{"../GetIntrinsic":14,has:28}],17:[function(e,t,n){var r=Number.isNaN||function(e){return e!=e};t.exports=Number.isFinite||function(e){return"number"==typeof e&&!r(e)&&e!==1/0&&e!==-1/0}},{}],18:[function(e,t,n){t.exports=Number.isNaN||function(e){return e!=e}},{}],19:[function(e,t,n){t.exports=function(e,t){var n=e%t;return Math.floor(n>=0?n:n+t)}},{}],20:[function(e,t,n){t.exports=function(e){return e>=0?1:-1}},{}],21:[function(e,t,n){"use strict";var r=Object.prototype.toString,i=e("./helpers/isPrimitive"),o=e("is-callable"),a=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===r.call(e)?String:Number)===String||t===Number){var n,a,s=t===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1?a(e,arguments[1]):a(e)}},{"./helpers/isPrimitive":22,"is-callable":32}],22:[function(e,t,n){t.exports=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e}},{}],23:[function(e,t,n){var r=e("dtype");t.exports=function(e,t,n){if(!e)throw new TypeError("must specify data as first parameter");if(n=0|+(n||0),Array.isArray(e)&&e[0]&&"number"==typeof e[0][0]){var i,o,a,s,l=e[0].length,u=e.length*l;t&&"string"!=typeof t||(t=new(r(t||"float32"))(u+n));var c=t.length-n;if(u!==c)throw new Error("source length "+u+" ("+l+"x"+e.length+") does not match destination length "+c);for(i=0,a=n;i=3&&(o=n),"[object Array]"===i.call(e)?a(e,t,o):"string"==typeof e?s(e,t,o):l(e,t,o)}},{"is-callable":32}],25:[function(e,t,n){"use strict";var r="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,o=Object.prototype.toString,a="[object Function]";t.exports=function(e){var t=this;if("function"!=typeof t||o.call(t)!==a)throw new TypeError(r+t);for(var n,s=i.call(arguments,1),l=function(){if(this instanceof n){var r=t.apply(this,s.concat(i.call(arguments)));return Object(r)===r?r:this}return t.apply(e,s.concat(i.call(arguments)))},u=Math.max(0,t.length-s.length),c=[],h=0;h>1,c=-7,h=n?i-1:0,d=n?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=u}return(p?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,l,u=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*l-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=f,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=f,a/=256,u-=8);e[n+p-f]|=128*m}},{}],30:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],31:[function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],32:[function(e,t,n){"use strict";var r=Function.prototype.toString,i=/^\s*class\b/,o=function(e){try{var t=r.call(e);return i.test(t)}catch(e){return!1}},a=Object.prototype.toString,s="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(s)return function(e){try{return!o(e)&&(r.call(e),!0)}catch(e){return!1}}(e);if(o(e))return!1;var t=a.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},{}],33:[function(e,t,n){t.exports=function(e){var t=r.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var r=Object.prototype.toString},{}],34:[function(e,t,n){"use strict";t.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},{}],35:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],36:[function(e,t,n){var r=e("word-wrapper"),i=e("xtend"),o=e("as-number"),a=["x","e","a","o","n","s","r","c","u","m","v","w","z"],s=["m","w"],l=["H","I","N","E","F","K","L","T","U","V","W","X","Y","Z"],u="\t".charCodeAt(0),c=" ".charCodeAt(0);function h(e){this.glyphs=[],this._measure=this.computeMetrics.bind(this),this.update(e)}function d(e){return new Function(["return function "+e+"() {"," return this._"+e,"}"].join("\n"))()}function p(e,t){if(!e.chars||0===e.chars.length)return null;var n=m(e.chars,t);return n>=0?e.chars[n]:null}function f(e,t,n){if(!e.kernings||0===e.kernings.length)return 0;for(var r=e.kernings,i=0;i=0)return e.chars[r].height}return 0}(s),this._capHeight=function(e){for(var t=0;t=0)return e.chars[r].height}return 0}(s),this._lineHeight=v,this._ascender=v-y-this._xHeight;var x=this;u.forEach((function(e,r){for(var i,o=e.start,a=e.end,l=e.width,u=o;u=0)return e.chars[r]}return 0}(e)||e.chars[0],n=this._opt.tabSize*t.xadvance;this._fallbackSpaceGlyph=t,this._fallbackTabGlyph=i(t,{x:0,y:0,xadvance:n,id:u,xoffset:0,yoffset:0,width:0,height:0})}},h.prototype.getGlyph=function(e,t){return p(e,t)||(t===u?this._fallbackTabGlyph:t===c?this._fallbackSpaceGlyph:null)},h.prototype.computeMetrics=function(e,t,n,r){var i,o=this._opt.letterSpacing||0,a=this._opt.font,s=0,l=0,u=0;if(!a.chars||0===a.chars.length)return{start:t,end:t,width:0};n=Math.min(e.length,n);for(var c=t;c=r||p>=r)break;s=p,l=m,i=h}u++}return i&&(l+=i.xoffset),{start:t,end:t+u,width:l}},["width","height","descender","ascender","xHeight","baseline","capHeight","lineHeight"].forEach((function(e){Object.defineProperty(h.prototype,e,{get:d(e),configurable:!0})}))},{"as-number":2,"word-wrapper":69,xtend:72}],37:[function(e,t,n){(function(n){var r=e("xhr"),i=function(){},o=e("parse-bmfont-ascii"),a=e("parse-bmfont-xml"),s=e("parse-bmfont-binary"),l=e("./lib/is-binary"),u=e("xtend"),c=self.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;t.exports=function(e,t){t="function"==typeof t?t:i,"string"==typeof e?e={uri:e}:e||(e={}),e.binary&&(e=function(e){if(c)return u(e,{responseType:"arraybuffer"});if(void 0===self.XMLHttpRequest)throw new Error("your browser does not support XHR loading");var t=new self.XMLHttpRequest;return t.overrideMimeType("text/plain; charset=x-user-defined"),u({xhr:t},e)}(e)),r(e,(function(r,u,c){if(r)return t(r);if(!/^2/.test(u.statusCode))return t(new Error("http status code: "+u.statusCode));if(!c)return t(new Error("no body result"));var h,d,p=!1;if(d=c,"[object ArrayBuffer]"===Object.prototype.toString.call(d)){var f=new Uint8Array(c);c=new n(f,"binary")}l(c)&&(p=!0,"string"==typeof c&&(c=new n(c,"binary"))),p||(n.isBuffer(c)&&(c=c.toString(e.encoding)),c=c.trim());try{var m=u.headers["content-type"];h=p?s(c):/json/.test(m)||"{"===c.charAt(0)?JSON.parse(c):/xml/.test(m)||"<"===c.charAt(0)?a(c):o(c)}catch(e){t(new Error("error parsing font "+e.message)),t=i}t(null,h)}))}}).call(this,e("buffer").Buffer)},{"./lib/is-binary":38,buffer:6,"parse-bmfont-ascii":43,"parse-bmfont-binary":44,"parse-bmfont-xml":45,xhr:70,xtend:72}],38:[function(e,t,n){(function(n){var r=e("buffer-equal"),i=new n([66,77,70,3]);t.exports=function(e){return"string"==typeof e?"BMF"===e.substring(0,3):e.length>4&&r(e.slice(0,4),i)}}).call(this,e("buffer").Buffer)},{buffer:6,"buffer-equal":5}],39:[function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,l=a(e),u=1;u0&&!i.call(e,0))for(var m=0;m0)for(var v=0;v=0&&"[object Function]"===r.call(e.callee)),n}},{}],43:[function(e,t,n){function r(e,t){if(!(e=e.replace(/\t+/g," ").trim()))return null;var n=e.indexOf(" ");if(-1===n)throw new Error("no named row at line "+t);var r=e.substring(0,n);e=(e=(e=(e=e.substring(n+1)).replace(/letter=[\'\"]\S+[\'\"]/gi,"")).split("=")).map((function(e){return e.trim().match(/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g)}));for(var o=[],a=0;at.length-1)return 0;var r=t.readUInt8(n++),i=t.readInt32LE(n);switch(n+=4,r){case 1:e.info=function(e,t){var n={};n.size=e.readInt16LE(t);var r=e.readUInt8(t+2);return n.smooth=r>>7&1,n.unicode=r>>6&1,n.italic=r>>5&1,n.bold=r>>4&1,r>>3&1&&(n.fixedHeight=1),n.charset=e.readUInt8(t+3)||"",n.stretchH=e.readUInt16LE(t+4),n.aa=e.readUInt8(t+6),n.padding=[e.readInt8(t+7),e.readInt8(t+8),e.readInt8(t+9),e.readInt8(t+10)],n.spacing=[e.readInt8(t+11),e.readInt8(t+12)],n.outline=e.readUInt8(t+13),n.face=function(e,t){return o(e,t).toString("utf8")}(e,t+14),n}(t,n);break;case 2:e.common=function(e,t){var n={};return n.lineHeight=e.readUInt16LE(t),n.base=e.readUInt16LE(t+2),n.scaleW=e.readUInt16LE(t+4),n.scaleH=e.readUInt16LE(t+6),n.pages=e.readUInt16LE(t+8),e.readUInt8(t+10),n.packed=0,n.alphaChnl=e.readUInt8(t+11),n.redChnl=e.readUInt8(t+12),n.greenChnl=e.readUInt8(t+13),n.blueChnl=e.readUInt8(t+14),n}(t,n);break;case 3:e.pages=function(e,t,n){for(var r=[],i=o(e,t),a=i.length+1,s=n/a,l=0;l3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");for(var n={kernings:[],chars:[]},o=0;o<5;o++)t+=i(n,e,t);return n}},{}],45:[function(e,t,n){var r=e("./parse-attribs"),i=e("xml-parse-from-string"),o={scaleh:"scaleH",scalew:"scaleW",stretchh:"stretchH",lineheight:"lineHeight",alphachnl:"alphaChnl",redchnl:"redChnl",greenchnl:"greenChnl",bluechnl:"blueChnl"};function a(e){return function(e){for(var t=[],n=0;n element");for(var s=o.getElementsByTagName("page"),l=0;l1)for(var n=1;n-1}function u(e,t){return e.apply(null,t)}var c=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,h=/^rgb/,d=/^hsl/,p={arr:function(e){return Array.isArray(e)},obj:function(e){return l(Object.prototype.toString.call(e),"Object")},pth:function(e){return p.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement},dom:function(e){return e.nodeType||p.svg(e)},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return void 0===e},hex:function(e){return c.test(e)},rgb:function(e){return h.test(e)},hsl:function(e){return d.test(e)},col:function(e){return p.hex(e)||p.rgb(e)||p.hsl(e)},key:function(e){return!r.hasOwnProperty(e)&&!i.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}},f=/\(([^)]+)\)/;function m(e){var t=f.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function v(e,t){var n=m(e),r=s(p.und(n[0])?1:n[0],.1,100),i=s(p.und(n[1])?100:n[1],.1,100),o=s(p.und(n[2])?10:n[2],.1,100),l=s(p.und(n[3])?0:n[3],.1,100),u=Math.sqrt(i/r),c=o/(2*Math.sqrt(i*r)),h=c<1?u*Math.sqrt(1-c*c):0,d=c<1?(c*u-l)/h:-l+u;function f(e){var n=t?t*e/1e3:e;return n=c<1?Math.exp(-n*c*u)*(1*Math.cos(h*n)+d*Math.sin(h*n)):(1+d*n)*Math.exp(-n*u),0===e||1===e?e:1-n}return t?f:function(){var t=a.springs[e];if(t)return t;for(var n=1/6,r=0,i=0;;)if(1===f(r+=n)){if(++i>=16)break}else i=0;var o=r*n*1e3;return a.springs[e]=o,o}}function g(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var n=s(e,1,10),r=s(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin((e-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}function y(e){return void 0===e&&(e=10),function(t){return Math.round(t*e)*(1/e)}}var b=function(){var e=.1;function t(e,t){return 1-3*t+3*e}function n(e,t){return 3*t-6*e}function r(e){return 3*e}function i(e,i,o){return((t(i,o)*e+n(i,o))*e+r(i))*e}function o(e,i,o){return 3*t(i,o)*e*e+2*n(i,o)*e+r(i)}return function(t,n,r,a){if(0<=t&&t<=1&&0<=r&&r<=1){var s=new Float32Array(11);if(t!==n||r!==a)for(var l=0;l<11;++l)s[l]=i(l*e,t,r);return function(l){return t===n&&r===a||0===l||1===l?l:i(function(n){for(var a=0,l=1,u=10;l!==u&&s[l]<=n;++l)a+=e;--l;var c=a+(n-s[l])/(s[l+1]-s[l])*e,h=o(c,t,r);return h>=.001?function(e,t,n,r){for(var a=0;a<4;++a){var s=o(t,n,r);if(0===s)return t;t-=(i(t,n,r)-e)/s}return t}(n,c,t,r):0===h?c:function(e,t,n,r,o){var a,s,l=0;do{(a=i(s=t+(n-t)/2,r,o)-e)>0?n=s:t=s}while(Math.abs(a)>1e-7&&++l<10);return s}(n,a,a+e,t,r)}(l),n,a)}}}}(),A=function(){var e=["Quad","Cubic","Quart","Quint","Sine","Expo","Circ","Back","Elastic"],t={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],g],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(e,t){return function(n){return 1-g(e,t)(1-n)}}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(e,t){return function(n){return n<.5?g(e,t)(2*n)/2:1-g(e,t)(-2*n+2)/2}}]},n={linear:[.25,.25,.75,.75]};for(var r in t)for(var i=0,o=t[r].length;i=2?arguments[1]:void 0,o=0;o1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0==a)t=n=r=s;else{var c=s<.5?s*(1+a):s+a-s*a,h=2*s-c;t=u(h,c,o+1/3),n=u(h,c,o),r=u(h,c,o-1/3)}return"rgba("+255*t+","+255*n+","+255*r+","+l+")"}(e):void 0;var t,n}var F=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/;function N(e){var t=F.exec(e);if(t)return t[2]}function U(e,t){return p.fnc(e)?e(t.target,t.id,t.total):e}function H(e,t){return e.getAttribute(t)}function z(e,t,n){if(S([n,"deg","rad","turn"],N(t)))return t;var r=a.CSS[t+n];if(!p.und(r))return r;var i=document.createElement(e.tagName),o=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;o.appendChild(i),i.style.position="absolute",i.style.width=100+n;var s=100/i.offsetWidth;o.removeChild(i);var l=s*parseFloat(t);return a.CSS[t+n]=l,l}function j(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?z(e,i,n):i}}function G(e,t){return p.dom(e)&&!p.inp(e)&&(H(e,t)||p.svg(e)&&e[t])?"attribute":p.dom(e)&&S(o,t)?"transform":p.dom(e)&&"transform"!==t&&j(e,t)?"css":null!=e[t]?"object":void 0}var V=/(\w+)\(([^)]*)\)/g;function W(e){if(p.dom(e)){for(var t,n=e.style.transform||"",r=new Map;t=V.exec(n);)r.set(t[1],t[2]);return r}}function q(e,t,n,r){var i=l(t,"scale")?1:0+function(e){return l(e,"translate")||"perspective"===e?"px":l(e,"rotate")||l(e,"skew")?"deg":void 0}(t),o=W(e).get(t)||i;return n&&(n.transforms.list.set(t,o),n.transforms.last=t),r?z(e,o,r):o}function X(e,t,n,r){switch(G(e,t)){case"transform":return q(e,t,r,n);case"css":return j(e,t,n);case"attribute":return H(e,t);default:return e[t]||0}}var Y=/^(\*=|\+=|-=)/;function Q(e,t){var n=Y.exec(e);if(!n)return e;var r=N(e)||0,i=parseFloat(t),o=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return i+o+r;case"-":return i-o+r;case"*":return i*o+r}}var K=/\s/g;function Z(e,t){if(p.col(e))return B(e);var n=N(e),r=n?e.substr(0,e.length-n.length):e;return t&&!K.test(e)?r+t:r}function J(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function $(e){for(var t,n=e.points,r=0,i=0;i0&&(r+=J(t,o)),t=o}return r}function ee(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*H(e,"r")}(e);case"rect":return function(e){return 2*H(e,"width")+2*H(e,"height")}(e);case"line":return function(e){return J({x:H(e,"x1"),y:H(e,"y1")},{x:H(e,"x2"),y:H(e,"y2")})}(e);case"polyline":return $(e);case"polygon":return function(e){var t=e.points;return $(e)+J(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function te(e,t){var n=t||{},r=n.el||function(e){for(var t=e.parentNode;p.svg(t)&&(t=t.parentNode,p.svg(t.parentNode)););return t}(e),i=r.getBoundingClientRect(),o=H(r,"viewBox"),a=i.width,s=i.height,l=n.viewBox||(o?o.split(" "):[0,0,a,s]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:a/l[2],h:s/l[3]}}function ne(e,t){function n(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var r=te(e.el,e.svg),i=n(),o=n(-1),a=n(1);switch(e.property){case"x":return(i.x-r.x)*r.w;case"y":return(i.y-r.y)*r.h;case"angle":return 180*Math.atan2(a.y-o.y,a.x-o.x)/Math.PI}}var re=/-?\d*\.?\d+/g;function ie(e,t){var n=Z(p.pth(e)?e.totalLength:e,t)+"";return{original:n,numbers:n.match(re)?n.match(re).map(Number):[0],strings:p.str(e)||t?n.split(re):[]}}function oe(e){return M(e?_(p.arr(e)?e.map(T):T(e)):[],(function(e,t,n){return n.indexOf(e)===t}))}function ae(e){var t=oe(e);return t.map((function(e,n){return{target:e,id:n,total:t.length,transforms:{list:W(e)}}}))}var se=/^spring/;function le(e,t){var n=C(t);if(se.test(n.easing)&&(n.duration=v(n.easing)),p.arr(e)){var r=e.length;2!==r||p.obj(e[0])?p.fnc(t.duration)||(n.duration=t.duration/r):e={value:e}}var i=p.arr(e)?e:[e];return i.map((function(e,n){var r=p.obj(e)&&!p.pth(e)?e:{value:e};return p.und(r.delay)&&(r.delay=n?0:t.delay),p.und(r.endDelay)&&(r.endDelay=n===i.length-1?t.endDelay:0),r})).map((function(e){return R(e,n)}))}function ue(e,t){var n=[],r=t.keyframes;for(var i in r&&(t=R(function(e){for(var t=M(_(e.map((function(e){return Object.keys(e)}))),(function(e){return p.key(e)})).reduce((function(e,t){return e.indexOf(t)<0&&e.push(t),e}),[]),n={},r=function(r){var i=t[r];n[i]=e.map((function(e){var t={};for(var n in e)p.key(n)?n==i&&(t.value=e[n]):t[n]=e[n];return t}))},i=0;i-1&&(ge.splice(o,1),n=ge.length)}else i.tick(t);r++}e()}else ve=cancelAnimationFrame(ve)}return e}();function Ae(e){void 0===e&&(e={});var t,n=0,o=0,a=0,l=0,u=null;function c(){return window.Promise&&new Promise((function(e){return u=e}))}var h=c(),d=function(e){var t=L(r,e),n=L(i,e),o=ue(n,e),a=ae(e.targets),s=pe(a,o),l=fe(s,n),u=me;return me++,R(t,{id:u,children:[],animatables:a,animations:s,duration:l.duration,delay:l.delay,endDelay:l.endDelay})}(e);function p(){d.reversed=!d.reversed;for(var e=0,n=t.length;e2||(b=Math.round(b*f)/f)),m.push(b)}var x=p.length;if(x){g=p[0];for(var E=0;E0&&(d.began=!0,y("begin"),y("loopBegin")),b<=i&&0!==d.currentTime&&g(0),(b>=m&&d.currentTime!==r||!r)&&g(r),b>i&&b=r&&(o=0,d.remaining&&!0!==d.remaining&&d.remaining--,d.remaining?(n=a,y("loopComplete"),y("loopBegin"),"alternate"===d.direction&&p()):(d.paused=!0,d.completed||(d.completed=!0,y("loopComplete"),y("complete"),"Promise"in window&&(u(),h=c()))))}return d.reset=function(){var e=d.direction;d.passThrough=!1,d.currentTime=0,d.progress=0,d.paused=!0,d.began=!1,d.changeBegan=!1,d.completed=!1,d.changeCompleted=!1,d.reversePlayback=!1,d.reversed="reverse"===e,d.remaining=d.loop,t=d.children;for(var n=l=t.length;n--;)d.children[n].reset();(d.reversed&&!0!==d.loop||"alternate"===e&&1===d.loop)&&d.remaining++,g(0)},d.set=function(e,t){return de(e,t),d},d.tick=function(e){a=e,n||(n=a),b((a+(o-n))*Ae.speed)},d.seek=function(e){b(f(e))},d.pause=function(){d.paused=!0,m()},d.play=function(){d.paused&&(d.paused=!1,ge.push(d),m(),ve||be())},d.reverse=function(){p(),m()},d.restart=function(){d.reset(),d.play()},d.finished=h,d.reset(),d.autoplay&&d.play(),d}function we(e,t){for(var n=t.length;n--;)S(e,t[n].animatable.target)&&t.splice(n,1)}document.addEventListener("visibilitychange",(function(){if(document.hidden){for(var e=0,t=ge.length;e-1&&ge.splice(o,1);for(var l=0;l0?1:+e}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(l&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}("object"==typeof t?t.exports:{});try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}var r="125",i=100,o=300,a=301,s=302,l=303,u=304,c=306,h=307,d=1e3,p=1001,f=1002,m=1003,v=1004,g=1005,y=1006,b=1007,A=1008,w=1009,x=1012,E=1014,M=1015,_=1016,T=1020,S=1022,C=1023,L=1026,R=1027,P=33776,D=33777,O=33778,k=33779,I=35840,B=35841,F=35842,N=35843,U=37492,H=37496,z=2300,j=2301,G=2302,V=2400,W=2401,q=2402,X=2500,Y=2501,Q=3e3,K=3001,Z=3007,J=3002,$=3004,ee=3005,te=3006,ne=7680,re=35044,ie=35048,oe="300 es";function ae(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function se(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function pe(){}Object.assign(pe.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r>8&255]+fe[e>>16&255]+fe[e>>24&255]+"-"+fe[255&t]+fe[t>>8&255]+"-"+fe[t>>16&15|64]+fe[t>>24&255]+"-"+fe[63&n|128]+fe[n>>8&255]+"-"+fe[n>>16&255]+fe[n>>24&255]+fe[255&r]+fe[r>>8&255]+fe[r>>16&255]+fe[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},damp:function(e,t,n,r){return ye.lerp(e,t,1-Math.exp(-n*r))},pingpong:function(e,t){return void 0===t&&(t=1),t-Math.abs(ye.euclideanModulo(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(ge=e%2147483647),((ge=16807*ge%2147483647)-1)/2147483646},degToRad:function(e){return e*ye.DEG2RAD},radToDeg:function(e){return e*ye.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),u=o((t+r)/2),c=a((t+r)/2),h=o((t-r)/2),d=a((t-r)/2),p=o((r-t)/2),f=a((r-t)/2);switch(i){case"XYX":e.set(s*c,l*h,l*d,s*u);break;case"YZY":e.set(l*d,s*c,l*h,s*u);break;case"ZXZ":e.set(l*h,l*d,s*c,s*u);break;case"XZX":e.set(s*c,l*f,l*p,s*u);break;case"YXY":e.set(l*p,s*c,l*f,s*u);break;case"ZYZ":e.set(l*f,l*p,s*c,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}},be=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t}var t=e.prototype;return t.set=function(e,t){return this.x=e,this.y=t,this},t.setScalar=function(e){return this.x=e,this.y=e,this},t.setX=function(e){return this.x=e,this},t.setY=function(e){return this.y=e,this},t.setComponent=function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},t.getComponent=function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},t.clone=function(){return new this.constructor(this.x,this.y)},t.copy=function(e){return this.x=e.x,this.y=e.y,this},t.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},t.addScalar=function(e){return this.x+=e,this.y+=e,this},t.addVectors=function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},t.addScaledVector=function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},t.sub=function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},t.subScalar=function(e){return this.x-=e,this.y-=e,this},t.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},t.multiply=function(e){return this.x*=e.x,this.y*=e.y,this},t.multiplyScalar=function(e){return this.x*=e,this.y*=e,this},t.divide=function(e){return this.x/=e.x,this.y/=e.y,this},t.divideScalar=function(e){return this.multiplyScalar(1/e)},t.applyMatrix3=function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},t.min=function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},t.max=function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},t.clamp=function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},t.clampScalar=function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},t.clampLength=function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},t.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},t.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},t.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},t.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},t.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.dot=function(e){return this.x*e.x+this.y*e.y},t.cross=function(e){return this.x*e.y-this.y*e.x},t.lengthSq=function(){return this.x*this.x+this.y*this.y},t.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)},t.normalize=function(){return this.divideScalar(this.length()||1)},t.angle=function(){return Math.atan2(-this.y,-this.x)+Math.PI},t.distanceTo=function(e){return Math.sqrt(this.distanceToSquared(e))},t.distanceToSquared=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},t.manhattanDistanceTo=function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},t.setLength=function(e){return this.normalize().multiplyScalar(e)},t.lerp=function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},t.lerpVectors=function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this},t.equals=function(e){return e.x===this.x&&e.y===this.y},t.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},t.fromBufferAttribute=function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},t.rotateAround=function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this},t.random=function(){return this.x=Math.random(),this.y=Math.random(),this},le(e,[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}}]),e}(),Ae=function(){function e(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}var t=e.prototype;return t.set=function(e,t,n,r,i,o,a,s,l){var u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=i,u[5]=s,u[6]=n,u[7]=o,u[8]=l,this},t.identity=function(){return this.set(1,0,0,0,1,0,0,0,1),this},t.clone=function(){return(new this.constructor).fromArray(this.elements)},t.copy=function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},t.extractBasis=function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},t.setFromMatrix4=function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},t.multiply=function(e){return this.multiplyMatrices(this,e)},t.premultiply=function(e){return this.multiplyMatrices(e,this)},t.multiplyMatrices=function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],l=n[1],u=n[4],c=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],v=r[6],g=r[1],y=r[4],b=r[7],A=r[2],w=r[5],x=r[8];return i[0]=o*f+a*g+s*A,i[3]=o*m+a*y+s*w,i[6]=o*v+a*b+s*x,i[1]=l*f+u*g+c*A,i[4]=l*m+u*y+c*w,i[7]=l*v+u*b+c*x,i[2]=h*f+d*g+p*A,i[5]=h*m+d*y+p*w,i[8]=h*v+d*b+p*x,this},t.multiplyScalar=function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},t.determinant=function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8];return t*o*u-t*a*l-n*i*u+n*a*s+r*i*l-r*o*s},t.invert=function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=u*o-a*l,h=a*s-u*i,d=l*i-o*s,p=t*c+n*h+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);var f=1/p;return e[0]=c*f,e[1]=(r*l-u*n)*f,e[2]=(a*n-r*o)*f,e[3]=h*f,e[4]=(u*t-r*s)*f,e[5]=(r*i-a*t)*f,e[6]=d*f,e[7]=(n*s-l*t)*f,e[8]=(o*t-n*i)*f,this},t.transpose=function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},t.getNormalMatrix=function(e){return this.setFromMatrix4(e).copy(this).invert().transpose()},t.transposeIntoArray=function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},t.setUvTransform=function(e,t,n,r,i,o,a){var s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*o+l*a)+o+e,-r*l,r*s,-r*(-l*o+s*a)+a+t,0,0,1),this},t.scale=function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},t.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],u=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*l,r[6]=t*a+n*u,r[1]=-n*i+t*s,r[4]=-n*o+t*l,r[7]=-n*a+t*u,this},t.translate=function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},t.equals=function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},t.fromArray=function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},t.toArray=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e},e}(),we={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===ve&&(ve=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),ve.width=e.width,ve.height=e.height;var n=ve.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ve}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},xe=0;function Ee(e,t,n,r,i,o,a,s,l,u){void 0===e&&(e=Ee.DEFAULT_IMAGE),void 0===t&&(t=Ee.DEFAULT_MAPPING),void 0===n&&(n=p),void 0===r&&(r=p),void 0===i&&(i=y),void 0===o&&(o=A),void 0===a&&(a=C),void 0===s&&(s=w),void 0===l&&(l=1),void 0===u&&(u=Q),Object.defineProperty(this,"id",{value:xe++}),this.uuid=ye.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=s,this.offset=new be(0,0),this.repeat=new be(1,1),this.center=new be(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ae,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=u,this.version=0,this.onUpdate=null}function Me(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?we.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Ee.DEFAULT_IMAGE=void 0,Ee.DEFAULT_MAPPING=o,Ee.prototype=Object.assign(Object.create(pe.prototype),{constructor:Ee,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=ye.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o1)switch(this.wrapS){case d:e.x=e.x-Math.floor(e.x);break;case p:e.x=e.x<0?0:1;break;case f:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case d:e.y=e.y-Math.floor(e.y);break;case p:e.y=e.y<0?0:1;break;case f:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Ee.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});var _e=function(){function e(e,t,n,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=1),Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=n,this.w=r}var t=e.prototype;return t.set=function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},t.setScalar=function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},t.setX=function(e){return this.x=e,this},t.setY=function(e){return this.y=e,this},t.setZ=function(e){return this.z=e,this},t.setW=function(e){return this.w=e,this},t.setComponent=function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},t.getComponent=function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},t.clone=function(){return new this.constructor(this.x,this.y,this.z,this.w)},t.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},t.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},t.addScalar=function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},t.addVectors=function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},t.addScaledVector=function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},t.sub=function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},t.subScalar=function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},t.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},t.multiply=function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},t.multiplyScalar=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},t.applyMatrix4=function(e){var t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this},t.divideScalar=function(e){return this.multiplyScalar(1/e)},t.setAxisAngleFromQuaternion=function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},t.setAxisAngleFromRotationMatrix=function(e){var t,n,r,i,o=.01,a=.1,s=e.elements,l=s[0],u=s[4],c=s[8],h=s[1],d=s[5],p=s[9],f=s[2],m=s[6],v=s[10];if(Math.abs(u-h)y&&g>b?gb?y=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var b=Math.sqrt(y),A=Math.atan2(b,v*g);m=Math.sin(m*A)/b,a=Math.sin(a*A)/b}var w=a*g;if(s=s*m+h*w,l=l*m+d*w,u=u*m+p*w,c=c*m+f*w,m===1-a){var x=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=x,l*=x,u*=x,c*=x}}e[t]=s,e[t+1]=l,e[t+2]=u,e[t+3]=c},e.multiplyQuaternionsFlat=function(e,t,n,r,i,o){var a=n[r],s=n[r+1],l=n[r+2],u=n[r+3],c=i[o],h=i[o+1],d=i[o+2],p=i[o+3];return e[t]=a*p+u*c+s*d-l*h,e[t+1]=s*p+u*h+l*c-a*d,e[t+2]=l*p+u*d+a*h-s*c,e[t+3]=u*p-a*c-s*h-l*d,e};var t=e.prototype;return t.set=function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this},t.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},t.copy=function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},t.setFromEuler=function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,l=a(n/2),u=a(r/2),c=a(i/2),h=s(n/2),d=s(r/2),p=s(i/2);switch(o){case"XYZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"YXZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"ZXY":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"ZYX":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"YZX":this._x=h*u*c+l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c-h*d*p;break;case"XZY":this._x=h*u*c-l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this},t.setFromAxisAngle=function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},t.setFromRotationMatrix=function(e){var t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],a=t[5],s=t[9],l=t[2],u=t[6],c=t[10],h=n+a+c;if(h>0){var d=.5/Math.sqrt(h+1);this._w=.25/d,this._x=(u-s)*d,this._y=(i-l)*d,this._z=(o-r)*d}else if(n>a&&n>c){var p=2*Math.sqrt(1+n-a-c);this._w=(u-s)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(i+l)/p}else if(a>c){var f=2*Math.sqrt(1+a-n-c);this._w=(i-l)/f,this._x=(r+o)/f,this._y=.25*f,this._z=(s+u)/f}else{var m=2*Math.sqrt(1+c-n-a);this._w=(o-r)/m,this._x=(i+l)/m,this._y=(s+u)/m,this._z=.25*m}return this._onChangeCallback(),this},t.setFromUnitVectors=function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},t.angleTo=function(e){return 2*Math.acos(Math.abs(ye.clamp(this.dot(e),-1,1)))},t.rotateTowards=function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},t.identity=function(){return this.set(0,0,0,1)},t.invert=function(){return this.conjugate()},t.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},t.dot=function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},t.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},t.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},t.normalize=function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},t.multiply=function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},t.premultiply=function(e){return this.multiplyQuaternions(e,this)},t.multiplyQuaternions=function(e,t){var n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+o*a+r*l-i*s,this._y=r*u+o*s+i*a-n*l,this._z=i*u+o*l+n*s-r*a,this._w=o*u-n*a-r*s-i*l,this._onChangeCallback(),this},t.slerp=function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var l=1-t;return this._w=l*o+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var u=Math.sqrt(s),c=Math.atan2(u,a),h=Math.sin((1-t)*c)/u,d=Math.sin(t*c)/u;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=r*h+this._y*d,this._z=i*h+this._z*d,this._onChangeCallback(),this},t.equals=function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},t.fromArray=function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},t.fromBufferAttribute=function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this},t._onChange=function(e){return this._onChangeCallback=e,this},t._onChangeCallback=function(){},le(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}]),e}(),Le=function(){function e(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=n}var t=e.prototype;return t.set=function(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this},t.setScalar=function(e){return this.x=e,this.y=e,this.z=e,this},t.setX=function(e){return this.x=e,this},t.setY=function(e){return this.y=e,this},t.setZ=function(e){return this.z=e,this},t.setComponent=function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},t.getComponent=function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},t.clone=function(){return new this.constructor(this.x,this.y,this.z)},t.copy=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},t.add=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},t.addScalar=function(e){return this.x+=e,this.y+=e,this.z+=e,this},t.addVectors=function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},t.addScaledVector=function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},t.sub=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},t.subScalar=function(e){return this.x-=e,this.y-=e,this.z-=e,this},t.subVectors=function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},t.multiply=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},t.multiplyScalar=function(e){return this.x*=e,this.y*=e,this.z*=e,this},t.multiplyVectors=function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},t.applyEuler=function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Pe.setFromEuler(e))},t.applyAxisAngle=function(e,t){return this.applyQuaternion(Pe.setFromAxisAngle(e,t))},t.applyMatrix3=function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},t.applyNormalMatrix=function(e){return this.applyMatrix3(e).normalize()},t.applyMatrix4=function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this},t.applyQuaternion=function(e){var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,l=s*t+o*r-a*n,u=s*n+a*t-i*r,c=s*r+i*n-o*t,h=-i*t-o*n-a*r;return this.x=l*s+h*-i+u*-a-c*-o,this.y=u*s+h*-o+c*-i-l*-a,this.z=c*s+h*-a+l*-o-u*-i,this},t.project=function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},t.unproject=function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},t.transformDirection=function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},t.divide=function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},t.divideScalar=function(e){return this.multiplyScalar(1/e)},t.min=function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},t.max=function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},t.clamp=function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},t.clampScalar=function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},t.clampLength=function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},t.floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},t.ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},t.round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},t.roundToZero=function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},t.negate=function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},t.dot=function(e){return this.x*e.x+this.y*e.y+this.z*e.z},t.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},t.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},t.manhattanLength=function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},t.normalize=function(){return this.divideScalar(this.length()||1)},t.setLength=function(e){return this.normalize().multiplyScalar(e)},t.lerp=function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},t.lerpVectors=function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this},t.cross=function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},t.crossVectors=function(e,t){var n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},t.projectOnVector=function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},t.projectOnPlane=function(e){return Re.copy(this).projectOnVector(e),this.sub(Re)},t.reflect=function(e){return this.sub(Re.copy(e).multiplyScalar(2*this.dot(e)))},t.angleTo=function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(ye.clamp(n,-1,1))},t.distanceTo=function(e){return Math.sqrt(this.distanceToSquared(e))},t.distanceToSquared=function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},t.manhattanDistanceTo=function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},t.setFromSpherical=function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},t.setFromSphericalCoords=function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},t.setFromCylindrical=function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},t.setFromCylindricalCoords=function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},t.setFromMatrixPosition=function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},t.setFromMatrixScale=function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},t.setFromMatrixColumn=function(e,t){return this.fromArray(e.elements,4*t)},t.setFromMatrix3Column=function(e,t){return this.fromArray(e.elements,3*t)},t.equals=function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},t.fromArray=function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},t.fromBufferAttribute=function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this},t.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},e}(),Re=new Le,Pe=new Ce,De=function(){function e(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new Le(1/0,1/0,1/0),this.max=void 0!==t?t:new Le(-1/0,-1/0,-1/0)}var t=e.prototype;return t.set=function(e,t){return this.min.copy(e),this.max.copy(t),this},t.setFromArray=function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,l=e.length;si&&(i=u),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},t.setFromBufferAttribute=function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,l=e.count;si&&(i=u),c>o&&(o=c),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},t.setFromPoints=function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)},t.containsBox=function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},t.getParameter=function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Le),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},t.intersectsBox=function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)},t.intersectsSphere=function(e){return this.clampPoint(e.center,Ie),Ie.distanceToSquared(e.center)<=e.radius*e.radius},t.intersectsPlane=function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},t.intersectsTriangle=function(e){if(this.isEmpty())return!1;this.getCenter(Ge),Ve.subVectors(this.max,Ge),Fe.subVectors(e.a,Ge),Ne.subVectors(e.b,Ge),Ue.subVectors(e.c,Ge),He.subVectors(Ne,Fe),ze.subVectors(Ue,Ne),je.subVectors(Fe,Ue);var t=[0,-He.z,He.y,0,-ze.z,ze.y,0,-je.z,je.y,He.z,0,-He.x,ze.z,0,-ze.x,je.z,0,-je.x,-He.y,He.x,0,-ze.y,ze.x,0,-je.y,je.x,0];return!!Oe(t,Fe,Ne,Ue,Ve)&&!!Oe(t=[1,0,0,0,1,0,0,0,1],Fe,Ne,Ue,Ve)&&(We.crossVectors(He,ze),Oe(t=[We.x,We.y,We.z],Fe,Ne,Ue,Ve))},t.clampPoint=function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Le),t.copy(e).clamp(this.min,this.max)},t.distanceToPoint=function(e){return Ie.copy(e).clamp(this.min,this.max).sub(e).length()},t.getBoundingSphere=function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(Ie).length(),e},t.intersect=function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},t.union=function(e){return this.min.min(e.min),this.max.max(e.max),this},t.applyMatrix4=function(e){return this.isEmpty()||(ke[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ke[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ke[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ke[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ke[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ke[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ke[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ke[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ke)),this},t.translate=function(e){return this.min.add(e),this.max.add(e),this},t.equals=function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},e}();function Oe(e,t,n,r,i){for(var o=0,a=e.length-3;o<=a;o+=3){qe.fromArray(e,o);var s=i.x*Math.abs(qe.x)+i.y*Math.abs(qe.y)+i.z*Math.abs(qe.z),l=t.dot(qe),u=n.dot(qe),c=r.dot(qe);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>s)return!1}return!0}var ke=[new Le,new Le,new Le,new Le,new Le,new Le,new Le,new Le],Ie=new Le,Be=new De,Fe=new Le,Ne=new Le,Ue=new Le,He=new Le,ze=new Le,je=new Le,Ge=new Le,Ve=new Le,We=new Le,qe=new Le,Xe=new De,Ye=function(){function e(e,t){this.center=void 0!==e?e:new Le,this.radius=void 0!==t?t:-1}var t=e.prototype;return t.set=function(e,t){return this.center.copy(e),this.radius=t,this},t.setFromPoints=function(e,t){var n=this.center;void 0!==t?n.copy(t):Xe.setFromPoints(e).getCenter(n);for(var r=0,i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},t.getBoundingBox=function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new De),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)},t.applyMatrix4=function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},t.translate=function(e){return this.center.add(e),this},t.equals=function(e){return e.center.equals(this.center)&&e.radius===this.radius},e}(),Qe=new Le,Ke=new Le,Ze=new Le,Je=new Le,$e=new Le,et=new Le,tt=new Le,nt=function(){function e(e,t){this.origin=void 0!==e?e:new Le,this.direction=void 0!==t?t:new Le(0,0,-1)}var t=e.prototype;return t.set=function(e,t){return this.origin.copy(e),this.direction.copy(t),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},t.at=function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Le),t.copy(this.direction).multiplyScalar(e).add(this.origin)},t.lookAt=function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},t.recast=function(e){return this.origin.copy(this.at(e,Qe)),this},t.closestPointToPoint=function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Le),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},t.distanceToPoint=function(e){return Math.sqrt(this.distanceSqToPoint(e))},t.distanceSqToPoint=function(e){var t=Qe.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Qe.copy(this.direction).multiplyScalar(t).add(this.origin),Qe.distanceToSquared(e))},t.distanceSqToSegment=function(e,t,n,r){Ke.copy(e).add(t).multiplyScalar(.5),Ze.copy(t).sub(e).normalize(),Je.copy(this.origin).sub(Ke);var i,o,a,s,l=.5*e.distanceTo(t),u=-this.direction.dot(Ze),c=Je.dot(this.direction),h=-Je.dot(Ze),d=Je.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(o=u*c-h,s=l*p,(i=u*h-c)>=0)if(o>=-s)if(o<=s){var f=1/p;a=(i*=f)*(i+u*(o*=f)+2*c)+o*(u*i+o+2*h)+d}else o=l,a=-(i=Math.max(0,-(u*o+c)))*i+o*(o+2*h)+d;else o=-l,a=-(i=Math.max(0,-(u*o+c)))*i+o*(o+2*h)+d;else o<=-s?a=-(i=Math.max(0,-(-u*l+c)))*i+(o=i>0?-l:Math.min(Math.max(-l,-h),l))*(o+2*h)+d:o<=s?(i=0,a=(o=Math.min(Math.max(-l,-h),l))*(o+2*h)+d):a=-(i=Math.max(0,-(u*l+c)))*i+(o=i>0?l:Math.min(Math.max(-l,-h),l))*(o+2*h)+d;else o=u>0?-l:l,a=-(i=Math.max(0,-(u*o+c)))*i+o*(o+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Ze).multiplyScalar(o).add(Ke),a},t.intersectSphere=function(e,t){Qe.subVectors(e.center,this.origin);var n=Qe.dot(this.direction),r=Qe.dot(Qe)-n*n,i=e.radius*e.radius;if(r>i)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)},t.intersectsSphere=function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},t.distanceToPlane=function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},t.intersectPlane=function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},t.intersectsPlane=function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},t.intersectBox=function(e,t){var n,r,i,o,a,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),u>=0?(i=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(i=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o=0?(a=(e.min.z-h.z)*c,s=(e.max.z-h.z)*c):(a=(e.max.z-h.z)*c,s=(e.min.z-h.z)*c),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s=0?n:r,t)))},t.intersectsBox=function(e){return null!==this.intersectBox(e,Qe)},t.intersectTriangle=function(e,t,n,r,i){$e.subVectors(t,e),et.subVectors(n,e),tt.crossVectors($e,et);var o,a=this.direction.dot(tt);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Je.subVectors(this.origin,e);var s=o*this.direction.dot(et.crossVectors(Je,et));if(s<0)return null;var l=o*this.direction.dot($e.cross(Je));if(l<0)return null;if(s+l>a)return null;var u=-o*Je.dot(tt);return u<0?null:this.at(u/a,i)},t.applyMatrix4=function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},t.equals=function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)},e}(),rt=function(){function e(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}var t=e.prototype;return t.set=function(e,t,n,r,i,o,a,s,l,u,c,h,d,p,f,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=r,v[1]=i,v[5]=o,v[9]=a,v[13]=s,v[2]=l,v[6]=u,v[10]=c,v[14]=h,v[3]=d,v[7]=p,v[11]=f,v[15]=m,this},t.identity=function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},t.clone=function(){return(new e).fromArray(this.elements)},t.copy=function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},t.copyPosition=function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},t.setFromMatrix3=function(e){var t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this},t.extractBasis=function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},t.makeBasis=function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},t.extractRotation=function(e){var t=this.elements,n=e.elements,r=1/it.setFromMatrixColumn(e,0).length(),i=1/it.setFromMatrixColumn(e,1).length(),o=1/it.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},t.makeRotationFromEuler=function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){var h=o*u,d=o*c,p=a*u,f=a*c;t[0]=s*u,t[4]=-s*c,t[8]=l,t[1]=d+p*l,t[5]=h-f*l,t[9]=-a*s,t[2]=f-h*l,t[6]=p+d*l,t[10]=o*s}else if("YXZ"===e.order){var m=s*u,v=s*c,g=l*u,y=l*c;t[0]=m+y*a,t[4]=g*a-v,t[8]=o*l,t[1]=o*c,t[5]=o*u,t[9]=-a,t[2]=v*a-g,t[6]=y+m*a,t[10]=o*s}else if("ZXY"===e.order){var b=s*u,A=s*c,w=l*u,x=l*c;t[0]=b-x*a,t[4]=-o*c,t[8]=w+A*a,t[1]=A+w*a,t[5]=o*u,t[9]=x-b*a,t[2]=-o*l,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){var E=o*u,M=o*c,_=a*u,T=a*c;t[0]=s*u,t[4]=_*l-M,t[8]=E*l+T,t[1]=s*c,t[5]=T*l+E,t[9]=M*l-_,t[2]=-l,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var S=o*s,C=o*l,L=a*s,R=a*l;t[0]=s*u,t[4]=R-S*c,t[8]=L*c+C,t[1]=c,t[5]=o*u,t[9]=-a*u,t[2]=-l*u,t[6]=C*c+L,t[10]=S-R*c}else if("XZY"===e.order){var P=o*s,D=o*l,O=a*s,k=a*l;t[0]=s*u,t[4]=-c,t[8]=l*u,t[1]=P*c+k,t[5]=o*u,t[9]=D*c-O,t[2]=O*c-D,t[6]=a*u,t[10]=k*c+P}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},t.makeRotationFromQuaternion=function(e){return this.compose(at,e,st)},t.lookAt=function(e,t,n){var r=this.elements;return ct.subVectors(e,t),0===ct.lengthSq()&&(ct.z=1),ct.normalize(),lt.crossVectors(n,ct),0===lt.lengthSq()&&(1===Math.abs(n.z)?ct.x+=1e-4:ct.z+=1e-4,ct.normalize(),lt.crossVectors(n,ct)),lt.normalize(),ut.crossVectors(ct,lt),r[0]=lt.x,r[4]=ut.x,r[8]=ct.x,r[1]=lt.y,r[5]=ut.y,r[9]=ct.y,r[2]=lt.z,r[6]=ut.z,r[10]=ct.z,this},t.multiply=function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},t.premultiply=function(e){return this.multiplyMatrices(e,this)},t.multiplyMatrices=function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],b=n[11],A=n[15],w=r[0],x=r[4],E=r[8],M=r[12],_=r[1],T=r[5],S=r[9],C=r[13],L=r[2],R=r[6],P=r[10],D=r[14],O=r[3],k=r[7],I=r[11],B=r[15];return i[0]=o*w+a*_+s*L+l*O,i[4]=o*x+a*T+s*R+l*k,i[8]=o*E+a*S+s*P+l*I,i[12]=o*M+a*C+s*D+l*B,i[1]=u*w+c*_+h*L+d*O,i[5]=u*x+c*T+h*R+d*k,i[9]=u*E+c*S+h*P+d*I,i[13]=u*M+c*C+h*D+d*B,i[2]=p*w+f*_+m*L+v*O,i[6]=p*x+f*T+m*R+v*k,i[10]=p*E+f*S+m*P+v*I,i[14]=p*M+f*C+m*D+v*B,i[3]=g*w+y*_+b*L+A*O,i[7]=g*x+y*T+b*R+A*k,i[11]=g*E+y*S+b*P+A*I,i[15]=g*M+y*C+b*D+A*B,this},t.multiplyScalar=function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},t.determinant=function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],l=e[13],u=e[2],c=e[6],h=e[10],d=e[14];return e[3]*(+i*s*c-r*l*c-i*a*h+n*l*h+r*a*d-n*s*d)+e[7]*(+t*s*d-t*l*h+i*o*h-r*o*d+r*l*u-i*s*u)+e[11]*(+t*l*c-t*a*d-i*o*c+n*o*d+i*a*u-n*l*u)+e[15]*(-r*a*u-t*s*c+t*a*h+r*o*c-n*o*h+n*s*u)},t.transpose=function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},t.setPosition=function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},t.invert=function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],v=e[15],g=c*m*l-f*h*l+f*s*d-a*m*d-c*s*v+a*h*v,y=p*h*l-u*m*l-p*s*d+o*m*d+u*s*v-o*h*v,b=u*f*l-p*c*l+p*a*d-o*f*d-u*a*v+o*c*v,A=p*c*s-u*f*s-p*a*h+o*f*h+u*a*m-o*c*m,w=t*g+n*y+r*b+i*A;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var x=1/w;return e[0]=g*x,e[1]=(f*h*i-c*m*i-f*r*d+n*m*d+c*r*v-n*h*v)*x,e[2]=(a*m*i-f*s*i+f*r*l-n*m*l-a*r*v+n*s*v)*x,e[3]=(c*s*i-a*h*i-c*r*l+n*h*l+a*r*d-n*s*d)*x,e[4]=y*x,e[5]=(u*m*i-p*h*i+p*r*d-t*m*d-u*r*v+t*h*v)*x,e[6]=(p*s*i-o*m*i-p*r*l+t*m*l+o*r*v-t*s*v)*x,e[7]=(o*h*i-u*s*i+u*r*l-t*h*l-o*r*d+t*s*d)*x,e[8]=b*x,e[9]=(p*c*i-u*f*i-p*n*d+t*f*d+u*n*v-t*c*v)*x,e[10]=(o*f*i-p*a*i+p*n*l-t*f*l-o*n*v+t*a*v)*x,e[11]=(u*a*i-o*c*i-u*n*l+t*c*l+o*n*d-t*a*d)*x,e[12]=A*x,e[13]=(u*f*r-p*c*r+p*n*h-t*f*h-u*n*m+t*c*m)*x,e[14]=(p*a*r-o*f*r-p*n*s+t*f*s+o*n*m-t*a*m)*x,e[15]=(o*c*r-u*a*r+u*n*s-t*c*s-o*n*h+t*a*h)*x,this},t.scale=function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},t.getMaxScaleOnAxis=function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},t.makeTranslation=function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},t.makeRotationX=function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},t.makeRotationY=function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},t.makeRotationZ=function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},t.makeRotationAxis=function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,l=i*o,u=i*a;return this.set(l*o+n,l*a-r*s,l*s+r*a,0,l*a+r*s,u*a+n,u*s-r*o,0,l*s-r*a,u*s+r*o,i*s*s+n,0,0,0,0,1),this},t.makeScale=function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},t.makeShear=function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},t.compose=function(e,t,n){var r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,l=i+i,u=o+o,c=a+a,h=i*l,d=i*u,p=i*c,f=o*u,m=o*c,v=a*c,g=s*l,y=s*u,b=s*c,A=n.x,w=n.y,x=n.z;return r[0]=(1-(f+v))*A,r[1]=(d+b)*A,r[2]=(p-y)*A,r[3]=0,r[4]=(d-b)*w,r[5]=(1-(h+v))*w,r[6]=(m+g)*w,r[7]=0,r[8]=(p+y)*x,r[9]=(m-g)*x,r[10]=(1-(h+f))*x,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},t.decompose=function(e,t,n){var r=this.elements,i=it.set(r[0],r[1],r[2]).length(),o=it.set(r[4],r[5],r[6]).length(),a=it.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ot.copy(this);var s=1/i,l=1/o,u=1/a;return ot.elements[0]*=s,ot.elements[1]*=s,ot.elements[2]*=s,ot.elements[4]*=l,ot.elements[5]*=l,ot.elements[6]*=l,ot.elements[8]*=u,ot.elements[9]*=u,ot.elements[10]*=u,t.setFromRotationMatrix(ot),n.x=i,n.y=o,n.z=a,this},t.makePerspective=function(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),l=2*i/(n-r),u=(t+e)/(t-e),c=(n+r)/(n-r),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=l,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},t.makeOrthographic=function(e,t,n,r,i,o){var a=this.elements,s=1/(t-e),l=1/(n-r),u=1/(o-i),c=(t+e)*s,h=(n+r)*l,d=(o+i)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},t.equals=function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},t.fromArray=function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},t.toArray=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e},e}(),it=new Le,ot=new rt,at=new Le(0,0,0),st=new Le(1,1,1),lt=new Le,ut=new Le,ct=new Le,ht=function(){function e(t,n,r,i){void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=e.DefaultOrder),Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=n,this._z=r,this._order=i}var t=e.prototype;return t.set=function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},t.clone=function(){return new this.constructor(this._x,this._y,this._z,this._order)},t.copy=function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},t.setFromRotationMatrix=function(e,t,n){var r=ye.clamp,i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],u=i[5],c=i[9],h=i[2],d=i[6],p=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,u),this._z=0);break;case"YXZ":this._x=Math.asin(-r(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,u));break;case"YZX":this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,p));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this},t.setFromQuaternion=function(e,t,n){return dt.makeRotationFromQuaternion(e),this.setFromRotationMatrix(dt,t,n)},t.setFromVector3=function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},t.reorder=function(e){return pt.setFromEuler(this),this.setFromQuaternion(pt,e)},t.equals=function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},t.fromArray=function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},t.toArray=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},t.toVector3=function(e){return e?e.set(this._x,this._y,this._z):new Le(this._x,this._y,this._z)},t._onChange=function(e){return this._onChangeCallback=e,this},t._onChangeCallback=function(){},le(e,[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}]),e}();ht.DefaultOrder="XYZ",ht.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var dt=new rt,pt=new Ce,ft=function(){function e(){this.mask=1}var t=e.prototype;return t.set=function(e){this.mask=1<1){for(var t=0;t1){for(var t=0;t0){r.children=[];for(var p=0;p0){r.animations=[];for(var f=0;f0&&(n.geometries=v),g.length>0&&(n.materials=g),y.length>0&&(n.textures=y),b.length>0&&(n.images=b),A.length>0&&(n.shapes=A),w.length>0&&(n.skeletons=w),x.length>0&&(n.animations=x)}return n.object=r,n;function E(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n1?void 0:t.copy(n).multiplyScalar(i).add(e.start)},t.intersectsLine=function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},t.intersectsBox=function(e){return e.intersectsPlane(this)},t.intersectsSphere=function(e){return e.intersectsPlane(this)},t.coplanarPoint=function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Le),e.copy(this.normal).multiplyScalar(-this.constant)},t.applyMatrix4=function(e,t){var n=t||Pt.getNormalMatrix(e),r=this.coplanarPoint(Lt).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},t.translate=function(e){return this.constant-=e.dot(this.normal),this},t.equals=function(e){return e.normal.equals(this.normal)&&e.constant===this.constant},e}(),Ot=new Le,kt=new Le,It=new Le,Bt=new Le,Ft=new Le,Nt=new Le,Ut=new Le,Ht=new Le,zt=new Le,jt=new Le,Gt=function(){function e(e,t,n){this.a=void 0!==e?e:new Le,this.b=void 0!==t?t:new Le,this.c=void 0!==n?n:new Le}e.getNormal=function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Le),r.subVectors(n,t),Ot.subVectors(e,t),r.cross(Ot);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},e.getBarycoord=function(e,t,n,r,i){Ot.subVectors(r,t),kt.subVectors(n,t),It.subVectors(e,t);var o=Ot.dot(Ot),a=Ot.dot(kt),s=Ot.dot(It),l=kt.dot(kt),u=kt.dot(It),c=o*l-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Le),0===c)return i.set(-2,-1,-1);var h=1/c,d=(l*s-a*u)*h,p=(o*u-a*s)*h;return i.set(1-d-p,p,d)},e.containsPoint=function(e,t,n,r){return this.getBarycoord(e,t,n,r,Bt),Bt.x>=0&&Bt.y>=0&&Bt.x+Bt.y<=1},e.getUV=function(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,Bt),s.set(0,0),s.addScaledVector(i,Bt.x),s.addScaledVector(o,Bt.y),s.addScaledVector(a,Bt.z),s},e.isFrontFacing=function(e,t,n,r){return Ot.subVectors(n,t),kt.subVectors(e,t),Ot.cross(kt).dot(r)<0};var t=e.prototype;return t.set=function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},t.setFromPointsAndIndices=function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},t.getArea=function(){return Ot.subVectors(this.c,this.b),kt.subVectors(this.a,this.b),.5*Ot.cross(kt).length()},t.getMidpoint=function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Le),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},t.getNormal=function(t){return e.getNormal(this.a,this.b,this.c,t)},t.getPlane=function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Dt),e.setFromCoplanarPoints(this.a,this.b,this.c)},t.getBarycoord=function(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)},t.getUV=function(t,n,r,i,o){return e.getUV(t,this.a,this.b,this.c,n,r,i,o)},t.containsPoint=function(t){return e.containsPoint(t,this.a,this.b,this.c)},t.isFrontFacing=function(t){return e.isFrontFacing(this.a,this.b,this.c,t)},t.intersectsBox=function(e){return e.intersectsTriangle(this)},t.closestPointToPoint=function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Le);var n,r,i=this.a,o=this.b,a=this.c;Ft.subVectors(o,i),Nt.subVectors(a,i),Ht.subVectors(e,i);var s=Ft.dot(Ht),l=Nt.dot(Ht);if(s<=0&&l<=0)return t.copy(i);zt.subVectors(e,o);var u=Ft.dot(zt),c=Nt.dot(zt);if(u>=0&&c<=u)return t.copy(o);var h=s*c-u*l;if(h<=0&&s>=0&&u<=0)return n=s/(s-u),t.copy(i).addScaledVector(Ft,n);jt.subVectors(e,a);var d=Ft.dot(jt),p=Nt.dot(jt);if(p>=0&&d<=p)return t.copy(a);var f=d*l-s*p;if(f<=0&&l>=0&&p<=0)return r=l/(l-p),t.copy(i).addScaledVector(Nt,r);var m=u*p-d*c;if(m<=0&&c-u>=0&&d-p>=0)return Ut.subVectors(a,o),r=(c-u)/(c-u+(d-p)),t.copy(o).addScaledVector(Ut,r);var v=1/(m+f+h);return n=f*v,r=h*v,t.copy(i).addScaledVector(Ft,n).addScaledVector(Nt,r)},t.equals=function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)},e}(),Vt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Wt={h:0,s:0,l:0},qt={h:0,s:0,l:0};function Xt(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Yt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Qt(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Kt=function(){function e(e,t,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}var t=e.prototype;return t.set=function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},t.setScalar=function(e){return this.r=e,this.g=e,this.b=e,this},t.setHex=function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},t.setRGB=function(e,t,n){return this.r=e,this.g=t,this.b=n,this},t.setHSL=function(e,t,n){if(e=ye.euclideanModulo(e,1),t=ye.clamp(t,0,1),n=ye.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Xt(i,r,e+1/3),this.g=Xt(i,r,e),this.b=Xt(i,r,e-1/3)}return this},t.setStyle=function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[4]),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[4]),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return t(r[4]),this.setHSL(a,s,l)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){var u=n[1],c=u.length;if(3===c)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},t.setColorName=function(e){var t=Vt[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},t.clone=function(){return new this.constructor(this.r,this.g,this.b)},t.copy=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},t.copyGammaToLinear=function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},t.copyLinearToGamma=function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},t.convertGammaToLinear=function(e){return this.copyGammaToLinear(this,e),this},t.convertLinearToGamma=function(e){return this.copyLinearToGamma(this,e),this},t.copySRGBToLinear=function(e){return this.r=Yt(e.r),this.g=Yt(e.g),this.b=Yt(e.b),this},t.copyLinearToSRGB=function(e){return this.r=Qt(e.r),this.g=Qt(e.g),this.b=Qt(e.b),this},t.convertSRGBToLinear=function(){return this.copySRGBToLinear(this),this},t.convertLinearToSRGB=function(){return this.copyLinearToSRGB(this),this},t.getHex=function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},t.getHexString=function(){return("000000"+this.getHex().toString(16)).slice(-6)},t.getHSL=function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),l=(s+a)/2;if(s===a)t=0,n=0;else{var u=a-s;switch(n=l<=.5?u/(a+s):u/(2-a-s),a){case r:t=(i-o)/u+(i0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),o=r(e.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty($t.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),en.prototype=Object.create($t.prototype),en.prototype.constructor=en,en.prototype.isMeshBasicMaterial=!0,en.prototype.copy=function(e){return $t.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var tn=new Le,nn=new be;function rn(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=re,this.updateRange={offset:0,count:-1},this.version=0}function on(e,t,n){rn.call(this,new Int8Array(e),t,n)}function an(e,t,n){rn.call(this,new Uint8Array(e),t,n)}function sn(e,t,n){rn.call(this,new Uint8ClampedArray(e),t,n)}function ln(e,t,n){rn.call(this,new Int16Array(e),t,n)}function un(e,t,n){rn.call(this,new Uint16Array(e),t,n)}function cn(e,t,n){rn.call(this,new Int32Array(e),t,n)}function hn(e,t,n){rn.call(this,new Uint32Array(e),t,n)}function dn(e,t,n){rn.call(this,new Uint16Array(e),t,n)}function pn(e,t,n){rn.call(this,new Float32Array(e),t,n)}function fn(e,t,n){rn.call(this,new Float64Array(e),t,n)}function mn(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;nt&&(t=e[n]);return t}Object.defineProperty(rn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(rn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r65535?hn:un)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},hasAttribute:function(e){return void 0!==this.attributes[e]},addGroup:function(e,t,n){void 0===n&&(n=0),this.groups.push({start:e,count:t,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new Ae).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return bn.makeRotationX(e),this.applyMatrix4(bn),this},rotateY:function(e){return bn.makeRotationY(e),this.applyMatrix4(bn),this},rotateZ:function(e){return bn.makeRotationZ(e),this.applyMatrix4(bn),this},translate:function(e,t,n){return bn.makeTranslation(e,t,n),this.applyMatrix4(bn),this},scale:function(e,t,n){return bn.makeScale(e,t,n),this.applyMatrix4(bn),this},lookAt:function(e){return An.lookAt(e),An.updateMatrix(),this.applyMatrix4(An.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(wn).negate(),this.translate(wn.x,wn.y,wn.z),this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var o in i){var a=i[o],s=a.toJSON(e.data);""!==a.name&&(s.name=a.name),e.data.attributes[o]=s}var l={},u=!1;for(var c in this.morphAttributes){for(var h=this.morphAttributes[c],d=[],p=0,f=h.length;p0&&(l[c]=d,u=!0)}u&&(e.data.morphAttributes=l,e.data.morphTargetsRelative=this.morphTargetsRelative);var g=this.groups;g.length>0&&(e.data.groups=JSON.parse(JSON.stringify(g)));var y=this.boundingSphere;return null!==y&&(e.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),e},clone:function(){return(new _n).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var n=e.index;null!==n&&this.setIndex(n.clone(t));var r=e.attributes;for(var i in r){var o=r[i];this.setAttribute(i,o.clone(t))}var a=e.morphAttributes;for(var s in a){for(var l=[],u=a[s],c=0,h=u.length;cn.far?null:{distance:l,point:jn.clone(),object:e}}(e,t,n,r,Ln,Rn,Pn,zn);if(g){s&&(Nn.fromBufferAttribute(s,u),Un.fromBufferAttribute(s,c),Hn.fromBufferAttribute(s,h),g.uv=Gt.getUV(zn,Ln,Rn,Pn,Nn,Un,Hn,new be)),l&&(Nn.fromBufferAttribute(l,u),Un.fromBufferAttribute(l,c),Hn.fromBufferAttribute(l,h),g.uv2=Gt.getUV(zn,Ln,Rn,Pn,Nn,Un,Hn,new be));var y=new Zt(u,c,h);Gt.getNormal(Ln,Rn,Pn,y.normal),g.face=y}return g}Gn.prototype=Object.assign(Object.create(Ct.prototype),{constructor:Gn,isMesh:!0,copy:function(e){return Ct.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),Cn.copy(r.boundingSphere),Cn.applyMatrix4(o),!1!==e.ray.intersectsSphere(Cn)&&(Tn.copy(o).invert(),Sn.copy(e.ray).applyMatrix4(Tn),null===r.boundingBox||!1!==Sn.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a=r.index,s=r.attributes.position,l=r.morphAttributes.position,u=r.morphTargetsRelative,c=r.attributes.uv,h=r.attributes.uv2,d=r.groups,p=r.drawRange;if(null!==a)if(Array.isArray(i))for(var f=0,m=d.length;f0?1:-1,h.push(S.x,S.y,S.z),d.push(R/m),d.push(1-C/v),_+=1}for(var D=0;D0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},Kn.prototype=Object.assign(Object.create(Ct.prototype),{constructor:Kn,isCamera:!0,copy:function(e,t){return Ct.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Le),this.updateWorldMatrix(!0,!1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Ct.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(e,t){Ct.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Zn.prototype=Object.assign(Object.create(Kn.prototype),{constructor:Zn,isPerspectiveCamera:!0,copy:function(e,t){return Kn.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*ye.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*ye.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*ye.RAD2DEG*Math.atan(Math.tan(.5*ye.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*ye.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,t-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var l=this.filmOffset;0!==l&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){var t=Ct.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var Jn=90;function $n(e,t,n){if(Ct.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var r=new Zn(Jn,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Le(1,0,0)),this.add(r);var i=new Zn(Jn,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Le(-1,0,0)),this.add(i);var o=new Zn(Jn,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new Le(0,1,0)),this.add(o);var a=new Zn(Jn,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Le(0,-1,0)),this.add(a);var s=new Zn(Jn,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Le(0,0,1)),this.add(s);var l=new Zn(Jn,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Le(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var u=e.xr.enabled,c=e.getRenderTarget();e.xr.enabled=!1;var h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=h,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(c),e.xr.enabled=u}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function er(e,t,n,r,i,o,s,l,u,c){e=void 0!==e?e:[],t=void 0!==t?t:a,s=void 0!==s?s:S,Ee.call(this,e,t,n,r,i,o,s,l,u,c),this.flipY=!1,this._needsFlipEnvMap=!0}$n.prototype=Object.create(Ct.prototype),$n.prototype.constructor=$n,er.prototype=Object.create(Ee.prototype),er.prototype.constructor=er,er.prototype.isCubeTexture=!0,Object.defineProperty(er.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var tr=function(e){function t(t,n,r){var i;return Number.isInteger(n)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),n=r),i=e.call(this,t,t,n)||this,Object.defineProperty(ce(i),"isWebGLCubeRenderTarget",{value:!0}),n=n||{},i.texture=new er(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),i.texture._needsFlipEnvMap=!1,i}ue(t,e);var n=t.prototype;return n.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=C,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;var n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",o=new Wn(5,5,5),a=new Qn({name:"CubemapFromEquirect",uniforms:qn(n),vertexShader:r,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=t;var s=new Gn(o,a),l=t.minFilter;return t.minFilter===A&&(t.minFilter=y),new $n(1,10,this).update(e,s),t.minFilter=l,s.geometry.dispose(),s.material.dispose(),this},n.clear=function(e,t,n,r){for(var i=e.getRenderTarget(),o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,r);e.setRenderTarget(i)},t}(Te);function nr(e,t,n,r,i,o,a,s,l,u,c,h){Ee.call(this,null,o,a,s,l,u,r,i,c,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:m,this.minFilter=void 0!==u?u:m,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}nr.prototype=Object.create(Ee.prototype),nr.prototype.constructor=nr,nr.prototype.isDataTexture=!0;var rr=new Ye,ir=new Le,or=function(){function e(e,t,n,r,i,o){this.planes=[void 0!==e?e:new Dt,void 0!==t?t:new Dt,void 0!==n?n:new Dt,void 0!==r?r:new Dt,void 0!==i?i:new Dt,void 0!==o?o:new Dt]}var t=e.prototype;return t.set=function(e,t,n,r,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},t.setFromProjectionMatrix=function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],u=n[6],c=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return t[0].setComponents(a-r,c-s,f-h,y-m).normalize(),t[1].setComponents(a+r,c+s,f+h,y+m).normalize(),t[2].setComponents(a+i,c+l,f+d,y+v).normalize(),t[3].setComponents(a-i,c-l,f-d,y-v).normalize(),t[4].setComponents(a-o,c-u,f-p,y-g).normalize(),t[5].setComponents(a+o,c+u,f+p,y+g).normalize(),this},t.intersectsObject=function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),rr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(rr)},t.intersectsSprite=function(e){return rr.center.set(0,0,0),rr.radius=.7071067811865476,rr.applyMatrix4(e.matrixWorld),this.intersectsSphere(rr)},t.intersectsSphere=function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(n)0?e.max.x:e.min.x,ir.y=r.normal.y>0?e.max.y:e.min.y,ir.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ir)<0)return!1}return!0},t.containsPoint=function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0},e}();function ar(){var e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function sr(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){var o=r.get(t);(!o||o.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(\t\t0, 1,\t\t0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t\tf.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(\t1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,\t1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,\t1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},cr={common:{diffuse:{value:new Kt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ae},uv2Transform:{value:new Ae},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new be(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Kt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Kt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Ae}},sprite:{diffuse:{value:new Kt(15658734)},opacity:{value:1},center:{value:new be(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Ae}}},hr={basic:{uniforms:Xn([cr.common,cr.specularmap,cr.envmap,cr.aomap,cr.lightmap,cr.fog]),vertexShader:ur.meshbasic_vert,fragmentShader:ur.meshbasic_frag},lambert:{uniforms:Xn([cr.common,cr.specularmap,cr.envmap,cr.aomap,cr.lightmap,cr.emissivemap,cr.fog,cr.lights,{emissive:{value:new Kt(0)}}]),vertexShader:ur.meshlambert_vert,fragmentShader:ur.meshlambert_frag},phong:{uniforms:Xn([cr.common,cr.specularmap,cr.envmap,cr.aomap,cr.lightmap,cr.emissivemap,cr.bumpmap,cr.normalmap,cr.displacementmap,cr.fog,cr.lights,{emissive:{value:new Kt(0)},specular:{value:new Kt(1118481)},shininess:{value:30}}]),vertexShader:ur.meshphong_vert,fragmentShader:ur.meshphong_frag},standard:{uniforms:Xn([cr.common,cr.envmap,cr.aomap,cr.lightmap,cr.emissivemap,cr.bumpmap,cr.normalmap,cr.displacementmap,cr.roughnessmap,cr.metalnessmap,cr.fog,cr.lights,{emissive:{value:new Kt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ur.meshphysical_vert,fragmentShader:ur.meshphysical_frag},toon:{uniforms:Xn([cr.common,cr.aomap,cr.lightmap,cr.emissivemap,cr.bumpmap,cr.normalmap,cr.displacementmap,cr.gradientmap,cr.fog,cr.lights,{emissive:{value:new Kt(0)}}]),vertexShader:ur.meshtoon_vert,fragmentShader:ur.meshtoon_frag},matcap:{uniforms:Xn([cr.common,cr.bumpmap,cr.normalmap,cr.displacementmap,cr.fog,{matcap:{value:null}}]),vertexShader:ur.meshmatcap_vert,fragmentShader:ur.meshmatcap_frag},points:{uniforms:Xn([cr.points,cr.fog]),vertexShader:ur.points_vert,fragmentShader:ur.points_frag},dashed:{uniforms:Xn([cr.common,cr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ur.linedashed_vert,fragmentShader:ur.linedashed_frag},depth:{uniforms:Xn([cr.common,cr.displacementmap]),vertexShader:ur.depth_vert,fragmentShader:ur.depth_frag},normal:{uniforms:Xn([cr.common,cr.bumpmap,cr.normalmap,cr.displacementmap,{opacity:{value:1}}]),vertexShader:ur.normal_vert,fragmentShader:ur.normal_frag},sprite:{uniforms:Xn([cr.sprite,cr.fog]),vertexShader:ur.sprite_vert,fragmentShader:ur.sprite_frag},background:{uniforms:{uvTransform:{value:new Ae},t2D:{value:null}},vertexShader:ur.background_vert,fragmentShader:ur.background_frag},cube:{uniforms:Xn([cr.envmap,{opacity:{value:1}}]),vertexShader:ur.cube_vert,fragmentShader:ur.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ur.equirect_vert,fragmentShader:ur.equirect_frag},distanceRGBA:{uniforms:Xn([cr.common,cr.displacementmap,{referencePosition:{value:new Le},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ur.distanceRGBA_vert,fragmentShader:ur.distanceRGBA_frag},shadow:{uniforms:Xn([cr.lights,cr.fog,{color:{value:new Kt(0)},opacity:{value:1}}]),vertexShader:ur.shadow_vert,fragmentShader:ur.shadow_frag}};function dr(e,t,n,r,i){var o,a,s=new Kt(0),l=0,u=null,h=0,d=null;function p(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return s},setClearColor:function(e,t){void 0===t&&(t=1),s.set(e),p(s,l=t)},getClearAlpha:function(){return l},setClearAlpha:function(e){p(s,l=e)},render:function(n,i,f,m){var v=!0===i.isScene?i.background:null;v&&v.isTexture&&(v=t.get(v));var g=e.xr,y=g.getSession&&g.getSession();y&&"additive"===y.environmentBlendMode&&(v=null),null===v?p(s,l):v&&v.isColor&&(p(v,1),m=!0),(e.autoClear||m)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),v&&(v.isCubeTexture||v.isWebGLCubeRenderTarget||v.mapping===c)?(void 0===a&&((a=new Gn(new Wn(1,1,1),new Qn({name:"BackgroundCubeMaterial",uniforms:qn(hr.cube.uniforms),vertexShader:hr.cube.vertexShader,fragmentShader:hr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(a)),v.isWebGLCubeRenderTarget&&(v=v.texture),a.material.uniforms.envMap.value=v,a.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,u===v&&h===v.version&&d===e.toneMapping||(a.material.needsUpdate=!0,u=v,h=v.version,d=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null)):v&&v.isTexture&&(void 0===o&&((o=new Gn(new lr(2,2),new Qn({name:"BackgroundMaterial",uniforms:qn(hr.background.uniforms),vertexShader:hr.background.vertexShader,fragmentShader:hr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=v,!0===v.matrixAutoUpdate&&v.updateMatrix(),o.material.uniforms.uvTransform.value.copy(v.matrix),u===v&&h===v.version&&d===e.toneMapping||(o.material.needsUpdate=!0,u=v,h=v.version,d=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function pr(e,t,n,r){var i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},l=d(null),u=l;function c(t){return r.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function h(t){return r.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function d(e){for(var t=[],n=[],r=[],o=0;o=0){var y=l[h];if(void 0!==y){var b=y.normalized,A=y.itemSize,w=n.get(y);if(void 0===w)continue;var x=w.buffer,E=w.type,M=w.bytesPerElement;if(y.isInterleavedBufferAttribute){var _=y.data,T=_.stride,S=y.offset;_&&_.isInstancedInterleavedBuffer?(m(d,_.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=_.meshPerAttribute*_.count)):f(d),e.bindBuffer(34962,x),g(d,A,E,b,T*M,S*M)}else y.isInstancedBufferAttribute?(m(d,y.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=y.meshPerAttribute*y.count)):f(d),e.bindBuffer(34962,x),g(d,A,E,b,0,0)}else if("instanceMatrix"===h){var C=n.get(i.instanceMatrix);if(void 0===C)continue;var L=C.buffer,R=C.type;m(d+0,1),m(d+1,1),m(d+2,1),m(d+3,1),e.bindBuffer(34962,L),e.vertexAttribPointer(d+0,4,R,!1,64,0),e.vertexAttribPointer(d+1,4,R,!1,64,16),e.vertexAttribPointer(d+2,4,R,!1,64,32),e.vertexAttribPointer(d+3,4,R,!1,64,48)}else if("instanceColor"===h){var P=n.get(i.instanceColor);if(void 0===P)continue;var D=P.buffer,O=P.type;m(d,1),e.bindBuffer(34962,D),e.vertexAttribPointer(d,3,O,!1,12,0)}else if(void 0!==c){var k=c[h];if(void 0!==k)switch(k.length){case 2:e.vertexAttrib2fv(d,k);break;case 3:e.vertexAttrib3fv(d,k);break;case 4:e.vertexAttrib4fv(d,k);break;default:e.vertexAttrib1fv(d,k)}}}}v()}}(i,l,h,y),null!==b&&e.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){for(var e in y(),s){var t=s[e];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0!==s[e.id]){var t=s[e.id];for(var n in t){var r=t[n];for(var i in r)h(r[i].object),delete r[i];delete t[n]}delete s[e.id]}},releaseStatesOfProgram:function(e){for(var t in s){var n=s[t];if(void 0!==n[e.id]){var r=n[e.id];for(var i in r)h(r[i].object),delete r[i];delete n[e.id]}}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:v}}function fr(e,t,n,r){var i,o=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=function(r,a,s){if(0!==s){var l,u;if(o)l=e,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(l=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[u](i,r,a,s),n.update(a,i,s)}}}function mr(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var l=!0===n.logarithmicDepthBuffer,u=e.getParameter(34930),c=e.getParameter(35660),h=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),v=e.getParameter(36349),g=c>0,y=o||!!t.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:c,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:o?e.getParameter(36183):0}}function vr(e){var t=this,n=null,r=0,i=!1,o=!1,a=new Dt,s=new Ae,l={value:null,needsUpdate:!1};function u(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function c(e,n,r,i){var o=null!==e?e.length:0,u=null;if(0!==o){if(u=l.value,!0!==i||null===u){var c=r+4*o,h=n.matrixWorldInverse;s.getNormalMatrix(h),(null===u||u.length0){var s=e.getRenderList(),c=e.getRenderTarget(),h=new tr(a.height/2);return h.fromEquirectangularTexture(e,i),t.set(i,h),e.setRenderTarget(c),e.setRenderList(s),i.addEventListener("dispose",r),n(h.texture,i.mapping)}return null}}return i},dispose:function(){t=new WeakMap}}}function yr(e){var t={};function n(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(e){var t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function br(e,t,n,r){var i={},o=new WeakMap;function a(e){var s=e.target;for(var l in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[l]);s.removeEventListener("dispose",a),delete i[s.id];var u=o.get(s);u&&(t.remove(u),o.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){var n=[],r=e.index,i=e.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var l=0,u=s.length;l65535?hn:un)(n,1);b.version=a;var A=o.get(e);A&&t.remove(A),o.set(e,b)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,n.memory.geometries++),t},update:function(e){var n=e.attributes;for(var r in n)t.update(n[r],34962);var i=e.morphAttributes;for(var o in i)for(var a=i[o],s=0,l=a.length;s0)return e;var i=t*n,o=Dr[i];if(void 0===o&&(o=new Float32Array(i),Dr[i]=o),0!==t){r.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=n,e[a].toArray(o,s)}return o}function Nr(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n/gm;function Oi(e){return e.replace(Di,ki)}function ki(e,t){var n=ur[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Oi(n)}var Ii=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Bi=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Fi(e){return e.replace(Bi,Ui).replace(Ii,Ni)}function Ni(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ui(0,t,n,r)}function Ui(e,t,n,r){for(var i="",o=parseInt(t);o0?e.gammaFactor:1,x=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Li).join("\n")}(n),E=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(f),M=p.createProgram(),_=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=[E].filter(Li).join("\n")).length>0&&(i+="\n"),(o=[x,E].filter(Li).join("\n")).length>0&&(o+="\n")):(i=[Hi(n),"#define SHADER_NAME "+n.shaderName,E,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+w,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+b:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+g:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Li).join("\n"),o=[x,Hi(n),"#define SHADER_NAME "+n.shaderName,E,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+w,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+y:"",n.envMap?"#define "+b:"",n.envMap?"#define "+A:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+g:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?ur.tonemapping_pars_fragment:"",0!==n.toneMapping?Ci("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",ur.encodings_pars_fragment,n.map?Si("mapTexelToLinear",n.mapEncoding):"",n.matcap?Si("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?Si("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?Si("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?Si("lightMapTexelToLinear",n.lightMapEncoding):"",(l="linearToOutputTexel",u=n.outputEncoding,d=_i(u),"vec4 "+l+"( vec4 value ) { return LinearTo"+d[0]+d[1]+"; }"),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Li).join("\n")),m=Pi(m=Ri(m=Oi(m),n),n),v=Pi(v=Ri(v=Oi(v),n),n),m=Fi(m),v=Fi(v),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(_="#version 300 es\n",i=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,o=["#define varying in",n.glslVersion===oe?"":"out highp vec4 pc_fragColor;",n.glslVersion===oe?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);var T,S,C=_+o+v,L=Ei(p,35633,_+i+m),R=Ei(p,35632,C);if(p.attachShader(M,L),p.attachShader(M,R),void 0!==n.index0AttributeName?p.bindAttribLocation(M,0,n.index0AttributeName):!0===n.morphTargets&&p.bindAttribLocation(M,0,"position"),p.linkProgram(M),e.debug.checkShaderErrors){var P=p.getProgramInfoLog(M).trim(),D=p.getShaderInfoLog(L).trim(),O=p.getShaderInfoLog(R).trim(),k=!0,I=!0;if(!1===p.getProgramParameter(M,35714)){k=!1;var B=Ti(p,L,"vertex"),F=Ti(p,R,"fragment");console.error("THREE.WebGLProgram: shader error: ",p.getError(),"35715",p.getProgramParameter(M,35715),"gl.getProgramInfoLog",P,B,F)}else""!==P?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",P):""!==D&&""!==O||(I=!1);I&&(this.diagnostics={runnable:k,programLog:P,vertexShader:{log:D,prefix:i},fragmentShader:{log:O,prefix:o}})}return p.deleteShader(L),p.deleteShader(R),this.getUniforms=function(){return void 0===T&&(T=new xi(p,M)),T},this.getAttributes=function(){return void 0===S&&(S=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i0,maxBones:T,useVertexTexture:u,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&v.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(!1===t.isRawShaderMaterial){for(var i=0;i1&&r.sort(e||Vi),i.length>1&&i.sort(t||Wi)}}}function Xi(e){var t=new WeakMap;return{get:function(n,r){var i,o=t.get(n);return void 0===o?(i=new qi(e),t.set(n,new WeakMap),t.get(n).set(r,i)):void 0===(i=o.get(r))&&(i=new qi(e),o.set(r,i)),i},dispose:function(){t=new WeakMap}}}function Yi(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Le,color:new Kt};break;case"SpotLight":n={position:new Le,direction:new Le,color:new Kt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Le,color:new Kt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Le,skyColor:new Kt,groundColor:new Kt};break;case"RectAreaLight":n={color:new Kt,position:new Le,halfWidth:new Le,halfHeight:new Le}}return e[t.id]=n,n}}}var Qi=0;function Ki(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Zi(e,t){for(var n=new Yi,r=function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},o=0;o<9;o++)i.probe.push(new Le);var a=new Le,s=new rt,l=new rt;return{setup:function(o){for(var a=0,s=0,l=0,u=0;u<9;u++)i.probe[u].set(0,0,0);var c=0,h=0,d=0,p=0,f=0,m=0,v=0,g=0;o.sort(Ki);for(var y=0,b=o.length;y0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=cr.LTC_FLOAT_1,i.rectAreaLTC2=cr.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=cr.LTC_HALF_1,i.rectAreaLTC2=cr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=s,i.ambient[2]=l;var F=i.hash;F.directionalLength===c&&F.pointLength===h&&F.spotLength===d&&F.rectAreaLength===p&&F.hemiLength===f&&F.numDirectionalShadows===m&&F.numPointShadows===v&&F.numSpotShadows===g||(i.directional.length=c,i.spot.length=d,i.rectArea.length=p,i.point.length=h,i.hemi.length=f,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=v,i.pointShadowMap.length=v,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=v,i.spotShadowMatrix.length=g,F.directionalLength=c,F.pointLength=h,F.spotLength=d,F.rectAreaLength=p,F.hemiLength=f,F.numDirectionalShadows=m,F.numPointShadows=v,F.numSpotShadows=g,i.version=Qi++)},setupView:function(e,t){for(var n=0,r=0,o=0,u=0,c=0,h=t.matrixWorldInverse,d=0,p=e.length;d=n.get(r).length?(o=new Ji(e,t),n.get(r).push(o)):o=n.get(r)[i],o},dispose:function(){n=new WeakMap}}}function eo(e){$t.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function to(e){$t.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Le,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}eo.prototype=Object.create($t.prototype),eo.prototype.constructor=eo,eo.prototype.isMeshDepthMaterial=!0,eo.prototype.copy=function(e){return $t.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},to.prototype=Object.create($t.prototype),to.prototype.constructor=to,to.prototype.isMeshDistanceMaterial=!0,to.prototype.copy=function(e){return $t.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function no(e,t,n){var r=new or,i=new be,o=new be,a=new _e,s=[],l=[],u={},c={0:1,1:0,2:2},h=new Qn({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new be},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=h.clone();d.defines.HORIZONTAL_PASS=1;var p=new _n;p.setAttribute("position",new rn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var f=new Gn(p,h),v=this;function g(n,r){var i=t.update(f);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,h,f,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,d,f,null)}function b(e,t,n){var r=e<<0|t<<1|n<<2,i=s[r];return void 0===i&&(i=new eo({depthPacking:3201,morphTargets:e,skinning:t}),s[r]=i),i}function A(e,t,n){var r=e<<0|t<<1|n<<2,i=l[r];return void 0===i&&(i=new to({morphTargets:e,skinning:t}),l[r]=i),i}function w(t,n,r,i,o,a,s){var l=null,h=b,d=t.customDepthMaterial;if(!0===i.isPointLight&&(h=A,d=t.customDistanceMaterial),void 0===d){var p=!1;!0===r.morphTargets&&(p=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var f=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),l=h(p,f,!0===t.isInstancedMesh)}else l=d;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=l.uuid,v=r.uuid,g=u[m];void 0===g&&(g={},u[m]=g);var y=g[v];void 0===y&&(y=l.clone(),g[v]=y),l=y}return l.visible=r.visible,l.wireframe=r.wireframe,l.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:c[r.side],l.clipShadows=r.clipShadows,l.clippingPlanes=r.clippingPlanes,l.clipIntersection=r.clipIntersection,l.wireframeLinewidth=r.wireframeLinewidth,l.linewidth=r.linewidth,!0===i.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(i.matrixWorld),l.nearDistance=o,l.farDistance=a),l}function x(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var l=t.update(n),u=n.material;if(Array.isArray(u))for(var c=l.groups,h=0,d=c.length;hn||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/w.x),i.x=o.x*w.x,A.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/w.y),i.y=o.y*w.y,A.mapSize.y=o.y)),null===A.map&&!A.isPointLightShadow&&3===this.type){var E={minFilter:y,magFilter:y,format:C};A.map=new Te(i.x,i.y,E),A.map.texture.name=b.name+".shadowMap",A.mapPass=new Te(i.x,i.y,E),A.camera.updateProjectionMatrix()}if(null===A.map){var M={minFilter:m,magFilter:m,format:C};A.map=new Te(i.x,i.y,M),A.map.texture.name=b.name+".shadowMap",A.camera.updateProjectionMatrix()}e.setRenderTarget(A.map),e.clear();for(var _=A.getViewportCount(),T=0;T<_;T++){var S=A.getViewport(T);a.set(o.x*S.x,o.y*S.y,o.x*S.z,o.y*S.w),d.viewport(a),A.updateMatrices(b,T),r=A.getFrustum(),x(s,l,A.camera,b,this.type)}A.isPointLightShadow||3!==this.type||g(A,l),A.needsUpdate=!1}}else console.warn("THREE.WebGLShadowMap:",b,"has no shadow.")}v.needsUpdate=!1,e.setRenderTarget(u,c,h)}}}function ro(e,t,n){var r,o,a=n.isWebGL2;var s=new function(){var t=!1,n=new _e,r=null,i=new _e(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,o,a,s){!0===s&&(t*=a,r*=a,o*=a),n.set(t,r,o,a),!1===i.equals(n)&&(e.clearColor(t,r,o,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},l=new function(){var t=!1,n=null,r=null,i=null;return{setTest:function(e){e?B(2929):F(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},u=new function(){var t=!1,n=null,r=null,i=null,o=null,a=null,s=null,l=null,u=null;return{setTest:function(e){t||(e?B(2960):F(2960))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&o===a||(e.stencilFunc(t,n,a),r=t,i=n,o=a)},setOp:function(t,n,r){a===t&&s===n&&l===r||(e.stencilOp(t,n,r),a=t,s=n,l=r)},setLocked:function(e){t=e},setClear:function(t){u!==t&&(e.clearStencil(t),u=t)},reset:function(){t=!1,n=null,r=null,i=null,o=null,a=null,s=null,l=null,u=null}}},c={},h=null,d=null,p=null,f=null,m=null,v=null,g=null,y=null,b=null,A=!1,w=null,x=null,E=null,M=null,_=null,T=e.getParameter(35661),S=!1,C=0,L=e.getParameter(7938);-1!==L.indexOf("WebGL")?(C=parseFloat(/^WebGL (\d)/.exec(L)[1]),S=C>=1):-1!==L.indexOf("OpenGL ES")&&(C=parseFloat(/^OpenGL ES (\d)/.exec(L)[1]),S=C>=2);var R=null,P={},D=new _e,O=new _e;function k(t,n,r){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var a=0;ar||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var o=t?ye.floorPowerOfTwo:Math.floor,a=o(i*e.width),s=o(i*e.height);void 0===u&&(u=P(a,s));var l=n?P(a,s):u;return l.width=a,l.height=s,l.getContext("2d").drawImage(e,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+s+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function O(e){return ye.isPowerOfTwo(e.width)&&ye.isPowerOfTwo(e.height)}function k(e,t){return e.generateMipmaps&&t&&e.minFilter!==m&&e.minFilter!==y}function I(t,n,i,o){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function B(n,r,i){if(!1===c)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function F(e){return e===m||e===v||e===g?9728:9729}function N(t){var n=t.target;n.removeEventListener("dispose",N),function(t){var n=r.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),r.remove(t))}(n),n.isVideoTexture&&A.delete(n),a.memory.textures--}function U(t){var n=t.target;n.removeEventListener("dispose",U),function(t){var n=r.get(t),i=r.get(t.texture);if(t){if(void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)e.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[o]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}}(n),a.memory.textures--}var H=0;function z(e,t){var i=r.get(e);if(e.isVideoTexture&&function(e){var t=a.render.frame;A.get(e)!==t&&(A.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){var o=e.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void X(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function j(t,i){var a=r.get(t);t.version>0&&a.__version!==t.version?function(t,r,i){if(6===r.image.length){q(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);for(var a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),s=r.image[0]&&r.image[0].isDataTexture,l=[],u=0;u<6;u++)l[u]=a||s?s?r.image[u].image:r.image[u]:D(r.image[u],!1,!0,d);var h,p=l[0],f=O(p)||c,m=o.convert(r.format),v=o.convert(r.type),g=B(r.internalFormat,m,v);if(W(34067,r,f),a){for(var y=0;y<6;y++){h=l[y].mipmaps;for(var b=0;b1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function q(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",N),t.__webglTexture=e.createTexture(),a.memory.textures++)}function X(t,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),q(t,r),n.activeTexture(33984+i),n.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s,l=function(e){return!c&&(e.wrapS!==p||e.wrapT!==p||e.minFilter!==m&&e.minFilter!==y)}(r)&&!1===O(r.image),u=D(r.image,l,!1,f),h=O(u)||c,d=o.convert(r.format),v=o.convert(r.type),g=B(r.internalFormat,d,v);W(a,r,h);var b=r.mipmaps;if(r.isDepthTexture)g=6402,c?g=r.type===M?36012:r.type===E?33190:r.type===T?35056:33189:r.type===M&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===L&&6402===g&&r.type!==x&&r.type!==E&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=x,v=o.convert(r.type)),r.format===R&&6402===g&&(g=34041,r.type!==T&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=T,v=o.convert(r.type))),n.texImage2D(3553,0,g,u.width,u.height,0,d,v,null);else if(r.isDataTexture)if(b.length>0&&h){for(var A=0,w=b.length;A0&&h){for(var F=0,N=b.length;F=h&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+h),H+=1,e},this.resetTextureUnits=function(){H=0},this.setTexture2D=z,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?X(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?X(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=j,this.setupRenderTarget=function(t){var i=r.get(t),s=r.get(t.texture);t.addEventListener("dispose",U),s.__webglTexture=e.createTexture(),a.memory.textures++;var l=!0===t.isWebGLCubeRenderTarget,u=!0===t.isWebGLMultisampleRenderTarget,h=O(t)||c;if(!c||t.texture.format!==S||t.texture.type!==M&&t.texture.type!==_||(t.texture.format=C,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),l){i.__webglFramebuffer=[];for(var d=0;d<6;d++)i.__webglFramebuffer[d]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),u)if(c){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var p=o.convert(t.texture.format),f=o.convert(t.texture.type),m=B(t.texture.internalFormat,p,f),v=Z(t);e.renderbufferStorageMultisample(36161,v,m,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),Q(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){n.bindTexture(34067,s.__webglTexture),W(34067,t.texture,h);for(var g=0;g<6;g++)Y(i.__webglFramebuffer[g],t,36064,34069+g);k(t.texture,h)&&I(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),W(3553,t.texture,h),Y(i.__webglFramebuffer,t,36064,3553),k(t.texture,h)&&I(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&K(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(k(t,O(e)||c)){var i=e.isWebGLCubeRenderTarget?34067:3553,o=r.get(t).__webglTexture;n.bindTexture(i,o),I(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(c){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,o=t.height,a=16384;t.depthBuffer&&(a|=256),t.stencilBuffer&&(a|=1024),e.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===J&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),J=!0),e=e.texture),z(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===$&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),$=!0),e=e.texture),j(e,t)}}function oo(e,t,n){var r=n.isWebGL2;return{convert:function(e){var n;if(e===w)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(e===x)return 5123;if(1013===e)return 5124;if(e===E)return 5125;if(e===M)return 5126;if(e===_)return r?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===e)return 6406;if(e===S)return 6407;if(e===C)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(e===L)return 6402;if(e===R)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(e===P||e===D||e===O||e===k){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;if(e===P)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===D)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===O)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===k)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===I||e===B||e===F||e===N){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(e===I)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===B)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===F)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===N)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===U||e===H)&&null!==(n=t.get("WEBGL_compressed_texture_etc"))){if(e===U)return n.COMPRESSED_RGB8_ETC2;if(e===H)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:36492===e?null!==(n=t.get("EXT_texture_compression_bptc"))?e:null:e===T?r?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function ao(){Ct.call(this),this.type="Group"}function so(e){void 0===e&&(e=[]),Zn.call(this),this.cameras=e}ao.prototype=Object.assign(Object.create(Ct.prototype),{constructor:ao,isGroup:!0}),so.prototype=Object.assign(Object.create(Zn.prototype),{constructor:so,isArrayCamera:!0});var lo=new Le,uo=new Le;function co(e){var t,n,r=this,i=null,o=null,a=null,s=[],l=new rt,u=new rt,c=1,h="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(o=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",A,!1));var d=new rt,p=new Ce,f=new Le,m=new Zn;m.viewport=new _e,m.layers.enable(1);var v=new Zn;v.viewport=new _e,v.layers.enable(2);var g=new so([m,v]);g.layers.enable(1),g.layers.enable(2);var y,b=new be;function A(){if(r.isPresenting=null!==i&&!0===i.isPresenting){var o=i.getEyeParameters("left");t=2*o.renderWidth*c,n=o.renderHeight*c,y=e.getPixelRatio(),e.getSize(b),e.setDrawingBufferSize(t,n,1),m.viewport.set(0,0,t/2,n),v.viewport.set(t/2,0,t/2,n),_.start(),r.dispatchEvent({type:"sessionstart"})}else r.enabled&&e.setDrawingBufferSize(b.width,b.height,y),_.stop(),r.dispatchEvent({type:"sessionend"})}var w=[],x=[];function E(e){for(var t=navigator.getGamepads&&navigator.getGamepads(),n=0,r=t.length;n0&&Oe(o,e,t),a.length>0&&Oe(a,e,t),!0===e.isScene&&e.onAfterRender(m,e,t),null!==A&&(J.updateRenderTargetMipmap(A),J.updateMultisampleRenderTarget(A)),Y.buffers.depth.setTest(!0),Y.buffers.depth.setMask(!0),Y.buffers.color.setMask(!0),Y.setPolygonOffset(!1),we.enabled&&we.submitFrame&&we.submitFrame(),f.pop(),p=f.length>0?f[f.length-1]:null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setTexture2D=(Re=!1,function(e,t){e&&e.isWebGLRenderTarget&&(Re||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),Re=!0),e=e.texture),J.setTexture2D(e,t)}),this.setFramebuffer=function(e){g!==e&&null===A&&fe.bindFramebuffer(36160,e),g=e},this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return b},this.getRenderList=function(){return d},this.setRenderList=function(e){d=e},this.getRenderTarget=function(){return A},this.setRenderTarget=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=0),A=e,y=t,b=n,e&&void 0===Z.get(e).__webglFramebuffer&&J.setupRenderTarget(e);var r=g,i=!1;if(e){var o=Z.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=o[t],i=!0):r=e.isWebGLMultisampleRenderTarget?Z.get(e).__webglMultisampledFramebuffer:o,S.copy(e.viewport),L.copy(e.scissor),R=e.scissorTest}else S.copy(B).multiplyScalar(O).floor(),L.copy(F).multiplyScalar(O).floor(),R=N;if(x!==r&&(fe.bindFramebuffer(36160,r),x=r),Y.viewport(S),Y.scissor(L),Y.setScissorTest(R),i){var a=Z.get(e.texture);fe.framebufferTexture2D(36160,36064,34069+t,a.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,r,i,o,a){if(e&&e.isWebGLRenderTarget){var s=Z.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var l=!1;s!==x&&(fe.bindFramebuffer(36160,s),l=!0);try{var u=e.texture,c=u.format,h=u.type;if(c!==C&&de.convert(c)!==fe.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");var d=h===_&&(q.has("EXT_color_buffer_half_float")||X.isWebGL2&&q.has("EXT_color_buffer_float"));if(!(h===w||de.convert(h)===fe.getParameter(35738)||h===M&&(X.isWebGL2||q.has("OES_texture_float")||q.has("WEBGL_color_buffer_float"))||d))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===fe.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&fe.readPixels(t,n,r,i,de.convert(c),de.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&fe.bindFramebuffer(36160,x)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r),a=de.convert(t.format);J.setTexture2D(t,0),fe.copyTexImage2D(3553,n,a,e.x,e.y,i,o,0),Y.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){void 0===r&&(r=0);var i=t.image.width,o=t.image.height,a=de.convert(n.format),s=de.convert(n.type);J.setTexture2D(n,0),fe.pixelStorei(37440,n.flipY),fe.pixelStorei(37441,n.premultiplyAlpha),fe.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?fe.texSubImage2D(3553,r,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?fe.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):fe.texSubImage2D(3553,r,e.x,e.y,a,s,t.image),0===r&&n.generateMipmaps&&fe.generateMipmap(3553),Y.unbindTexture()},this.initTexture=function(e){J.setTexture2D(e,0),Y.unbindTexture()},this.resetState=function(){Y.reset(),pe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function vo(e){mo.call(this,e)}Object.assign(co.prototype,pe.prototype),Object.assign(ho.prototype,{constructor:ho,getHandSpace:function(){return null===this._hand&&(this._hand=new ao,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new ao,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new ao,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){var r=null,i=null,o=null,a=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(l&&e.hand){o=!0;for(var u,c=de(e.hand.values());!(u=c()).done;){var h=u.value,d=t.getJointPose(h,n);if(void 0===l.joints[h.jointName]){var p=new ao;p.matrixAutoUpdate=!1,p.visible=!1,l.joints[h.jointName]=p,l.add(p)}var f=l.joints[h.jointName];null!==d&&(f.matrix.fromArray(d.transform.matrix),f.matrix.decompose(f.position,f.rotation,f.scale),f.jointRadius=d.radius),f.visible=null!==d}var m=l.joints["index-finger-tip"],v=l.joints["thumb-tip"],g=m.position.distanceTo(v.position);l.inputState.pinching&&g>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&g<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&null!==(r=t.getPose(e.targetRaySpace,n))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)),null!==s&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==o),this}}),Object.assign(po.prototype,pe.prototype),vo.prototype=Object.assign(Object.create(mo.prototype),{constructor:vo,isWebGL1Renderer:!0});var go=function(){function e(e,t){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new Kt(e),this.density=void 0!==t?t:25e-5}var t=e.prototype;return t.clone=function(){return new e(this.color,this.density)},t.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},e}(),yo=function(){function e(e,t,n){Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new Kt(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}var t=e.prototype;return t.clone=function(){return new e(this.color,this.near,this.far)},t.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},e}(),bo=function(e){function t(){var t;return t=e.call(this)||this,Object.defineProperty(ce(t),"isScene",{value:!0}),t.type="Scene",t.background=null,t.environment=null,t.fog=null,t.overrideMaterial=null,t.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:ce(t)})),t}ue(t,e);var n=t.prototype;return n.copy=function(t,n){return e.prototype.copy.call(this,t,n),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},n.toJSON=function(t){var n=e.prototype.toJSON.call(this,t);return null!==this.background&&(n.object.background=this.background.toJSON(t)),null!==this.environment&&(n.object.environment=this.environment.toJSON(t)),null!==this.fog&&(n.object.fog=this.fog.toJSON()),n},t}(Ct);function Ao(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=re,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ye.generateUUID()}Object.defineProperty(Ao.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ao.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;re.far||t.push({distance:s,point:_o.clone(),uv:Gt.getUV(_o,Po,Do,Oo,ko,Io,Bo,new be),face:null,object:this})}},copy:function(e){return Ct.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});var Uo=new Le,Ho=new Le;function zo(){Ct.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}zo.prototype=Object.assign(Object.create(Ct.prototype),{constructor:zo,isLOD:!0,copy:function(e){Ct.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n0){var n,r;for(n=1,r=t.length;n0){Uo.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Uo);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){Uo.setFromMatrixPosition(e.matrixWorld),Ho.setFromMatrixPosition(this.matrixWorld);var n,r,i=Uo.distanceTo(Ho)/e.zoom;for(t[0].object.visible=!0,n=1,r=t.length;n=t[n].distance;n++)t[n-1].object.visible=!1,t[n].object.visible=!0;for(this._currentLevel=n-1;na)){c.applyMatrix4(this.matrixWorld);var b=e.ray.origin.distanceTo(c);be.far||t.push({distance:b,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else for(var A=0,w=p.count-1;Aa)){c.applyMatrix4(this.matrixWorld);var x=e.ray.origin.distanceTo(c);xe.far||t.push({distance:x,point:u.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){var t=e.morphAttributes,n=Object.keys(t);if(n.length>0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});var ca=new Le,ha=new Le;function da(e,t){ua.call(this,e,t),this.type="LineSegments"}function pa(e,t){ua.call(this,e,t),this.type="LineLoop"}function fa(e){$t.call(this),this.type="PointsMaterial",this.color=new Kt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}da.prototype=Object.assign(Object.create(ua.prototype),{constructor:da,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;ri.far)return;o.push({distance:u,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,object:a})}}function wa(e,t,n,r,i,o,a,s,l){Ee.call(this,e,t,n,r,i,o,a,s,l),this.format=void 0!==a?a:S,this.minFilter=void 0!==o?o:y,this.magFilter=void 0!==i?i:y,this.generateMipmaps=!1;var u=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){u.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function xa(e,t,n,r,i,o,a,s,l,u,c,h){Ee.call(this,null,o,a,s,l,u,r,i,c,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Ea(e,t,n,r,i,o,a,s,l){Ee.call(this,e,t,n,r,i,o,a,s,l),this.needsUpdate=!0}function Ma(e,t,n,r,i,o,a,s,l,u){if((u=void 0!==u?u:L)!==L&&u!==R)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===L&&(n=x),void 0===n&&u===R&&(n=T),Ee.call(this,null,r,i,o,a,s,u,n,l),this.image={width:e,height:t},this.magFilter=void 0!==a?a:m,this.minFilter=void 0!==s?s:m,this.flipY=!1,this.generateMipmaps=!1}ba.prototype=Object.assign(Object.create(Ct.prototype),{constructor:ba,isPoints:!0,copy:function(e){return Ct.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),ga.copy(n.boundingSphere),ga.applyMatrix4(r),ga.radius+=i,!1!==e.ray.intersectsSphere(ga)){ma.copy(r).invert(),va.copy(e.ray).applyMatrix4(ma);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){var s=n.index,l=n.attributes.position;if(null!==s)for(var u=s.array,c=0,h=u.length;c0){var r=t[n[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var i=0,o=r.length;i0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),wa.prototype=Object.assign(Object.create(Ee.prototype),{constructor:wa,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){var e=this.image;0=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),xa.prototype=Object.create(Ee.prototype),xa.prototype.constructor=xa,xa.prototype.isCompressedTexture=!0,Ea.prototype=Object.create(Ee.prototype),Ea.prototype.constructor=Ea,Ea.prototype.isCanvasTexture=!0,Ma.prototype=Object.create(Ee.prototype),Ma.prototype.constructor=Ma,Ma.prototype.isDepthTexture=!0;var _a=function(e){function t(t,n,r,i){var o;void 0===t&&(t=1),void 0===n&&(n=8),void 0===r&&(r=0),void 0===i&&(i=2*Math.PI),(o=e.call(this)||this).type="CircleGeometry",o.parameters={radius:t,segments:n,thetaStart:r,thetaLength:i},n=Math.max(3,n);var a=[],s=[],l=[],u=[],c=new Le,h=new be;s.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(var d=0,p=3;d<=n;d++,p+=3){var f=r+d/n*i;c.x=t*Math.cos(f),c.y=t*Math.sin(f),s.push(c.x,c.y,c.z),l.push(0,0,1),h.x=(s[p]/t+1)/2,h.y=(s[p+1]/t+1)/2,u.push(h.x,h.y)}for(var m=1;m<=n;m++)a.push(m,m+1,0);return o.setIndex(a),o.setAttribute("position",new pn(s,3)),o.setAttribute("normal",new pn(l,3)),o.setAttribute("uv",new pn(u,2)),o}return ue(t,e),t}(_n),Ta=function(e){function t(t,n,r,i,o,a,s,l){var u;void 0===t&&(t=1),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=8),void 0===o&&(o=1),void 0===a&&(a=!1),void 0===s&&(s=0),void 0===l&&(l=2*Math.PI),(u=e.call(this)||this).type="CylinderGeometry",u.parameters={radiusTop:t,radiusBottom:n,height:r,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:l};var c=ce(u);i=Math.floor(i),o=Math.floor(o);var h=[],d=[],p=[],f=[],m=0,v=[],g=r/2,y=0;function b(e){for(var r=m,o=new be,a=new Le,u=0,v=!0===e?t:n,b=!0===e?1:-1,A=1;A<=i;A++)d.push(0,g*b,0),p.push(0,b,0),f.push(.5,.5),m++;for(var w=m,x=0;x<=i;x++){var E=x/i*l+s,M=Math.cos(E),_=Math.sin(E);a.x=v*_,a.y=g*b,a.z=v*M,d.push(a.x,a.y,a.z),p.push(0,b,0),o.x=.5*M+.5,o.y=.5*_*b+.5,f.push(o.x,o.y),m++}for(var T=0;T0&&b(!0),n>0&&b(!1)),u.setIndex(h),u.setAttribute("position",new pn(d,3)),u.setAttribute("normal",new pn(p,3)),u.setAttribute("uv",new pn(f,2)),u}return ue(t,e),t}(_n),Sa=function(e){function t(t,n,r,i,o,a,s){var l;return void 0===t&&(t=1),void 0===n&&(n=1),void 0===r&&(r=8),void 0===i&&(i=1),void 0===o&&(o=!1),void 0===a&&(a=0),void 0===s&&(s=2*Math.PI),(l=e.call(this,0,t,n,r,i,o,a,s)||this).type="ConeGeometry",l.parameters={radius:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},l}return ue(t,e),t}(Ta),Ca=function(e){function t(t,n,r,i){var o;void 0===r&&(r=1),void 0===i&&(i=0),(o=e.call(this)||this).type="PolyhedronGeometry",o.parameters={vertices:t,indices:n,radius:r,detail:i};var a=[],s=[];function l(e,t,n,r){for(var i=r+1,o=[],a=0;a<=i;a++){o[a]=[];for(var s=e.clone().lerp(n,a/i),l=t.clone().lerp(n,a/i),c=i-a,h=0;h<=c;h++)o[a][h]=0===h&&a===i?s:s.clone().lerp(l,h/c)}for(var d=0;d.9&&o<.1&&(t<.2&&(s[e+0]+=1),n<.2&&(s[e+2]+=1),r<.2&&(s[e+4]+=1))}}()}(),o.setAttribute("position",new pn(a,3)),o.setAttribute("normal",new pn(a.slice(),3)),o.setAttribute("uv",new pn(s,2)),0===i?o.computeVertexNormals():o.normalizeNormals(),o}return ue(t,e),t}(_n),La=function(e){function t(t,n){var r;void 0===t&&(t=1),void 0===n&&(n=0);var i=(1+Math.sqrt(5))/2,o=1/i,a=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-o,-i,0,-o,i,0,o,-i,0,o,i,-o,-i,0,-o,i,0,o,-i,0,o,i,0,-i,0,-o,i,0,-o,-i,0,o,i,0,o];return(r=e.call(this,a,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,n)||this).type="DodecahedronGeometry",r.parameters={radius:t,detail:n},r}return ue(t,e),t}(Ca),Ra=new Le,Pa=new Le,Da=new Le,Oa=new Gt,ka=function(e){function t(t,n){var r;if((r=e.call(this)||this).type="EdgesGeometry",r.parameters={thresholdAngle:n},n=void 0!==n?n:1,!0===t.isGeometry)return console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),ce(r);for(var i=Math.pow(10,4),o=Math.cos(ye.DEG2RAD*n),a=t.getIndex(),s=t.getAttribute("position"),l=a?a.count:s.count,u=[0,0,0],c=["a","b","c"],h=new Array(3),d={},p=[],f=0;f80*n){r=o=e[0],i=a=e[1];for(var f=n;fo&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-r,a-i))?1/u:0}return Na(d,p,n,r,i,u),p};function Ba(e,t,n,r,i){var o,a;if(i===function(e,t,n,r){for(var i=0,o=t,a=n-r;o0)for(o=t;o=t;o-=r)a=rs(o,e[o],e[o+1],a);return a&&Za(a,a.next)&&(is(a),a=a.next),a}function Fa(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Za(r,r.next)&&0!==Ka(r.prev,r,r.next))r=r.next;else{if(is(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Na(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=qa(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,u=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1)}(i)}(e,r,i,o);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?Ha(e,r,i,o):Ua(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),is(e),e=l.next,u=l.next;else if((e=l)===u){a?1===a?Na(e=za(Fa(e),t,n),t,n,r,i,o,2):2===a&&ja(e,t,n,r,i,o):Na(Fa(e),t,n,r,i,o,1);break}}}function Ua(e){var t=e.prev,n=e,r=e.next;if(Ka(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Ya(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ka(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ha(e,t,n,r){var i=e.prev,o=e,a=e.next;if(Ka(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=qa(s,l,t,n,r),d=qa(u,c,t,n,r),p=e.prevZ,f=e.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&Ya(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ka(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&Ya(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ka(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&Ya(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ka(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Ya(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ka(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function za(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!Za(i,o)&&Ja(i,r,r.next,o)&&ts(i,o)&&ts(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),is(r),is(r.next),r=e=o),r=r.next}while(r!==e);return Fa(r)}function ja(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Qa(a,s)){var l=ns(a,s);return a=Fa(a,a.next),l=Fa(l,l.next),Na(a,t,n,r,i,o),void Na(l,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function Ga(e,t){return e.x-t.x}function Va(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=c&&i!==r.x&&Ya(on.x||r.x===n.x&&Wa(n,r)))&&(n=r,d=l)),r=r.next}while(r!==u);return n}(e,t)){var n=ns(t,e);Fa(t,t.next),Fa(n,n.next)}}function Wa(e,t){return Ka(e.prev,e,t.prev)<0&&Ka(t.next,e,e.next)<0}function qa(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Xa(e){var t=e,n=e;do{(t.x=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Qa(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Ja(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(ts(e,t)&&ts(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Ka(e.prev,e,t.prev)||Ka(e,t.prev,t))||Za(e,t)&&Ka(e.prev,e,e.next)>0&&Ka(t.prev,t,t.next)>0)}function Ka(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Za(e,t){return e.x===t.x&&e.y===t.y}function Ja(e,t,n,r){var i=es(Ka(e,t,n)),o=es(Ka(e,t,r)),a=es(Ka(n,r,e)),s=es(Ka(n,r,t));return i!==o&&a!==s||!(0!==i||!$a(e,n,t))||!(0!==o||!$a(e,r,t))||!(0!==a||!$a(n,e,r))||!(0!==s||!$a(n,t,r))}function $a(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function es(e){return e>0?1:e<0?-1:0}function ts(e,t){return Ka(e.prev,e,e.next)<0?Ka(e,t,e.next)>=0&&Ka(e,e.prev,t)>=0:Ka(e,t,e.prev)<0||Ka(e,e.next,t)<0}function ns(e,t){var n=new os(e.i,e.x,e.y),r=new os(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function rs(e,t,n,r){var i=new os(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function is(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function os(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var as={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function ls(e,t){for(var n=0;nNumber.EPSILON){var d=Math.sqrt(c),p=Math.sqrt(l*l+u*u),f=t.x-s/d,m=t.y+a/d,v=((n.x-u/p-f)*u-(n.y+l/p-m)*l)/(a*u-s*l),g=(r=f+a*v-e.x)*r+(i=m+s*v-e.y)*i;if(g<=2)return new be(r,i);o=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),y?(r=-s,i=a,o=Math.sqrt(c)):(r=a,i=s,o=Math.sqrt(c/2))}return new be(r/o,i/o)}for(var F=[],N=0,U=L.length,H=U-1,z=N+1;N=0;ge--){for(var ye=ge/p,Ae=c*Math.cos(ye*Math.PI/2),we=h*Math.sin(ye*Math.PI/2)+d,xe=0,Ee=L.length;xe=0;){var r=n,i=n-1;i<0&&(i=e.length-1);for(var o=0,a=s+2*p;o=0?(e(g-s,m,c),h.subVectors(u,c)):(e(g+s,m,c),h.subVectors(c,u)),m-s>=0?(e(g,m-s,c),d.subVectors(u,c)):(e(g,m+s,c),d.subVectors(c,u)),l.crossVectors(h,d).normalize(),o.push(l.x,l.y,l.z),a.push(g,m)}for(var y=0;y0)&&f.push(T,S,L),(M!==r-1||u=r)){c.push(l.times[d]);for(var f=0;fo.tracks[v].times[0]&&(m=o.tracks[v].times[0]);for(var g=0;g=r.times[h]){var m=h*l+s,v=m+l-s;d=Bs.arraySlice(r.values,m,v)}else{var g=r.createInterpolant(),y=s,b=l-s;g.evaluate(o),d=Bs.arraySlice(g.resultBuffer,y,b)}"quaternion"===i&&(new Ce).fromArray(d).normalize().conjugate().toArray(d);for(var A=a.times.length,w=0;w=i)break e;var s=t[1];e=(i=t[--n-1]))break t}o=n,n=0}for(;n>>1;et;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Bs.arraySlice(n,i,o),this.values=Bs.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==r&&Bs.isTypedArray(r))for(var l=0,u=r.length;l!==u;++l){var c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e},optimize:function(){for(var e=Bs.arraySlice(this.times),t=Bs.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===G,i=e.length-1,o=1,a=1;a0){e[o]=e[i];for(var g=i*n,y=o*n,b=0;b!==n;++b)t[y+b]=t[g+b];++o}return o!==e.length?(this.times=Bs.arraySlice(e,0,o),this.values=Bs.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this},clone:function(){var e=Bs.arraySlice(this.times,0),t=Bs.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),js.prototype=Object.assign(Object.create(zs.prototype),{constructor:js,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:z,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Gs.prototype=Object.assign(Object.create(zs.prototype),{constructor:Gs,ValueTypeName:"color"}),Vs.prototype=Object.assign(Object.create(zs.prototype),{constructor:Vs,ValueTypeName:"number"}),Ws.prototype=Object.assign(Object.create(Fs.prototype),{constructor:Ws,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-t)/(r-t),l=e*a,u=l+a;l!==u;l+=4)Ce.slerpFlat(i,0,o,l-a,o,l,s);return i}}),qs.prototype=Object.assign(Object.create(zs.prototype),{constructor:qs,ValueTypeName:"quaternion",DefaultInterpolation:j,InterpolantFactoryMethodLinear:function(e){return new Ws(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Xs.prototype=Object.assign(Object.create(zs.prototype),{constructor:Xs,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:z,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ys.prototype=Object.assign(Object.create(zs.prototype),{constructor:Ys,ValueTypeName:"vector"}),Object.assign(Qs,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,o=n.length;i!==o;++i)t.push(Ks(n[i]).scale(r));var a=new Qs(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode},i=0,o=n.length;i!==o;++i)t.push(zs.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,o=[],a=0;a1){var u=l[1],c=r[u];c||(r[u]=c=[]),c.push(s)}}var h=[];for(var d in r)h.push(Qs.CreateFromMorphTargetSequence(d,r[d],t,n));return h},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var o=[],a=[];Bs.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode,s=e.length||-1,l=e.hierarchy||[],u=0;u0||0===e.search(/^data\:image\/jpeg/);i.format=r?S:C,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(ul.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n=[],r=this.getPoint(0),i=0;n.push(0);for(var o=1;o<=e;o++)i+=(t=this.getPoint(o/e)).distanceTo(r),n.push(i),r=t;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,l=o-1;s<=l;)if((a=r[i=Math.floor(s+(l-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(r[i=l]===n)return i/(o-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(o-1)},getTangent:function(e,t){var n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);var o=this.getPoint(r),a=this.getPoint(i),s=t||(o.isVector2?new be:new Le);return s.copy(a).sub(o).normalize(),s},getTangentAt:function(e,t){var n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){for(var n=new Le,r=[],i=[],o=[],a=new Le,s=new rt,l=0;l<=e;l++){var u=l/e;r[l]=this.getTangentAt(u,new Le),r[l].normalize()}i[0]=new Le,o[0]=new Le;var c=Number.MAX_VALUE,h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=c&&(c=h,n.set(1,0,0)),d<=c&&(c=d,n.set(0,1,0)),p<=c&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(var f=1;f<=e;f++){if(i[f]=i[f-1].clone(),o[f]=o[f-1].clone(),a.crossVectors(r[f-1],r[f]),a.length()>Number.EPSILON){a.normalize();var m=Math.acos(ye.clamp(r[f-1].dot(r[f]),-1,1));i[f].applyMatrix4(s.makeRotationAxis(a,m))}o[f].crossVectors(r[f],i[f])}if(!0===t){var v=Math.acos(ye.clamp(i[0].dot(i[e]),-1,1));v/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(v=-v);for(var g=1;g<=e;g++)i[g].applyMatrix4(s.makeRotationAxis(r[g],v*g)),o[g].crossVectors(r[g],i[g])}return{tangents:r,normals:i,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),cl.prototype=Object.create(ul.prototype),cl.prototype.constructor=cl,cl.prototype.isEllipseCurve=!0,cl.prototype.getPoint=function(e,t){for(var n=t||new be,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(l)/a)+1)*a:0===u&&l===a-1&&(l=a-2,u=1),this.closed||l>0?n=o[(l-1)%a]:(pl.subVectors(o[0],o[1]).add(o[0]),n=pl);var c=o[l%a],h=o[(l+1)%a];if(this.closed||l+2r.length-2?r.length-1:o+1],c=r[o>r.length-3?r.length-1:o+2];return n.set(yl(a,s.x,l.x,u.x,c.x),yl(a,s.y,l.y,u.y,c.y)),n},Sl.prototype.copy=function(e){ul.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t=t){var i=n[r]-t,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){ul.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t0){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(e){return Ll.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Ll.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Ll.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Pl.prototype=Object.assign(Object.create(Rl.prototype),{constructor:Pl,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var i in e.uniforms){var o=e.uniforms[i];switch(r.uniforms[i]={},o.type){case"t":r.uniforms[i].value=n(o.value);break;case"c":r.uniforms[i].value=(new Kt).setHex(o.value);break;case"v2":r.uniforms[i].value=(new be).fromArray(o.value);break;case"v3":r.uniforms[i].value=(new Le).fromArray(o.value);break;case"v4":r.uniforms[i].value=(new _e).fromArray(o.value);break;case"m3":r.uniforms[i].value=(new Ae).fromArray(o.value);break;case"m4":r.uniforms[i].value=(new rt).fromArray(o.value);break;default:r.uniforms[i].value=o.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var a in e.extensions)r.extensions[a]=e.extensions[a];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new be).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new be).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r},setTextures:function(e){return this.textures=e,this}});var Xl={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n0){var a=new Js(t);(n=new ol(a)).setCrossOrigin(this.crossOrigin);for(var s=0,l=e.length;sNumber.EPSILON){if(u<0&&(a=t[o],l=-l,s=t[i],u=-u),e.ys.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var c=u*(e.x-a.x)-l*(e.y-a.y);if(0===c)return!0;if(c<0)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var i,o,a,s=as.isClockWise,l=this.subPaths;if(0===l.length)return[];if(!0===t)return n(l);var u=[];if(1===l.length)return o=l[0],(a=new Pl).curves=o.curves,u.push(a),u;var c=!s(l[0].getPoints());c=e?!c:c;var h,d,p=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=l.length;g1){for(var b=!1,A=[],w=0,x=f.length;w0&&(b||(m=p))}for(var R=0,P=f.length;R0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(var l=t,u=t+t;l!==u;++l)if(n[l]!==n[l+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(var i=n,o=r;i!==o;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize,n=e;n=.5)for(var o=0;o!==i;++o)e[t+o]=e[n+o]},_slerp:function(e,t,n,r){Ce.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){var o=this._workIndex*i;Ce.multiplyQuaternionsFlat(e,o,e,t,e,n),Ce.slerpFlat(e,t,e,t,e,o,r)},_lerp:function(e,t,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[n+a]*r}},_lerpAdditive:function(e,t,n,r,i){for(var o=0;o!==i;++o){var a=t+o;e[a]=e[a]+e[n+o]*r}}});var Lu="\\[\\]\\.:\\/",Ru=new RegExp("[\\[\\]\\.:\\/]","g"),Pu="[^\\[\\]\\.:\\/]",Du="[^"+Lu.replace("\\.","")+"]",Ou=/((?:WC+[\/:])*)/.source.replace("WC",Pu),ku=/(WCOD+)?/.source.replace("WCOD",Du),Iu=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Pu),Bu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Pu),Fu=new RegExp("^"+Ou+ku+Iu+Bu+"$"),Nu=["material","materials","bones"];function Uu(e,t,n){var r=n||Hu.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Hu(e,t,n){this.path=t,this.parsedPath=n||Hu.parseTrackName(t),this.node=Hu.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function zu(){this.uuid=ye.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}Object.assign(Uu.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(Hu,{Composite:Uu,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Hu.Composite(e,t,n):new Hu(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Ru,"")},parseTrackName:function(e){var t=Fu.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==Nu.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function e(n){for(var r=0;r=i){var c=i++,h=e[c];t[h.uuid]=u,e[u]=h,t[l]=c,e[c]=s;for(var d=0,p=r;d!==p;++d){var f=n[d],m=f[c],v=f[u];f[u]=m,f[c]=v}}}this.nCachedObjects_=i},uncache:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,o=e.length,a=0,s=arguments.length;a!==s;++a){var l=arguments[a].uuid,u=t[l];if(void 0!==u)if(delete t[l],u0&&(t[A.uuid]=u),e[u]=A,e.pop();for(var w=0,x=r;w!==x;++w){var E=n[w];E[u]=E[b],E.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,l=s.length,u=this.nCachedObjects_,c=new Array(l);r=i.length,n[e]=r,o.push(e),a.push(t),i.push(c);for(var h=u,d=s.length;h!==d;++h){var p=s[h];c[h]=new Hu(p,e,t)}return c},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];t[e[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}});var ju=function(){function e(e,t,n,r){void 0===n&&(n=null),void 0===r&&(r=t.blendMode),this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;for(var i=t.tracks,o=i.length,a=new Array(o),s={endingStart:V,endingEnd:V},l=0;l!==o;++l){var u=i[l].createInterpolant(null);a[l]=u,u.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}var t=e.prototype;return t.play=function(){return this._mixer._activateAction(this),this},t.stop=function(){return this._mixer._deactivateAction(this),this.reset()},t.reset=function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},t.isRunning=function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},t.isScheduled=function(){return this._mixer._isActiveAction(this)},t.startAt=function(e){return this._startTime=e,this},t.setLoop=function(e,t){return this.loop=e,this.repetitions=t,this},t.setEffectiveWeight=function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},t.getEffectiveWeight=function(){return this._effectiveWeight},t.fadeIn=function(e){return this._scheduleFading(e,0,1)},t.fadeOut=function(e){return this._scheduleFading(e,1,0)},t.crossFadeFrom=function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,o=i/r,a=r/i;e.warp(1,o,t),this.warp(a,1,t)}return this},t.crossFadeTo=function(e,t,n){return e.crossFadeFrom(this,t,n)},t.stopFading=function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},t.setEffectiveTimeScale=function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},t.getEffectiveTimeScale=function(){return this._effectiveTimeScale},t.setDuration=function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},t.syncWith=function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},t.halt=function(e){return this.warp(this._effectiveTimeScale,0,e)},t.warp=function(e,t,n){var r=this._mixer,i=r.time,o=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/o,l[1]=t/o,this},t.stopWarping=function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},t.getMixer=function(){return this._mixer},t.getClip=function(){return this._clip},t.getRoot=function(){return this._localRoot||this._mixer._root},t._update=function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(e-i)*n;if(o<0||0===n)return;this._startTime=null,t=n*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0){var l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case Y:for(var c=0,h=l.length;c!==h;++c)l[c].evaluate(a),u[c].accumulateAdditive(s);break;case X:default:for(var d=0,p=l.length;d!==p;++d)l[d].evaluate(a),u[d].accumulate(r,s)}}}else this._updateWeight(e)},t._updateWeight=function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},t._updateTimeScale=function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t},t._updateTime=function(e){var t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,o=2202===n;if(0===e)return-1===i?r:o&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=t||r<0){var a=Math.floor(r/t);r-=t*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&1==(1&i))return t-r}return r},t._setEndings=function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=W,r.endingEnd=W):(r.endingStart=e?this.zeroSlopeAtStart?W:V:q,r.endingEnd=t?this.zeroSlopeAtEnd?W:V:q)},t._scheduleFading=function(e,t,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this},e}();function Gu(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Gu.prototype=Object.assign(Object.create(pe.prototype),{constructor:Gu,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,u=l[s];void 0===u&&(u={},l[s]=u);for(var c=0;c!==i;++c){var h=r[c],d=h.name,p=u[d];if(void 0!==p)o[c]=p;else{if(void 0!==(p=o[c])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=t&&t._propertyBindings[c].binding.parsedPath;++(p=new Cu(Hu.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),o[c]=p}a[c].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1,a=0;a!==n;++a)t[a]._update(r,e,i,o);for(var s=this._bindings,l=this._nActiveBindings,u=0;u!==l;++u)s[u].apply(o);return this},setTime:function(e){this.time=0;for(var t=0;tthis.max.x||e.ythis.max.y)},t.containsBox=function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},t.getParameter=function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new be),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},t.intersectsBox=function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)},t.clampPoint=function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new be),t.copy(e).clamp(this.min,this.max)},t.distanceToPoint=function(e){return Ju.copy(e).clamp(this.min,this.max).sub(e).length()},t.intersect=function(e){return this.min.max(e.min),this.max.min(e.max),this},t.union=function(e){return this.min.min(e.min),this.max.max(e.max),this},t.translate=function(e){return this.min.add(e),this.max.add(e),this},t.equals=function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},e}(),ec=new Le,tc=new Le,nc=function(){function e(e,t){this.start=void 0!==e?e:new Le,this.end=void 0!==t?t:new Le}var t=e.prototype;return t.set=function(e,t){return this.start.copy(e),this.end.copy(t),this},t.clone=function(){return(new this.constructor).copy(this)},t.copy=function(e){return this.start.copy(e.start),this.end.copy(e.end),this},t.getCenter=function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Le),e.addVectors(this.start,this.end).multiplyScalar(.5)},t.delta=function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Le),e.subVectors(this.end,this.start)},t.distanceSq=function(){return this.start.distanceToSquared(this.end)},t.distance=function(){return this.start.distanceTo(this.end)},t.at=function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Le),this.delta(t).multiplyScalar(e).add(this.start)},t.closestPointToPointParameter=function(e,t){ec.subVectors(e,this.start),tc.subVectors(this.end,this.start);var n=tc.dot(tc),r=tc.dot(ec)/n;return t&&(r=ye.clamp(r,0,1)),r},t.closestPointToPoint=function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Le),this.delta(n).multiplyScalar(r).add(this.start)},t.applyMatrix4=function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},t.equals=function(e){return e.start.equals(this.start)&&e.end.equals(this.end)},e}();function rc(e){Ct.call(this),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}rc.prototype=Object.create(Ct.prototype),rc.prototype.constructor=rc,rc.prototype.isImmediateRenderObject=!0;var ic=new Le,oc=function(e){function t(t,n){var r;(r=e.call(this)||this).light=t,r.light.updateMatrixWorld(),r.matrix=t.matrixWorld,r.matrixAutoUpdate=!1,r.color=n;for(var i=new _n,o=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],a=0,s=1;a<32;a++,s++){var l=a/32*Math.PI*2,u=s/32*Math.PI*2;o.push(Math.cos(l),Math.sin(l),1,Math.cos(u),Math.sin(u),1)}i.setAttribute("position",new pn(o,3));var c=new ra({fog:!1,toneMapped:!1});return r.cone=new da(i,c),r.add(r.cone),r.update(),r}ue(t,e);var n=t.prototype;return n.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},n.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),ic.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ic),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)},t}(Ct),ac=new Le,sc=new rt,lc=new rt,uc=function(e){function t(t){for(var n,r=cc(t),i=new _n,o=[],a=[],s=new Kt(0,0,1),l=new Kt(0,1,0),u=0;u.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Oc.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Oc,t)}},n.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},n.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},n.copy=function(t){return e.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},t}(Ct),Ic=function(e){function t(t){var n;void 0===t&&(t=1);var r=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new _n;i.setAttribute("position",new pn(r,3)),i.setAttribute("color",new pn([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var o=new ra({vertexColors:!0,toneMapped:!1});return(n=e.call(this,i,o)||this).type="AxesHelper",n}return ue(t,e),t}(da),Bc=new Float32Array(1),Fc=new Int32Array(Bc.buffer),Nc={toHalfFloat:function(e){Bc[0]=e;var t=Fc[0],n=t>>16&32768,r=t>>12&2047,i=t>>23&255;return i<103?n:i>142?(n|=31744,n|=(255==i?0:1)&&8388607&t):i<113?n|=((r|=2048)>>114-i)+(r>>113-i&1):(n|=i-112<<10|r>>1,n+=1&r)}},Uc=Math.pow(2,8),Hc=[.125,.215,.35,.446,.526,.582],zc=5+Hc.length,jc=20,Gc=((Cc={})[3e3]=0,Cc[3001]=1,Cc[3002]=2,Cc[3004]=3,Cc[3005]=4,Cc[3006]=5,Cc[3007]=6,Cc),Vc=new en({side:1,depthWrite:!1,depthTest:!1}),Wc=new Gn(new Wn,Vc),qc=new Ul,Xc=oh(),Yc=Xc._lodPlanes,Qc=Xc._sizeLods,Kc=Xc._sigmas,Zc=new Kt,Jc=null,$c=(1+Math.sqrt(5))/2,eh=1/$c,th=[new Le(1,1,1),new Le(-1,1,1),new Le(1,1,-1),new Le(-1,1,-1),new Le(0,$c,eh),new Le(0,$c,-eh),new Le(eh,0,$c),new Le(-eh,0,$c),new Le($c,eh,0),new Le(-$c,eh,0)];function nh(e){var t=Math.max(e.r,e.g,e.b),n=Math.min(Math.max(Math.ceil(Math.log2(t)),-128),127);return e.multiplyScalar(Math.pow(2,-n)),(n+128)/255}var rh=function(){function e(e){var t;this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=new Ts({name:"SphericalGaussianBlur",defines:{n:t=jc},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(t)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new Le(0,1,0)},inputEncoding:{value:Gc[3e3]},outputEncoding:{value:Gc[3e3]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1}),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}var t=e.prototype;return t.fromScene=function(e,t,n,r){void 0===t&&(t=0),void 0===n&&(n=.1),void 0===r&&(r=100),Jc=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i},t.fromEquirectangular=function(e){return this._fromTexture(e)},t.fromCubemap=function(e){return this._fromTexture(e)},t.compileCubemapShader=function(){null===this._cubemapShader&&(this._cubemapShader=uh(),this._compileMaterial(this._cubemapShader))},t.compileEquirectangularShader=function(){null===this._equirectShader&&(this._equirectShader=lh(),this._compileMaterial(this._equirectShader))},t.dispose=function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var e=0;e2?Uc:0,Uc,Uc),s.setRenderTarget(r),h&&s.render(Wc,i),s.render(e,i)}s.toneMapping=c,s.outputEncoding=u,s.autoClear=l},t._textureToCubeUV=function(e,t){var n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=uh()):null==this._equirectShader&&(this._equirectShader=lh());var r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new Gn(Yc[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=Gc[e.encoding],o.outputEncoding.value=Gc[t.texture.encoding],sh(t,0,0,3*Uc,2*Uc),n.setRenderTarget(t),n.render(i,qc)},t._applyPMREM=function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var r=1;rjc&&console.warn("sigmaRadians, "+i+", is too large and will clip, as it requested "+f+" samples when the maximum is set to "+jc);for(var m=[],v=0,g=0;g4?r-8+4:0),3*w,2*w),s.setRenderTarget(t),s.render(u,qc)},e}();function ih(e){return void 0!==e&&e.type===w&&(e.encoding===Q||e.encoding===K||e.encoding===Z)}function oh(){for(var e=[],t=[],n=[],r=8,i=0;i4?a=Hc[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),l=-s/2,u=1+s/2,c=[l,l,u,l,u,u,l,l,u,u,l,u],h=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,v=f>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];h.set(g,18*f),d.set(c,12*f);var y=[f,f,f,f,f,f];p.set(y,6*f)}var b=new _n;b.setAttribute("position",new rn(h,3)),b.setAttribute("uv",new rn(d,2)),b.setAttribute("faceIndex",new rn(p,1)),e.push(b),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function ah(e){var t=new Te(3*Uc,3*Uc,e);return t.texture.mapping=c,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function sh(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function lh(){return new Ts({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new be(1,1)},inputEncoding:{value:Gc[3e3]},outputEncoding:{value:Gc[3e3]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function uh(){return new Ts({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Gc[3e3]},outputEncoding:{value:Gc[3e3]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function ch(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),gl.call(this,e),this.type="catmullrom",this.closed=!0}function hh(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),gl.call(this,e),this.type="catmullrom"}function dh(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),gl.call(this,e),this.type="catmullrom"}ul.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(ul.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Rl.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),ch.prototype=Object.create(gl.prototype),hh.prototype=Object.create(gl.prototype),dh.prototype=Object.create(gl.prototype),Object.assign(dh.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),vc.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},uc.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(el.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Xl.extractUrlBase(e)}}),el.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign($u.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(De.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Ye.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),or.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},nc.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(ye,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),ye.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),ye.ceilPowerOfTwo(e)}}),Object.assign(Ae.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Object.assign(rt.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Le).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,o)},getInverse:function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Dt.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Object.assign(Ce.prototype,{multiplyVector3:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(nt.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Gt.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Gt,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Gt.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Gt.getNormal(e,t,n,r)}}),Object.assign(Pl.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new us(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new vs(this,e)}}),Object.assign(be.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Le.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(_e.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ct.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Ct.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Gn.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Gn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(zo.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Zo.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Xo.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(ul.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Zn.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Dl.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(rn.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===ie},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(ie)}}}),Object.assign(rn.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?ie:re),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(_n.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new rn(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(_n.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Yl.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(Xu.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(Ao.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===ie},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(Ao.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?ie:re),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(us.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(bo.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(Vu.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties($t.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Kt}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Ls.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Cs.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(Qn.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(mo.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(mo.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?K:Q}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(no.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Te.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(wu.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new lu).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Su.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},$n.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},$n.prototype.clear=function(e,t,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,n,r)};var ph={merge:function(e,t,n){var r;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};we.crossOrigin=void 0,we.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new ll;i.setCrossOrigin(this.crossOrigin);var o=i.load(e,n,void 0,r);return t&&(o.mapping=t),o},we.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new al;i.setCrossOrigin(this.crossOrigin);var o=i.load(e,n,void 0,r);return t&&(o.mapping=t),o},we.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},we.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var fh={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:r}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=r),e.ACESFilmicToneMapping=4,e.AddEquation=i,e.AddOperation=2,e.AdditiveAnimationBlendMode=Y,e.AdditiveBlending=2,e.AlphaFormat=1021,e.AlwaysDepth=1,e.AlwaysStencilFunc=519,e.AmbientLight=jl,e.AmbientLightProbe=cu,e.AnimationClip=Qs,e.AnimationLoader=rl,e.AnimationMixer=Gu,e.AnimationObjectGroup=zu,e.AnimationUtils=Bs,e.ArcCurve=hl,e.ArrayCamera=so,e.ArrowHelper=kc,e.Audio=wu,e.AudioAnalyser=Su,e.AudioContext=su,e.AudioListener=Au,e.AudioLoader=lu,e.AxesHelper=Ic,e.AxisHelper=function(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Ic(e)},e.BackSide=1,e.BasicDepthPacking=3200,e.BasicShadowMap=0,e.BinaryTextureLoader=function(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new sl(e)},e.Bone=Yo,e.BooleanKeyframeTrack=js,e.BoundingBoxHelper=function(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Rc(e,t)},e.Box2=$u,e.Box3=De,e.Box3Helper=Pc,e.BoxBufferGeometry=Wn,e.BoxGeometry=Wn,e.BoxHelper=Rc,e.BufferAttribute=rn,e.BufferGeometry=_n,e.BufferGeometryLoader=Kl,e.ByteType=1010,e.Cache=Zs,e.Camera=Kn,e.CameraHelper=Mc,e.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},e.CanvasTexture=Ea,e.CatmullRomCurve3=gl,e.CineonToneMapping=3,e.CircleBufferGeometry=_a,e.CircleGeometry=_a,e.ClampToEdgeWrapping=p,e.Clock=fu,e.ClosedSplineCurve3=ch,e.Color=Kt,e.ColorKeyframeTrack=Gs,e.CompressedTexture=xa,e.CompressedTextureLoader=il,e.ConeBufferGeometry=Sa,e.ConeGeometry=Sa,e.CubeCamera=$n,e.CubeReflectionMapping=a,e.CubeRefractionMapping=s,e.CubeTexture=er,e.CubeTextureLoader=al,e.CubeUVReflectionMapping=c,e.CubeUVRefractionMapping=h,e.CubicBezierCurve=wl,e.CubicBezierCurve3=xl,e.CubicInterpolant=Ns,e.CullFaceBack=1,e.CullFaceFront=2,e.CullFaceFrontBack=3,e.CullFaceNone=0,e.Curve=ul,e.CurvePath=Ll,e.CustomBlending=5,e.CustomToneMapping=5,e.CylinderBufferGeometry=Ta,e.CylinderGeometry=Ta,e.Cylindrical=Zu,e.DataTexture=nr,e.DataTexture2DArray=Tr,e.DataTexture3D=Sr,e.DataTextureLoader=sl,e.DataUtils=Nc,e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=$s,e.DepthFormat=L,e.DepthStencilFormat=R,e.DepthTexture=Ma,e.DirectionalLight=zl,e.DirectionalLightHelper=wc,e.DiscreteInterpolant=Hs,e.DodecahedronBufferGeometry=La,e.DodecahedronGeometry=La,e.DoubleSide=2,e.DstAlphaFactor=206,e.DstColorFactor=208,e.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new rn(e,t).setUsage(ie)},e.DynamicCopyUsage=35050,e.DynamicDrawUsage=ie,e.DynamicReadUsage=35049,e.EdgesGeometry=ka,e.EdgesHelper=function(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new da(new ka(e.geometry),new ra({color:void 0!==t?t:16777215}))},e.EllipseCurve=cl,e.EqualDepth=4,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=l,e.EquirectangularRefractionMapping=u,e.Euler=ht,e.EventDispatcher=pe,e.ExtrudeBufferGeometry=us,e.ExtrudeGeometry=us,e.Face3=Zt,e.Face4=function(e,t,n,r,i,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Zt(e,t,n,i,o,a)},e.FaceColors=1,e.FileLoader=nl,e.FlatShading=1,e.Float16BufferAttribute=dn,e.Float32Attribute=function(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new pn(e,t)},e.Float32BufferAttribute=pn,e.Float64Attribute=function(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new fn(e,t)},e.Float64BufferAttribute=fn,e.FloatType=M,e.Fog=yo,e.FogExp2=go,e.Font=iu,e.FontLoader=au,e.FrontSide=0,e.Frustum=or,e.GLBufferAttribute=qu,e.GLSL1="100",e.GLSL3=oe,e.GammaEncoding=Z,e.GeometryUtils=ph,e.GreaterDepth=6,e.GreaterEqualDepth=5,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=vc,e.Group=ao,e.HalfFloatType=_,e.HemisphereLight=Ol,e.HemisphereLightHelper=mc,e.HemisphereLightProbe=uu,e.IcosahedronBufferGeometry=hs,e.IcosahedronGeometry=hs,e.ImageBitmapLoader=tu,e.ImageLoader=ol,e.ImageUtils=we,e.ImmediateRenderObject=rc,e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=Ql,e.InstancedBufferGeometry=Yl,e.InstancedInterleavedBuffer=Wu,e.InstancedMesh=na,e.Int16Attribute=function(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new ln(e,t)},e.Int16BufferAttribute=ln,e.Int32Attribute=function(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new cn(e,t)},e.Int32BufferAttribute=cn,e.Int8Attribute=function(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new on(e,t)},e.Int8BufferAttribute=on,e.IntType=1013,e.InterleavedBuffer=Ao,e.InterleavedBufferAttribute=Eo,e.Interpolant=Fs,e.InterpolateDiscrete=z,e.InterpolateLinear=j,e.InterpolateSmooth=G,e.InvertStencilOp=5386,e.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},e.KeepStencilOp=ne,e.KeyframeTrack=zs,e.LOD=zo,e.LatheBufferGeometry=ds,e.LatheGeometry=ds,e.Layers=ft,e.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")},e.LessDepth=2,e.LessEqualDepth=3,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=Dl,e.LightProbe=Wl,e.Line=ua,e.Line3=nc,e.LineBasicMaterial=ra,e.LineCurve=El,e.LineCurve3=Ml,e.LineDashedMaterial=ks,e.LineLoop=pa,e.LinePieces=1,e.LineSegments=da,e.LineStrip=0,e.LinearEncoding=Q,e.LinearFilter=y,e.LinearInterpolant=Us,e.LinearMipMapLinearFilter=1008,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=A,e.LinearMipmapNearestFilter=b,e.LinearToneMapping=1,e.Loader=el,e.LoaderUtils=Xl,e.LoadingManager=Js,e.LogLuvEncoding=3003,e.LoopOnce=2200,e.LoopPingPong=2202,e.LoopRepeat=2201,e.LuminanceAlphaFormat=1025,e.LuminanceFormat=1024,e.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},e.Material=$t,e.MaterialLoader=ql,e.Math=ye,e.MathUtils=ye,e.Matrix3=Ae,e.Matrix4=rt,e.MaxEquation=104,e.Mesh=Gn,e.MeshBasicMaterial=en,e.MeshDepthMaterial=eo,e.MeshDistanceMaterial=to,e.MeshFaceMaterial=function(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e},e.MeshLambertMaterial=Ds,e.MeshMatcapMaterial=Os,e.MeshNormalMaterial=Ps,e.MeshPhongMaterial=Ls,e.MeshPhysicalMaterial=Cs,e.MeshStandardMaterial=Ss,e.MeshToonMaterial=Rs,e.MinEquation=103,e.MirroredRepeatWrapping=f,e.MixOperation=1,e.MultiMaterial=function(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e},e.MultiplyBlending=4,e.MultiplyOperation=0,e.NearestFilter=m,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=g,e.NearestMipmapNearestFilter=v,e.NeverDepth=0,e.NeverStencilFunc=512,e.NoBlending=0,e.NoColors=0,e.NoToneMapping=0,e.NormalAnimationBlendMode=X,e.NormalBlending=1,e.NotEqualDepth=7,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=Vs,e.Object3D=Ct,e.ObjectLoader=Zl,e.ObjectSpaceNormalMap=1,e.OctahedronBufferGeometry=ps,e.OctahedronGeometry=ps,e.OneFactor=201,e.OneMinusDstAlphaFactor=207,e.OneMinusDstColorFactor=209,e.OneMinusSrcAlphaFactor=205,e.OneMinusSrcColorFactor=203,e.OrthographicCamera=Ul,e.PCFShadowMap=1,e.PCFSoftShadowMap=2,e.PMREMGenerator=rh,e.ParametricBufferGeometry=fs,e.ParametricGeometry=fs,e.Particle=function(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Fo(e)},e.ParticleBasicMaterial=function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new fa(e)},e.ParticleSystem=function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new ba(e,t)},e.ParticleSystemMaterial=function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new fa(e)},e.Path=Rl,e.PerspectiveCamera=Zn,e.Plane=Dt,e.PlaneBufferGeometry=lr,e.PlaneGeometry=lr,e.PlaneHelper=Dc,e.PointCloud=function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new ba(e,t)},e.PointCloudMaterial=function(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new fa(e)},e.PointLight=Nl,e.PointLightHelper=hc,e.Points=ba,e.PointsMaterial=fa,e.PolarGridHelper=gc,e.PolyhedronBufferGeometry=Ca,e.PolyhedronGeometry=Ca,e.PositionalAudio=Tu,e.PropertyBinding=Hu,e.PropertyMixer=Cu,e.QuadraticBezierCurve=_l,e.QuadraticBezierCurve3=Tl,e.Quaternion=Ce,e.QuaternionKeyframeTrack=qs,e.QuaternionLinearInterpolant=Ws,e.REVISION=r,e.RGBADepthPacking=3201,e.RGBAFormat=C,e.RGBAIntegerFormat=1033,e.RGBA_ASTC_10x10_Format=37819,e.RGBA_ASTC_10x5_Format=37816,e.RGBA_ASTC_10x6_Format=37817,e.RGBA_ASTC_10x8_Format=37818,e.RGBA_ASTC_12x10_Format=37820,e.RGBA_ASTC_12x12_Format=37821,e.RGBA_ASTC_4x4_Format=37808,e.RGBA_ASTC_5x4_Format=37809,e.RGBA_ASTC_5x5_Format=37810,e.RGBA_ASTC_6x5_Format=37811,e.RGBA_ASTC_6x6_Format=37812,e.RGBA_ASTC_8x5_Format=37813,e.RGBA_ASTC_8x6_Format=37814,e.RGBA_ASTC_8x8_Format=37815,e.RGBA_BPTC_Format=36492,e.RGBA_ETC2_EAC_Format=H,e.RGBA_PVRTC_2BPPV1_Format=N,e.RGBA_PVRTC_4BPPV1_Format=F,e.RGBA_S3TC_DXT1_Format=D,e.RGBA_S3TC_DXT3_Format=O,e.RGBA_S3TC_DXT5_Format=k,e.RGBDEncoding=te,e.RGBEEncoding=J,e.RGBEFormat=1023,e.RGBFormat=S,e.RGBIntegerFormat=1032,e.RGBM16Encoding=ee,e.RGBM7Encoding=$,e.RGB_ETC1_Format=36196,e.RGB_ETC2_Format=U,e.RGB_PVRTC_2BPPV1_Format=B,e.RGB_PVRTC_4BPPV1_Format=I,e.RGB_S3TC_DXT1_Format=P,e.RGFormat=1030,e.RGIntegerFormat=1031,e.RawShaderMaterial=Ts,e.Ray=nt,e.Raycaster=Xu,e.RectAreaLight=Gl,e.RedFormat=1028,e.RedIntegerFormat=1029,e.ReinhardToneMapping=2,e.RepeatWrapping=d,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=102,e.RingBufferGeometry=ms,e.RingGeometry=ms,e.SRGB8_ALPHA8_ASTC_10x10_Format=37851,e.SRGB8_ALPHA8_ASTC_10x5_Format=37848,e.SRGB8_ALPHA8_ASTC_10x6_Format=37849,e.SRGB8_ALPHA8_ASTC_10x8_Format=37850,e.SRGB8_ALPHA8_ASTC_12x10_Format=37852,e.SRGB8_ALPHA8_ASTC_12x12_Format=37853,e.SRGB8_ALPHA8_ASTC_4x4_Format=37840,e.SRGB8_ALPHA8_ASTC_5x4_Format=37841,e.SRGB8_ALPHA8_ASTC_5x5_Format=37842,e.SRGB8_ALPHA8_ASTC_6x5_Format=37843,e.SRGB8_ALPHA8_ASTC_6x6_Format=37844,e.SRGB8_ALPHA8_ASTC_8x5_Format=37845,e.SRGB8_ALPHA8_ASTC_8x6_Format=37846,e.SRGB8_ALPHA8_ASTC_8x8_Format=37847,e.Scene=bo,e.SceneUtils=fh,e.ShaderChunk=ur,e.ShaderLib=hr,e.ShaderMaterial=Qn,e.ShadowMaterial=_s,e.Shape=Pl,e.ShapeBufferGeometry=vs,e.ShapeGeometry=vs,e.ShapePath=nu,e.ShapeUtils=as,e.ShortType=1011,e.Skeleton=Zo,e.SkeletonHelper=uc,e.SkinnedMesh=Xo,e.SmoothShading=2,e.Sphere=Ye,e.SphereBufferGeometry=gs,e.SphereGeometry=gs,e.Spherical=Ku,e.SphericalHarmonics3=Vl,e.Spline=dh,e.SplineCurve=Sl,e.SplineCurve3=hh,e.SpotLight=Bl,e.SpotLightHelper=oc,e.Sprite=Fo,e.SpriteMaterial=Mo,e.SrcAlphaFactor=204,e.SrcAlphaSaturateFactor=210,e.SrcColorFactor=202,e.StaticCopyUsage=35046,e.StaticDrawUsage=re,e.StaticReadUsage=35045,e.StereoCamera=pu,e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=Xs,e.SubtractEquation=101,e.SubtractiveBlending=3,e.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},e.TangentSpaceNormalMap=0,e.TetrahedronBufferGeometry=ys,e.TetrahedronGeometry=ys,e.TextBufferGeometry=bs,e.TextGeometry=bs,e.Texture=Ee,e.TextureLoader=ll,e.TorusBufferGeometry=As,e.TorusGeometry=As,e.TorusKnotBufferGeometry=ws,e.TorusKnotGeometry=ws,e.Triangle=Gt,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeBufferGeometry=xs,e.TubeGeometry=xs,e.UVMapping=o,e.Uint16Attribute=function(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new un(e,t)},e.Uint16BufferAttribute=un,e.Uint32Attribute=function(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new hn(e,t)},e.Uint32BufferAttribute=hn,e.Uint8Attribute=function(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new an(e,t)},e.Uint8BufferAttribute=an,e.Uint8ClampedAttribute=function(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new sn(e,t)},e.Uint8ClampedBufferAttribute=sn,e.Uniform=Vu,e.UniformsLib=cr,e.UniformsUtils=Yn,e.UnsignedByteType=w,e.UnsignedInt248Type=T,e.UnsignedIntType=E,e.UnsignedShort4444Type=1017,e.UnsignedShort5551Type=1018,e.UnsignedShort565Type=1019,e.UnsignedShortType=x,e.VSMShadowMap=3,e.Vector2=be,e.Vector3=Le,e.Vector4=_e,e.VectorKeyframeTrack=Ys,e.Vertex=function(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Le(e,t,n)},e.VertexColors=2,e.VideoTexture=wa,e.WebGL1Renderer=vo,e.WebGLCubeRenderTarget=tr,e.WebGLMultisampleRenderTarget=Se,e.WebGLRenderTarget=Te,e.WebGLRenderTargetCube=function(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new tr(e,n)},e.WebGLRenderer=mo,e.WebGLUtils=oo,e.WireframeGeometry=Es,e.WireframeHelper=function(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new da(new Es(e.geometry),new ra({color:void 0!==t?t:16777215}))},e.WrapAroundEnding=q,e.XHRLoader=function(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new nl(e)},e.ZeroCurvatureEnding=V,e.ZeroFactor=200,e.ZeroSlopeEnding=W,e.ZeroStencilOp=0,e.sRGBEncoding=K,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof n&&void 0!==t?n:(r="undefined"!=typeof globalThis?globalThis:r||self).THREE={})},{}],58:[function(e,t,n){THREE.DRACOLoader=function(e){THREE.Loader.call(this,e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}},THREE.DRACOLoader.prototype=Object.assign(Object.create(THREE.Loader.prototype),{constructor:THREE.DRACOLoader,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(e,t,n,r){var i=new THREE.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{var n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)}),n,r)},decodeDracoFile:function(e,t,n,r){var i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)},decodeGeometry:function(e,t){for(var n in t.attributeTypes){var r=t.attributeTypes[n];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[n]=r.name)}var i,o=JSON.stringify(t);if(THREE.DRACOLoader.taskCache.has(e)){var a=THREE.DRACOLoader.taskCache.get(e);if(a.key===o)return a.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var s=this.workerNextTaskID++,l=e.byteLength,u=this._getWorker(s,l).then((n=>(i=n,new Promise(((n,r)=>{i._callbacks[s]={resolve:n,reject:r},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return u.catch((()=>!0)).then((()=>{i&&s&&this._releaseTask(i,s)})),THREE.DRACOLoader.taskCache.set(e,{key:o,promise:u}),u},_createGeometry:function(e){var t=new THREE.BufferGeometry;e.index&&t.setIndex(new THREE.BufferAttribute(e.index.array,1));for(var n=0;n{n.load(e,t,void 0,r)}))},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{var n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);var r=THREE.DRACOLoader.DRACOWorker.toString(),i=["/* draco decoder */",n,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then((()=>{var n;return this.workerPool.lengtht._taskLoad?-1:1})),(n=this.workerPool[this.workerPool.length-1])._taskCosts[e]=t,n._taskLoad+=t,n}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))},dispose:function(){for(var e=0;e{var t=e.draco,r=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(o),o.byteLength);try{var l=n(t,r,s,a),u=l.attributes.map((e=>e.array.buffer));l.index&&u.push(l.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:l},u)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(s),t.destroy(r)}}))}}},THREE.DRACOLoader.taskCache=new WeakMap,THREE.DRACOLoader.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},THREE.DRACOLoader.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},THREE.DRACOLoader.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},THREE.DRACOLoader.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")}},{}],59:[function(e,t,n){THREE.GLTFLoader=function(){function e(e){THREE.Loader.call(this,e),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new a(e)})),this.register((function(e){return new l(e)})),this.register((function(e){return new u(e)})),this.register((function(e){return new s(e)})),this.register((function(e){return new i(e)})),this.register((function(e){return new c(e)}))}function t(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(THREE.Loader.prototype),{constructor:e,load:function(e,t,n,r){var i,o=this;i=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:THREE.LoaderUtils.extractUrlBase(e),this.manager.itemStart(e);var a=function(t){r?r(t):console.error(t),o.manager.itemError(e),o.manager.itemEnd(e)},s=new THREE.FileLoader(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{o.parse(n,i,(function(n){t(n),o.manager.itemEnd(e)}),a)}catch(e){a(e)}}),n,a)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},setKTX2Loader:function(e){return this.ktx2Loader=e,this},setMeshoptDecoder:function(e){return this.meshoptDecoder=e,this},register:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this},unregister:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this},parse:function(e,t,i,a){var s,l={},u={};if("string"==typeof e)s=e;else if(THREE.LoaderUtils.decodeText(new Uint8Array(e,0,4))===h){try{l[n.KHR_BINARY_GLTF]=new f(e)}catch(e){return void(a&&a(e))}s=l[n.KHR_BINARY_GLTF].content}else s=THREE.LoaderUtils.decodeText(new Uint8Array(e));var c=JSON.parse(s);if(void 0===c.asset||c.asset.version[0]<2)a&&a(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var d=new G(c,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(var p=0;p=0&&void 0===u[A]&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}d.setExtensions(l),d.setPlugins(u),d.parse(i,a)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function r(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=e}function i(e){this.parser=e,this.name=n.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}function o(){this.name=n.KHR_MATERIALS_UNLIT}function a(e){this.parser=e,this.name=n.KHR_MATERIALS_CLEARCOAT}function s(e){this.parser=e,this.name=n.KHR_MATERIALS_TRANSMISSION}function l(e){this.parser=e,this.name=n.KHR_TEXTURE_BASISU}function u(e){this.parser=e,this.name=n.EXT_TEXTURE_WEBP,this.isSupported=null}function c(e){this.name=n.EXT_MESHOPT_COMPRESSION,this.parser=e}i.prototype._markDefs=function(){for(var e=this.parser,t=this.parser.json.nodes||[],n=0,r=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,o,a)},u.prototype.loadTexture=function(e){var t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;var o=i.extensions[t],a=r.images[o.source],s=a.uri?n.options.manager.getHandler(a.uri):n.textureLoader;return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,a,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))},u.prototype.detectSupport=function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported},c.prototype.loadBufferView=function(e){var t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){var r=n.extensions[this.name],i=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([i,o.ready]).then((function(e){var t=r.byteOffset||0,n=r.byteLength||0,i=r.count,a=r.byteStride,s=new ArrayBuffer(i*a),l=new Uint8Array(e[0],t,n);return o.decodeGltfBuffer(new Uint8Array(s),i,a,l,r.mode,r.filter),s}))}return null};var h="glTF",d=1313821514,p=5130562;function f(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:THREE.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==h)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var r=this.header.length-12,i=new DataView(e,12),o=0;o",t).replace("#include ",n).replace("#include ",r).replace("#include ",i).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(e){a.specular.value=e}},specularMap:{get:function(){return a.specularMap.value},set:function(e){a.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(e){a.glossiness.value=e}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(e){a.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function y(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return g},extendParams:function(e,t,n){var r=t.extensions[this.name];e.color=new THREE.Color(1,1,1),e.opacity=1;var i=[];if(Array.isArray(r.diffuseFactor)){var o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(void 0!==r.diffuseTexture&&i.push(n.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new THREE.Color(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new THREE.Color(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var a=r.specularGlossinessTexture;i.push(n.assignTexture(e,"glossinessMap",a)),i.push(n.assignTexture(e,"specularMap",a))}return Promise.all(i)},createMaterial:function(e){var t=new g(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=THREE.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function b(){this.name=n.KHR_MESH_QUANTIZATION}function A(e,t,n,r){THREE.Interpolant.call(this,e,t,n,r)}m.prototype.decodePrimitive=function(e,t){var n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},s={},l={};for(var u in o){var c=D[u]||u.toLowerCase();a[c]=o[u]}for(u in e.attributes)if(c=D[u]||u.toLowerCase(),void 0!==o[u]){var h=n.accessors[e.attributes[u]],d=C[h.componentType];l[c]=d,s[c]=!0===h.normalized}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(var n in e.attributes){var r=e.attributes[n],i=s[n];void 0!==i&&(r.normalized=i)}t(e)}),a,l)}))}))},v.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},g.prototype=Object.create(THREE.MeshStandardMaterial.prototype),g.prototype.constructor=g,g.prototype.copy=function(e){return THREE.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},A.prototype=Object.create(THREE.Interpolant.prototype),A.prototype.constructor=A,A.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r,o=0;o!==r;o++)t[o]=n[i+o];return t},A.prototype.beforeStart_=A.prototype.copySampleValue_,A.prototype.afterEnd_=A.prototype.copySampleValue_,A.prototype.interpolate_=function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=2*a,l=3*a,u=r-t,c=(n-t)/u,h=c*c,d=h*c,p=e*l,f=p-l,m=-2*d+3*h,v=d-h,g=1-m,y=v-h+c,b=0;b!==a;b++){var A=o[f+b+a],w=o[f+b+s]*u,x=o[p+b+a],E=o[p+b]*u;i[b]=g*A+y*w+m*x+v*E}return i};var w=0,x=1,E=2,M=3,_=4,T=5,S=6,C={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},L={9728:THREE.NearestFilter,9729:THREE.LinearFilter,9984:THREE.NearestMipmapNearestFilter,9985:THREE.LinearMipmapNearestFilter,9986:THREE.NearestMipmapLinearFilter,9987:THREE.LinearMipmapLinearFilter},R={33071:THREE.ClampToEdgeWrapping,33648:THREE.MirroredRepeatWrapping,10497:THREE.RepeatWrapping},P={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},D={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},O={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},k={CUBICSPLINE:void 0,LINEAR:THREE.InterpolateLinear,STEP:THREE.InterpolateDiscrete},I="OPAQUE",B="MASK",F="BLEND";function N(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function U(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function H(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function z(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,r=t.weights.length;n=2&&o.setY(_,x[E*s+1]),s>=3&&o.setZ(_,x[E*s+2]),s>=4&&o.setW(_,x[E*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},G.prototype.loadTexture=function(e){var t,r,i=this.json,o=this.options,a=i.textures[e],s=a.extensions||{};return(t=s[n.MSFT_TEXTURE_DDS]?i.images[s[n.MSFT_TEXTURE_DDS].source]:i.images[a.source]).uri&&(r=o.manager.getHandler(t.uri)),r||(r=s[n.MSFT_TEXTURE_DDS]?this.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(e,t,r)},G.prototype.loadTextureImage=function(e,t,n){var r=this,i=this.json,o=this.options,a=i.textures[e],s=self.URL||self.webkitURL,l=t.uri,u=!1,c=!0;return"image/jpeg"===t.mimeType&&(c=!1),void 0!==t.bufferView&&(l=r.getDependency("bufferView",t.bufferView).then((function(e){if("image/png"===t.mimeType){var n=new DataView(e,25,1).getUint8(0,!1);c=6===n||4===n||3===n}u=!0;var r=new Blob([e],{type:t.mimeType});return l=s.createObjectURL(r)}))),Promise.resolve(l).then((function(e){return new Promise((function(t,r){var i=t;!0===n.isImageBitmapLoader&&(i=function(e){t(new THREE.CanvasTexture(e))}),n.load(N(e,o.path),i,void 0,r)}))})).then((function(t){!0===u&&s.revokeObjectURL(l),t.flipY=!1,a.name&&(t.name=a.name),c||(t.format=THREE.RGBFormat);var n=(i.samplers||{})[a.sampler]||{};return t.magFilter=L[n.magFilter]||THREE.LinearFilter,t.minFilter=L[n.minFilter]||THREE.LinearMipmapLinearFilter,t.wrapS=R[n.wrapS]||THREE.RepeatWrapping,t.wrapT=R[n.wrapT]||THREE.RepeatWrapping,r.associations.set(t,{type:"textures",index:e}),t}))},G.prototype.assignTexture=function(e,t,r){var i=this;return this.getDependency("texture",r.index).then((function(o){if(void 0===r.texCoord||0==r.texCoord||"aoMap"===t&&1==r.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+r.texCoord+" for texture "+t+" not yet supported."),i.extensions[n.KHR_TEXTURE_TRANSFORM]){var a=void 0!==r.extensions?r.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(a){var s=i.associations.get(o);o=i.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),i.associations.set(o,s)}}e[t]=o}))},G.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,r=void 0!==t.attributes.tangent,i=void 0!==t.attributes.color,o=void 0===t.attributes.normal,a=!0===e.isSkinnedMesh,s=Object.keys(t.morphAttributes).length>0,l=s&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+n.uuid,c=this.cache.get(u);c||(c=new THREE.PointsMaterial,THREE.Material.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(u,c)),n=c}else if(e.isLine){u="LineBasicMaterial:"+n.uuid;var h=this.cache.get(u);h||(h=new THREE.LineBasicMaterial,THREE.Material.prototype.copy.call(h,n),h.color.copy(n.color),this.cache.add(u,h)),n=h}if(r||i||o||a||s){u="ClonedMaterial:"+n.uuid+":",n.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),a&&(u+="skinning:"),r&&(u+="vertex-tangents:"),i&&(u+="vertex-colors:"),o&&(u+="flat-shading:"),s&&(u+="morph-targets:"),l&&(u+="morph-normals:");var d=this.cache.get(u);d||(d=n.clone(),a&&(d.skinning=!0),i&&(d.vertexColors=!0),o&&(d.flatShading=!0),s&&(d.morphTargets=!0),l&&(d.morphNormals=!0),r&&(d.vertexTangents=!0,n.normalScale&&(n.normalScale.y*=-1),n.clearcoatNormalScale&&(n.clearcoatNormalScale.y*=-1)),this.cache.add(u,d),this.associations.set(d,this.associations.get(n))),n=d}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=n},G.prototype.getMaterialType=function(){return THREE.MeshStandardMaterial},G.prototype.loadMaterial=function(e){var t,r=this,i=this.json,o=this.extensions,a=i.materials[e],s={},l=a.extensions||{},u=[];if(l[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var c=o[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=c.getMaterialType(),u.push(c.extendParams(s,a,r))}else if(l[n.KHR_MATERIALS_UNLIT]){var h=o[n.KHR_MATERIALS_UNLIT];t=h.getMaterialType(),u.push(h.extendParams(s,a,r))}else{var d=a.pbrMetallicRoughness||{};if(s.color=new THREE.Color(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){var p=d.baseColorFactor;s.color.fromArray(p),s.opacity=p[3]}void 0!==d.baseColorTexture&&u.push(r.assignTexture(s,"map",d.baseColorTexture)),s.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,s.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(u.push(r.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),u.push(r.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),u.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,s)}))))}!0===a.doubleSided&&(s.side=THREE.DoubleSide);var f=a.alphaMode||I;return f===F?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,f===B&&(s.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==THREE.MeshBasicMaterial&&(u.push(r.assignTexture(s,"normalMap",a.normalTexture)),s.normalScale=new THREE.Vector2(1,-1),void 0!==a.normalTexture.scale&&s.normalScale.set(a.normalTexture.scale,-a.normalTexture.scale)),void 0!==a.occlusionTexture&&t!==THREE.MeshBasicMaterial&&(u.push(r.assignTexture(s,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(s.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==THREE.MeshBasicMaterial&&(s.emissive=(new THREE.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&t!==THREE.MeshBasicMaterial&&u.push(r.assignTexture(s,"emissiveMap",a.emissiveTexture)),Promise.all(u).then((function(){var i;return i=t===g?o[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new t(s),a.name&&(i.name=a.name),i.map&&(i.map.encoding=THREE.sRGBEncoding),i.emissiveMap&&(i.emissiveMap.encoding=THREE.sRGBEncoding),H(i,a),r.associations.set(i,{type:"materials",index:e}),a.extensions&&U(o,i,a),i}))},G.prototype.createUniqueName=function(e){for(var t=THREE.PropertyBinding.sanitizeNodeName(e||""),n=t,r=1;this.nodeNamesUsed[n];++r)n=t+"_"+r;return this.nodeNamesUsed[n]=!0,n},G.prototype.loadGeometries=function(e){var t,r,i=this,o=this.extensions,a=this.primitiveCache;function s(e){return o[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,i).then((function(t){return V(t,e,i)}))}for(var l=[],u=0,c=e.length;u0&&z(h,i),h.name=t.createUniqueName(i.name||"mesh_"+e),H(h,i),p.extensions&&U(r,h,p),t.assignFinalMaterial(h),l.push(h)}if(1===l.length)return l[0];var m=new THREE.Group;for(u=0,c=l.length;u1?new THREE.Group:1===t.length?t[0]:new THREE.Object3D)!==t[0])for(var s=0,l=t.length;s=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},o[c]=r;else if("ka"===u||"kd"===u||"ks"===u||"ke"===u){var h=c.split(i,3);r[u]=[parseFloat(h[0]),parseFloat(h[1]),parseFloat(h[2])]}else r[u]=c}}var d=new THREE.MTLLoader.MaterialCreator(this.resourcePath||t,this.materialOptions);return d.setCrossOrigin(this.crossOrigin),d.setManager(this.manager),d.setMaterials(o),d}}),THREE.MTLLoader.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:THREE.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:THREE.RepeatWrapping},THREE.MTLLoader.MaterialCreator.prototype={constructor:THREE.MTLLoader.MaterialCreator,crossOrigin:"anonymous",setCrossOrigin:function(e){return this.crossOrigin=e,this},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var n in e){var r=e[n],i={};for(var o in t[n]=i,r){var a=!0,s=r[o],l=o.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(a=!1)}a&&(i[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,n=this.materialsInfo[e],r={name:e,side:this.side};function i(e,n){if(!r[e]){var i=t.getTextureParams(n,r),o=t.loadTexture((a=t.baseUrl,"string"!=typeof(s=i.url)||""===s?"":/^https?:\/\//i.test(s)?s:a+s));o.repeat.copy(i.scale),o.offset.copy(i.offset),o.wrapS=t.wrap,o.wrapT=t.wrap,r[e]=o}var a,s}for(var o in n){var a,s=n[o];if(""!==s)switch(o.toLowerCase()){case"kd":r.color=(new THREE.Color).fromArray(s);break;case"ks":r.specular=(new THREE.Color).fromArray(s);break;case"ke":r.emissive=(new THREE.Color).fromArray(s);break;case"map_kd":i("map",s);break;case"map_ks":i("specularMap",s);break;case"map_ke":i("emissiveMap",s);break;case"norm":i("normalMap",s);break;case"map_bump":case"bump":i("bumpMap",s);break;case"map_d":i("alphaMap",s),r.transparent=!0;break;case"ns":r.shininess=parseFloat(s);break;case"d":(a=parseFloat(s))<1&&(r.opacity=a,r.transparent=!0);break;case"tr":a=parseFloat(s),this.options&&this.options.invertTrProperty&&(a=1-a),a>0&&(r.opacity=1-a,r.transparent=!0)}}return this.materials[e]=new THREE.MeshPhongMaterial(r),this.materials[e]},getTextureParams:function(e,t){var n,r={scale:new THREE.Vector2(1,1),offset:new THREE.Vector2(0,0)},i=e.split(/\s+/);return(n=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[n+1]),i.splice(n,2)),(n=i.indexOf("-s"))>=0&&(r.scale.set(parseFloat(i[n+1]),parseFloat(i[n+2])),i.splice(n,4)),(n=i.indexOf("-o"))>=0&&(r.offset.set(parseFloat(i[n+1]),parseFloat(i[n+2])),i.splice(n,4)),r.url=i.join(" ").trim(),r},loadTexture:function(e,t,n,r,i){var o,a=void 0!==this.manager?this.manager:THREE.DefaultLoadingManager,s=a.getHandler(e);return null===s&&(s=new THREE.TextureLoader(a)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,n,r,i),void 0!==t&&(o.mapping=t),o}}},{}],61:[function(e,t,n){THREE.OBJLoader=function(){var e=/^[og]\s*(.+)?/,t=/^mtllib /,n=/^usemtl /,r=/^usemap /,i=new THREE.Vector3,o=new THREE.Vector3,a=new THREE.Vector3,s=new THREE.Vector3,l=new THREE.Vector3;function u(){var e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);var n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){var n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);var r={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},n&&n.name&&"function"==typeof n.clone){var r=n.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseNormalIndex:function(e,t){var n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseUVIndex:function(e,t){var n=parseInt(e,10);return 2*(n>=0?n-1:n+t/2)},addVertex:function(e,t,n){var r=this.vertices,i=this.object.geometry.vertices;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){var r=this.normals,i=this.object.geometry.normals;i.push(r[e+0],r[e+1],r[e+2]),i.push(r[t+0],r[t+1],r[t+2]),i.push(r[n+0],r[n+1],r[n+2])},addFaceNormal:function(e,t,n){var r=this.vertices,u=this.object.geometry.normals;i.fromArray(r,e),o.fromArray(r,t),a.fromArray(r,n),l.subVectors(a,o),s.subVectors(i,o),l.cross(s),l.normalize(),u.push(l.x,l.y,l.z),u.push(l.x,l.y,l.z),u.push(l.x,l.y,l.z)},addColor:function(e,t,n){var r=this.colors,i=this.object.geometry.colors;void 0!==r[e]&&i.push(r[e+0],r[e+1],r[e+2]),void 0!==r[t]&&i.push(r[t+0],r[t+1],r[t+2]),void 0!==r[n]&&i.push(r[n+0],r[n+1],r[n+2])},addUV:function(e,t,n){var r=this.uvs,i=this.object.geometry.uvs;i.push(r[e+0],r[e+1]),i.push(r[t+0],r[t+1]),i.push(r[n+0],r[n+1])},addDefaultUV:function(){var e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,r,i,o,a,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),h=this.parseVertexIndex(t,u),d=this.parseVertexIndex(n,u);if(this.addVertex(c,h,d),this.addColor(c,h,d),void 0!==a&&""!==a){var p=this.normals.length;c=this.parseNormalIndex(a,p),h=this.parseNormalIndex(s,p),d=this.parseNormalIndex(l,p),this.addNormal(c,h,d)}else this.addFaceNormal(c,h,d);if(void 0!==r&&""!==r){var f=this.uvs.length;c=this.parseUVIndex(r,f),h=this.parseUVIndex(i,f),d=this.parseUVIndex(o,f),this.addUV(c,h,d),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,n=0,r=e.length;n=7?o.colors.push(parseFloat(f[4]),parseFloat(f[5]),parseFloat(f[6])):o.colors.push(void 0,void 0,void 0);break;case"vn":o.normals.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3]));break;case"vt":o.uvs.push(parseFloat(f[1]),parseFloat(f[2]))}}else if("f"===l){for(var m=s.substr(1).trim().split(/\s+/),v=[],g=0,y=m.length;g0){var A=b.split("/");v.push(A)}}var w=v[0];for(g=1,y=v.length-1;g1){var D=c[1].trim().toLowerCase();o.object.smooth="0"!==D&&"off"!==D}else o.object.smooth=!0;(W=o.object.currentMaterial())&&(W.smooth=o.object.smooth)}else{if("\0"===s)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+s+'"')}o.finalize();var O=new THREE.Group;if(O.materialLibraries=[].concat(o.materialLibraries),1==!(1===o.objects.length&&0===o.objects[0].geometry.vertices.length))for(d=0,p=o.objects.length;d0&&Q.setAttribute("normal",new THREE.Float32BufferAttribute(I.normals,3)),I.colors.length>0&&(U=!0,Q.setAttribute("color",new THREE.Float32BufferAttribute(I.colors,3))),!0===I.hasUVIndices&&Q.setAttribute("uv",new THREE.Float32BufferAttribute(I.uvs,2));for(var H,z=[],j=0,G=B.length;j1){for(j=0,G=B.length;j0){var Q;W=new THREE.PointsMaterial({size:1,sizeAttenuation:!1}),(Q=new THREE.BufferGeometry).setAttribute("position",new THREE.Float32BufferAttribute(o.vertices,3)),o.colors.length>0&&void 0!==o.colors[0]&&(Q.setAttribute("color",new THREE.Float32BufferAttribute(o.colors,3)),W.vertexColors=!0);var K=new THREE.Points(Q,W);O.add(K)}return O}}),c}()},{}],62:[function(e,t,n){THREE.BufferGeometryUtils={computeTangents:function(e){e.computeTangents(),console.warn("THREE.BufferGeometryUtils: .computeTangents() has been removed. Use BufferGeometry.computeTangents() instead.")},mergeBufferGeometries:function(e,t){for(var n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),o={},a={},s=e[0].morphTargetsRelative,l=new THREE.BufferGeometry,u=0,c=0;c[])));var f=Math.log10(1/t),m=Math.pow(10,f);for(d=0;d0}));this.visibleGlyphs=c;var h=l.positions(c),d=l.uvs(c,i,u,t),p=o({clockwise:!0,type:"uint16",count:c.length});if(a.index(this,p,1,"uint16"),a.attr(this,"position",h,2),a.attr(this,"uv",d,2),!e.multipage&&"page"in this.attributes)this.removeAttribute("page");else if(e.multipage){var f=l.pages(c);a.attr(this,"page",f,1)}},h.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var e=this.attributes.position.array,t=this.attributes.position.itemSize;if(!e||!t||e.length<2)return this.boundingSphere.radius=0,void this.boundingSphere.center.set(0,0,0);u.computeSphere(e,this.boundingSphere),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')},h.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var e=this.boundingBox,t=this.attributes.position.array,n=this.attributes.position.itemSize;!t||!n||t.length<2?e.makeEmpty():u.computeBox(t,e)}},{"./lib/utils":64,"./lib/vertices":65,inherits:30,"layout-bmfont-text":36,"object-assign":39,"quad-indices":51,"three-buffer-vertex-data":66}],64:[function(e,t,n){var r={min:[0,0],max:[0,0]};function i(e){var t=e.length/2;r.min[0]=e[0],r.min[1]=e[1],r.max[0]=e[0],r.max[1]=e[1];for(var n=0;n=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n.setImmediate="function"==typeof t?t:function(e){var t=l++,r=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,i((function(){s[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))})),t},n.clearImmediate="function"==typeof r?r:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":49,timers:67}],68:[function(e,t,n){(function(e){!function(e,r){"object"==typeof n&&void 0!==t?t.exports=r():e.WebVRPolyfill=r()}(this,(function(){"use strict";var t="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};var n,r=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},i=function(e,t){for(var n=0,r=e.length;ne.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),r.push(null,null);break}i||(i=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(l),r.push(e.getParameter(a),null);break;case e.ACTIVE_TEXTURE:i=e.getParameter(e.ACTIVE_TEXTURE),r.push(null);break;default:r.push(e.getParameter(a))}for(n(e),o=0;oe.TEXTURE31)break;e.activeTexture(l),e.bindTexture(e.TEXTURE_2D,s);break;case e.TEXTURE_BINDING_CUBE_MAP:var l;if((l=t[++o])e.TEXTURE31)break;e.activeTexture(l),e.bindTexture(e.TEXTURE_CUBE_MAP,s);break;case e.VIEWPORT:e.viewport(s[0],s[1],s[2],s[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:s?e.enable(a):e.disable(a);break;default:console.log("No GL restore behavior for 0x"+a.toString(16))}i&&e.activeTexture(i)}}else n(e)},L=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),R=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");function P(e,t,n,r){this.gl=e,this.cardboardUI=t,this.bufferScale=n,this.dirtySubmitFrameBindings=r,this.ctxAttribs=e.getContextAttributes(),this.instanceExt=e.getExtension("ANGLE_instanced_arrays"),this.meshWidth=20,this.meshHeight=20,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,s()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=b(e,L,R,this.attribs),this.uniforms=A(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize()}P.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},P.prototype.onResize=function(){var e=this.gl,t=this,n=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];C(e,n,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)})),this.cardboardUI&&this.cardboardUI.onResize()},P.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,n=this.gl;s()||(t.width=v()*this.bufferScale,t.height=g()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(n){e.bufferWidth=n,e.realCanvasWidth.set.call(t,n),e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(n){e.bufferHeight=n,e.realCanvasHeight.set.call(t,n),e.onResize()}})),this.lastBoundFramebuffer=n.getParameter(n.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(n.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,r){e.lastBoundFramebuffer=r||e.framebuffer,e.realBindFramebuffer.call(n,t,e.lastBoundFramebuffer)},this.cullFace=n.getParameter(n.CULL_FACE),this.depthTest=n.getParameter(n.DEPTH_TEST),this.blend=n.getParameter(n.BLEND),this.scissorTest=n.getParameter(n.SCISSOR_TEST),this.stencilTest=n.getParameter(n.STENCIL_TEST),n.enable=function(t){switch(t){case n.CULL_FACE:e.cullFace=!0;break;case n.DEPTH_TEST:e.depthTest=!0;break;case n.BLEND:e.blend=!0;break;case n.SCISSOR_TEST:e.scissorTest=!0;break;case n.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(n,t)},n.disable=function(t){switch(t){case n.CULL_FACE:e.cullFace=!1;break;case n.DEPTH_TEST:e.depthTest=!1;break;case n.BLEND:e.blend=!1;break;case n.SCISSOR_TEST:e.scissorTest=!1;break;case n.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(n,t)},this.colorMask=n.getParameter(n.COLOR_WRITEMASK),n.colorMask=function(t,r,i,o){e.colorMask[0]=t,e.colorMask[1]=r,e.colorMask[2]=i,e.colorMask[3]=o,e.realColorMask.call(n,t,r,i,o)},this.clearColor=n.getParameter(n.COLOR_CLEAR_VALUE),n.clearColor=function(t,r,i,o){e.clearColor[0]=t,e.clearColor[1]=r,e.clearColor[2]=i,e.clearColor[3]=o,e.realClearColor.call(n,t,r,i,o)},this.viewport=n.getParameter(n.VIEWPORT),n.viewport=function(t,r,i,o){e.viewport[0]=t,e.viewport[1]=r,e.viewport[2]=i,e.viewport[3]=o,e.realViewport.call(n,t,r,i,o)},this.isPatched=!0,E(t)}},P.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;s()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout((function(){E(t)}),1)}},P.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},P.prototype.submitFrame=function(){var e=this.gl,t=this,n=[];if(this.dirtySubmitFrameBindings||n.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),C(e,n,(function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null);var n=0,r=0;t.instanceExt&&(n=e.getVertexAttrib(t.attribs.position,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE),r=e.getVertexAttrib(t.attribs.texCoord,t.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||s())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),t.instanceExt&&(0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,0),0!=r&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,0)),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),t.dirtySubmitFrameBindings||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),!t.ctxAttribs.alpha&&t.ctxAttribs.preserveDrawingBuffer||t.realClearColor.apply(e,t.clearColor),t.instanceExt&&(0!=n&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.position,n),0!=r&&t.instanceExt.vertexAttribDivisorANGLE(t.attribs.texCoord,r))})),s()){var r=e.canvas;r.width==t.bufferWidth&&r.height==t.bufferHeight||(t.bufferWidth=r.width,t.bufferHeight=r.height,t.onResize())}},P.prototype.updateDeviceInfo=function(e){var t=this.gl,n=this,r=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];C(t,r,(function(t){var r=n.computeMeshVertices_(n.meshWidth,n.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,n.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW),!n.indexCount){var i=n.computeMeshIndices_(n.meshWidth,n.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,i,t.STATIC_DRAW),n.indexCount=i.length}}))},P.prototype.computeMeshVertices_=function(e,t,n){for(var r=new Float32Array(2*e*t*5),i=n.getLeftEyeVisibleTanAngles(),o=n.getLeftEyeNoLensTanAngles(),s=n.getLeftEyeVisibleScreenRect(o),l=0,u=0;u<2;u++){for(var c=0;ci-42&&r.clientXn.clientHeight-42?e(r):r.clientX<42&&r.clientY<42&&t(r)},n.addEventListener("click",this.listener,!1)},F.prototype.onResize=function(){var e=this.gl,t=this,n=[e.ARRAY_BUFFER_BINDING];C(e,n,(function(e){var n=[],r=e.drawingBufferWidth/2,i=Math.max(screen.width,screen.height)*window.devicePixelRatio,o=e.drawingBufferWidth/i*window.devicePixelRatio,a=4*o/2,s=42*o,l=B*o/2,u=14*o;function c(e,t){var i=(90-e)*k,o=Math.cos(i),a=Math.sin(i);n.push(I*o*l+r,I*a*l+l),n.push(t*o*l+r,t*a*l+l)}n.push(r-a,s),n.push(r-a,e.drawingBufferHeight),n.push(r+a,s),n.push(r+a,e.drawingBufferHeight),t.gearOffset=n.length/2;for(var h=0;h<=6;h++){var d=60*h;c(d,1),c(d+12,1),c(d+20,.75),c(d+40,.75),c(d+48,1)}function p(t,r){n.push(u+t,e.drawingBufferHeight-u-r)}t.gearVertexCount=n.length/2-t.gearOffset,t.arrowOffset=n.length/2;var f=a/Math.sin(45*k);p(0,l),p(l,0),p(l+f,f),p(f,l+f),p(f,l-f),p(0,l),p(l,2*l),p(l+f,2*l-f),p(f,l-f),p(0,l),p(f,l-a),p(B*o,l-a),p(f,l+a),p(B*o,l+a),t.arrowVertexCount=n.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(n),e.STATIC_DRAW)}))},F.prototype.render=function(){var e=this.gl,t=this,n=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];C(e,n,(function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()}))},F.prototype.renderNoState=function(){var e,t,n,r,i,o,a,s,l,u,c=this.gl;c.useProgram(this.program),c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer),c.enableVertexAttribArray(this.attribs.position),c.vertexAttribPointer(this.attribs.position,2,c.FLOAT,!1,8,0),c.uniform4f(this.uniforms.color,1,1,1,1),e=this.projMat,t=0,n=c.drawingBufferWidth,r=0,i=c.drawingBufferHeight,s=1/(t-n),l=1/(r-i),u=1/((o=.1)-(a=1024)),e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(a+o)*u,e[15]=1,c.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),c.drawArrays(c.TRIANGLE_STRIP,0,4),c.drawArrays(c.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),c.drawArrays(c.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},N.prototype.distortInverse=function(e){for(var t=0,n=1,r=e-this.distort(t);Math.abs(n-t)>1e-4;){var i=e-this.distort(n),o=n-i*((n-t)/(i-r));t=n,n=o,r=i}return n},N.prototype.distort=function(e){for(var t=e*e,n=0,r=0;r=1)return this.w=o,this.x=n,this.y=r,this.z=i,this;var s=Math.acos(a),l=Math.sqrt(1-a*a);if(Math.abs(l)<.001)return this.w=.5*(o+this.w),this.x=.5*(n+this.x),this.y=.5*(r+this.y),this.z=.5*(i+this.z),this;var u=Math.sin((1-t)*s)/l,c=Math.sin(t*s)/l;return this.w=o*u+this.w*c,this.x=n*u+this.x*c,this.y=r*u+this.y*c,this.z=i*u+this.z*c,this},setFromUnitVectors:function(e,t){return void 0===j&&(j=new z),(G=e.dot(t)+1)<1e-6?(G=0,Math.abs(e.x)>Math.abs(e.z)?j.set(-e.y,e.x,0):j.set(0,-e.z,e.y)):j.crossVectors(e,t),this.x=j.x,this.y=j.y,this.z=j.z,this.w=G,this.normalize(),this}};var q=new W({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),X=new W({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),Y={CardboardV1:new K({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new K({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};function Q(e,t){this.viewer=Y.CardboardV2,this.updateDeviceParams(e),this.distortion=new N(this.viewer.distortionCoefficients);for(var n=0;n=200&&n.status<=299?(r.dpdb=JSON.parse(n.response),r.recalculateDeviceParams_()):console.error("Error loading online DPDB!")})),n.send()}}function $(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}function ee(e,t){this.set(e,t)}function te(e,t){this.kFilter=e,this.isDebug=t,this.currentAccelMeasurement=new ee,this.currentGyroMeasurement=new ee,this.previousGyroMeasurement=new ee,s()?this.filterQ=new V(-1,0,0,1):this.filterQ=new V(1,0,0,1),this.previousFilterQ=new V,this.previousFilterQ.copy(this.filterQ),this.accelQ=new V,this.isOrientationInitialized=!1,this.estimatedGravity=new z,this.measuredGravity=new z,this.gyroIntegralQ=new V}function ne(e,t){this.predictionTimeS=e,this.isDebug=t,this.previousQ=new V,this.previousTimestampS=null,this.deltaQ=new V,this.outQ=new V}function re(e,t,n,r){this.yawOnly=n,this.accelerometer=new z,this.gyroscope=new z,this.filter=new te(e,r),this.posePredictor=new ne(t,r),this.isFirefoxAndroid=c(),this.isIOS=s();var i=h();this.isDeviceMotionInRadians=!this.isIOS&&i&&i<66,this.isWithoutDeviceMotion=p()||d(),this.filterToWorldQ=new V,s()?this.filterToWorldQ.setFromAxisAngle(new z(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new z(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new V,this.worldToScreenQ=new V,this.originalPoseAdjustQ=new V,this.originalPoseAdjustQ.setFromAxisAngle(new z(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),m()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new V,this.orientationOut_=new Float32Array(4),this.start()}J.prototype.getDeviceParams=function(){return this.deviceParams},J.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},J.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var t=navigator.userAgent||navigator.vendor||window.opera,n=v(),r=g();if(!e.devices)return console.error("DPDB has no devices section."),null;for(var i=0;i1)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},te.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var n=new V;n.copy(this.filterQ),n.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(n),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r,i=new V;i.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),i.inverse(),this.isDebug&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",H*((r=i).w>1?(console.warn("getQuaternionAngle: w > 1"),0):2*Math.acos(r.w)),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var o=new V;o.copy(this.filterQ),o.multiply(i),this.filterQ.slerp(o,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},te.prototype.getOrientation=function(){return this.filterQ},te.prototype.accelToQuaternion_=function(e){var t=new z;t.copy(e),t.normalize();var n=new V;return n.setFromUnitVectors(new z(0,0,-1),t),n.inverse(),n},te.prototype.gyroToQuaternionDelta_=function(e,t){var n=new V,r=new z;return r.copy(e),r.normalize(),n.setFromAxisAngle(r,e.length()*t),n},ne.prototype.getPrediction=function(e,t,n){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=n,e;var r=new z;r.copy(t),r.normalize();var i=t.length();if(i<20*U)return this.isDebug&&console.log("Moving slowly, at %s deg/s: no prediction",(H*i).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var o=i*this.predictionTimeS;return this.deltaQ.setFromAxisAngle(r,o),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=n,this.outQ},re.prototype.getPosition=function(){return null},re.prototype.getOrientation=function(){var e=void 0;if(this.isWithoutDeviceMotion&&this._deviceOrientationQ)return this.deviceOrientationFixQ=this.deviceOrientationFixQ||(n=(new V).setFromAxisAngle(new z(0,0,-1),0),r=new V,-90===window.orientation?r.setFromAxisAngle(new z(0,1,0),Math.PI/-2):r.setFromAxisAngle(new z(0,1,0),Math.PI/2),n.multiply(r)),this.deviceOrientationFilterToWorldQ=this.deviceOrientationFilterToWorldQ||((t=new V).setFromAxisAngle(new z(1,0,0),-Math.PI/2),t),e=this._deviceOrientationQ,(i=new V).copy(e),i.multiply(this.deviceOrientationFilterToWorldQ),i.multiply(this.resetQ),i.multiply(this.worldToScreenQ),i.multiplyQuaternions(this.deviceOrientationFixQ,i),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_;var t,n,r,i,o=this.filter.getOrientation();return e=this.posePredictor.getPrediction(o,this.gyroscope,this.previousTimestampS),(i=new V).copy(this.filterToWorldQ),i.multiply(this.resetQ),i.multiply(e),i.multiply(this.worldToScreenQ),this.yawOnly&&(i.x=0,i.z=0,i.normalize()),this.orientationOut_[0]=i.x,this.orientationOut_[1]=i.y,this.orientationOut_[2]=i.z,this.orientationOut_[3]=i.w,this.orientationOut_},re.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),m()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ)},re.prototype.onDeviceOrientation_=function(e){this._deviceOrientationQ=this._deviceOrientationQ||new V;var t=e.alpha,n=e.beta,r=e.gamma;t=(t||0)*Math.PI/180,n=(n||0)*Math.PI/180,r=(r||0)*Math.PI/180,this._deviceOrientationQ.setFromEulerYXZ(n,t,-r)},re.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},re.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,n=e.rotationRate,r=e.timeStamp/1e3,i=r-this.previousTimestampS;return i<0?(T("fusion-pose-sensor:invalid:non-monotonic","Invalid timestamps detected: non-monotonic timestamp from devicemotion"),void(this.previousTimestampS=r)):i<=.001||i>1?(T("fusion-pose-sensor:invalid:outside-threshold","Invalid timestamps detected: Timestamp from devicemotion outside expected range."),void(this.previousTimestampS=r)):(this.accelerometer.set(-t.x,-t.y,-t.z),n&&(f()?this.gyroscope.set(-n.beta,n.alpha,n.gamma):this.gyroscope.set(n.alpha,n.beta,n.gamma),this.isDeviceMotionInRadians||this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addGyroMeasurement(this.gyroscope,r)),this.filter.addAccelMeasurement(this.accelerometer,r),void(this.previousTimestampS=r))},re.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},re.prototype.onMessage_=function(e){var t=e.data;t&&t.type&&"devicemotion"===t.type.toLowerCase()&&this.updateDeviceMotion_(t.deviceMotionEvent)},re.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new z(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new z(0,0,1),Math.PI/2)}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},re.prototype.start=function(){var e,t,n;this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),this.onDeviceOrientationCallback_=this.onDeviceOrientation_.bind(this),s()&&(e=window.self!==window.top,t=_(document.referrer),n=_(window.location.href),e&&t!==n)&&window.addEventListener("message",this.onMessageCallback_),window.addEventListener("orientationchange",this.onOrientationChangeCallback_),this.isWithoutDeviceMotion?window.addEventListener("deviceorientation",this.onDeviceOrientationCallback_):window.addEventListener("devicemotion",this.onDeviceMotionCallback_)},re.prototype.stop=function(){window.removeEventListener("devicemotion",this.onDeviceMotionCallback_),window.removeEventListener("deviceorientation",this.onDeviceOrientationCallback_),window.removeEventListener("orientationchange",this.onOrientationChangeCallback_),window.removeEventListener("message",this.onMessageCallback_)};var ie=new z(1,0,0),oe=new z(0,0,1),ae=new V;ae.setFromAxisAngle(ie,-Math.PI/2),ae.multiply((new V).setFromAxisAngle(oe,Math.PI/2));var se=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.config=t,this.sensor=null,this.fusionSensor=null,this._out=new Float32Array(4),this.api=null,this.errors=[],this._sensorQ=new V,this._outQ=new V,this._onSensorRead=this._onSensorRead.bind(this),this._onSensorError=this._onSensorError.bind(this),this.init()}return i(e,[{key:"init",value:function(){var e=null;try{(e=new RelativeOrientationSensor({frequency:60,referenceFrame:"screen"})).addEventListener("error",this._onSensorError)}catch(e){this.errors.push(e),"SecurityError"===e.name?(console.error("Cannot construct sensors due to the Feature Policy"),console.warn('Attempting to fall back using "devicemotion"; however this will fail in the future without correct permissions.'),this.useDeviceMotion()):"ReferenceError"===e.name?this.useDeviceMotion():console.error(e)}e&&(this.api="sensor",this.sensor=e,this.sensor.addEventListener("reading",this._onSensorRead),this.sensor.start())}},{key:"useDeviceMotion",value:function(){this.api="devicemotion",this.fusionSensor=new re(this.config.K_FILTER,this.config.PREDICTION_TIME_S,this.config.YAW_ONLY,this.config.DEBUG),this.sensor&&(this.sensor.removeEventListener("reading",this._onSensorRead),this.sensor.removeEventListener("error",this._onSensorError),this.sensor=null)}},{key:"getOrientation",value:function(){if(this.fusionSensor)return this.fusionSensor.getOrientation();if(!this.sensor||!this.sensor.quaternion)return this._out[0]=this._out[1]=this._out[2]=0,this._out[3]=1,this._out;var e=this.sensor.quaternion;this._sensorQ.set(e[0],e[1],e[2],e[3]);var t=this._outQ;return t.copy(ae),t.multiply(this._sensorQ),this.config.YAW_ONLY&&(t.x=t.z=0,t.normalize()),this._out[0]=t.x,this._out[1]=t.y,this._out[2]=t.z,this._out[3]=t.w,this._out}},{key:"_onSensorError",value:function(e){this.errors.push(e.error),"NotAllowedError"===e.error.name?console.error("Permission to access sensor was denied"):"NotReadableError"===e.error.name?console.error("Sensor could not be read"):console.error(e.error),this.useDeviceMotion()}},{key:"_onSensorRead",value:function(){}}]),e}();function le(){this.loadIcon_();var e=document.createElement("div");(o=e.style).position="fixed",o.top=0,o.right=0,o.bottom=0,o.left=0,o.backgroundColor="gray",o.fontFamily="sans-serif",o.zIndex=1e6;var t=document.createElement("img");t.src=this.icon,(o=t.style).marginLeft="25%",o.marginTop="25%",o.width="50%",e.appendChild(t);var n=document.createElement("div");(o=n.style).textAlign="center",o.fontSize="16px",o.lineHeight="24px",o.margin="24px 25%",o.width="50%",n.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(n);var r=document.createElement("div");(o=r.style).backgroundColor="#CFD8DC",o.position="fixed",o.bottom=0,o.width="100%",o.height="48px",o.padding="14px 24px",o.boxSizing="border-box",o.color="#656A6B",e.appendChild(r);var i=document.createElement("div");i.style.float="left",i.innerHTML="No Cardboard viewer?";var o,a=document.createElement("a");a.href="https://www.google.com/get/cardboard/get-cardboard/",a.innerHTML="get one",a.target="_blank",(o=a.style).float="right",o.fontWeight=600,o.textTransform="uppercase",o.borderLeft="1px solid gray",o.paddingLeft="24px",o.textDecoration="none",o.color="#656A6B",r.appendChild(i),r.appendChild(a),this.overlay=e,this.text=n,this.hide()}le.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img").style;m()?(t.width="20%",t.marginLeft="40%",t.marginTop="3%"):(t.width="50%",t.marginLeft="25%",t.marginTop="25%")},le.prototype.hide=function(){this.overlay.style.display="none"},le.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},le.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},le.prototype.update=function(){this.disableShowTemporarily(),!m()&&w()?this.show():this.hide()},le.prototype.loadIcon_=function(){this.icon="data:image/svg+xml,"+encodeURIComponent("")};var ue="WEBVR_CARDBOARD_VIEWER";function ce(e){try{this.selectedKey=localStorage.getItem(ue)}catch(e){console.error("Failed to load viewer profile: %s",e)}this.selectedKey||(this.selectedKey=e||"CardboardV1"),this.dialog=this.createDialog_(Q.Viewers),this.root=null,this.onChangeCallbacks_=[]}ce.prototype.show=function(e){this.root=e,e.appendChild(this.dialog),this.dialog.querySelector("#"+this.selectedKey).checked=!0,this.dialog.style.display="block"},ce.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},ce.prototype.getCurrentViewer=function(){return Q.Viewers[this.selectedKey]},ce.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},ce.prototype.onChange=function(e){this.onChangeCallbacks_.push(e)},ce.prototype.fireOnChange_=function(e){for(var t=0;t.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return r(e,[{key:"enable",value:function(){o?(this.disable(),this.noSleepTimer=window.setInterval((function(){window.location.href="/",window.setTimeout(window.stop,0)}),15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){o?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),e}();e.exports=a},function(e,t,n){e.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])},e.exports=n()})))&&he.__esModule&&Object.prototype.hasOwnProperty.call(he,"default")?he.default:he,pe=1e3,fe=[0,0,.5,1],me=[.5,0,.5,1],ve=window.requestAnimationFrame,ge=window.cancelAnimationFrame;function ye(e){Object.defineProperties(this,{hasPosition:{writable:!1,enumerable:!0,value:e.hasPosition},hasExternalDisplay:{writable:!1,enumerable:!0,value:e.hasExternalDisplay},canPresent:{writable:!1,enumerable:!0,value:e.canPresent},maxLayers:{writable:!1,enumerable:!0,value:e.maxLayers},hasOrientation:{enumerable:!0,get:function(){return S("VRDisplayCapabilities.prototype.hasOrientation","VRDisplay.prototype.getFrameData"),e.hasOrientation}}})}function be(e){var t=!("wakelock"in(e=e||{}))||e.wakelock;this.isPolyfilled=!0,this.displayId=pe++,this.displayName="",this.depthNear=.01,this.depthFar=1e4,this.isPresenting=!1,Object.defineProperty(this,"isConnected",{get:function(){return S("VRDisplay.prototype.isConnected","VRDisplayCapabilities.prototype.hasExternalDisplay"),!1}}),this.capabilities=new ye({hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1}),this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.originalParent_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,t&&w()&&(this.wakelock_=new de)}be.prototype.getFrameData=function(e){return M(e,this._getPose(),this)},be.prototype.getPose=function(){return S("VRDisplay.prototype.getPose","VRDisplay.prototype.getFrameData"),this._getPose()},be.prototype.resetPose=function(){return S("VRDisplay.prototype.resetPose"),this._resetPose()},be.prototype.getImmediatePose=function(){return S("VRDisplay.prototype.getImmediatePose","VRDisplay.prototype.getFrameData"),this._getPose()},be.prototype.requestAnimationFrame=function(e){return ve(e)},be.prototype.cancelAnimationFrame=function(e){return ge(e)},be.prototype.wrapForFullscreen=function(e){if(s())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var t=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",t.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;if(this.fullscreenElement_&&(this.originalParent_?this.originalParent_.appendChild(this.fullscreenElement_):this.fullscreenElement_.parentElement.removeChild(this.fullscreenElement_)),this.fullscreenElement_=e,this.originalParent_=e.parentElement,this.originalParent_||document.body.appendChild(e),!this.fullscreenWrapper_.parentElement){var n=this.fullscreenElement_.parentElement;n.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),n.removeChild(this.fullscreenElement_)}this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var r=this;return function(){if(r.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];r.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}(),this.fullscreenWrapper_},be.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),this.originalParent_===t?t.insertBefore(e,this.fullscreenWrapper_):this.originalParent_&&this.originalParent_.appendChild(e),t.removeChild(this.fullscreenWrapper_),e}},be.prototype.requestPresent=function(e){var t=this.isPresenting,n=this;return e instanceof Array||(S("VRDisplay.prototype.requestPresent with non-array argument","an array of VRLayers as the first argument"),e=[e]),new Promise((function(r,i){if(n.capabilities.canPresent)if(0==e.length||e.length>n.capabilities.maxLayers)i(new Error("Invalid number of layers."));else{var o=e[0];if(o.source){var a=o.leftBounds||fe,u=o.rightBounds||me;if(t){var c=n.layer_;c.source!==o.source&&(c.source=o.source);for(var h=0;h<4;h++)c.leftBounds[h]=a[h],c.rightBounds[h]=u[h];return n.wrapForFullscreen(n.layer_.source),n.updatePresent_(),void r()}if(n.layer_={predistorted:o.predistorted,source:o.source,leftBounds:a.slice(0),rightBounds:u.slice(0)},n.waitingForPresent_=!1,n.layer_&&n.layer_.source){var d=n.wrapForFullscreen(n.layer_.source);n.addFullscreenListeners_(d,(function(){var e=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;n.isPresenting=d===e,n.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch((function(e){console.error("screen.orientation.lock() failed due to",e.message)})),n.waitingForPresent_=!1,n.beginPresent_(),r()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),n.removeFullscreenWrapper(),n.disableWakeLock(),n.endPresent_(),n.removeFullscreenListeners_()),n.fireVRDisplayPresentChange_()}),(function(){n.waitingForPresent_&&(n.removeFullscreenWrapper(),n.removeFullscreenListeners_(),n.disableWakeLock(),n.waitingForPresent_=!1,n.isPresenting=!1,i(new Error("Unable to present.")))})),function(e){if(l())return!1;if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0}(d)?(n.enableWakeLock(),n.waitingForPresent_=!0):(s()||l())&&(n.enableWakeLock(),n.isPresenting=!0,n.beginPresent_(),n.fireVRDisplayPresentChange_(),r())}n.waitingForPresent_||s()||(y(),i(new Error("Unable to present.")))}else r()}else i(new Error("VRDisplay is not capable of presenting."))}))},be.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.disableWakeLock(),new Promise((function(n,r){e?(!y()&&s()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),l()&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.endPresent_(),t.fireVRDisplayPresentChange_()),n()):r(new Error("Was not presenting to VRDisplay."))}))},be.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},be.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});window.dispatchEvent(e)},be.prototype.fireVRDisplayConnect_=function(){var e=new CustomEvent("vrdisplayconnect",{detail:{display:this}});window.dispatchEvent(e)},be.prototype.addFullscreenListeners_=function(e,t,n){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=n,t&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",t,!1)),n&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",n,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",n,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",n,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",n,!1))},be.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var n=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",n,!1),e.removeEventListener("webkitfullscreenerror",n,!1),document.removeEventListener("mozfullscreenerror",n,!1),e.removeEventListener("msfullscreenerror",n,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},be.prototype.enableWakeLock=function(){this.wakelock_&&this.wakelock_.enable()},be.prototype.disableWakeLock=function(){this.wakelock_&&this.wakelock_.disable()},be.prototype.beginPresent_=function(){},be.prototype.endPresent_=function(){},be.prototype.submitFrame=function(e){},be.prototype.getEyeParameters=function(e){return null};var Ae={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},we="left",xe="right";function Ee(e){var t=x({},Ae);e=x(t,e||{}),be.call(this,{wakelock:e.MOBILE_WAKE_LOCK}),this.config=e,this.displayName="Cardboard VRDisplay",this.capabilities=new ye({hasPosition:!1,hasOrientation:!0,hasExternalDisplay:!1,canPresent:!0,maxLayers:1}),this.stageParameters=null,this.bufferScale_=this.config.BUFFER_SCALE,this.poseSensor_=new se(this.config),this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new J(this.config.DPDB_URL,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new Q(this.dpdb_.getDeviceParams(),e.ADDITIONAL_VIEWERS),this.viewerSelector_=new ce(e.DEFAULT_VIEWER),this.viewerSelector_.onChange(this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),this.config.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new le),s()&&window.addEventListener("resize",this.onResize_.bind(this))}return Ee.prototype=Object.create(be.prototype),Ee.prototype._getPose=function(){return{position:null,orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},Ee.prototype._resetPose=function(){this.poseSensor_.resetPose&&this.poseSensor_.resetPose()},Ee.prototype._getFieldOfView=function(e){var t;if(e==we)t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=xe)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return t},Ee.prototype._getEyeOffset=function(e){var t;if(e==we)t=[.5*-this.deviceInfo_.viewer.interLensDistance,0,0];else{if(e!=xe)return console.error("Invalid eye provided: %s",e),null;t=[.5*this.deviceInfo_.viewer.interLensDistance,0,0]}return t},Ee.prototype.getEyeParameters=function(e){var t=this._getEyeOffset(e),n=this._getFieldOfView(e),r={offset:t,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_};return Object.defineProperty(r,"fieldOfView",{enumerable:!0,get:function(){return S("VRFieldOfView","VRFrameData's projection matrices"),n}}),r},Ee.prototype.onDeviceParamsUpdated_=function(e){this.config.DEBUG&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},Ee.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},Ee.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?this.config.CARDBOARD_UI_DISABLED||(e.canvas.width=v()*this.bufferScale_,e.canvas.height=g()*this.bufferScale_,this.cardboardUI_=new F(e)):(this.config.CARDBOARD_UI_DISABLED||(this.cardboardUI_=new F(e)),this.distorter_=new P(e,this.cardboardUI_,this.config.BUFFER_SCALE,this.config.DIRTY_SUBMIT_FRAME_BINDINGS),this.distorter_.updateDeviceInfo(this.deviceInfo_)),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(m()&&w()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.vrdisplaypresentchangeHandler=this.updateBounds_.bind(this),window.addEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler),this.fireVRDisplayDeviceParamsChange_())},Ee.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler),window.removeEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler)},Ee.prototype.updatePresent_=function(){this.endPresent_(),this.beginPresent_()},Ee.prototype.submitFrame=function(e){if(this.distorter_)this.updateBounds_(),this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2"));var n=t.canvas;n.width==this.lastWidth&&n.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=n.width,this.lastHeight=n.height,this.cardboardUI_.render()}},Ee.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},Ee.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl");t||(t=this.layer_.source.getContext("experimental-webgl")),t||(t=this.layer_.source.getContext("webgl2")),t.canvas.setAttribute("style",["position: absolute","top: 0","left: 0","width: 100vw","height: 100vh","border: 0","margin: 0","padding: 0px","box-sizing: content-box"].join("; ")+";"),E(t.canvas)}},Ee.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},Ee.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},Ee.VRFrameData=function(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null},Ee.VRDisplay=be,Ee},e.exports=r()})))&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,s={ADDITIONAL_VIEWERS:[],DEFAULT_VIEWER:"",PROVIDE_MOBILE_VRDISPLAY:!0,MOBILE_WAKE_LOCK:!0,DEBUG:!1,DPDB_URL:"https://dpdb.webvr.rocks/dpdb.json",K_FILTER:.98,PREDICTION_TIME_S:.04,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1};function l(e){this.config=o(o({},s),e),this.polyfillDisplays=[],this.enabled=!1,this.hasNative="getVRDisplays"in navigator,this.native={},this.native.getVRDisplays=navigator.getVRDisplays,this.native.VRFrameData=window.VRFrameData,this.native.VRDisplay=window.VRDisplay,(!this.hasNative||this.config.PROVIDE_MOBILE_VRDISPLAY&&r())&&(this.enable(),this.getVRDisplays().then((function(e){e&&e[0]&&e[0].fireVRDisplayConnect_&&e[0].fireVRDisplayConnect_()})))}l.prototype.getPolyfillDisplays=function(){if(this._polyfillDisplaysPopulated)return this.polyfillDisplays;if(r()){var e=new a({ADDITIONAL_VIEWERS:this.config.ADDITIONAL_VIEWERS,DEFAULT_VIEWER:this.config.DEFAULT_VIEWER,MOBILE_WAKE_LOCK:this.config.MOBILE_WAKE_LOCK,DEBUG:this.config.DEBUG,DPDB_URL:this.config.DPDB_URL,CARDBOARD_UI_DISABLED:this.config.CARDBOARD_UI_DISABLED,K_FILTER:this.config.K_FILTER,PREDICTION_TIME_S:this.config.PREDICTION_TIME_S,ROTATE_INSTRUCTIONS_DISABLED:this.config.ROTATE_INSTRUCTIONS_DISABLED,YAW_ONLY:this.config.YAW_ONLY,BUFFER_SCALE:this.config.BUFFER_SCALE,DIRTY_SUBMIT_FRAME_BINDINGS:this.config.DIRTY_SUBMIT_FRAME_BINDINGS});this.polyfillDisplays.push(e)}return this._polyfillDisplaysPopulated=!0,this.polyfillDisplays},l.prototype.enable=function(){if(this.enabled=!0,this.hasNative&&this.native.VRFrameData){var e=this.native.VRFrameData,t=new this.native.VRFrameData,n=this.native.VRDisplay.prototype.getFrameData;window.VRDisplay.prototype.getFrameData=function(r){r instanceof e?n.call(this,r):(n.call(this,t),r.pose=t.pose,i(t.leftProjectionMatrix,r.leftProjectionMatrix),i(t.rightProjectionMatrix,r.rightProjectionMatrix),i(t.leftViewMatrix,r.leftViewMatrix),i(t.rightViewMatrix,r.rightViewMatrix))}}navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=a.VRDisplay,window.VRFrameData=a.VRFrameData},l.prototype.getVRDisplays=function(){var e=this;return this.config,this.hasNative?this.native.getVRDisplays.call(navigator).then((function(t){return t.length>0?t:e.getPolyfillDisplays()})):Promise.resolve(this.getPolyfillDisplays())},l.version="0.10.12",l.VRFrameData=a.VRFrameData,l.VRDisplay=a.VRDisplay;var u=Object.freeze({default:l}),c=u&&l||u;return void 0!==t&&t.window&&(t.document||(t.document=t.window.document),t.navigator||(t.navigator=t.window.navigator)),c}))}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],69:[function(e,t,n){var r=/\n/,i="\n",o=/\s/;function a(e,t,n,r){var i=e.indexOf(t,n);return-1===i||i>r?r:i}function s(e){return o.test(e)}function l(e,t,n,r){return{start:t,end:t+Math.min(r,n-t)}}t.exports=function(e,n){return t.exports.lines(e,n).map((function(t){return e.substring(t.start,t.end)})).join("\n")},t.exports.lines=function(e,t){if(0===(t=t||{}).width&&"nowrap"!==t.mode)return[];e=e||"";var n="number"==typeof t.width?t.width:Number.MAX_VALUE,o=Math.max(0,t.start||0),u="number"==typeof t.end?t.end:e.length,c=t.mode,h=t.measure||l;return"pre"===c?function(e,t,n,i,o){for(var a=[],s=n,l=n;ln&&!s(t.charAt(p));)p--;if(p===n)f>n+i.length&&f--,p=f;else for(f=p;p>n&&s(t.charAt(p-i.length));)p--}if(p>=n){var m=e(t,n,p,c);u.push(m)}n=f}return u}(h,e,o,u,n,c)}},{}],70:[function(e,t,n){"use strict";var r=e("global/window"),i=e("is-function"),o=e("parse-headers"),a=e("xtend");function s(e,t,n){var r=e;return i(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=a(t,{uri:e}),r.callback=n,r}function l(e,t,n){return u(t=s(e,t,n))}function u(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,n=function(n,r,i){t||(t=!0,e.callback(n,r,i))};function r(){var e=void 0;if(e=c.response?c.response:c.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(c),g)try{e=JSON.parse(e)}catch(e){}return e}function i(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,n(e,y)}function a(){if(!u){var t;clearTimeout(h),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=y,a=null;return 0!==t?(i={body:r(),statusCode:t,method:p,headers:{},url:d,rawRequest:c},c.getAllResponseHeaders&&(i.headers=o(c.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),n(a,i,i.body)}}var s,u,c=e.xhr||null;c||(c=e.cors||e.useXDR?new l.XDomainRequest:new l.XMLHttpRequest);var h,d=c.url=e.uri||e.url,p=c.method=e.method||"GET",f=e.body||e.data,m=c.headers=e.headers||{},v=!!e.sync,g=!1,y={body:void 0,headers:{},statusCode:0,method:p,url:d,rawRequest:c};if("json"in e&&!1!==e.json&&(g=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(a,0)},c.onload=a,c.onerror=i,c.onprogress=function(){},c.onabort=function(){u=!0},c.ontimeout=i,c.open(p,d,!v,e.username,e.password),v||(c.withCredentials=!!e.withCredentials),!v&&e.timeout>0&&(h=setTimeout((function(){if(!u){u=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",i(e)}}),e.timeout)),c.setRequestHeader)for(s in m)m.hasOwnProperty(s)&&c.setRequestHeader(s,m[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(f||null),c}t.exports=l,t.exports.default=l,l.XMLHttpRequest=r.XMLHttpRequest||function(){},l.XDomainRequest="withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:r.XDomainRequest,function(e,t){for(var n=0;n dist/aframe-master.js","dist:min":"npm run browserify -s -- --debug -p [ minifyify --map aframe-master.min.js.map --output dist/aframe-master.min.js.map ] -o dist/aframe-master.min.js",docs:"markserv --dir docs --port 9001",preghpages:"node ./scripts/preghpages.js",ghpages:"ghpages -p gh-pages/",lint:"semistandard -v | snazzy","lint:fix":"semistandard --fix",precommit:"npm run lint",prepush:"node scripts/testOnlyCheck.js",prerelease:"node scripts/release.js 1.0.4 1.1.0",start:"npm run dev","start:https":"cross-env SSL=true npm run dev",test:"karma start ./tests/karma.conf.js","test:docs":"node scripts/docsLint.js","test:firefox":"npm test -- --browsers Firefox","test:chrome":"npm test -- --browsers Chrome","test:nobrowser":"NO_BROWSER=true npm test","test:node":"mocha --ui tdd tests/node"},repository:"aframevr/aframe",license:"MIT",files:["dist/*","docs/**/*","src/**/*","vendor/**/*"],dependencies:{"custom-event-polyfill":"^1.0.6",debug:"ngokevin/debug#noTimestamp","deep-assign":"^2.0.0","document-register-element":"dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90","load-bmfont":"^1.2.3","object-assign":"^4.0.1",present:"0.0.6","promise-polyfill":"^3.1.0","super-animejs":"^3.1.0","super-three":"^0.125.1","three-bmfont-text":"dmarcos/three-bmfont-text#1babdf8507c731a18f8af3b807292e2b9740955e","webvr-polyfill":"^0.10.12"},devDependencies:{browserify:"^13.1.0","browserify-css":"^0.8.4","browserify-derequire":"^0.9.4","browserify-istanbul":"^2.0.0",budo:"^9.2.0",chai:"^3.5.0","chai-shallow-deep-equal":"^1.4.0",chalk:"^1.1.3",codecov:"^1.0.1","cross-env":"^5.0.1",envify:"^3.4.1",exorcist:"^0.4.0",ghpages:"0.0.8","git-rev":"^0.2.1",glob:"^7.1.1",husky:"^0.11.7",istanbul:"^0.4.5",jsdom:"^9.11.0",karma:"1.4.1","karma-browserify":"^5.1.0","karma-chai-shallow-deep-equal":"0.0.4","karma-chrome-launcher":"^2.0.0","karma-coverage":"^1.1.1","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.2.0","karma-mocha":"^1.1.1","karma-mocha-reporter":"^2.1.0","karma-sinon-chai":"1.2.4",lolex:"^1.5.1",markserv:"github:sukima/markserv#feature/fix-broken-websoketio-link",minifyify:"^7.3.3",mocha:"^3.0.2","mozilla-download":"^1.1.1","replace-in-file":"^2.5.3",semistandard:"^9.0.0",shelljs:"^0.7.7",shx:"^0.2.2",sinon:"^1.17.5","sinon-chai":"2.8.0",snazzy:"^5.0.0","too-wordy":"ngokevin/too-wordy",uglifyjs:"^2.4.10","write-good":"^0.9.1"},link:!0,browserify:{transform:["browserify-css","envify"]},semistandard:{ignore:["build/**","dist/**","examples/**/shaders/*.js","**/vendor/**"]},keywords:["3d","aframe","cardboard","components","oculus","three","three.js","rift","vive","vr","web-components","webvr"],"browserify-css":{minify:!0},engines:{node:">= 4.6.0",npm:"^2.15.9"}}},{}],74:[function(e,t,n){var r=e("super-animejs"),i=e("../core/component").components,o=e("../core/component").registerComponent,a=e("../lib/three"),s=e("../utils"),l=new a.Color,u=new a.Color,c=s.entity.getComponentProperty,h=s.entity.setComponentProperty,d={},p="color",f="rotation",m="scale",v="components";function g(e){e.x=a.Math.degToRad(e.x),e.y=a.Math.degToRad(e.y),e.z=a.Math.degToRad(e.z)}function y(e,t,n){var r;for(r=0;r=1),E(o)?w(a,o.property,n,o.type):h(a,o.property,n))})},updateConfigForVector:function(){var e,t,n,r,i=this.config,o=this.data,a=this.el;for(e in t=""!==o.from?s.coordinates.parse(o.from):c(a,o.property),n=s.coordinates.parse(o.to),o.property===f&&(g(t),g(n)),this.targetsArray.length=0,this.targetsArray.push(t),i.targets=this.targetsArray,n)i[e]=n[e];"position"!==o.property&&o.property!==f&&o.property!==m?i.update=function(){var e={};return function(t){var n=t.animatables[0].target;n.x===e.x&&n.y===e.y&&n.z===e.z||(e.x=n.x,e.y=n.y,e.z=n.z,h(a,o.property,n))}}():i.update=(r={},function(e){var t=e.animatables[0].target;o.property===m&&(t.x=Math.max(1e-4,t.x),t.y=Math.max(1e-4,t.y),t.z=Math.max(1e-4,t.z)),t.x===r.x&&t.y===r.y&&t.z===r.z||(r.x=t.x,r.y=t.y,r.z=t.z,a.object3D[o.property].set(t.x,t.y,t.z))})},updateConfig:function(){var e,t,n,r,o,a,s;t=this.el,n=this.data.property,o=(a=n.split("."))[0],s=a[1],e=(r=t.components[o]||i[o])?s&&!r.schema[s]?null:s?r.schema[s].type:r.schema.type:null,E(this.data)&&this.data.type===p?this.updateConfigForRawColor():"vec2"===e||"vec3"===e||"vec4"===e?this.updateConfigForVector():this.updateConfigForDefault()},waitComponentInitRawProperty:function(e){var t,n=this.data,i=this.el,o=this;return""===n.from&&!!n.property.startsWith(v)&&(t=x(n.property)[1],!i.components[t]&&(i.addEventListener("componentinitialized",(function n(a){a.detail.name===t&&(e(),o.animation=r(o.config),i.removeEventListener("componentinitialized",n))})),!0))},stopRelatedAnimations:function(){var e,t;for(t in this.el.components)e=this.el.components[t],t!==this.attrName&&"animation"===e.name&&e.animationIsPlaying&&e.data.property===this.data.property&&(e.animationIsPlaying=!1)},addEventListeners:function(){var e=this.data,t=this.el;y(t,e.startEvents,this.onStartEvent),y(t,e.pauseEvents,this.pauseAnimation),y(t,e.resumeEvents,this.resumeAnimation)},removeEventListeners:function(){var e=this.data,t=this.el;b(t,e.startEvents,this.onStartEvent),b(t,e.pauseEvents,this.pauseAnimation),b(t,e.resumeEvents,this.resumeAnimation)},setColorConfig:function(e,t){l.set(e),u.set(t),e=this.fromColor,t=this.toColor,e.r=l.r,e.g=l.g,e.b=l.b,t.r=u.r,t.g=u.g,t.b=u.b}})},{"../core/component":131,"../lib/three":179,"../utils":205,"super-animejs":56}],75:[function(e,t,n){var r=e("../core/component").registerComponent,i=e("../lib/three");t.exports.Component=r("camera",{schema:{active:{default:!0},far:{default:1e4},fov:{default:80,min:0},near:{default:.005,min:0},spectator:{default:!1},zoom:{default:1,min:0}},init:function(){var e,t=this.el;e=this.camera=new i.PerspectiveCamera,t.setObject3D("camera",e)},update:function(e){var t=this.data,n=this.camera;n.aspect=t.aspect||window.innerWidth/window.innerHeight,n.far=t.far,n.fov=t.fov,n.near=t.near,n.zoom=t.zoom,n.updateProjectionMatrix(),this.updateActiveCamera(e),this.updateSpectatorCamera(e)},updateActiveCamera:function(e){var t=this.data,n=this.el,r=this.system;e&&e.active===t.active||t.spectator||(t.active&&r.activeCameraEl!==n?r.setActiveCamera(n):t.active||r.activeCameraEl!==n||r.disableActiveCamera())},updateSpectatorCamera:function(e){var t=this.data,n=this.el,r=this.system;e&&e.spectator===t.spectator||(t.spectator&&r.spectatorCameraEl!==n?r.setSpectatorCamera(n):t.spectator||r.spectatorCameraEl!==n||r.disableSpectatorCamera())},remove:function(){this.el.removeObject3D("camera")}})},{"../core/component":131,"../lib/three":179}],76:[function(e,t,n){var r,i,o,a,s=e("../core/component").registerComponent,l=e("../utils/"),u=l.bind,c="click",h="fusing",d="mouseenter",p="mousedown",f="mouseleave",m="mouseup",v="cursor-fusing",g="cursor-hovering",y="cursor-hovered",b={DOWN:["mousedown","touchstart"],UP:["mouseup","touchend"]},A={DOWN:["selectstart"],UP:["selectend"]},w="a-mouse-cursor-hover";t.exports.Component=s("cursor",{dependencies:["raycaster"],schema:{downEvents:{default:[]},fuse:{default:l.device.isMobile()},fuseTimeout:{default:1500,min:0},mouseCursorStylesEnabled:{default:!0},upEvents:{default:[]},rayOrigin:{default:"entity",oneOf:["mouse","entity"]}},init:function(){var e=this;this.fuseTimeout=void 0,this.cursorDownEl=null,this.intersectedEl=null,this.canvasBounds=document.body.getBoundingClientRect(),this.isCursorDown=!1,this.updateCanvasBounds=l.debounce((function(){e.canvasBounds=e.el.sceneEl.canvas.getBoundingClientRect()}),500),this.eventDetail={},this.intersectedEventDetail={cursorEl:this.el},this.onCursorDown=u(this.onCursorDown,this),this.onCursorUp=u(this.onCursorUp,this),this.onIntersection=u(this.onIntersection,this),this.onIntersectionCleared=u(this.onIntersectionCleared,this),this.onMouseMove=u(this.onMouseMove,this),this.onEnterVR=u(this.onEnterVR,this)},update:function(e){this.data.rayOrigin!==e.rayOrigin&&this.updateMouseEventListeners()},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},remove:function(){var e=this.el;e.removeState(g),e.removeState(v),clearTimeout(this.fuseTimeout),this.intersectedEl&&this.intersectedEl.removeState(y),this.removeEventListeners()},addEventListeners:function(){var e,t=this.data,n=this.el,r=this;function i(){e=n.sceneEl.canvas,t.downEvents.length||t.upEvents.length||(b.DOWN.forEach((function(t){e.addEventListener(t,r.onCursorDown)})),b.UP.forEach((function(t){e.addEventListener(t,r.onCursorUp)})))}(e=n.sceneEl.canvas)?i():n.sceneEl.addEventListener("render-target-loaded",i),t.downEvents.forEach((function(e){n.addEventListener(e,r.onCursorDown)})),t.upEvents.forEach((function(e){n.addEventListener(e,r.onCursorUp)})),n.addEventListener("raycaster-intersection",this.onIntersection),n.addEventListener("raycaster-intersection-cleared",this.onIntersectionCleared),n.sceneEl.addEventListener("rendererresize",this.updateCanvasBounds),n.sceneEl.addEventListener("enter-vr",this.onEnterVR),window.addEventListener("resize",this.updateCanvasBounds),window.addEventListener("scroll",this.updateCanvasBounds),this.updateMouseEventListeners()},removeEventListeners:function(){var e,t=this.data,n=this.el,r=this;!(e=n.sceneEl.canvas)||t.downEvents.length||t.upEvents.length||(b.DOWN.forEach((function(t){e.removeEventListener(t,r.onCursorDown)})),b.UP.forEach((function(t){e.removeEventListener(t,r.onCursorUp)}))),t.downEvents.forEach((function(e){n.removeEventListener(e,r.onCursorDown)})),t.upEvents.forEach((function(e){n.removeEventListener(e,r.onCursorUp)})),n.removeEventListener("raycaster-intersection",this.onIntersection),n.removeEventListener("raycaster-intersection-cleared",this.onIntersectionCleared),e.removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("touchstart",this.onMouseMove),e.removeEventListener("touchmove",this.onMouseMove),n.sceneEl.removeEventListener("rendererresize",this.updateCanvasBounds),n.sceneEl.removeEventListener("enter-vr",this.onEnterVR),window.removeEventListener("resize",this.updateCanvasBounds),window.removeEventListener("scroll",this.updateCanvasBounds)},updateMouseEventListeners:function(){var e,t=this.el;(e=t.sceneEl.canvas).removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("touchmove",this.onMouseMove),t.setAttribute("raycaster","useWorldCoordinates",!1),"mouse"===this.data.rayOrigin&&(e.addEventListener("mousemove",this.onMouseMove,!1),e.addEventListener("touchmove",this.onMouseMove,!1),t.setAttribute("raycaster","useWorldCoordinates",!0),this.updateCanvasBounds())},onMouseMove:(r=new THREE.Vector3,i=new THREE.Vector2,o=new THREE.Vector3,a={origin:o,direction:r},function(e){var t,n,s,l=this.canvasBounds,u=this.el.sceneEl.camera;u.parent.updateMatrixWorld(),t=(n="touchmove"===e.type||"touchstart"===e.type?e.touches.item(0):e).clientX-l.left,s=n.clientY-l.top,i.x=t/l.width*2-1,i.y=-s/l.height*2+1,o.setFromMatrixPosition(u.matrixWorld),r.set(i.x,i.y,.5).unproject(u).sub(o).normalize(),this.el.setAttribute("raycaster",a),"touchmove"===e.type&&e.preventDefault()}),onCursorDown:function(e){this.isCursorDown=!0,"mouse"===this.data.rayOrigin&&"touchstart"===e.type&&(this.onMouseMove(e),this.el.components.raycaster.checkIntersections(),e.preventDefault()),this.twoWayEmit(p),this.cursorDownEl=this.intersectedEl},onCursorUp:function(e){if(this.isCursorDown){this.isCursorDown=!1;var t=this.data;this.twoWayEmit(m),this.cursorDownEl&&this.cursorDownEl!==this.intersectedEl&&(this.intersectedEventDetail.intersection=null,this.cursorDownEl.emit(m,this.intersectedEventDetail)),t.fuse&&"mouse"!==t.rayOrigin||!this.intersectedEl||this.cursorDownEl!==this.intersectedEl||this.twoWayEmit(c),this.cursorDownEl=null,"touchend"===e.type&&e.preventDefault()}},onIntersection:function(e){var t,n,r,i,o=this.el;n=e.detail.els[0]===o?1:0,i=e.detail.intersections[n],(r=e.detail.els[n])&&this.intersectedEl!==r&&(this.intersectedEl&&(t=this.el.components.raycaster.getIntersection(this.intersectedEl))&&t.distance<=i.distance||(this.clearCurrentIntersection(!0),this.setIntersection(r,i)))},onIntersectionCleared:function(e){-1!==e.detail.clearedEls.indexOf(this.intersectedEl)&&this.clearCurrentIntersection()},onEnterVR:function(){this.clearCurrentIntersection(!0);var e=this.el.sceneEl.xrSession,t=this;e&&"mouse"!==this.data.rayOrigin&&(A.DOWN.forEach((function(n){e.addEventListener(n,t.onCursorDown)})),A.UP.forEach((function(n){e.addEventListener(n,t.onCursorUp)})))},setIntersection:function(e,t){var n=this.el,r=this.data,i=this;this.intersectedEl!==e&&(this.intersectedEl=e,n.addState(g),e.addState(y),this.twoWayEmit(d),this.data.mouseCursorStylesEnabled&&"mouse"===this.data.rayOrigin&&this.el.sceneEl.canvas.classList.add(w),0!==r.fuseTimeout&&r.fuse&&(n.addState(v),this.twoWayEmit(h),this.fuseTimeout=setTimeout((function(){n.removeState(v),i.twoWayEmit(c)}),r.fuseTimeout)))},clearCurrentIntersection:function(e){var t,n,r=this.el;this.intersectedEl&&(this.intersectedEl.removeState(y),r.removeState(g),r.removeState(v),this.twoWayEmit(f),this.data.mouseCursorStylesEnabled&&"mouse"===this.data.rayOrigin&&this.el.sceneEl.canvas.classList.remove(w),this.intersectedEl=null,clearTimeout(this.fuseTimeout),!0!==e&&0!==(n=this.el.components.raycaster.intersections).length&&(t=n[n[0].object.el===r?1:0])&&this.setIntersection(t.object.el,t))},twoWayEmit:function(e){var t,n=this.el,r=this.intersectedEl;t=this.el.components.raycaster.getIntersection(r),this.eventDetail.intersectedEl=r,this.eventDetail.intersection=t,n.emit(e,this.eventDetail),r&&(this.intersectedEventDetail.intersection=t,r.emit(e,this.intersectedEventDetail))}})},{"../core/component":131,"../utils/":205}],77:[function(e,t,n){var r=e("../core/component").registerComponent,i=e("../utils/bind"),o=e("../utils/tracked-controls"),a=o.checkControllerPresentAndSetup,s=o.emitIfAxesChanged,l=o.onButtonEvent,u=e("../utils/").device.isWebXRAvailable,c=u?"google-daydream":"Daydream Controller",h=u?{axes:{touchpad:[0,1]},buttons:["none","none","touchpad","menu","system"]}:{axes:{trackpad:[0,1]},buttons:["trackpad","menu","system"]};t.exports.Component=r("daydream-controls",{schema:{hand:{default:""},buttonColor:{type:"color",default:"#000000"},buttonTouchedColor:{type:"color",default:"#777777"},buttonHighlightColor:{type:"color",default:"#FFFFFF"},model:{default:!0},orientationOffset:{type:"vec3"},armModel:{default:!0}},mapping:h,bindMethods:function(){this.onModelLoaded=i(this.onModelLoaded,this),this.onControllersUpdate=i(this.onControllersUpdate,this),this.checkIfControllerPresent=i(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=i(this.removeControllersUpdateListener,this),this.onAxisMoved=i(this.onAxisMoved,this)},init:function(){var e=this;this.onButtonChanged=i(this.onButtonChanged,this),this.onButtonDown=function(t){l(t.detail.id,"down",e)},this.onButtonUp=function(t){l(t.detail.id,"up",e)},this.onButtonTouchStart=function(t){l(t.detail.id,"touchstart",e)},this.onButtonTouchEnd=function(t){l(t.detail.id,"touchend",e)},this.controllerPresent=!1,this.lastControllerCheck=0,this.bindMethods()},addEventListeners:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("touchstart",this.onButtonTouchStart),e.addEventListener("touchend",this.onButtonTouchEnd),e.addEventListener("model-loaded",this.onModelLoaded),e.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0},removeEventListeners:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("touchstart",this.onButtonTouchStart),e.removeEventListener("touchend",this.onButtonTouchEnd),e.removeEventListener("model-loaded",this.onModelLoaded),e.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1},checkIfControllerPresent:function(){a(this,c,this.data.hand?{hand:this.data.hand}:{})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var e=this.el,t=this.data;e.setAttribute("tracked-controls",{armModel:t.armModel,hand:t.hand,idPrefix:c,id:c,orientationOffset:t.orientationOffset}),this.data.model&&this.el.setAttribute("obj-model",{obj:"https://cdn.aframe.io/controllers/google/vr_controller_daydream.obj",mtl:"https://cdn.aframe.io/controllers/google/vr_controller_daydream.mtl"})},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onModelLoaded:function(e){var t,n=e.detail.model;this.data.model&&((t=this.buttonMeshes={}).menu=n.getObjectByName("AppButton_AppButton_Cylinder.004"),t.system=n.getObjectByName("HomeButton_HomeButton_Cylinder.005"),t.trackpad=n.getObjectByName("TouchPad_TouchPad_Cylinder.003"),t.touchpad=n.getObjectByName("TouchPad_TouchPad_Cylinder.003"),n.position.set(0,0,-.04))},onAxisMoved:function(e){s(this,this.mapping.axes,e)},onButtonChanged:function(e){var t=this.mapping.buttons[e.detail.id];t&&this.el.emit(t+"changed",e.detail.state)},updateModel:function(e,t){this.data.model&&this.updateButtonModel(e,t)},updateButtonModel:function(e,t){var n=this.buttonMeshes;if(n&&n[e]){var r;switch(t){case"down":r=this.data.buttonHighlightColor;break;case"touchstart":r=this.data.buttonTouchedColor;break;default:r=this.data.buttonColor}n[e].material.color.set(r)}}})},{"../core/component":131,"../utils/":205,"../utils/bind":199,"../utils/tracked-controls":214}],78:[function(e,t,n){var r=e("../core/component").registerComponent,i=e("../utils/bind"),o=e("../utils/tracked-controls"),a=o.checkControllerPresentAndSetup,s=o.emitIfAxesChanged,l=o.onButtonEvent,u=e("../utils/").device.isWebXRAvailable,c=u?"samsung-gearvr":"Gear VR",h=u?{axes:{touchpad:[0,1]},buttons:["trigger","none","touchpad","none","menu"]}:{axes:{trackpad:[0,1]},buttons:["trackpad","trigger"]};t.exports.Component=r("gearvr-controls",{schema:{hand:{default:""},buttonColor:{type:"color",default:"#000000"},buttonTouchedColor:{type:"color",default:"#777777"},buttonHighlightColor:{type:"color",default:"#FFFFFF"},model:{default:!0},orientationOffset:{type:"vec3"},armModel:{default:!0}},mapping:h,bindMethods:function(){this.onModelLoaded=i(this.onModelLoaded,this),this.onControllersUpdate=i(this.onControllersUpdate,this),this.checkIfControllerPresent=i(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=i(this.removeControllersUpdateListener,this),this.onAxisMoved=i(this.onAxisMoved,this)},init:function(){var e=this;this.onButtonChanged=i(this.onButtonChanged,this),this.onButtonDown=function(t){l(t.detail.id,"down",e)},this.onButtonUp=function(t){l(t.detail.id,"up",e)},this.onButtonTouchStart=function(t){l(t.detail.id,"touchstart",e)},this.onButtonTouchEnd=function(t){l(t.detail.id,"touchend",e)},this.controllerPresent=!1,this.lastControllerCheck=0,this.bindMethods()},addEventListeners:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("touchstart",this.onButtonTouchStart),e.addEventListener("touchend",this.onButtonTouchEnd),e.addEventListener("model-loaded",this.onModelLoaded),e.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0},removeEventListeners:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("touchstart",this.onButtonTouchStart),e.removeEventListener("touchend",this.onButtonTouchEnd),e.removeEventListener("model-loaded",this.onModelLoaded),e.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1},checkIfControllerPresent:function(){a(this,c,this.data.hand?{hand:this.data.hand}:{})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var e=this.el,t=this.data;e.setAttribute("tracked-controls",{armModel:t.armModel,hand:t.hand,idPrefix:c,id:c,orientationOffset:t.orientationOffset}),this.data.model&&this.el.setAttribute("obj-model",{obj:"https://cdn.aframe.io/controllers/samsung/gear_vr_controller.obj",mtl:"https://cdn.aframe.io/controllers/samsung/gear_vr_controller.mtl"})},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onModelLoaded:function(e){var t,n=e.detail.model;this.data.model&&((t=this.buttonMeshes={}).trigger=n.children[2],t.trackpad=n.children[1],t.touchpad=n.children[1])},onButtonChanged:function(e){var t=this.mapping.buttons[e.detail.id];t&&this.el.emit(t+"changed",e.detail.state)},onAxisMoved:function(e){s(this,this.mapping.axes,e)},updateModel:function(e,t){this.data.model&&this.updateButtonModel(e,t)},updateButtonModel:function(e,t){var n=this.buttonMeshes;if(n&&n[e]){var r;switch(t){case"down":r=this.data.buttonHighlightColor;break;case"touchstart":r=this.data.buttonTouchedColor;break;default:r=this.data.buttonColor}n[e].material.color.set(r)}}})},{"../core/component":131,"../utils/":205,"../utils/bind":199,"../utils/tracked-controls":214}],79:[function(e,t,n){var r=e("../core/component").registerComponent,i=e("../utils/bind"),o=e("../utils/tracked-controls"),a=o.checkControllerPresentAndSetup,s=o.emitIfAxesChanged,l=o.onButtonEvent,u="generic";t.exports.Component=r("generic-tracked-controller-controls",{schema:{hand:{default:""},defaultModel:{default:!0},defaultModelColor:{default:"gray"},orientationOffset:{type:"vec3"},disabled:{default:!1}},mapping:{axes:{touchpad:[0,1],thumbstick:[2,3]},buttons:["trigger","squeeze","touchpad","thumbstick"]},bindMethods:function(){this.onControllersUpdate=i(this.onControllersUpdate,this),this.checkIfControllerPresent=i(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=i(this.removeControllersUpdateListener,this),this.onAxisMoved=i(this.onAxisMoved,this)},init:function(){var e=this;this.onButtonChanged=i(this.onButtonChanged,this),this.onButtonDown=function(t){l(t.detail.id,"down",e)},this.onButtonUp=function(t){l(t.detail.id,"up",e)},this.onButtonTouchStart=function(t){l(t.detail.id,"touchstart",e)},this.onButtonTouchEnd=function(t){l(t.detail.id,"touchend",e)},this.controllerPresent=!1,this.wasControllerConnected=!1,this.lastControllerCheck=0,this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods(),this.el.addEventListener("controllerconnected",(function(t){t.detail.name!==e.name&&(e.wasControllerConnected=!0,e.removeEventListeners(),e.removeControllersUpdateListener())}))},addEventListeners:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("touchstart",this.onButtonTouchStart),e.addEventListener("touchend",this.onButtonTouchEnd),e.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0},removeEventListeners:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("touchstart",this.onButtonTouchStart),e.removeEventListener("touchend",this.onButtonTouchEnd),e.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1},checkIfControllerPresent:function(){var e=this.data,t=e.hand?e.hand:void 0;a(this,u,{hand:t,iterateControllerProfiles:!0})},play:function(){this.wasControllerConnected||(this.checkIfControllerPresent(),this.addControllersUpdateListener())},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var e=this.el,t=this.data;this.el.components["tracked-controls"]?this.removeEventListeners():(e.setAttribute("tracked-controls",{hand:t.hand,idPrefix:u,orientationOffset:t.orientationOffset,iterateControllerProfiles:!0}),this.data.defaultModel&&this.initDefaultModel())},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onButtonChanged:function(e){var t=this.mapping.buttons[e.detail.id];t&&this.el.emit(t+"changed",e.detail.state)},onAxisMoved:function(e){s(this,this.mapping.axes,e)},initDefaultModel:function(){var e=this.modelEl=document.createElement("a-entity");e.setAttribute("geometry",{primitive:"sphere",radius:.03}),e.setAttribute("material",{color:this.data.color}),this.el.appendChild(e)}})},{"../core/component":131,"../utils/bind":199,"../utils/tracked-controls":214}],80:[function(e,t,n){var r=e("../core/geometry").geometries,i=e("../core/geometry").geometryNames,o=e("../core/component").registerComponent,a=e("../lib/three"),s=new a.BufferGeometry;t.exports.Component=o("geometry",{schema:{buffer:{default:!0},primitive:{default:"box",oneOf:i,schemaChange:!0},skipCache:{default:!1}},init:function(){this.geometry=null},update:function(e){var t,n=this.data,r=this.el,i=this.system;this.geometry&&(i.unuseGeometry(e),this.geometry=null),this.geometry=i.getOrCreateGeometry(n),(t=r.getObject3D("mesh"))?t.geometry=this.geometry:((t=new a.Mesh).geometry=this.geometry,this.el.getAttribute("material")||(t.material=new a.MeshStandardMaterial({color:16777215*Math.random(),metalness:0,roughness:.5})),r.setObject3D("mesh",t))},remove:function(){this.system.unuseGeometry(this.data),this.el.getObject3D("mesh").geometry=s,this.geometry=null},updateSchema:function(e){var t=this.oldData&&this.oldData.primitive,n=e.primitive,i=r[n]&&r[n].schema;if(!i)throw new Error("Unknown geometry schema `"+n+"`");t&&t===n||this.extendSchema(i)}})},{"../core/component":131,"../core/geometry":132,"../lib/three":179}],81:[function(e,t,n){var r=e("../core/component").registerComponent,i=e("../lib/three"),o=e("../utils/").debug("components:gltf-model:warn");t.exports.Component=r("gltf-model",{schema:{type:"model"},init:function(){var e=this.system.getDRACOLoader();this.model=null,this.loader=new i.GLTFLoader,e&&this.loader.setDRACOLoader(e)},update:function(){var e=this,t=this.el,n=this.data;n&&(this.remove(),this.loader.load(n,(function(n){e.model=n.scene||n.scenes[0],e.model.animations=n.animations,t.setObject3D("mesh",e.model),t.emit("model-loaded",{format:"gltf",model:e.model})}),void 0,(function(e){var r=e&&e.message?e.message:"Failed to load glTF model";o(r),t.emit("model-error",{format:"gltf",src:n})})))},remove:function(){this.model&&this.el.removeObject3D("mesh")}})},{"../core/component":131,"../lib/three":179,"../utils/":205}],82:[function(e,t,n){var r=e("../core/component").registerComponent,i={toonLeft:"https://cdn.aframe.io/controllers/hands/leftHand.glb",toonRight:"https://cdn.aframe.io/controllers/hands/rightHand.glb",lowPolyLeft:"https://cdn.aframe.io/controllers/hands/leftHandLow.glb",lowPolyRight:"https://cdn.aframe.io/controllers/hands/rightHandLow.glb",highPolyLeft:"https://cdn.aframe.io/controllers/hands/leftHandHigh.glb",highPolyRight:"https://cdn.aframe.io/controllers/hands/rightHandHigh.glb"},o="Open",a="Point",s="Point + Thumb",l="Fist",u="Hold",c="Thumb Up",h={};function d(e,t){var n;if(e)return"grip"===(n=h[e])?n+(t?"close":"open"):"point"===n?n+(t?"up":"down"):"pointing"===n||"pistol"===n?n+(t?"start":"end"):void 0}h[l]="grip",h[c]="pistol",h[a]="pointing",t.exports.Component=r("hand-controls",{schema:{color:{default:"white",type:"color"},hand:{default:"left"},handModelStyle:{default:"lowPoly",oneOf:["lowPoly","highPoly","toon"]}},init:function(){var e=this,t=this.el;this.gesture=o,this.pressedButtons={},this.touchedButtons={},this.loader=new THREE.GLTFLoader,this.loader.setCrossOrigin("anonymous"),this.onGripDown=function(){e.handleButton("grip","down")},this.onGripUp=function(){e.handleButton("grip","up")},this.onTrackpadDown=function(){e.handleButton("trackpad","down")},this.onTrackpadUp=function(){e.handleButton("trackpad","up")},this.onTrackpadTouchStart=function(){e.handleButton("trackpad","touchstart")},this.onTrackpadTouchEnd=function(){e.handleButton("trackpad","touchend")},this.onTriggerDown=function(){e.handleButton("trigger","down")},this.onTriggerUp=function(){e.handleButton("trigger","up")},this.onTriggerTouchStart=function(){e.handleButton("trigger","touchstart")},this.onTriggerTouchEnd=function(){e.handleButton("trigger","touchend")},this.onGripTouchStart=function(){e.handleButton("grip","touchstart")},this.onGripTouchEnd=function(){e.handleButton("grip","touchend")},this.onThumbstickDown=function(){e.handleButton("thumbstick","down")},this.onThumbstickUp=function(){e.handleButton("thumbstick","up")},this.onAorXTouchStart=function(){e.handleButton("AorX","touchstart")},this.onAorXTouchEnd=function(){e.handleButton("AorX","touchend")},this.onBorYTouchStart=function(){e.handleButton("BorY","touchstart")},this.onBorYTouchEnd=function(){e.handleButton("BorY","touchend")},this.onSurfaceTouchStart=function(){e.handleButton("surface","touchstart")},this.onSurfaceTouchEnd=function(){e.handleButton("surface","touchend")},this.onControllerConnected=this.onControllerConnected.bind(this),this.onControllerDisconnected=this.onControllerDisconnected.bind(this),t.addEventListener("controllerconnected",this.onControllerConnected),t.addEventListener("controllerdisconnected",this.onControllerDisconnected),t.object3D.visible=!1},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},tick:function(e,t){var n=this.el.getObject3D("mesh");n&&n.mixer&&n.mixer.update(t/1e3)},onControllerConnected:function(){this.el.object3D.visible=!0},onControllerDisconnected:function(){this.el.object3D.visible=!1},addEventListeners:function(){var e=this.el;e.addEventListener("gripdown",this.onGripDown),e.addEventListener("gripup",this.onGripUp),e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("trackpadtouchstart",this.onTrackpadTouchStart),e.addEventListener("trackpadtouchend",this.onTrackpadTouchEnd),e.addEventListener("triggerdown",this.onTriggerDown),e.addEventListener("triggerup",this.onTriggerUp),e.addEventListener("triggertouchstart",this.onTriggerTouchStart),e.addEventListener("triggertouchend",this.onTriggerTouchEnd),e.addEventListener("griptouchstart",this.onGripTouchStart),e.addEventListener("griptouchend",this.onGripTouchEnd),e.addEventListener("thumbstickdown",this.onThumbstickDown),e.addEventListener("thumbstickup",this.onThumbstickUp),e.addEventListener("abuttontouchstart",this.onAorXTouchStart),e.addEventListener("abuttontouchend",this.onAorXTouchEnd),e.addEventListener("bbuttontouchstart",this.onBorYTouchStart),e.addEventListener("bbuttontouchend",this.onBorYTouchEnd),e.addEventListener("xbuttontouchstart",this.onAorXTouchStart),e.addEventListener("xbuttontouchend",this.onAorXTouchEnd),e.addEventListener("ybuttontouchstart",this.onBorYTouchStart),e.addEventListener("ybuttontouchend",this.onBorYTouchEnd),e.addEventListener("surfacetouchstart",this.onSurfaceTouchStart),e.addEventListener("surfacetouchend",this.onSurfaceTouchEnd)},removeEventListeners:function(){var e=this.el;e.removeEventListener("gripdown",this.onGripDown),e.removeEventListener("gripup",this.onGripUp),e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("trackpadtouchstart",this.onTrackpadTouchStart),e.removeEventListener("trackpadtouchend",this.onTrackpadTouchEnd),e.removeEventListener("triggerdown",this.onTriggerDown),e.removeEventListener("triggerup",this.onTriggerUp),e.removeEventListener("triggertouchstart",this.onTriggerTouchStart),e.removeEventListener("triggertouchend",this.onTriggerTouchEnd),e.removeEventListener("griptouchstart",this.onGripTouchStart),e.removeEventListener("griptouchend",this.onGripTouchEnd),e.removeEventListener("thumbstickdown",this.onThumbstickDown),e.removeEventListener("thumbstickup",this.onThumbstickUp),e.removeEventListener("abuttontouchstart",this.onAorXTouchStart),e.removeEventListener("abuttontouchend",this.onAorXTouchEnd),e.removeEventListener("bbuttontouchstart",this.onBorYTouchStart),e.removeEventListener("bbuttontouchend",this.onBorYTouchEnd),e.removeEventListener("xbuttontouchstart",this.onAorXTouchStart),e.removeEventListener("xbuttontouchend",this.onAorXTouchEnd),e.removeEventListener("ybuttontouchstart",this.onBorYTouchStart),e.removeEventListener("ybuttontouchend",this.onBorYTouchEnd),e.removeEventListener("surfacetouchstart",this.onSurfaceTouchStart),e.removeEventListener("surfacetouchend",this.onSurfaceTouchEnd)},update:function(e){var t,n=this.el,r=this.data.hand,o=this.data.handModelStyle,a=this.data.color,s=this;if(t={hand:r,model:!1},r!==e){var l=i[o+r.charAt(0).toUpperCase()+r.slice(1)];this.loader.load(l,(function(e){var i=e.scene.children[0],o="left"===r?Math.PI/2:-Math.PI/2;i.mixer=new THREE.AnimationMixer(i),s.clips=e.animations,n.setObject3D("mesh",i),i.children[1].material.color=new THREE.Color(a),i.position.set(0,0,0),i.rotation.set(0,0,o),n.setAttribute("magicleap-controls",t),n.setAttribute("vive-controls",t),n.setAttribute("oculus-touch-controls",t),n.setAttribute("windows-motion-controls",t)}))}},remove:function(){this.el.removeObject3D("mesh")},handleButton:function(e,t){var n,r="down"===t,i="touchstart"===t;if(0===t.indexOf("touch")){if(i===this.touchedButtons[e])return;this.touchedButtons[e]=i}else{if(r===this.pressedButtons[e])return;this.pressedButtons[e]=r}n=this.gesture,this.gesture=this.determineGesture(),this.gesture!==n&&(this.animateGesture(this.gesture,n),this.emitGestureEvents(this.gesture,n))},determineGesture:function(){var e,t,n,r=this.pressedButtons.grip,i=this.pressedButtons.surface||this.touchedButtons.surface,o=this.pressedButtons.trackpad||this.touchedButtons.trackpad,h=this.pressedButtons.trigger||this.touchedButtons.trigger,d=this.touchedButtons.AorX||this.touchedButtons.BorY;return t=this.el.components["tracked-controls"],(n=t&&t.controller)&&(n.id&&0===n.id.indexOf("OpenVR ")||n.profiles&&n.profiles[0]&&"htc-vive-controller-mv"===n.profiles[0])?r||h?e=l:o&&(e=a):r?e=i||d||o?h?l:a:h?c:s:h&&(e=u),e},getClip:function(e){var t,n;for(n=0;n.03&&!0===this.isPinched&&(this.isPinched=!1,this.pinchEventDetail.position.copy(t).lerp(r,.5),this.pinchEventDetail.position.y+=1.5,this.el.emit("pinchended",this.pinchEventDetail)),this.isPinched&&(this.pinchEventDetail.position.copy(t).lerp(r,.5),this.pinchEventDetail.position.y+=1.5,this.el.emit("pinchmoved",this.pinchEventDetail)),t.y+=1.5}}}),pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var e=this.el,t=this.data;e.setAttribute("tracked-controls",{hand:t.hand,iterateControllerProfiles:!0,handTrackingEnabled:!0}),this.initDefaultModel()},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){var e;this.checkIfControllerPresent(),e=this.el.components["tracked-controls"]&&this.el.components["tracked-controls"].controller,this.el.getObject3D("mesh")&&(e&&e.hand&&e.hand[0]||(this.el.getObject3D("mesh").visible=!1))},initDefaultModel:function(){this.el.getObject3D("mesh")||("dots"===this.data.modelStyle&&this.initDotsModel(),"mesh"===this.data.modelStyle&&this.initMeshHandModel())},initDotsModel:function(){if(0===this.jointEls.length)for(var e=0;e20)this.previousQuaternion||(this.quaternionClone.copy(u),this.previousQuaternion=this.quaternionClone),r.lookAt(s);else{if(e=this.calculateCameraPortalOrientation(),t<.5){if(!0===this.semiSphereEl.getAttribute("visible"))return;o.setAttribute("text","width",1.5),e<=0?(o.setAttribute("position","0 0 0.75"),o.setAttribute("rotation","0 180 0"),this.semiSphereEl.setAttribute("rotation","0 0 0")):(o.setAttribute("position","0 0 -0.75"),o.setAttribute("rotation","0 0 0"),this.semiSphereEl.setAttribute("rotation","0 180 0")),n.getObject3D("mesh").visible=!1,this.semiSphereEl.setAttribute("visible",!0),this.peekCameraPortalOrientation=e}else e<=0?o.setAttribute("rotation","0 180 0"):o.setAttribute("rotation","0 0 0"),o.setAttribute("text","width",5),o.setAttribute("position","0 1.5 0"),n.getObject3D("mesh").visible=!0,this.semiSphereEl.setAttribute("visible",!1),this.peekCameraPortalOrientation=void 0;this.previousQuaternion&&(r.quaternion.copy(this.previousQuaternion),this.previousQuaternion=void 0)}}),hideAll:function(){var e=this.el,t=this.hiddenEls,n=this;t.length>0||e.sceneEl.object3D.traverse((function(r){r&&r.el&&r.el.hasAttribute("link-controls")||r.el&&r!==e.sceneEl.object3D&&r.el!==e&&r.el!==n.sphereEl&&r.el!==e.sceneEl.cameraEl&&!1!==r.el.getAttribute("visible")&&r.el!==n.textEl&&r.el!==n.semiSphereEl&&(r.el.setAttribute("visible",!1),t.push(r.el))}))},showAll:function(){this.hiddenEls.forEach((function(e){e.setAttribute("visible",!0)})),this.hiddenEls=[]},calculateCameraPortalOrientation:(r=new p.Matrix4,i=new p.Vector3,o=new p.Vector3(0,0,1),a=new p.Vector3(0,0,0),function(){var e=this.el,t=e.sceneEl.camera;return i.set(0,0,0),o.set(0,0,1),a.set(0,0,0),e.object3D.matrixWorld.extractRotation(r),o.applyMatrix4(r),e.object3D.updateMatrixWorld(),e.object3D.localToWorld(a),t.parent.parent.updateMatrixWorld(),t.parent.updateMatrixWorld(),t.updateMatrixWorld(),t.localToWorld(i),i.sub(a).normalize(),o.normalize(),Math.sign(o.dot(i))}),remove:function(){this.removeEventListener()}}),d("portal",{schema:{borderEnabled:{default:1,type:"int",is:"uniform"},backgroundColor:{default:"red",type:"color",is:"uniform"},pano:{type:"map",is:"uniform"},strokeColor:{default:"white",type:"color",is:"uniform"}},vertexShader:["vec3 portalPosition;","varying vec3 vWorldPosition;","varying float vDistanceToCenter;","varying float vDistance;","void main() {","vDistanceToCenter = clamp(length(position - vec3(0.0, 0.0, 0.0)), 0.0, 1.0);","portalPosition = (modelMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz;","vDistance = length(portalPosition - cameraPosition);","vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI2 0.15915494","uniform sampler2D pano;","uniform vec3 strokeColor;","uniform vec3 backgroundColor;","uniform float borderEnabled;","varying float vDistanceToCenter;","varying float vDistance;","varying vec3 vWorldPosition;","void main() {","vec3 direction = normalize(vWorldPosition - cameraPosition);","vec2 sampleUV;","float borderThickness = clamp(exp(-vDistance / 50.0), 0.6, 0.95);","sampleUV.y = clamp(direction.y * 0.5 + 0.5, 0.0, 1.0);","sampleUV.x = atan(direction.z, -direction.x) * -RECIPROCAL_PI2 + 0.5;","if (vDistanceToCenter > borderThickness && borderEnabled == 1.0) {","gl_FragColor = vec4(strokeColor, 1.0);","} else {","gl_FragColor = mix(texture2D(pano, sampleUV), vec4(backgroundColor, 1.0), clamp(pow((vDistance / 15.0), 2.0), 0.0, 1.0));","}","}"].join("\n")})},{"../core/component":131,"../core/shader":141,"../lib/three":179}],90:[function(e,t,n){var r,i=e("../core/component").registerComponent,o=e("../lib/three"),a=e("../utils/"),s=a.bind,l=Math.PI/2;t.exports.Component=i("look-controls",{dependencies:["position","rotation"],schema:{enabled:{default:!0},magicWindowTrackingEnabled:{default:!0},pointerLockEnabled:{default:!1},reverseMouseDrag:{default:!1},reverseTouchDrag:{default:!1},touchEnabled:{default:!0},mouseEnabled:{default:!0}},init:function(){this.deltaYaw=0,this.previousHMDPosition=new o.Vector3,this.hmdQuaternion=new o.Quaternion,this.magicWindowAbsoluteEuler=new o.Euler,this.magicWindowDeltaEuler=new o.Euler,this.position=new o.Vector3,this.magicWindowObject=new o.Object3D,this.rotation={},this.deltaRotation={},this.savedPose=null,this.pointerLocked=!1,this.setupMouseControls(),this.bindMethods(),this.previousMouseEvent={},this.setupMagicWindowControls(),this.savedPose={position:new o.Vector3,rotation:new o.Euler},this.el.sceneEl.is("vr-mode")&&this.onEnterVR()},setupMagicWindowControls:function(){var e,t=this.data;a.device.isMobile()&&(e=this.magicWindowControls=new o.DeviceOrientationControls(this.magicWindowObject),"undefined"!=typeof DeviceOrientationEvent&&DeviceOrientationEvent.requestPermission&&(e.enabled=!1,this.el.sceneEl.components["device-orientation-permission-ui"].permissionGranted?e.enabled=t.magicWindowTrackingEnabled:this.el.sceneEl.addEventListener("deviceorientationpermissiongranted",(function(){e.enabled=t.magicWindowTrackingEnabled}))))},update:function(e){var t=this.data;t.enabled!==e.enabled&&this.updateGrabCursor(t.enabled),e&&!t.magicWindowTrackingEnabled&&e.magicWindowTrackingEnabled&&(this.magicWindowAbsoluteEuler.set(0,0,0),this.magicWindowDeltaEuler.set(0,0,0)),this.magicWindowControls&&(this.magicWindowControls.enabled=t.magicWindowTrackingEnabled),e&&!t.pointerLockEnabled!==e.pointerLockEnabled&&(this.removeEventListeners(),this.addEventListeners(),this.pointerLocked&&this.exitPointerLock())},tick:function(e){this.data.enabled&&this.updateOrientation()},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners(),this.pointerLocked&&this.exitPointerLock()},remove:function(){this.removeEventListeners(),this.pointerLocked&&this.exitPointerLock()},bindMethods:function(){this.onMouseDown=s(this.onMouseDown,this),this.onMouseMove=s(this.onMouseMove,this),this.onMouseUp=s(this.onMouseUp,this),this.onTouchStart=s(this.onTouchStart,this),this.onTouchMove=s(this.onTouchMove,this),this.onTouchEnd=s(this.onTouchEnd,this),this.onEnterVR=s(this.onEnterVR,this),this.onExitVR=s(this.onExitVR,this),this.onPointerLockChange=s(this.onPointerLockChange,this),this.onPointerLockError=s(this.onPointerLockError,this)},setupMouseControls:function(){this.mouseDown=!1,this.pitchObject=new o.Object3D,this.yawObject=new o.Object3D,this.yawObject.position.y=10,this.yawObject.add(this.pitchObject)},addEventListeners:function(){var e=this.el.sceneEl,t=e.canvas;t?(t.addEventListener("mousedown",this.onMouseDown,!1),window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",this.onMouseUp,!1),t.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove),window.addEventListener("touchend",this.onTouchEnd),e.addEventListener("enter-vr",this.onEnterVR),e.addEventListener("exit-vr",this.onExitVR),this.data.pointerLockEnabled&&(document.addEventListener("pointerlockchange",this.onPointerLockChange,!1),document.addEventListener("mozpointerlockchange",this.onPointerLockChange,!1),document.addEventListener("pointerlockerror",this.onPointerLockError,!1))):e.addEventListener("render-target-loaded",s(this.addEventListeners,this))},removeEventListeners:function(){var e=this.el.sceneEl,t=e&&e.canvas;t&&(t.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("enter-vr",this.onEnterVR),e.removeEventListener("exit-vr",this.onExitVR),document.removeEventListener("pointerlockchange",this.onPointerLockChange,!1),document.removeEventListener("mozpointerlockchange",this.onPointerLockChange,!1),document.removeEventListener("pointerlockerror",this.onPointerLockError,!1))},updateOrientation:(r=new o.Matrix4,function(){var e,t=this.el.object3D,n=this.pitchObject,i=this.yawObject,o=this.el.sceneEl;o.is("vr-mode")&&o.checkHeadsetConnected()?o.hasWebXR&&(e=o.renderer.xr.getCameraPose())&&(r.elements=e.transform.matrix,r.decompose(t.position,t.rotation,t.scale)):(this.updateMagicWindowOrientation(),t.rotation.x=this.magicWindowDeltaEuler.x+n.rotation.x,t.rotation.y=this.magicWindowDeltaEuler.y+i.rotation.y,t.rotation.z=this.magicWindowDeltaEuler.z)}),updateMagicWindowOrientation:function(){var e=this.magicWindowAbsoluteEuler,t=this.magicWindowDeltaEuler;this.magicWindowControls&&this.magicWindowControls.enabled&&(this.magicWindowControls.update(),e.setFromQuaternion(this.magicWindowObject.quaternion,"YXZ"),this.previousMagicWindowYaw||0===e.y||(this.previousMagicWindowYaw=e.y),this.previousMagicWindowYaw&&(t.x=e.x,t.y+=e.y-this.previousMagicWindowYaw,t.z=e.z,this.previousMagicWindowYaw=e.y))},onMouseMove:function(e){var t,n,r,i=this.pitchObject,o=this.previousMouseEvent,a=this.yawObject;this.data.enabled&&(this.mouseDown||this.pointerLocked)&&(this.pointerLocked?(n=e.movementX||e.mozMovementX||0,r=e.movementY||e.mozMovementY||0):(n=e.screenX-o.screenX,r=e.screenY-o.screenY),this.previousMouseEvent.screenX=e.screenX,this.previousMouseEvent.screenY=e.screenY,t=this.data.reverseMouseDrag?1:-1,a.rotation.y+=.002*n*t,i.rotation.x+=.002*r*t,i.rotation.x=Math.max(-l,Math.min(l,i.rotation.x)))},onMouseDown:function(e){var t=this.el.sceneEl;if(this.data.enabled&&this.data.mouseEnabled&&(!t.is("vr-mode")||!t.checkHeadsetConnected())&&0===e.button){var n=t&&t.canvas;this.mouseDown=!0,this.previousMouseEvent.screenX=e.screenX,this.previousMouseEvent.screenY=e.screenY,this.showGrabbingCursor(),this.data.pointerLockEnabled&&!this.pointerLocked&&(n.requestPointerLock?n.requestPointerLock():n.mozRequestPointerLock&&n.mozRequestPointerLock())}},showGrabbingCursor:function(){this.el.sceneEl.canvas.style.cursor="grabbing"},hideGrabbingCursor:function(){this.el.sceneEl.canvas.style.cursor=""},onMouseUp:function(){this.mouseDown=!1,this.hideGrabbingCursor()},onTouchStart:function(e){1===e.touches.length&&this.data.touchEnabled&&!this.el.sceneEl.is("vr-mode")&&(this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY},this.touchStarted=!0)},onTouchMove:function(e){var t,n,r=this.el.sceneEl.canvas,i=this.yawObject;this.touchStarted&&this.data.touchEnabled&&(n=2*Math.PI*(e.touches[0].pageX-this.touchStart.x)/r.clientWidth,t=this.data.reverseTouchDrag?1:-1,i.rotation.y-=.5*n*t,this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY})},onTouchEnd:function(){this.touchStarted=!1},onEnterVR:function(){var e=this.el.sceneEl;e.checkHeadsetConnected()&&(this.saveCameraPose(),this.el.object3D.position.set(0,0,0),this.el.object3D.rotation.set(0,0,0),e.hasWebXR&&(this.el.object3D.matrixAutoUpdate=!1,this.el.object3D.updateMatrix()))},onExitVR:function(){this.el.sceneEl.checkHeadsetConnected()&&(this.restoreCameraPose(),this.previousHMDPosition.set(0,0,0),this.el.object3D.matrixAutoUpdate=!0)},onPointerLockChange:function(){this.pointerLocked=!(!document.pointerLockElement&&!document.mozPointerLockElement)},onPointerLockError:function(){this.pointerLocked=!1},exitPointerLock:function(){document.exitPointerLock(),this.pointerLocked=!1},updateGrabCursor:function(e){var t=this.el.sceneEl;function n(){t.canvas.classList.add("a-grab-cursor")}function r(){t.canvas.classList.remove("a-grab-cursor")}t.canvas?e?n():r():e?t.addEventListener("render-target-loaded",n):t.addEventListener("render-target-loaded",r)},saveCameraPose:function(){var e=this.el;this.savedPose.position.copy(e.object3D.position),this.savedPose.rotation.copy(e.object3D.rotation),this.hasSavedPose=!0},restoreCameraPose:function(){var e=this.el,t=this.savedPose;this.hasSavedPose&&(e.object3D.position.copy(t.position),e.object3D.rotation.copy(t.rotation),this.hasSavedPose=!1)}})},{"../core/component":131,"../lib/three":179,"../utils/":205}],91:[function(e,t,n){var r=e("../utils/bind"),i=e("../core/component").registerComponent,o=e("../utils/tracked-controls"),a=o.checkControllerPresentAndSetup,s=o.emitIfAxesChanged,l=o.onButtonEvent,u="magicleap-one";t.exports.Component=i("magicleap-controls",{schema:{hand:{default:"none"},model:{default:!0},orientationOffset:{type:"vec3"}},mapping:{axes:{touchpad:[0,1]},buttons:["trigger","grip","touchpad","menu"]},init:function(){var e=this;this.controllerPresent=!1,this.lastControllerCheck=0,this.onButtonChanged=r(this.onButtonChanged,this),this.onButtonDown=function(t){l(t.detail.id,"down",e)},this.onButtonUp=function(t){l(t.detail.id,"up",e)},this.onButtonTouchEnd=function(t){l(t.detail.id,"touchend",e)},this.onButtonTouchStart=function(t){l(t.detail.id,"touchstart",e)},this.previousButtonValues={},this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods()},update:function(){var e=this.data;this.controllerIndex="right"===e.hand?0:"left"===e.hand?1:2},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},bindMethods:function(){this.onModelLoaded=r(this.onModelLoaded,this),this.onControllersUpdate=r(this.onControllersUpdate,this),this.checkIfControllerPresent=r(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=r(this.removeControllersUpdateListener,this),this.onAxisMoved=r(this.onAxisMoved,this)},addEventListeners:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("touchstart",this.onButtonTouchStart),e.addEventListener("touchend",this.onButtonTouchEnd),e.addEventListener("axismove",this.onAxisMoved),e.addEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!0},removeEventListeners:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("touchstart",this.onButtonTouchStart),e.removeEventListener("touchend",this.onButtonTouchEnd),e.removeEventListener("axismove",this.onAxisMoved),e.removeEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!1},checkIfControllerPresent:function(){var e=this.data;a(this,u,{index:this.controllerIndex,hand:e.hand})},injectTrackedControls:function(){var e=this.el,t=this.data;e.setAttribute("tracked-controls",{idPrefix:u,hand:t.hand,controller:this.controllerIndex,orientationOffset:t.orientationOffset}),this.data.model&&this.el.setAttribute("gltf-model","https://cdn.aframe.io/controllers/magicleap/magicleap-one-controller.glb")},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onButtonChanged:function(e){var t,n=this.mapping.buttons[e.detail.id];n&&("trigger"===n&&(t=e.detail.state.value,console.log("analog value of trigger press: "+t)),this.el.emit(n+"changed",e.detail.state))},onModelLoaded:function(e){e.detail.model.scale.set(.01,.01,.01)},onAxisMoved:function(e){s(this,this.mapping.axes,e)},updateModel:function(e,t){},setButtonColor:function(e,t){}})},{"../core/component":131,"../utils/bind":199,"../utils/tracked-controls":214}],92:[function(e,t,n){var r=e("../utils/"),i=e("../core/component"),o=e("../lib/three"),a=e("../core/shader"),s=r.debug("components:material:error"),l=i.registerComponent,u=a.shaders,c=a.shaderNames;function h(e,t){e.dispose(),t.unregisterMaterial(e)}t.exports.Component=l("material",{schema:{alphaTest:{default:0,min:0,max:1},depthTest:{default:!0},depthWrite:{default:!0},flatShading:{default:!1},npot:{default:!1},offset:{type:"vec2",default:{x:0,y:0}},opacity:{default:1,min:0,max:1},repeat:{type:"vec2",default:{x:1,y:1}},shader:{default:"standard",oneOf:c,schemaChange:!0},side:{default:"front",oneOf:["front","back","double"]},transparent:{default:!1},vertexColors:{type:"string",default:"none",oneOf:["face","vertex"]},visible:{default:!0},blending:{default:"normal",oneOf:["none","normal","additive","subtractive","multiply"]},dithering:{default:!0}},init:function(){this.material=null},update:function(e){var t=this.data;this.shader&&t.shader===e.shader||this.updateShader(t.shader),this.shader.update(this.data),this.updateMaterial(e)},updateSchema:function(e){var t,n,r,i;n=e&&e.shader,t=this.oldData&&this.oldData.shader,(r=u[i=n||t]&&u[i].schema)||s("Unknown shader schema "+i),t&&n===t||(this.extendSchema(r),this.updateBehavior())},updateBehavior:function(){var e,t,n=this.el.sceneEl,r=this.schema,i=this;function o(e,n){var r;for(r in t)t[r]=e;i.shader.update(t)}for(e in this.tick=void 0,t={},r)"time"===r[e].type&&(this.tick=o,t[e]=!0);n&&(this.tick?n.addBehavior(this):n.removeBehavior(this))},updateShader:function(e){var t,n=this.data,r=u[e]&&u[e].Shader;if(!r)throw new Error("Unknown shader "+e);(t=this.shader=new r).el=this.el,t.init(n),this.setMaterial(t.material),this.updateSchema(n)},updateMaterial:function(e){var t,n=this.data,r=this.material;for(t in r.alphaTest=n.alphaTest,r.depthTest=!1!==n.depthTest,r.depthWrite=!1!==n.depthWrite,r.opacity=n.opacity,r.flatShading=n.flatShading,r.side=function(e){switch(e){case"back":return o.BackSide;case"double":return o.DoubleSide;default:return o.FrontSide}}(n.side),r.transparent=!1!==n.transparent||n.opacity<1,r.vertexColors=function(e){switch(e){case"face":return o.FaceColors;case"vertex":return o.VertexColors;default:return o.NoColors}}(n.vertexColors),r.visible=n.visible,r.blending=function(e){switch(e){case"none":return o.NoBlending;case"additive":return o.AdditiveBlending;case"subtractive":return o.SubtractiveBlending;case"multiply":return o.MultiplyBlending;default:return o.NormalBlending}}(n.blending),r.dithering=n.dithering,e)break;!t||e.alphaTest===n.alphaTest&&e.side===n.side&&e.vertexColors===n.vertexColors||(r.needsUpdate=!0)},remove:function(){var e=new o.MeshBasicMaterial,t=this.material,n=this.el.getObject3D("mesh");n&&(n.material=e),h(t,this.system)},setMaterial:function(e){var t,n=this.el,r=this.system;this.material&&h(this.material,r),this.material=e,r.registerMaterial(e),(t=n.getObject3D("mesh"))?t.material=e:n.addEventListener("object3dset",(function t(r){"mesh"===r.detail.type&&r.target===n&&(n.getObject3D("mesh").material=e,n.removeEventListener("object3dset",t))}))}})},{"../core/component":131,"../core/shader":141,"../lib/three":179,"../utils/":205}],93:[function(e,t,n){var r=e("../utils/debug"),i=e("../core/component").registerComponent,o=e("../lib/three"),a=r("components:obj-model:warn");t.exports.Component=i("obj-model",{schema:{mtl:{type:"model"},obj:{type:"model"}},init:function(){var e=this;this.model=null,this.objLoader=new o.OBJLoader,this.mtlLoader=new o.MTLLoader(this.objLoader.manager),this.mtlLoader.crossOrigin="",this.el.addEventListener("componentinitialized",(function(t){e.model&&"material"===t.detail.name&&e.applyMaterial()}))},update:function(){var e=this.data;e.obj&&(this.resetMesh(),this.loadObj(e.obj,e.mtl))},remove:function(){this.model&&this.resetMesh()},resetMesh:function(){this.el.removeObject3D("mesh")},loadObj:function(e,t){var n=this,r=this.el,i=this.mtlLoader,o=this.objLoader,s=this.el.sceneEl.systems.renderer,l=t.substr(0,t.lastIndexOf("/")+1);if(t)return r.hasAttribute("material")&&a("Material component properties are ignored when a .MTL is provided"),i.setResourcePath(l),void i.load(t,(function(t){t.preload(),o.setMaterials(t),o.load(e,(function(e){n.model=e,n.model.traverse((function(e){if(e.isMesh){var t=e.material;t.color&&s.applyColorCorrection(t.color),t.map&&s.applyColorCorrection(t.map),t.emissive&&s.applyColorCorrection(t.emissive),t.emissiveMap&&s.applyColorCorrection(t.emissiveMap)}})),r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})}))}));o.load(e,(function(e){n.model=e,n.applyMaterial(),r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})}))},applyMaterial:function(){var e=this.el.components.material;e&&this.model.traverse((function(t){t instanceof o.Mesh&&(t.material=e.material)}))}})},{"../core/component":131,"../lib/three":179,"../utils/debug":201}],94:[function(e,t,n){var r=e("../core/component").registerComponent,i=e("../utils/bind"),o=e("../utils/tracked-controls"),a=o.checkControllerPresentAndSetup,s=o.emitIfAxesChanged,l=o.onButtonEvent,u=e("../utils/").device.isWebXRAvailable,c=u?"oculus-go":"Oculus Go",h=u?{axes:{touchpad:[0,1]},buttons:["trigger","none","touchpad"]}:{axes:{trackpad:[0,1]},buttons:["trackpad","trigger"]};t.exports.Component=r("oculus-go-controls",{schema:{hand:{default:""},buttonColor:{type:"color",default:"#FFFFFF"},buttonTouchedColor:{type:"color",default:"#BBBBBB"},buttonHighlightColor:{type:"color",default:"#7A7A7A"},model:{default:!0},orientationOffset:{type:"vec3"},armModel:{default:!0}},mapping:h,bindMethods:function(){this.onModelLoaded=i(this.onModelLoaded,this),this.onControllersUpdate=i(this.onControllersUpdate,this),this.checkIfControllerPresent=i(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=i(this.removeControllersUpdateListener,this),this.onAxisMoved=i(this.onAxisMoved,this)},init:function(){var e=this;this.onButtonChanged=i(this.onButtonChanged,this),this.onButtonDown=function(t){l(t.detail.id,"down",e)},this.onButtonUp=function(t){l(t.detail.id,"up",e)},this.onButtonTouchStart=function(t){l(t.detail.id,"touchstart",e)},this.onButtonTouchEnd=function(t){l(t.detail.id,"touchend",e)},this.controllerPresent=!1,this.lastControllerCheck=0,this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods()},addEventListeners:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("touchstart",this.onButtonTouchStart),e.addEventListener("touchend",this.onButtonTouchEnd),e.addEventListener("model-loaded",this.onModelLoaded),e.addEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!0},removeEventListeners:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("touchstart",this.onButtonTouchStart),e.removeEventListener("touchend",this.onButtonTouchEnd),e.removeEventListener("model-loaded",this.onModelLoaded),e.removeEventListener("axismove",this.onAxisMoved),this.controllerEventsActive=!1},checkIfControllerPresent:function(){a(this,c,this.data.hand?{hand:this.data.hand}:{})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},injectTrackedControls:function(){var e=this.el,t=this.data;e.setAttribute("tracked-controls",{armModel:t.armModel,hand:t.hand,idPrefix:c,orientationOffset:t.orientationOffset}),this.data.model&&this.el.setAttribute("gltf-model","https://cdn.aframe.io/controllers/oculus/go/oculus-go-controller.gltf")},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onModelLoaded:function(e){var t,n=e.detail.model;this.data.model&&((t=this.buttonMeshes={}).trigger=n.getObjectByName("oculus_go_button_trigger"),t.trackpad=n.getObjectByName("oculus_go_touchpad"),t.touchpad=n.getObjectByName("oculus_go_touchpad"))},onButtonChanged:function(e){var t=this.mapping.buttons[e.detail.id];t&&this.el.emit(t+"changed",e.detail.state)},onAxisMoved:function(e){s(this,this.mapping.axes,e)},updateModel:function(e,t){this.data.model&&this.updateButtonModel(e,t)},updateButtonModel:function(e,t){var n=this.buttonMeshes;if(n&&n[e]){var r,i;switch(t){case"down":r=this.data.buttonHighlightColor;break;case"touchstart":r=this.data.buttonTouchedColor;break;default:r=this.data.buttonColor}(i=n[e]).material.color.set(r),this.rendererSystem.applyColorCorrection(i.material.color)}}})},{"../core/component":131,"../utils/":205,"../utils/bind":199,"../utils/tracked-controls":214}],95:[function(e,t,n){var r=e("../utils/bind"),i=e("../core/component").registerComponent,o=e("../lib/three"),a=e("../utils/tracked-controls"),s=a.checkControllerPresentAndSetup,l=a.emitIfAxesChanged,u=a.onButtonEvent,c=e("../utils/").device.isWebXRAvailable,h="oculus-touch",d=c?h:"Oculus Touch",p="https://cdn.aframe.io/controllers/oculus/oculus-touch-controller-",f={left:{modelUrl:p+"left.gltf",rayOrigin:{origin:{x:.008,y:-.01,z:0},direction:{x:0,y:-.8,z:-1}},modelPivotOffset:new o.Vector3(-.005,.003,-.055),modelPivotRotation:new o.Euler(0,0,0)},right:{modelUrl:p+"right.gltf",rayOrigin:{origin:{x:-.008,y:-.01,z:0},direction:{x:0,y:-.8,z:-1}},modelPivotOffset:new o.Vector3(.005,.003,-.055),modelPivotRotation:new o.Euler(0,0,0)}},m={left:{modelUrl:p+"left.gltf",rayOrigin:{origin:{x:.002,y:-.005,z:-.03},direction:{x:0,y:-.8,z:-1}},modelPivotOffset:new o.Vector3(-.005,.036,-.037),modelPivotRotation:new o.Euler(Math.PI/4.5,0,0)},right:{modelUrl:p+"right.gltf",rayOrigin:{origin:{x:-.002,y:-.005,z:-.03},direction:{x:0,y:-.8,z:-1}},modelPivotOffset:new o.Vector3(.005,.036,-.037),modelPivotRotation:new o.Euler(Math.PI/4.5,0,0)}},v="oculus-touch",g={"oculus-touch":c?m:f,"oculus-touch-v2":{left:{modelUrl:p+"gen2-left.gltf",rayOrigin:{origin:{x:-.01,y:0,z:-.02},direction:{x:0,y:-.5,z:-1}},modelPivotOffset:new o.Vector3(0,0,0),modelPivotRotation:new o.Euler(0,0,0)},right:{modelUrl:p+"gen2-right.gltf",rayOrigin:{origin:{x:.01,y:0,z:-.02},direction:{x:0,y:-.5,z:-1}},modelPivotOffset:new o.Vector3(0,0,0),modelPivotRotation:new o.Euler(0,0,0)}},"oculus-touch-v3":{left:{modelUrl:p+"v3-left.glb",rayOrigin:{origin:{x:.015,y:.005,z:0},direction:{x:0,y:0,z:-1}},modelPivotOffset:new o.Vector3(.01,-.01,.05),modelPivotRotation:new o.Euler(Math.PI/4,0,0)},right:{modelUrl:p+"v3-right.glb",rayOrigin:{origin:{x:-.015,y:.005,z:0},direction:{x:0,y:0,z:-1}},modelPivotOffset:new o.Vector3(-.01,-.01,.05),modelPivotRotation:new o.Euler(Math.PI/4,0,0)}}},y=c?{left:{axes:{thumbstick:[2,3]},buttons:["trigger","grip","none","thumbstick","xbutton","ybutton","surface"]},right:{axes:{thumbstick:[2,3]},buttons:["trigger","grip","none","thumbstick","abutton","bbutton","surface"]}}:{left:{axes:{thumbstick:[0,1]},buttons:["thumbstick","trigger","grip","xbutton","ybutton","surface"]},right:{axes:{thumbstick:[0,1]},buttons:["thumbstick","trigger","grip","abutton","bbutton","surface"]}};t.exports.Component=i("oculus-touch-controls",{schema:{hand:{default:"left"},buttonColor:{type:"color",default:"#999"},buttonTouchColor:{type:"color",default:"#8AB"},buttonHighlightColor:{type:"color",default:"#2DF"},model:{default:!0},controllerType:{default:"auto",oneOf:["auto","oculus-touch","oculus-touch-v2","oculus-touch-v3"]},orientationOffset:{type:"vec3",default:{x:43,y:0,z:0}}},mapping:y,bindMethods:function(){this.onModelLoaded=r(this.onModelLoaded,this),this.onControllersUpdate=r(this.onControllersUpdate,this),this.checkIfControllerPresent=r(this.checkIfControllerPresent,this),this.onAxisMoved=r(this.onAxisMoved,this)},init:function(){var e=this;this.onButtonChanged=r(this.onButtonChanged,this),this.onButtonDown=function(t){u(t.detail.id,"down",e,e.data.hand)},this.onButtonUp=function(t){u(t.detail.id,"up",e,e.data.hand)},this.onButtonTouchStart=function(t){u(t.detail.id,"touchstart",e,e.data.hand)},this.onButtonTouchEnd=function(t){u(t.detail.id,"touchend",e,e.data.hand)},this.controllerPresent=!1,this.lastControllerCheck=0,this.previousButtonValues={},this.rendererSystem=this.el.sceneEl.systems.renderer,this.bindMethods()},addEventListeners:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("touchstart",this.onButtonTouchStart),e.addEventListener("touchend",this.onButtonTouchEnd),e.addEventListener("axismove",this.onAxisMoved),e.addEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!0},removeEventListeners:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("touchstart",this.onButtonTouchStart),e.removeEventListener("touchend",this.onButtonTouchEnd),e.removeEventListener("axismove",this.onAxisMoved),e.removeEventListener("model-loaded",this.onModelLoaded),this.controllerEventsActive=!1},checkIfControllerPresent:function(){s(this,d,{hand:this.data.hand})},play:function(){this.checkIfControllerPresent(),this.addControllersUpdateListener()},pause:function(){this.removeEventListeners(),this.removeControllersUpdateListener()},loadModel:function(e){var t,n=this.data;if(n.model){if(this.displayModel=g[n.controllerType]||g["oculus-touch"],"auto"===n.controllerType){var r=this.el.sceneEl.systems["tracked-controls-webvr"];if(r&&r.vrDisplay){var i=r.vrDisplay.displayName;/^Oculus Quest$/.test(i)&&(this.displayModel=g["oculus-touch-v2"])}else t=v,t=-1!==e.profiles.indexOf("oculus-touch-v2")?"oculus-touch-v2":t,t=-1!==e.profiles.indexOf("oculus-touch-v3")?"oculus-touch-v3":t,this.displayModel=g[t]}var o=this.displayModel[n.hand].modelUrl;this.el.setAttribute("gltf-model",o)}},injectTrackedControls:function(e){var t=this.data,n="right"===t.hand?"Oculus Touch (Right)":"Oculus Touch (Left)",r=c?"oculus-touch":n;this.el.setAttribute("tracked-controls",{id:r,hand:t.hand,orientationOffset:t.orientationOffset,handTrackingEnabled:!1}),this.loadModel(e)},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.checkIfControllerPresent()},onButtonChanged:function(e){var t,n=this.mapping[this.data.hand].buttons[e.detail.id],r=this.buttonMeshes;n&&("trigger"!==n&&"grip"!==n||(t=e.detail.state.value),r&&("trigger"===n&&r.trigger&&(r.trigger.rotation.x=this.originalXRotationTrigger-t*(Math.PI/26)),"grip"===n&&r.grip&&(r.grip.position.x=this.originalXPositionGrip+("left"===this.data.hand?-1:1)*t*.004)),this.el.emit(n+"changed",e.detail.state))},onModelLoaded:function(e){var t,n=this.controllerObject3D=e.detail.model;this.data.model&&((t=this.buttonMeshes={}).grip=n.getObjectByName("buttonHand"),this.originalXPositionGrip=t.grip&&t.grip.position.x,t.thumbstick=n.getObjectByName("stick"),t.trigger=n.getObjectByName("buttonTrigger"),this.originalXRotationTrigger=t.trigger&&t.trigger.rotation.x,t.xbutton=n.getObjectByName("buttonX"),t.abutton=n.getObjectByName("buttonA"),t.ybutton=n.getObjectByName("buttonY"),t.bbutton=n.getObjectByName("buttonB"),n.position.copy(this.displayModel[this.data.hand].modelPivotOffset),n.rotation.copy(this.displayModel[this.data.hand].modelPivotRotation),this.el.emit("controllermodelready",{name:"oculus-touch-controls",model:this.data.model,rayOrigin:this.displayModel[this.data.hand].rayOrigin}))},onAxisMoved:function(e){l(this,this.mapping[this.data.hand].axes,e)},updateModel:function(e,t){this.data.model&&this.updateButtonModel(e,t)},updateButtonModel:function(e,t){var n,r="up"===t||"touchend"===t?this.data.buttonColor:"touchstart"===t?this.data.buttonTouchColor:this.data.buttonHighlightColor,i=this.buttonMeshes;this.data.model&&i&&i[e]&&((n=i[e]).material.color.set(r),this.rendererSystem.applyColorCorrection(n.material.color))}})},{"../core/component":131,"../lib/three":179,"../utils/":205,"../utils/bind":199,"../utils/tracked-controls":214}],96:[function(e,t,n){var r=e("../core/component").registerComponent;t.exports.Component=r("position",{schema:{type:"vec3"},update:function(){var e=this.el.object3D,t=this.data;e.position.set(t.x,t.y,t.z)},remove:function(){this.el.object3D.position.set(0,0,0)}})},{"../core/component":131}],97:[function(e,t,n){var r,i,o=e("../core/component").registerComponent,a=e("../lib/three"),s=e("../utils/").debug("components:raycaster:warn"),l=/^[\w\s-.,[\]#]*$/,u={childList:!0,attributes:!0,subtree:!0},c="raycaster-intersected",h="raycaster-intersection",d="raycaster-intersected-cleared",p="raycaster-intersection-cleared";function f(e,t){var n;for(e.length=t.length,n=0;n")},remove:function(){var e=this.el.object3D.fog;e&&(e.far=0,e.near=.1)}})},{"../../core/component":131,"../../lib/three":179,"../../utils/debug":201}],105:[function(e,t,n){(function(n){var r=e("../../constants").AFRAME_INJECTED,i=e("../../../package"),o=e("../../core/component").registerComponent,a=e("../../utils/");var s,l,u="https://unpkg.com/aframe-inspector@"+(s=i.version,(l=s.split("."))[2]="x",l.join(".")+"/dist/aframe-inspector.min.js"),c="dev"===n.env.INSPECTOR_VERSION?"https://aframe.io/aframe-inspector/dist/aframe-inspector.js":u;t.exports.Component=o("inspector",{schema:{url:{default:c}},init:function(){this.firstPlay=!0,this.onKeydown=this.onKeydown.bind(this),this.onMessage=this.onMessage.bind(this),this.initOverlay(),window.addEventListener("keydown",this.onKeydown),window.addEventListener("message",this.onMessage)},play:function(){var e;this.firstPlay&&"false"!==(e=a.getUrlParameter("inspector"))&&e&&(this.openInspector(),this.firstPlay=!1)},initOverlay:function(){this.loadingMessageEl=document.createElement("div"),this.loadingMessageEl.classList.add("a-inspector-loader"),this.loadingMessageEl.innerHTML='Loading Inspector...'},remove:function(){this.removeEventListeners()},onKeydown:function(e){73===e.keyCode&&(e.ctrlKey&&e.altKey||e.getModifierState("AltGraph"))&&this.openInspector()},showLoader:function(){document.body.appendChild(this.loadingMessageEl)},hideLoader:function(){document.body.removeChild(this.loadingMessageEl)},onMessage:function(e){"INJECT_AFRAME_INSPECTOR"===e.data&&this.openInspector()},openInspector:function(e){var t,n=this;AFRAME.INSPECTOR||AFRAME.inspectorInjected?AFRAME.INSPECTOR.open(e):(this.showLoader(),(t=document.createElement("script")).src=this.data.url,t.setAttribute("data-name","aframe-inspector"),t.setAttribute(r,""),t.onload=function(){AFRAME.INSPECTOR.open(e),n.hideLoader(),n.removeEventListeners()},t.onerror=function(){n.loadingMessageEl.innerHTML="Error loading Inspector"},document.head.appendChild(t),AFRAME.inspectorInjected=!0)},removeEventListeners:function(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("message",this.onMessage)}})}).call(this,e("_process"))},{"../../../package":73,"../../constants":123,"../../core/component":131,"../../utils/":205,_process:49}],106:[function(e,t,n){var r=e("../../core/component").registerComponent,i=e("../../utils/").shouldCaptureKeyEvent;t.exports.Component=r("keyboard-shortcuts",{schema:{enterVR:{default:!0},exitVR:{default:!0}},init:function(){this.onKeyup=this.onKeyup.bind(this)},update:function(e){var t=this.data;this.enterVREnabled=t.enterVR},play:function(){window.addEventListener("keyup",this.onKeyup,!1)},pause:function(){window.removeEventListener("keyup",this.onKeyup)},onKeyup:function(e){var t=this.el;i(e)&&(this.enterVREnabled&&70===e.keyCode&&t.enterVR(),this.enterVREnabled&&27===e.keyCode&&t.exitVR())}})},{"../../core/component":131,"../../utils/":205}],107:[function(e,t,n){var r=e("../../utils/debug"),i=e("../../core/component").registerComponent,o=r("components:pool:warn");t.exports.Component=i("pool",{schema:{container:{default:""},mixin:{default:""},size:{default:0},dynamic:{default:!1}},multiple:!0,initPool:function(){var e;for(this.availableEls=[],this.usedEls=[],this.data.mixin||o("No mixin provided for pool component."),this.data.container&&(this.container=document.querySelector(this.data.container),this.container||o("Container "+this.data.container+" not found.")),this.container=this.container||this.el,e=0;e0&&(this.stopSound(),n.removeObject3D("sound"));var a=this.listener=r.audioListener||new o.AudioListener;for(r.audioListener=a,r.camera&&r.camera.add(a),r.addEventListener("camera-set-active",(function(e){e.detail.cameraEl.getObject3D("camera").add(a)})),this.pool=new o.Group,e=0;e=0?n="msdf":r.font in p&&-1===f.indexOf(r.font)&&(n="sdf"),e=(this.shaderObject&&this.shaderObject.name)!==n,o.alphaTest=r.alphaTest,o.color=r.color,o.map=this.texture,o.opacity=r.opacity,o.side=function(e){switch(e){case"back":return s.FrontSide;case"double":return s.DoubleSide;default:return s.BackSide}}(r.side),o.transparent=r.transparent,o.negate=r.negate,!e)return this.shaderObject.update(o),i.transparent=o.transparent,void(i.side=o.side);t=function(e,t,n){var r,i;return(i=new c[t].Shader).el=e,i.init(n),i.update(n),(r=i.material).transparent=n.transparent,{material:r,shader:i}}(this.el,n,o),this.material=t.material,this.shaderObject=t.shader,this.material.side=o.side,this.mesh&&(this.mesh.material=this.material)},updateFont:function(){var e,t=this.data,n=this.el,r=this.geometry,o=this;t.font||h("No font specified. Using the default font."),this.mesh&&(this.mesh.visible=!1),e=this.lookupFont(t.font||m)||t.font,A.get(e,(function(){return n=e,r=t.yOffset,new Promise((function(e,t){i(n,(function(i,o){if(i)return u("Error loading font",n),void t(i);n.indexOf("/Roboto-msdf.json")>=0&&(r=30),r&&o.chars.map((function(e){e.yoffset+=r})),e(o)}))}));var n,r})).then((function(i){var a;if(1!==i.pages.length)throw new Error("Currently only single-page bitmap fonts are supported.");w[e]||(i.widthFactor=w[i]=function(e){var t=0,n=0,r=0;return e.chars.map((function(e){t+=e.xadvance,e.id>=48&&e.id<=57&&(r++,n+=e.xadvance)})),r?n/r:t/e.chars.length}(i)),o.currentFont=i,a=o.getFontImageSrc(),A.get(a,(function(){return e=a,new Promise((function(t,n){(new s.ImageLoader).load(e,(function(e){t(e)}),void 0,(function(){u("Error loading font image",e),n(null)}))}));var e})).then((function(e){var a=o.texture;a.image=e,a.needsUpdate=!0,x[t.font]=a,o.texture=a,o.initMesh(),o.currentFont=i,o.updateGeometry(r,i),o.updateLayout(),o.mesh.visible=!0,n.emit("textfontset",{font:t.font,fontObj:i})})).catch((function(e){u(e.message),u(e.stack)}))})).catch((function(e){u(e.message),u(e.stack)}))},initMesh:function(){this.mesh||(this.mesh=new s.Mesh(this.geometry,this.material),this.el.setObject3D(this.attrName,this.mesh))},getFontImageSrc:function(){if(this.data.fontImage)return this.data.fontImage;var e=this.lookupFont(this.data.font||m)||this.data.font,t=this.currentFont.pages[0];return t.match(E)&&0!==t.indexOf("http")?e.replace(/(\.fnt)|(\.json)/,".png"):s.LoaderUtils.extractUrlBase(e)+t},updateLayout:function(){var e,t,n,r,i,o,a,s,l,u=this.el,c=this.data,h=this.geometry,d=this.mesh;if(d&&h.layout){if(n=u.getAttribute("geometry"),r=(o=(a=c.width||n&&n.width||1)/M(c.wrapPixels,c.wrapCount,this.currentFont.widthFactor))*((i=h.layout).height+i.descender),n&&"plane"===n.primitive&&(n.width||u.setAttribute("geometry","width",a),n.height||u.setAttribute("geometry","height",r)),"left"===(e="align"===c.anchor?c.align:c.anchor))s=0;else if("right"===e)s=-1*i.width;else{if("center"!==e)throw new TypeError("Invalid text.anchor property value",e);s=-1*i.width/2}if("bottom"===(t=c.baseline))l=0;else if("top"===t)l=-1*i.height+i.ascender;else{if("center"!==t)throw new TypeError("Invalid text.baseline property value",t);l=-1*i.height/2}d.position.x=s*o+c.xOffset,d.position.y=l*o,d.position.z=c.zOffset,d.scale.set(o,-1*o,o)}},lookupFont:function(e){return p[e]},updateGeometry:(v={},g={},y=/\\n/g,b=/\\t/g,function(e,t){var n=this.data;g.font=t,g.lineHeight=n.lineHeight&&isFinite(n.lineHeight)?n.lineHeight:t.common.lineHeight,g.text=n.value.toString().replace(y,"\n").replace(b,"\t"),g.width=M(n.wrapPixels,n.wrapCount,t.widthFactor),e.update(l.extend(v,n,g))})})},{"../core/component":131,"../core/shader":141,"../lib/three":179,"../utils/":205,"load-bmfont":37,"three-bmfont-text":63}],114:[function(e,t,n){var r=e("../core/component").registerComponent,i=e("../utils/tracked-controls"),o=e("../constants").DEFAULT_CAMERA_HEIGHT,a=e("../lib/three"),s=e("../constants").DEFAULT_HANDEDNESS,l=.175,u=-.3,c=-.03,h=0,d=0,p=-.175,f={touches:[]},m="axismove",v="buttonchanged",g="buttondown",y="buttonup",b="touchstart",A="touchend";t.exports.Component=r("tracked-controls-webvr",{schema:{autoHide:{default:!0},controller:{default:0},id:{type:"string",default:""},hand:{type:"string",default:""},idPrefix:{type:"string",default:""},orientationOffset:{type:"vec3"},armModel:{default:!1},headElement:{type:"selector"}},init:function(){this.axis=this.el.components["tracked-controls"].axis=[0,0,0],this.buttonStates=this.el.components["tracked-controls"].buttonStates={},this.changedAxes=[],this.targetControllerNumber=this.data.controller,this.axisMoveEventDetail={axis:this.axis,changed:this.changedAxes},this.deltaControllerPosition=new a.Vector3,this.controllerQuaternion=new a.Quaternion,this.controllerEuler=new a.Euler,this.updateGamepad(),this.buttonEventDetails={}},tick:function(e,t){var n=this.el.getObject3D("mesh");n&&n.update&&n.update(t/1e3),this.updateGamepad(),this.updatePose(),this.updateButtons()},defaultUserHeight:function(){return o},getHeadElement:function(){return this.data.headElement||this.el.sceneEl.camera.el},updateGamepad:function(){var e=this.data,t=i.findMatchingControllerWebVR(this.system.controllers,e.id,e.idPrefix,e.hand,e.controller);this.controller=t,this.el.components["tracked-controls"].controller=t,this.data.autoHide&&(this.el.object3D.visible=!!this.controller)},applyArmModel:function(e){var t,n,r,i,o=this.controller,a=this.controllerEuler,f=this.controllerQuaternion,m=this.deltaControllerPosition;n=this.getHeadElement().object3D,i=this.defaultUserHeight(),r=o.pose,t=(o?o.hand:void 0)||s,e.copy(n.position),m.set(l*("left"===t?-1:"right"===t?1:0),u,c),m.multiplyScalar(i),m.applyAxisAngle(n.up,n.rotation.y),e.add(m),m.set(h,d,p),m.multiplyScalar(i),r.orientation?f.fromArray(r.orientation):f.copy(n.quaternion),a.setFromQuaternion(f),a.set(a.x,a.y,0),m.applyEuler(a),e.add(m)},updatePose:function(){var e,t,n=this.controller,r=this.data,i=this.el.object3D,o=this.system.vrDisplay;n&&((e=n.pose).position?i.position.fromArray(e.position):r.armModel&&this.applyArmModel(i.position),e.orientation&&i.quaternion.fromArray(e.orientation),o&&e.position&&(t=this.el.sceneEl.renderer.xr.getStandingMatrix(),i.matrix.compose(i.position,i.quaternion,i.scale),i.matrix.multiplyMatrices(t,i.matrix),i.matrix.decompose(i.position,i.quaternion,i.scale)),i.rotateX(this.data.orientationOffset.x*a.Math.DEG2RAD),i.rotateY(this.data.orientationOffset.y*a.Math.DEG2RAD),i.rotateZ(this.data.orientationOffset.z*a.Math.DEG2RAD))},updateButtons:function(){var e,t,n=this.controller;if(n){for(t=0;t.2)return l[n]=0,void(l[i]=0);var u=Math.pow(1/this.easing,60*e);0!==l[n]&&(l[n]=l[n]*u),0!==l[i]&&(l[i]=l[i]*u),Math.abs(l[n])=e.duration&&("VIDEO"===e.tagName&&(s.Cache.files[e.getAttribute("src")]=e),t())}e.addEventListener("loadeddata",r,!1),e.addEventListener("progress",r,!1),e.addEventListener("error",n,!1)}))}function h(e){var t=function(e){var t;if(e.hasAttribute("crossorigin"))return e;if(null!==(t=e.getAttribute("src"))){if(-1===t.indexOf("://"))return e;if((r=(n=t).indexOf("://")>-1?n.split("/")[2]:n.split("/")[0]).substring(0,r.indexOf(":"))===window.location.host)return e}var n,r;return u('Cross-origin element (e.g., ) was requested without `crossorigin` set. A-Frame will re-request the asset with `crossorigin` attribute set. Please set `crossorigin` on the element (e.g., )',t),e.crossOrigin="anonymous",e.cloneNode(!0)}(e);return t.tagName&&"video"===t.tagName.toLowerCase()&&(t.setAttribute("playsinline",""),t.setAttribute("webkit-playsinline","")),t!==e&&(e.parentNode.appendChild(t),e.parentNode.removeChild(e)),t}function d(e){var t=p(e),n=t.lastIndexOf(".");return n>=0&&".glb"===t.slice(n,e.search(/\?|#|$/))?"arraybuffer":"text"}function p(e){var t=document.createElement("a");t.href=e;var n=t.search.replace(/^\?/,""),r=e.replace(n,"").replace("?","");return r.substring(r.lastIndexOf("/")+1)}t.exports=a("a-assets",{prototype:Object.create(r.prototype,{createdCallback:{value:function(){this.isAssets=!0,this.fileLoader=l,this.timeout=null}},attachedCallback:{value:function(){var e,t,n,r,o,a,l=this,d=[];if(!this.parentNode.isScene)throw new Error(" must be a child of a .");for(o=this.querySelectorAll("img"),e=0;e did not contain exactly six elements each with a `src` attribute.")},writable:window.debug}})})},{"../utils/debug":201,"./a-register-element":130}],127:[function(e,t,n){var r,i,o,a=e("./a-node"),s=e("./component").components,l=e("./a-register-element").registerElement,u=e("../lib/three"),c=e("../utils/"),h=c.debug("core:a-entity:debug"),d=c.debug("core:a-entity:warn"),p="__",f=["position","rotation","scale","visible"],m={once:!0},v=Object.create(a.prototype,{createdCallback:{value:function(){this.components={},this.initializingComponents={},this.componentsToUpdate={},this.isEntity=!0,this.isPlaying=!1,this.object3D=new u.Group,this.object3D.el=this,this.object3DMap={},this.parentEl=null,this.rotationObj={},this.states=[]}},attributeChangedCallback:{value:function(e,t,n){var r=this.components[e];r&&r.justInitialized&&""===n?delete r.justInitialized:(r||null!==n)&&this.setEntityAttribute(e,t,n)}},attachedCallback:{value:function(){var e,t=this.sceneEl,n=this;this.addToParent(),this.isScene||(t?!(e=t.querySelector("a-assets"))||e.hasLoaded?this.load():e.addEventListener("loaded",(function(){n.load()})):this.load())}},detachedCallback:{value:function(){var e;if(this.parentEl){for(e in this.components)this.removeComponent(e,!1);this.isScene||(this.removeFromParent(),a.prototype.detachedCallback.call(this),this.object3D.el=null)}}},getObject3D:{value:function(e){return this.object3DMap[e]}},setObject3D:{value:function(e,t){var n,r=this;if(!(t instanceof u.Object3D))throw new Error("`Entity.setObject3D` was called with an object that was not an instance of THREE.Object3D.");(n=this.getObject3D(e))&&this.object3D.remove(n),t.el=this,t.children.length&&t.traverse((function(e){e.el=r})),this.object3D.add(t),this.object3DMap[e]=t,this.emit("object3dset",{object:t,type:e})}},removeObject3D:{value:function(e){var t=this.getObject3D(e);t?(this.object3D.remove(t),delete this.object3DMap[e],this.emit("object3dremove",{type:e})):d("Tried to remove `Object3D` of type:",e,"which was not defined.")}},getOrCreateObject3D:{value:function(e,t){var n=this.getObject3D(e);return!n&&t&&(n=new t,this.setObject3D(e,n)),d("`getOrCreateObject3D` has been deprecated. Use `setObject3D()` and `object3dset` event instead."),n}},add:{value:function(e){if(!e.object3D)throw new Error("Trying to add an element that doesn't have an `object3D`");this.object3D.add(e.object3D),this.emit("child-attached",{el:e})}},addToParent:{value:function(){var e=this.parentEl=this.parentNode;e&&e.add&&!this.attachedToParent&&(e.add(this),this.attachedToParent=!0)}},removeFromParent:{value:function(){var e=this.parentEl;this.parentEl.remove(this),this.attachedToParent=!1,this.parentEl=null,e.emit("child-detached",{el:this})}},load:{value:function(){var e=this;!this.hasLoaded&&this.parentEl&&a.prototype.load.call(this,(function(){e.parentEl&&(e.updateComponents(),(e.isScene||e.parentEl.isPlaying)&&e.play())}))},writable:window.debug},remove:{value:function(e){e?this.object3D.remove(e.object3D):this.parentNode.removeChild(this)}},getChildEntities:{value:function(){for(var e=this.children,t=[],n=0;n2?o.slice(1).join("__"):o[1],s[a]&&(g(this,e)||void 0!==t||n)&&!(e in this.components)){if(this.initComponentDependencies(a),i&&!s[a].multiple)throw new Error("Trying to initialize multiple components of type `"+a+"`. There can only be one component of this type per entity.");r=new s[a].Component(this,t,i),this.isPlaying&&r.play(),this.hasAttribute(e)||(r.justInitialized=!0,window.HTMLElement.prototype.setAttribute.call(this,e,"")),h("Component initialized: %s",e)}},writable:window.debug},initComponentDependencies:{value:function(e){var t,n;if(s[e]&&(t=s[e].dependencies))for(n=0;n0?e.substring(0,u):e,!s[l])return"mixin"===e&&this.mixinUpdate(t),void a.prototype.setAttribute.call(this,e,t);if(!this.components[e]&&this.hasAttribute(e)&&this.updateComponent(e,window.HTMLElement.prototype.getAttribute.call(this,e)),void 0!==n&&"string"==typeof t&&t.length>0&&"string"==typeof c.styleParser.parse(t)){for(h in i)delete i[h];(r=i)[t]=n,o=!1}else r=t,o=!0===n;this.updateComponent(e,r,o),this.sceneEl&&this.sceneEl.getAttribute("debug")&&this.components[e].flushToDOM()}),writable:window.debug},flushToDOM:{value:function(e){var t,n,r,i=this.components,o=this.children;for(r in i)i[r].flushToDOM();if(e)for(n=0;n outside of an A-Frame scene. Append this element to `` instead."),this.hasLoaded=!1,this.emit("nodeready",void 0,!1),this.isMixin||(e=this.getAttribute("mixin"))&&this.updateMixins(e)},writable:window.debug},attributeChangedCallback:{value:function(e,t,n){n!==this.computedMixinStr&&("mixin"!==e||this.isMixin||this.updateMixins(n,t))}},closestScene:{value:function(){for(var e=this;e&&!e.isScene;)e=e.parentElement;return e}},closest:{value:function(e){for(var t=this.matches||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector,n=this;n&&!t.call(n,e);)n=n.parentElement;return n}},detachedCallback:{value:function(){this.hasLoaded=!1}},load:{value:function(e,t){var n,r=this;this.hasLoaded||(t=t||l,n=this.getChildren().filter(t).map((function(e){return new Promise((function(t){if(e.hasLoaded)return t();e.addEventListener("loaded",t)}))})),Promise.all(n).then((function(){r.hasLoaded=!0,e&&e(),r.emit("loaded",void 0,!1)})).catch((function(e){h("Failure loading node: ",e)})))},writable:!0},getChildren:{value:function(){return Array.prototype.slice.call(this.children,0)}},updateMixins:{value:(i=[],o=[],a={},function(e,t){var n,r,s;for(i.length=0,o.length=0,r=e?u.split(e.trim(),/\s+/):i,s=t?u.split(t.trim(),/\s+/):o,a.newMixinIds=r,a.oldMixinIds=s,n=0;n tag after the scene. Component

    AFrame React (Complex)

    A slightly more complex AFrame application with React, allowing user input

    Exploring WebXR applications using AFrame and React. Compiled with Babel and Webpack.


    Compatible with any WebXR enabled browser and any WebXR enabled VR headset.

    Focus the ring to change the colour of each object in the scene.

    Click below to launch the AFrame scene.

    Launch scene
    \ No newline at end of file +Portfolio

    AFrame React Example

    An example AFrame application with React, allowing for user input

    Exploring WebXR applications using AFrame and React. Compiled with Babel and Webpack.


    Compatible with any WebXR enabled browser and any WebXR enabled VR headset.

    Focus the ring to change the colour of each object in the scene.

    Click below to launch the AFrame scene.

    Launch scene
    \ No newline at end of file diff --git a/docs/app_aframeComplex/scene.html b/docs/app_aframeComplex/scene.html index e333e7dea..7eb066ba1 100644 --- a/docs/app_aframeComplex/scene.html +++ b/docs/app_aframeComplex/scene.html @@ -1 +1 @@ -Portfolio
    \ No newline at end of file +Portfolio
    \ No newline at end of file diff --git a/docs/app_awsDotNetCoreAsyncCoffeeMachine/index.html b/docs/app_awsDotNetCoreAsyncCoffeeMachine/index.html deleted file mode 100644 index 4b260d5f2..000000000 --- a/docs/app_awsDotNetCoreAsyncCoffeeMachine/index.html +++ /dev/null @@ -1 +0,0 @@ -Portfolio

    AWS .NET, Asynchronous Coffee Maker

    Demonstraiting knowledge of asynchrony, multithreading and the State Machine in .NET, with a React UI

    AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.


    Think about how a cup of coffee is made. Typically tasks are carried out while the kettle is boiling. Why wait for a process to complete, when it could be run as a background task ?

    How ?

    Technically, when calling the Sync method, a series of actions are run in order of execution, synchronously. With each action completing before the next is run. When calling the Async method, however async / await are being used, spawning a State Machine object, with Task acting as the interface between code and state. The threadpool is free to use new threads if needed and return execution instead of blocking execution as with a synchronous program.

    Run the process of making a cup of coffee both synchronously and asynchronously. Notice the difference in the order of tasks ?

    \ No newline at end of file diff --git a/docs/app_awsDotNetCoreAsyncCoffeeMachine/main.js b/docs/app_awsDotNetCoreAsyncCoffeeMachine/main.js deleted file mode 100644 index 1489dbbed..000000000 --- a/docs/app_awsDotNetCoreAsyncCoffeeMachine/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={544:(e,t,a)=>{var n=a(294),r=a(935),o=a(625),i=a(754),l=a(151),c=a(555);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25,a=void 0!==e?e.substring(0,t).split(" ").join(""):"";return a}}],null&&f(t.prototype,null),a&&f(t,a),e}();function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function S(e,t){for(var a=0;a0?n.createElement("h3",{className:"mb-4"},"Log of tasks carried out"):null}},{key:"render",value:function(){return n.createElement(n.Fragment,null,n.createElement("div",{className:"row mb-3"},n.createElement("div",{className:"col-lg-6"},n.createElement("button",{id:"runSync",type:"button",className:"btn btn-dark mr-2",onClick:this.props.handleRun},"Run Sync"),n.createElement("button",{id:"runAsync",type:"button",className:"btn btn-dark mr-2",onClick:this.props.handleRunAsync},"Run Async"))),n.createElement("div",{className:"row"},n.createElement("div",{className:"col-lg-6"},n.createElement("p",{className:"text-muted"},"(Processing is delayed for this demonstration)"),n.createElement(this.renderProcessHeading,null),n.createElement("ul",{id:"resultOutput",className:"list-group"},this.props.log.map((function(e,t){var a=h.generate(e.detail);return n.createElement("li",{key:a,className:"list-group-item d-flex align-items-center"},n.createElement("span",{className:"badge badge-primary badge-pill mr-3 bg-dark"},t+1),e.detail)}))))))}}])&&S(t.prototype,a),l}(n.Component);const E=JSON.parse('{"host":"localhost","port":8080,"prefix":"app_","entry":"home","index":"index.html","masterTemplateDir":"master_react","developmentDir":"app","publishDir":"docs","folderRoot":"/tree/master/app/","repoRootUrl":"https://github.com/fsereno/portfolio","linkedInUrl":"https://www.linkedin.com/in/fabio-sereno-6a97b986/","gitHubUrl":"https://github.com/fsereno","title":"Portfolio","author":"Fabio Sereno","role":"Software developer","description":"Portfolio website for Fabio Sereno - Software Developer.","thumbnail":"PortfolioThumbnail.png","labels":[{"name":"JavaScript","class":"warning"},{"name":"C#","class":"info"},{"name":"Cloud","class":"danger"}],"quickSearch":["React",".NET","Cloud"],"grecaptcha":{"active":true,"key":"6LdFJsIaAAAAAGltxQjmncdNsjOtxAshDewjKCS3","endpoints":{"base":"https://7pq7bx3nt6.execute-api.eu-west-2.amazonaws.com","verify":"verify"}},"applications":[{"name":"Portfolio","subHeading":"By Fabio Sereno","description":"Highly experienced, highly self-motivated, enthusiastic, professional Full Stack Web Developer.","folder":"home","active":true,"include":false,"folderRoot":"/","useWebpack":true,"useRoot":true,"isLandingPage":true},{"name":"MIT Licence","subHeading":"MIT Licence for this repository.","description":"","folder":"licence","useWebpack":true,"active":true,"include":false},{"name":"To-Do List (React)","subHeading":"A basic list builder using React","description":"Using React, with Babel and Webpack.","searchTerms":"JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"toDoReact","active":true,"include":true,"useWebpack":true,"labels":[0]},{"name":"To-Do List (React Redux)","subHeading":"A basic list builder using React and Redux","description":"Using Redux with React to manage application state, implementing Undo and Redo functionality.","searchTerms":"JavaScript,React,Redux,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"reactRedux","active":true,"include":true,"useWebpack":true,"labels":[0]},{"name":"To-Do List (Vue)","subHeading":"A basic list builder using Vue","description":"Experimenting with Vue, Babel and Webpack.","searchTerms":"JavaScript,Vue,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"toDoVue","active":true,"include":true,"useWebpack":true,"labels":[0]},{"name":"Tic-Tac-Toe (React)","subHeading":"A Tic-Tac-Toe game built using React","description":"Experimenting with more complex aspects of React, Babel and Webpack.","searchTerms":"JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"ticTacToeReact","active":true,"include":true,"useWebpack":true,"labels":[0]},{"name":"Azure Functions .NET, Unique Data Entry","subHeading":"Unique data entry implementing IEqualityComparer to manage illegal duplicate data entries, with a React UI","description":"Using Azure Functions serverless compute and .NET, with a React user interface.","searchTerms":"Cloud,Azure,Azure Functions,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"AzureDotNetCoreUniqueDataEntryApi","active":true,"include":true,"useWebpack":true,"masterTemplateDir":"master_react","endpoints":{"api":"https://app-azure-dotnetcore-unique-data-entry-api.azurewebsites.net/api","canItemBeAddedAsync":"canItemBeAddedAsync"},"labels":[0,1,2],"featured":false},{"name":"Azure Functions .NET, Data Structures","subHeading":"First in, first out (FIFO) and last in, first out (LIFO) data structures implementing Queue and Stack in .NET, with a React UI","description":"Using Azure Functions serverless compute and .NET, with a React user interface.","searchTerms":"Cloud,Azure,Azure Functions,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"AzureDotNetCoreDataStructuresApi","active":true,"include":true,"useWebpack":true,"masterTemplateDir":"master_react","endpoints":{"api":"https://app-azure-dotnetcore-data-structures-api.azurewebsites.net/api","addQueueItem":"addQueueItemAsync","removeQueueItem":"removeQueueItemAsync","addStackItem":"addStackItemAsync","removeStackItem":"removeStackItemAsync"},"labels":[0,1,2],"featured":false},{"name":"AWS .NET, Complex Entity Sorting Algorithm","subHeading":"A sorting mechanism, implementing IComparable and IComparer to sort complex types, with a React UI","description":"AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.","searchTerms":"Cloud,AWS,Amazon Web Services,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"awsDotNetCoreEntitySortApi","active":true,"include":true,"useWebpack":true,"masterTemplateDir":"master_react","endpoints":{"api":"https://lni2f3xvgc.execute-api.eu-west-2.amazonaws.com/Prod/api/employees","sortSalaryAsc":"sort/salary/asc","sortSalaryDesc":"sort/salary/desc"},"labels":[0,1,2],"featured":false},{"name":"AWS .NET, Natural Sorting Algorithm","subHeading":"A natural string sorting algorithm, implementing IComparer in .NET, passing in a custom comparer, with a React UI","description":"AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.","searchTerms":"Cloud,AWS,Amazon Web Services,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"awsDotNetCoreStringSortApi","active":true,"include":true,"useWebpack":true,"masterTemplateDir":"master_react","endpoints":{"api":"https://t8txttdaee.execute-api.eu-west-2.amazonaws.com/Prod/api/values","sort":"sort"},"labels":[0,1,2],"featured":false},{"name":"AWS .NET, Shopping Basket List Builder","subHeading":"A basic shopping basket application, with data processing handled by a Serverless .NET RESTful API, with a React UI","description":"AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.","searchTerms":"Cloud,AWS,Amazon Web Services,C#,dotnet,.net core,.netcore,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"awsDotNetCoreShoppingCart","active":true,"include":true,"useWebpack":true,"endpoints":{"api":"https://6pzl3f4421.execute-api.eu-west-2.amazonaws.com/Prod/api/basket","get":"get","add":"add","delete":"delete","update":"update"},"labels":[0,1,2],"order":2},{"name":"AWS .NET, Asynchronous Coffee Maker","subHeading":"Demonstraiting knowledge of asynchrony, multithreading and the State Machine in .NET, with a React UI","description":"AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.","searchTerms":"Cloud,AWS,Amazon Web Services,C#,dotnet,.net core,.netcore,Multithreading,Async,Asynchronous,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"awsDotNetCoreAsyncCoffeeMachine","active":true,"include":true,"useWebpack":true,"masterTemplateDir":"master_react","endpoints":{"api":"https://ro5qqsplje.execute-api.eu-west-2.amazonaws.com/Prod/api/values","run":"run","runAsync":"runasync"},"labels":[0,1,2],"order":3},{"name":"Three JS Scene (Basic)","subHeading":"A basic THREE JS scene","description":"An interactive Three JS scene, using Babel and Webpack.","searchTerms":"JavaScript,Three JS,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"threeJSScene","active":true,"include":true,"useWebpack":true,"labels":[0]},{"name":"AFrame React (Basic)","subHeading":"An AFrame Hello World application with React","description":"Exploring WebXR applications using AFrame and React. Compiled with Babel and Webpack.","searchTerms":"JavaScript,AFrame,Babel,Webpack,PUG,HTML,CSS,SASS,VR,Virtual Reality","folder":"aframe","active":true,"include":true,"useWebpack":true,"labels":[0]},{"name":"AFrame React (Complex)","subHeading":"A slightly more complex AFrame application with React, allowing user input","description":"Exploring WebXR applications using AFrame and React. Compiled with Babel and Webpack.","searchTerms":"JavaScript,AFrame,Babel,Webpack,PUG,HTML,CSS,SASS,VR,Virtual Reality","folder":"aframeComplex","active":true,"include":true,"useWebpack":true,"labels":[0]},{"name":"JS Coding Standards","subHeading":"A JavaScript Code Style Guide","description":"By Fabio Sereno","searchTerms":"JavaScript,SOLID Principles,YAGNI,DRY,KISS","folder":"jsCodingStandards","active":false,"include":false,"labels":[0]},{"name":"Basic React Email Client","subHeading":"An SPA using React and React Router. React Context and useReducer handle state. Optimised with useCallback, useMemo and React.memo","description":"Using React, Babel and Webpack.","searchTerms":"JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"basicEmailClientReactSpa","active":true,"include":true,"useWebpack":true,"masterTemplateDir":"basicSpaReact","labels":[0],"order":2,"featured":false},{"name":"AWS Node.js, B2C API, To-Do List","subHeading":"Authenticated with Cognito, data stored using Dynamo DB, driven by Lambda Functions and with a React UI","description":"Built with Node.js, the AWS Serverless Framework and managed by an HTTP API Gateway.","searchTerms":"Cloud,AWS,Amazon Web Services,Serverless Framework,Node.js,Cognito,Dynamo DB,JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"awsNodeToDoApi","active":true,"include":true,"useWebpack":true,"masterTemplateDir":"basicEmailClientReactSpa","labels":[0,2],"order":1,"featured":false,"endpoints":{"base":"https://7pq7bx3nt6.execute-api.eu-west-2.amazonaws.com","api":"todos"}},{"name":"Master React Template","subHeading":"Subheading","description":"Description","searchTerms":"JavaScript,React,Babel,Webpack,PUG,HTML,CSS,SASS","folder":"master_react","masterTemplateDir":"toDoReact","active":true,"include":false,"useWebpack":true,"labels":[0]}]}');function C(e,t){for(var a=0;a0?t[0]:E}}],null&&C(t.prototype,null),a&&C(t,a),e}(),k=a(755);function T(e,t){for(var a=0;a{if(!a){var i=1/0;for(u=0;u=o)&&Object.keys(n.O).every((e=>n.O[e](a[c])))?a.splice(c--,1):(l=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[a,r,o]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={179:0};n.O.j=t=>0===e[t];var t=(t,a)=>{var r,o,[i,l,c]=a,s=0;for(r in l)n.o(l,r)&&(n.m[r]=l[r]);if(c)var u=c(n);for(t&&t(a);sn(544)));r=n.O(r)})(); \ No newline at end of file diff --git a/docs/app_awsDotNetCoreEntitySortApi/index.html b/docs/app_awsDotNetCoreEntitySortApi/index.html deleted file mode 100644 index eb6cdc294..000000000 --- a/docs/app_awsDotNetCoreEntitySortApi/index.html +++ /dev/null @@ -1 +0,0 @@ -Portfolio

    AWS .NET, Complex Entity Sorting Algorithm

    A sorting mechanism, implementing IComparable and IComparer to sort complex types, with a React UI

    AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.


    \ No newline at end of file diff --git a/docs/app_awsDotNetCoreEntitySortApi/main.js b/docs/app_awsDotNetCoreEntitySortApi/main.js deleted file mode 100644 index 8d4373027..000000000 --- a/docs/app_awsDotNetCoreEntitySortApi/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={164:(e,t,a)=>{var n=a(294),r=a(935);function l(e,t){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25,a=void 0!==e?e.substring(0,t).split(" ").join(""):"";return a}}],null&&l(t.prototype,null),a&&l(t,a),e}(),i=a(625),s=a(754),c=a(151),u=a(555);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a0?t[0]:y}}],null&&b(t.prototype,null),a&&b(t,a),e}(),v=a(318);function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);ae.length)&&(t=e.length);for(var a=0,n=new Array(t);a{if(!a){var o=1/0;for(u=0;u=l)&&Object.keys(n.O).every((e=>n.O[e](a[s])))?a.splice(s--,1):(i=!1,l0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[a,r,l]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={179:0};n.O.j=t=>0===e[t];var t=(t,a)=>{var r,l,[o,i,s]=a,c=0;for(r in i)n.o(i,r)&&(n.m[r]=i[r]);if(s)var u=s(n);for(t&&t(a);cn(164)));r=n.O(r)})(); \ No newline at end of file diff --git a/docs/app_awsDotNetCoreShoppingCart/index.html b/docs/app_awsDotNetCoreShoppingCart/index.html deleted file mode 100644 index cdbe3da72..000000000 --- a/docs/app_awsDotNetCoreShoppingCart/index.html +++ /dev/null @@ -1 +0,0 @@ -Portfolio

    AWS .NET, Shopping Basket List Builder

    A basic shopping basket application, with data processing handled by a Serverless .NET RESTful API, with a React UI

    AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.


    \ No newline at end of file diff --git a/docs/app_awsDotNetCoreShoppingCart/main.css b/docs/app_awsDotNetCoreShoppingCart/main.css deleted file mode 100644 index a0905aeda..000000000 --- a/docs/app_awsDotNetCoreShoppingCart/main.css +++ /dev/null @@ -1 +0,0 @@ -.api-submit{width:5rem} \ No newline at end of file diff --git a/docs/app_awsDotNetCoreShoppingCart/main.js b/docs/app_awsDotNetCoreShoppingCart/main.js deleted file mode 100644 index cc9b19fbc..000000000 --- a/docs/app_awsDotNetCoreShoppingCart/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={591:(e,t,a)=>{var n=a(294),r=a(935),i=a(625),l=a(754),o=a(151),s=a(555);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a0?t[0]:h}}],null&&b(t.prototype,null),a&&b(t,a),e}(),S=a(51),v=a(318);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a0})(e)&&t.setState({resultSet:e,showSpinner:!1})}};this.handleAjax(r)}},{key:"handleAddSubmit",value:function(e){var t=this;e.preventDefault();var a=e.target.elements[0].value,n={url:N,type:"POST",contentType:"application/json;",data:JSON.stringify({item:{name:a},items:this.state.items}),success:function(e){t.setState({resultSet:e,items:e,showSpinner:!1})}};this.handleAjax(n)}},{key:"handleUpdateSubmit",value:function(e){var t=this;e.preventDefault();var a=Number(e.target.elements[0].value),n=e.target.elements[1].value,r={url:M,type:"POST",contentType:"application/json;",data:JSON.stringify({index:a,item:{name:n},items:this.state.items}),success:function(e){t.setState({resultSet:e,items:e,showSpinner:!1})}};this.handleAjax(r)}},{key:"handleDeleteSubmit",value:function(e){var t=this;e.preventDefault();var a=Number(e.target.elements[0].value),n={url:I,type:"POST",contentType:"application/json;",data:JSON.stringify({index:a,items:this.state.items}),success:function(e){t.setState({resultSet:e,items:e,showSpinner:!1})}};this.handleAjax(n)}},{key:"handleIsPuzzleValid",value:function(){this.setState({isPuzzleValid:!0,showPuzzleModal:!1})}},{key:"handlePuzzleModalClose",value:function(){this.setState({showPuzzleModal:!1})}},{key:"handlePuzzleModalShow",value:function(){this.setState({showPuzzleModal:!0})}},{key:"handleErrorModalClose",value:function(){this.setState({showErrorModal:!1})}},{key:"render",value:function(){return n.createElement("div",null,n.createElement(m,{id:"errorModal",show:this.state.showErrorModal,handleClose:this.handleErrorModalClose}),n.createElement(d,{show:this.state.showSpinner}),n.createElement(u,{answer:15,puzzle:"4 x 4 - 1 =",show:this.state.showPuzzleModal,handleClose:this.handlePuzzleModalClose,handleShow:this.handlePuzzleModalShow,handleIsValid:this.handleIsPuzzleValid}),n.createElement("div",{className:"row splitter"},n.createElement("div",{className:"col-lg-12"},n.createElement("h3",null,"Basket:"),n.createElement("ul",{id:"basketItems"},this.state.resultSet.map((function(e){return n.createElement("li",{key:e.name},e.name)}))),n.createElement("p",{className:"lead"},"Use the below interface to alter the basket's contents:"))),n.createElement("div",{className:"row splitter"},n.createElement("div",{className:"col-lg-4"},n.createElement(g,{handleSubmit:this.handleGetSubmit,button:"Get",id:"get",label:"Get items (eg. 1 or 2 to get singular)",children:[{id:"get",placeholder:"Item position or leave empty",type:"number"}]}),n.createElement(g,{handleSubmit:this.handleAddSubmit,button:"Add",id:"add",label:"Add an item",children:[{id:"add",placeholder:"Name of item to add",required:!0}]}),n.createElement(g,{handleSubmit:this.handleDeleteSubmit,button:"Delete",id:"delete",label:"Delete an item",children:[{id:"delete",placeholder:"Item position to remove (eg. 1 or 2)",required:!0,type:"number"}]}),n.createElement(g,{handleSubmit:this.handleUpdateSubmit,button:"Update",id:"update",label:"Update an item (eg. 1 or 2)",children:[{id:"update_position",placeholder:"Position...",required:!0,type:"number"},{id:"update_value",placeholder:"Value...",required:!0}]}))))}}])&&C(t.prototype,a),o}(n.Component);r.render(n.createElement(j,null),document.getElementById("result"))}},a={};function n(e){var r=a[e];if(void 0!==r)return r.exports;var i=a[e]={exports:{}};return t[e].call(i.exports,i,i.exports,n),i.exports}n.m=t,e=[],n.O=(t,a,r,i)=>{if(!a){var l=1/0;for(u=0;u=i)&&Object.keys(n.O).every((e=>n.O[e](a[s])))?a.splice(s--,1):(o=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[a,r,i]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={179:0};n.O.j=t=>0===e[t];var t=(t,a)=>{var r,i,[l,o,s]=a,c=0;for(r in o)n.o(o,r)&&(n.m[r]=o[r]);if(s)var u=s(n);for(t&&t(a);cn(591)));r=n.O(r)})(); \ No newline at end of file diff --git a/docs/app_awsDotNetCoreShoppingCart/vendor.js b/docs/app_awsDotNetCoreShoppingCart/vendor.js deleted file mode 100644 index 46c6aca3d..000000000 --- a/docs/app_awsDotNetCoreShoppingCart/vendor.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.js.LICENSE.txt */ -(self.webpackChunkportfolio=self.webpackChunkportfolio||[]).push([[736],{184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t0&&t-1 in e)}T.fn=T.prototype={jquery:k,constructor:T,length:0,toArray:function(){return l.call(this)},get:function(e){return null==e?l.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return T.each(this,e)},map:function(e){return this.pushStack(T.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(T.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(T.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),V=new RegExp(F+"|>"),$=new RegExp(H),Z=new RegExp("^"+M+"$"),Q={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,G=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{A.apply(O=L.call(w.childNodes),w.childNodes),O[w.childNodes.length].nodeType}catch(e){A={apply:O.length?function(e,t){R.apply(e,L.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function le(e,t,r,i){var o,l,s,c,f,h,g,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(d(t),t=t||p,m)){if(11!==w&&(f=J.exec(e)))if(o=f[1]){if(9===w){if(!(s=t.getElementById(o)))return r;if(s.id===o)return r.push(s),r}else if(y&&(s=y.getElementById(o))&&b(t,s)&&s.id===o)return r.push(s),r}else{if(f[2])return A.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return A.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!N[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(g=e,y=t,1===w&&(V.test(e)||B.test(e))){for((y=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=x)),l=(h=a(e)).length;l--;)h[l]=(c?"#"+c:":scope")+" "+be(h[l]);g=h.join(",")}try{return A.apply(r,y.querySelectorAll(g)),r}catch(t){N(e,!0)}finally{c===x&&t.removeAttribute("id")}}}return u(e.replace(W,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[x]=!0,e}function ce(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function de(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return se((function(t){return t=+t,se((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=le.support={},o=le.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},d=le.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=p&&9===a.nodeType&&a.documentElement?(h=(p=a).documentElement,m=!o(p),w!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce((function(e){return h.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=G.test(p.getElementsByClassName),n.getById=ce((function(e){return h.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},g=[],v=[],(n.qsa=G.test(p.querySelectorAll))&&(ce((function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+I+")"),e.querySelectorAll("[id~="+x+"-]").length||v.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=G.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",H)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),t=G.test(h.compareDocumentPosition),b=t||G.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},P=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==w&&b(w,e)?-1:t==p||t.ownerDocument==w&&b(w,t)?1:c?j(c,e)-j(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],l=[t];if(!i||!o)return e==p?-1:t==p?1:i?-1:o?1:c?j(c,e)-j(c,t):0;if(i===o)return de(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;a[r]===l[r];)r++;return r?de(a[r],l[r]):a[r]==w?-1:l[r]==w?1:0},p):p},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!N[t+" "]&&(!g||!g.test(t))&&(!v||!v.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){N(t,!0)}return le(t,p,null,[e]).length>0},le.contains=function(e,t){return(e.ownerDocument||e)!=p&&d(e),b(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=p&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&_.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},le.escape=function(e){return(e+"").replace(re,ie)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(P),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=le.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=le.selectors={cacheLength:50,createPseudo:se,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&$.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+F+"|$)"))&&T(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=le.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var s,c,f,d,p,h,m=o!==a?"nextSibling":"previousSibling",v=t.parentNode,g=l&&t.nodeName.toLowerCase(),y=!u&&!l,b=!1;if(v){if(o){for(;m;){for(d=t;d=d[m];)if(l?d.nodeName.toLowerCase()===g:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?v.firstChild:v.lastChild],a&&y){for(b=(p=(s=(c=(f=(d=v)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===E&&s[1])&&s[2],d=p&&v.childNodes[p];d=++p&&d&&d[m]||(b=p=0)||h.pop();)if(1===d.nodeType&&++b&&d===t){c[e]=[E,p,b];break}}else if(y&&(b=p=(s=(c=(f=(d=t)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===E&&s[1]),!1===b)for(;(d=++p&&d&&d[m]||(b=p=0)||h.pop())&&((l?d.nodeName.toLowerCase()!==g:1!==d.nodeType)||!++b||(y&&((c=(f=d[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]=[E,b]),d!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=j(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:se((function(e){var t=[],n=[],r=l(e.replace(W,"$1"));return r[x]?se((function(e,t,n,i){for(var o,a=r(e,null,i,[]),l=e.length;l--;)(o=a[l])&&(e[l]=!(t[l]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:se((function(e){return function(t){return le(e,t).length>0}})),contains:se((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:se((function(e){return Z.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve((function(){return[0]})),last:ve((function(e,t){return[t-1]})),eq:ve((function(e,t,n){return[n<0?n+t:n]})),even:ve((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ve((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Ee(e,t,n,r,i){for(var o,a=[],l=0,u=e.length,s=null!=t;l-1&&(o[s]=!(a[s]=f))}}else g=Ee(g===a?g.splice(h,g.length):g),i?i(null,a,g,u):A.apply(a,g)}))}function Te(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],l=a||r.relative[" "],u=a?1:0,c=xe((function(e){return e===t}),l,!0),f=xe((function(e){return j(t,e)>-1}),l,!0),d=[function(e,n,r){var i=!a&&(r||n!==s)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&we(d),u>1&&be(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(W,"$1"),n,u0,i=e.length>0,o=function(o,a,l,u,c){var f,h,v,g=0,y="0",b=o&&[],x=[],w=s,k=o||i&&r.find.TAG("*",c),T=E+=null==w?1:Math.random()||.1,C=k.length;for(c&&(s=a==p||a||c);y!==C&&null!=(f=k[y]);y++){if(i&&f){for(h=0,a||f.ownerDocument==p||(d(f),l=!m);v=e[h++];)if(v(f,a||p,l)){u.push(f);break}c&&(E=T)}n&&((f=!v&&f)&&g--,o&&b.push(f))}if(g+=y,n&&y!==g){for(h=0;v=t[h++];)v(b,x,a,l);if(o){if(g>0)for(;y--;)b[y]||x[y]||(x[y]=D.call(u));x=Ee(x)}A.apply(u,x),c&&!o&&x.length>0&&g+t.length>1&&le.uniqueSort(u)}return c&&(E=T,s=w),b};return n?se(o):o}(o,i))).selector=e}return l},u=le.select=function(e,t,n,i){var o,u,s,c,f,d="function"==typeof e&&e,p=!i&&a(e=d.selector||e);if(n=n||[],1===p.length){if((u=p[0]=p[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&m&&r.relative[u[1].type]){if(!(t=(r.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=Q.needsContext.test(e)?0:u.length;o--&&(s=u[o],!r.relative[c=s.type]);)if((f=r.find[c])&&(i=f(s.matches[0].replace(te,ne),ee.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&be(u)))return A.apply(n,i),n;break}}return(d||l(e,p))(i,t,!m,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=x.split("").sort(P).join("")===x,n.detectDuplicates=!!f,d(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),ce((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||fe("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||fe("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||fe(I,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),le}(r);T.find=S,T.expr=S.selectors,T.expr[":"]=T.expr.pseudos,T.uniqueSort=T.unique=S.uniqueSort,T.text=S.getText,T.isXMLDoc=S.isXML,T.contains=S.contains,T.escapeSelector=S.escape;var N=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&T(e).is(n))break;r.push(e)}return r},P=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},_=T.expr.match.needsContext;function O(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function R(e,t,n){return g(t)?T.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?T.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?T.grep(e,(function(e){return c.call(t,e)>-1!==n})):T.filter(t,e,n)}T.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?T.find.matchesSelector(r,e)?[r]:[]:T.find.matches(e,T.grep(t,(function(e){return 1===e.nodeType})))},T.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(T(e).filter((function(){for(t=0;t1?T.uniqueSort(n):n},filter:function(e){return this.pushStack(R(this,e||[],!1))},not:function(e){return this.pushStack(R(this,e||[],!0))},is:function(e){return!!R(this,"string"==typeof e&&_.test(e)?T(e):e||[],!1).length}});var A,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||A,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof T?t[0]:t,T.merge(this,T.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),D.test(r[1])&&T.isPlainObject(t))for(r in t)g(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(T):T.makeArray(e,this)}).prototype=T.fn,A=T(b);var j=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function F(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&T.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?T.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(T(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),T.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return N(e,"parentNode")},parentsUntil:function(e,t,n){return N(e,"parentNode",n)},next:function(e){return F(e,"nextSibling")},prev:function(e){return F(e,"previousSibling")},nextAll:function(e){return N(e,"nextSibling")},prevAll:function(e){return N(e,"previousSibling")},nextUntil:function(e,t,n){return N(e,"nextSibling",n)},prevUntil:function(e,t,n){return N(e,"previousSibling",n)},siblings:function(e){return P((e.parentNode||{}).firstChild,e)},children:function(e){return P(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(O(e,"template")&&(e=e.content||e),T.merge([],e.childNodes))}},(function(e,t){T.fn[e]=function(n,r){var i=T.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=T.filter(r,i)),this.length>1&&(I[e]||T.uniqueSort(i),j.test(e)&&i.reverse()),this.pushStack(i)}}));var M=/[^\x20\t\r\n\f]+/g;function z(e){return e}function H(e){throw e}function q(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}T.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return T.each(e.match(M)||[],(function(e,n){t[n]=!0})),t}(e):T.extend({},e);var t,n,r,i,o=[],a=[],l=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;l=-1)for(n=a.shift();++l-1;)o.splice(n,1),n<=l&&l--})),this},has:function(e){return e?T.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!r}};return s},T.extend({Deferred:function(e){var t=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return T.Deferred((function(n){T.each(t,(function(t,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,i){var o=0;function a(e,t,n,i){return function(){var l=this,u=arguments,s=function(){var r,s;if(!(e=o&&(n!==H&&(l=void 0,u=[r]),t.rejectWith(l,u))}};e?c():(T.Deferred.getStackHook&&(c.stackTrace=T.Deferred.getStackHook()),r.setTimeout(c))}}return T.Deferred((function(r){t[0][3].add(a(0,r,g(i)?i:z,r.notifyWith)),t[1][3].add(a(0,r,g(e)?e:z)),t[2][3].add(a(0,r,g(n)?n:H))})).promise()},promise:function(e){return null!=e?T.extend(e,i):i}},o={};return T.each(t,(function(e,r){var a=r[2],l=r[5];i[r[1]]=a.add,l&&a.add((function(){n=l}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=l.call(arguments),o=T.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?l.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(q(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||g(i[n]&&i[n].then)))return o.then();for(;n--;)q(i[n],a(n),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&W.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},T.readyException=function(e){r.setTimeout((function(){throw e}))};var U=T.Deferred();function B(){b.removeEventListener("DOMContentLoaded",B),r.removeEventListener("load",B),T.ready()}T.fn.ready=function(e){return U.then(e).catch((function(e){T.readyException(e)})),this},T.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--T.readyWait:T.isReady)||(T.isReady=!0,!0!==e&&--T.readyWait>0||U.resolveWith(b,[T]))}}),T.ready.then=U.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(T.ready):(b.addEventListener("DOMContentLoaded",B),r.addEventListener("load",B));var V=function(e,t,n,r,i,o,a){var l=0,u=e.length,s=null==n;if("object"===E(n))for(l in i=!0,n)V(e,t,l,n[l],!0,o,a);else if(void 0!==r&&(i=!0,g(r)||(a=!0),s&&(a?(t.call(e,r),t=null):(s=t,t=function(e,t,n){return s.call(T(e),n)})),t))for(;l1,null,!0)},removeData:function(e){return this.each((function(){J.remove(this,e)}))}}),T.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=G.get(e,t),n&&(!r||Array.isArray(n)?r=G.access(e,t,T.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=T.queue(e,t),r=n.length,i=n.shift(),o=T._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){T.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:T.Callbacks("once memory").add((function(){G.remove(e,[t+"queue",n])}))})}}),T.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ye=/^$|^module$|\/(?:java|ecma)script/i;he=b.createDocumentFragment().appendChild(b.createElement("div")),(me=b.createElement("input")).setAttribute("type","radio"),me.setAttribute("checked","checked"),me.setAttribute("name","t"),he.appendChild(me),v.checkClone=he.cloneNode(!0).cloneNode(!0).lastChild.checked,he.innerHTML="",v.noCloneChecked=!!he.cloneNode(!0).lastChild.defaultValue,he.innerHTML="",v.option=!!he.lastChild;var be={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function xe(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&O(e,t)?T.merge([e],n):n}function we(e,t){for(var n=0,r=e.length;n",""]);var Ee=/<|&#?\w+;/;function ke(e,t,n,r,i){for(var o,a,l,u,s,c,f=t.createDocumentFragment(),d=[],p=0,h=e.length;p-1)i&&i.push(o);else if(s=le(o),a=xe(f.appendChild(o),"script"),s&&we(a),n)for(c=0;o=a[c++];)ye.test(o.type||"")&&n.push(o);return f}var Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return b.activeElement}catch(e){}}()==("focus"===t)}function Pe(e,t,n,r,i,o){var a,l;if("object"==typeof t){for(l in"string"!=typeof n&&(r=r||n,n=void 0),t)Pe(e,l,n,r,t[l],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return T().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=T.guid++)),e.each((function(){T.event.add(this,t,i,r,n)}))}function _e(e,t,n){n?(G.set(e,t,!1),T.event.add(e,t,{namespace:!1,handler:function(e){var r,i,o=G.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(T.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=l.call(arguments),G.set(this,t,o),r=n(this,t),this[t](),o!==(i=G.get(this,t))||r?G.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else o.length&&(G.set(this,t,{value:T.event.trigger(T.extend(o[0],T.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===G.get(e,t)&&T.event.add(e,t,Ce)}T.event={global:{},add:function(e,t,n,r,i){var o,a,l,u,s,c,f,d,p,h,m,v=G.get(e);if(X(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&T.find.matchesSelector(ae,i),n.guid||(n.guid=T.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(t){return void 0!==T&&T.event.triggered!==t.type?T.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(M)||[""]).length;s--;)p=m=(l=Te.exec(t[s])||[])[1],h=(l[2]||"").split(".").sort(),p&&(f=T.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=T.event.special[p]||{},c=T.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&T.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||((d=u[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),T.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,l,u,s,c,f,d,p,h,m,v=G.hasData(e)&&G.get(e);if(v&&(u=v.events)){for(s=(t=(t||"").match(M)||[""]).length;s--;)if(p=m=(l=Te.exec(t[s])||[])[1],h=(l[2]||"").split(".").sort(),p){for(f=T.event.special[p]||{},d=u[p=(r?f.delegateType:f.bindType)||p]||[],l=l[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||l&&!l.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||T.removeEvent(e,p,v.handle),delete u[p])}else for(p in u)T.event.remove(e,p+t[s],n,r,!0);T.isEmptyObject(u)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,l=new Array(arguments.length),u=T.event.fix(e),s=(G.get(this,"events")||Object.create(null))[u.type]||[],c=T.event.special[u.type]||{};for(l[0]=u,t=1;t=1))for(;s!==this;s=s.parentNode||this)if(1===s.nodeType&&("click"!==e.type||!0!==s.disabled)){for(o=[],a={},n=0;n-1:T.find(i,this,null,[s]).length),a[i]&&o.push(r);o.length&&l.push({elem:s,handlers:o})}return s=this,u\s*$/g;function Ae(e,t){return O(e,"table")&&O(11!==t.nodeType?t:t.firstChild,"tr")&&T(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function je(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,r,i,o,a,l;if(1===t.nodeType){if(G.hasData(e)&&(l=G.get(e).events))for(i in G.remove(t,"handle events"),l)for(n=0,r=l[i].length;n1&&"string"==typeof h&&!v.checkClone&&De.test(h))return e.each((function(i){var o=e.eq(i);m&&(t[0]=h.call(this,i,o.html())),Me(o,t,n,r)}));if(d&&(o=(i=ke(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(l=(a=T.map(xe(i,"script"),Le)).length;f0&&we(a,!u&&xe(e,"script")),l},cleanData:function(e){for(var t,n,r,i=T.event.special,o=0;void 0!==(n=e[o]);o++)if(X(n)){if(t=n[G.expando]){if(t.events)for(r in t.events)i[r]?T.event.remove(n,r):T.removeEvent(n,r,t.handle);n[G.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),T.fn.extend({detach:function(e){return ze(this,e,!0)},remove:function(e){return ze(this,e)},text:function(e){return V(this,(function(e){return void 0===e?T.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Me(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ae(this,e).appendChild(e)}))},prepend:function(){return Me(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ae(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Me(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Me(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(T.cleanData(xe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return T.clone(this,e,t)}))},html:function(e){return V(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!be[(ge.exec(e)||["",""])[1].toLowerCase()]){e=T.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-l-.5))||0),u}function nt(e,t,n){var r=qe(e),i=(!v.boxSizingReliable()||n)&&"border-box"===T.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),l="offset"+t[0].toUpperCase()+t.slice(1);if(He.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&O(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===T.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===T.css(e,"boxSizing",!1,r),(o=l in e)&&(a=e[l])),(a=parseFloat(a)||0)+tt(e,t,n||(i?"border":"content"),o,r,a)+"px"}function rt(e,t,n,r,i){return new rt.prototype.init(e,t,n,r,i)}T.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,l=K(t),u=Ye.test(t),s=e.style;if(u||(t=Ke(l)),a=T.cssHooks[t]||T.cssHooks[l],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:s[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ce(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(T.cssNumber[l]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(s[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?s.setProperty(t,n):s[t]=n))}},css:function(e,t,n,r){var i,o,a,l=K(t);return Ye.test(t)||(t=Ke(l)),(a=T.cssHooks[t]||T.cssHooks[l])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Je&&(i=Je[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),T.each(["height","width"],(function(e,t){T.cssHooks[t]={get:function(e,n,r){if(n)return!Xe.test(T.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?nt(e,t,r):We(e,Ge,(function(){return nt(e,t,r)}))},set:function(e,n,r){var i,o=qe(e),a=!v.scrollboxSize()&&"absolute"===o.position,l=(a||r)&&"border-box"===T.css(e,"boxSizing",!1,o),u=r?tt(e,t,r,l,o):0;return l&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-tt(e,t,"border",!1,o)-.5)),u&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=T.css(e,t)),et(0,n,u)}}})),T.cssHooks.marginLeft=Ve(v.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),T.each({margin:"",padding:"",border:"Width"},(function(e,t){T.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(T.cssHooks[e+t].set=et)})),T.fn.extend({css:function(e,t){return V(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=qe(e),i=t.length;a1)}}),T.Tween=rt,rt.prototype={constructor:rt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||T.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(T.cssNumber[n]?"":"px")},cur:function(){var e=rt.propHooks[this.prop];return e&&e.get?e.get(this):rt.propHooks._default.get(this)},run:function(e){var t,n=rt.propHooks[this.prop];return this.options.duration?this.pos=t=T.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rt.propHooks._default.set(this),this}},rt.prototype.init.prototype=rt.prototype,rt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=T.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){T.fx.step[e.prop]?T.fx.step[e.prop](e):1!==e.elem.nodeType||!T.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:T.style(e.elem,e.prop,e.now+e.unit)}}},rt.propHooks.scrollTop=rt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},T.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},T.fx=rt.prototype.init,T.fx.step={};var it,ot,at=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function ut(){ot&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ut):r.setTimeout(ut,T.fx.interval),T.fx.tick())}function st(){return r.setTimeout((function(){it=void 0})),it=Date.now()}function ct(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ft(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){T.removeAttr(this,e)}))}}),T.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?T.prop(e,t,n):(1===o&&T.isXMLDoc(e)||(i=T.attrHooks[t.toLowerCase()]||(T.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void T.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=T.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&O(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?T.removeAttr(e,n):e.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=ht[t]||T.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}}));var mt=/^(?:input|select|textarea|button)$/i,vt=/^(?:a|area)$/i;function gt(e){return(e.match(M)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(M)||[]}T.fn.extend({prop:function(e,t){return V(this,T.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[T.propFix[e]||e]}))}}),T.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&T.isXMLDoc(e)||(t=T.propFix[t]||t,i=T.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=T.find.attr(e,"tabindex");return t?parseInt(t,10):mt.test(e.nodeName)||vt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(T.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){T.propFix[this.toLowerCase()]=this})),T.fn.extend({addClass:function(e){var t,n,r,i,o,a,l,u=0;if(g(e))return this.each((function(t){T(this).addClass(e.call(this,t,yt(this)))}));if((t=bt(e)).length)for(;n=this[u++];)if(i=yt(n),r=1===n.nodeType&&" "+gt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(l=gt(r))&&n.setAttribute("class",l)}return this},removeClass:function(e){var t,n,r,i,o,a,l,u=0;if(g(e))return this.each((function(t){T(this).removeClass(e.call(this,t,yt(this)))}));if(!arguments.length)return this.attr("class","");if((t=bt(e)).length)for(;n=this[u++];)if(i=yt(n),r=1===n.nodeType&&" "+gt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(l=gt(r))&&n.setAttribute("class",l)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each((function(n){T(this).toggleClass(e.call(this,n,yt(this),t),t)})):this.each((function(){var t,i,o,a;if(r)for(i=0,o=T(this),a=bt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=yt(this))&&G.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":G.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+gt(yt(n))+" ").indexOf(t)>-1)return!0;return!1}});var xt=/\r/g;T.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=g(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,T(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=T.map(i,(function(e){return null==e?"":e+""}))),(t=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=T.valHooks[i.type]||T.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(xt,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(e){var t=T.find.attr(e,"value");return null!=t?t:gt(T.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,l=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),T.each(["radio","checkbox"],(function(){T.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=T.inArray(T(e).val(),t)>-1}},v.checkOn||(T.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),v.focusin="onfocusin"in r;var wt=/^(?:focusinfocus|focusoutblur)$/,Et=function(e){e.stopPropagation()};T.extend(T.event,{trigger:function(e,t,n,i){var o,a,l,u,s,c,f,d,h=[n||b],m=p.call(e,"type")?e.type:e,v=p.call(e,"namespace")?e.namespace.split("."):[];if(a=d=l=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!wt.test(m+T.event.triggered)&&(m.indexOf(".")>-1&&(v=m.split("."),m=v.shift(),v.sort()),s=m.indexOf(":")<0&&"on"+m,(e=e[T.expando]?e:new T.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=v.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:T.makeArray(t,[e]),f=T.event.special[m]||{},i||!f.trigger||!1!==f.trigger.apply(n,t))){if(!i&&!f.noBubble&&!y(n)){for(u=f.delegateType||m,wt.test(u+m)||(a=a.parentNode);a;a=a.parentNode)h.push(a),l=a;l===(n.ownerDocument||b)&&h.push(l.defaultView||l.parentWindow||r)}for(o=0;(a=h[o++])&&!e.isPropagationStopped();)d=a,e.type=o>1?u:f.bindType||m,(c=(G.get(a,"events")||Object.create(null))[e.type]&&G.get(a,"handle"))&&c.apply(a,t),(c=s&&a[s])&&c.apply&&X(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(h.pop(),t)||!X(n)||s&&g(n[m])&&!y(n)&&((l=n[s])&&(n[s]=null),T.event.triggered=m,e.isPropagationStopped()&&d.addEventListener(m,Et),n[m](),e.isPropagationStopped()&&d.removeEventListener(m,Et),T.event.triggered=void 0,l&&(n[s]=l)),e.result}},simulate:function(e,t,n){var r=T.extend(new T.Event,n,{type:e,isSimulated:!0});T.event.trigger(r,null,t)}}),T.fn.extend({trigger:function(e,t){return this.each((function(){T.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return T.event.trigger(e,t,n,!0)}}),v.focusin||T.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){T.event.simulate(t,e.target,T.event.fix(e))};T.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=G.access(r,t);i||r.addEventListener(e,n,!0),G.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=G.access(r,t)-1;i?G.access(r,t,i):(r.removeEventListener(e,n,!0),G.remove(r,t))}}}));var kt=r.location,Tt={guid:Date.now()},Ct=/\?/;T.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||T.error("Invalid XML: "+(n?T.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var St=/\[\]$/,Nt=/\r?\n/g,Pt=/^(?:submit|button|image|reset|file)$/i,_t=/^(?:input|select|textarea|keygen)/i;function Ot(e,t,n,r){var i;if(Array.isArray(t))T.each(t,(function(t,i){n||St.test(e)?r(e,i):Ot(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==E(t))r(e,t);else for(i in t)Ot(e+"["+i+"]",t[i],n,r)}T.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!T.isPlainObject(e))T.each(e,(function(){i(this.name,this.value)}));else for(n in e)Ot(n,e[n],t,i);return r.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=T.prop(this,"elements");return e?T.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!T(this).is(":disabled")&&_t.test(this.nodeName)&&!Pt.test(e)&&(this.checked||!ve.test(e))})).map((function(e,t){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,(function(e){return{name:t.name,value:e.replace(Nt,"\r\n")}})):{name:t.name,value:n.replace(Nt,"\r\n")}})).get()}});var Dt=/%20/g,Rt=/#.*$/,At=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,jt=/^(?:GET|HEAD)$/,It=/^\/\//,Ft={},Mt={},zt="*/".concat("*"),Ht=b.createElement("a");function qt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Wt(e,t,n,r){var i={},o=e===Mt;function a(l){var u;return i[l]=!0,T.each(e[l]||[],(function(e,l){var s=l(t,n,r);return"string"!=typeof s||o||i[s]?o?!(u=s):void 0:(t.dataTypes.unshift(s),a(s),!1)})),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ut(e,t){var n,r,i=T.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&T.extend(!0,e,r),e}Ht.href=kt.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:kt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(kt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,T.ajaxSettings),t):Ut(T.ajaxSettings,e)},ajaxPrefilter:qt(Ft),ajaxTransport:qt(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,a,l,u,s,c,f,d,p=T.ajaxSetup({},t),h=p.context||p,m=p.context&&(h.nodeType||h.jquery)?T(h):T.event,v=T.Deferred(),g=T.Callbacks("once memory"),y=p.statusCode||{},x={},w={},E="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(s){if(!a)for(a={};t=Lt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return s?o:null},setRequestHeader:function(e,t){return null==s&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==s&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(s)k.always(e[k.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||E;return n&&n.abort(t),C(0,t),this}};if(v.promise(k),p.url=((e||p.url||kt.href)+"").replace(It,kt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(M)||[""],null==p.crossDomain){u=b.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=Ht.protocol+"//"+Ht.host!=u.protocol+"//"+u.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=T.param(p.data,p.traditional)),Wt(Ft,p,t,k),s)return k;for(f in(c=T.event&&p.global)&&0==T.active++&&T.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!jt.test(p.type),i=p.url.replace(Rt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Dt,"+")):(d=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(Ct.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(At,"$1"),d=(Ct.test(i)?"&":"?")+"_="+Tt.guid+++d),p.url=i+d),p.ifModified&&(T.lastModified[i]&&k.setRequestHeader("If-Modified-Since",T.lastModified[i]),T.etag[i]&&k.setRequestHeader("If-None-Match",T.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+zt+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(h,k,p)||s))return k.abort();if(E="abort",g.add(p.complete),k.done(p.success),k.fail(p.error),n=Wt(Mt,p,t,k)){if(k.readyState=1,c&&m.trigger("ajaxSend",[k,p]),s)return k;p.async&&p.timeout>0&&(l=r.setTimeout((function(){k.abort("timeout")}),p.timeout));try{s=!1,n.send(x,C)}catch(e){if(s)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,a,u){var f,d,b,x,w,E=t;s||(s=!0,l&&r.clearTimeout(l),n=void 0,o=u||"",k.readyState=e>0?4:0,f=e>=200&&e<300||304===e,a&&(x=function(e,t,n){for(var r,i,o,a,l=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in l)if(l[i]&&l[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,k,a)),!f&&T.inArray("script",p.dataTypes)>-1&&T.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,a,l,u,s={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)s[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=s[u+" "+o]||s["* "+o]))for(i in s)if((l=i.split(" "))[1]===o&&(a=s[u+" "+l[0]]||s["* "+l[0]])){!0===a?a=s[i]:!0!==s[i]&&(o=l[0],c.unshift(l[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(p,x,k,f),f?(p.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(T.lastModified[i]=w),(w=k.getResponseHeader("etag"))&&(T.etag[i]=w)),204===e||"HEAD"===p.type?E="nocontent":304===e?E="notmodified":(E=x.state,d=x.data,f=!(b=x.error))):(b=E,!e&&E||(E="error",e<0&&(e=0))),k.status=e,k.statusText=(t||E)+"",f?v.resolveWith(h,[d,E,k]):v.rejectWith(h,[k,E,b]),k.statusCode(y),y=void 0,c&&m.trigger(f?"ajaxSuccess":"ajaxError",[k,p,f?d:b]),g.fireWith(h,[k,E]),c&&(m.trigger("ajaxComplete",[k,p]),--T.active||T.event.trigger("ajaxStop")))}return k},getJSON:function(e,t,n){return T.get(e,t,n,"json")},getScript:function(e,t){return T.get(e,void 0,t,"script")}}),T.each(["get","post"],(function(e,t){T[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),T.ajax(T.extend({url:e,type:t,dataType:i,data:n,success:r},T.isPlainObject(e)&&e))}})),T.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),T._evalUrl=function(e,t,n){return T.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){T.globalEval(e,t,n)}})},T.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=T(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return g(e)?this.each((function(t){T(this).wrapInner(e.call(this,t))})):this.each((function(){var t=T(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=g(e);return this.each((function(n){T(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){T(this).replaceWith(this.childNodes)})),this}}),T.expr.pseudos.hidden=function(e){return!T.expr.pseudos.visible(e)},T.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},Vt=T.ajaxSettings.xhr();v.cors=!!Vt&&"withCredentials"in Vt,v.ajax=Vt=!!Vt,T.ajaxTransport((function(e){var t,n;if(v.cors||Vt&&!e.crossDomain)return{send:function(i,o){var a,l=e.xhr();if(l.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)l[a]=e.xhrFields[a];for(a in e.mimeType&&l.overrideMimeType&&l.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)l.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=n=l.onload=l.onerror=l.onabort=l.ontimeout=l.onreadystatechange=null,"abort"===e?l.abort():"error"===e?"number"!=typeof l.status?o(0,"error"):o(l.status,l.statusText):o(Bt[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=t(),n=l.onerror=l.ontimeout=t("error"),void 0!==l.onabort?l.onabort=n:l.onreadystatechange=function(){4===l.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{l.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),T.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return T.globalEval(e),e}}}),T.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),T.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=T("

    AWS .NET, Natural Sorting Algorithm

    A natural string sorting algorithm, implementing IComparer in .NET, passing in a custom comparer, with a React UI

    AWS Lambda serverless application (SAM), using .NET along with an AWS RESTful Gateway API.


    \ No newline at end of file diff --git a/docs/app_awsDotNetCoreStringSortApi/main.css b/docs/app_awsDotNetCoreStringSortApi/main.css deleted file mode 100644 index 4c0e11841..000000000 --- a/docs/app_awsDotNetCoreStringSortApi/main.css +++ /dev/null @@ -1 +0,0 @@ -body h1{color:#000} \ No newline at end of file diff --git a/docs/app_awsDotNetCoreStringSortApi/main.js b/docs/app_awsDotNetCoreStringSortApi/main.js deleted file mode 100644 index 46d0f516b..000000000 --- a/docs/app_awsDotNetCoreStringSortApi/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,t={45:(e,t,a)=>{var r=a(294),n=a(935),l=a(625),o=a(754),i=a(151),s=a(555);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a0?t[0]:h}}],null&&f(t.prototype,null),a&&f(t,a),e}();function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a0&&this.handleSort()}},{key:"handleIsPuzzleValid",value:function(){this.setState({isPuzzleValid:!0,showPuzzleModal:!1})}},{key:"handlePuzzleModalClose",value:function(){this.setState({showPuzzleModal:!1})}},{key:"handlePuzzleModalShow",value:function(){this.setState({showPuzzleModal:!0})}},{key:"handleErrorModalClose",value:function(){this.setState({showErrorModal:!1})}},{key:"render",value:function(){return r.createElement("div",null,r.createElement(m,{id:"errorModal",show:this.state.showErrorModal,handleClose:this.handleErrorModalClose}),r.createElement(d,{show:this.state.showSpinner}),r.createElement(u,{answer:11,puzzle:"4 x 4 - 5 =",show:this.state.showPuzzleModal,handleClose:this.handlePuzzleModalClose,handleShow:this.handlePuzzleModalShow,handleIsValid:this.handleIsPuzzleValid}),r.createElement("div",{className:"row splitter"},r.createElement("div",{className:"col-lg-12"},r.createElement("h3",null,"Sorted values:"),r.createElement("p",{id:"resultOutput",className:"lead"},this.state.result))),r.createElement("div",{className:"row splitter"},r.createElement("div",{className:"col-lg-12"},r.createElement("p",null,"Values to sort: ",this.state.values))),r.createElement("div",{className:"row"},r.createElement("div",{className:"col-lg-12"},r.createElement(v,{value:this.state.values,onChange:this.handleValuesChange,handleSubmit:this.handleSubmit}))))}}])&&E(t.prototype,a),i}(r.Component);n.render(r.createElement(W,null),document.getElementById("result"))}},a={};function r(e){var n=a[e];if(void 0!==n)return n.exports;var l=a[e]={exports:{}};return t[e].call(l.exports,l,l.exports,r),l.exports}r.m=t,e=[],r.O=(t,a,n,l)=>{if(!a){var o=1/0;for(u=0;u=l)&&Object.keys(r.O).every((e=>r.O[e](a[s])))?a.splice(s--,1):(i=!1,l0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[a,n,l]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={179:0};r.O.j=t=>0===e[t];var t=(t,a)=>{var n,l,[o,i,s]=a,c=0;for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(s)var u=s(r);for(t&&t(a);cr(45)));n=r.O(n)})(); \ No newline at end of file diff --git a/docs/app_awsDotNetCoreStringSortApi/vendor.js b/docs/app_awsDotNetCoreStringSortApi/vendor.js deleted file mode 100644 index e7062e0ee..000000000 --- a/docs/app_awsDotNetCoreStringSortApi/vendor.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.js.LICENSE.txt */ -(self.webpackChunkportfolio=self.webpackChunkportfolio||[]).push([[736],{184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t0&&t-1 in e)}T.fn=T.prototype={jquery:k,constructor:T,length:0,toArray:function(){return l.call(this)},get:function(e){return null==e?l.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return T.each(this,e)},map:function(e){return this.pushStack(T.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(T.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(T.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),$=new RegExp(F+"|>"),V=new RegExp(H),Q=new RegExp("^"+M+"$"),Z={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,G=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{A.apply(O=L.call(w.childNodes),w.childNodes),O[w.childNodes.length].nodeType}catch(e){A={apply:O.length?function(e,t){R.apply(e,L.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function le(e,t,r,i){var o,l,s,c,f,h,g,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(d(t),t=t||p,m)){if(11!==w&&(f=J.exec(e)))if(o=f[1]){if(9===w){if(!(s=t.getElementById(o)))return r;if(s.id===o)return r.push(s),r}else if(y&&(s=y.getElementById(o))&&b(t,s)&&s.id===o)return r.push(s),r}else{if(f[2])return A.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return A.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!N[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(g=e,y=t,1===w&&($.test(e)||B.test(e))){for((y=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=x)),l=(h=a(e)).length;l--;)h[l]=(c?"#"+c:":scope")+" "+be(h[l]);g=h.join(",")}try{return A.apply(r,y.querySelectorAll(g)),r}catch(t){N(e,!0)}finally{c===x&&t.removeAttribute("id")}}}return u(e.replace(W,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[x]=!0,e}function ce(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function de(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return se((function(t){return t=+t,se((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=le.support={},o=le.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},d=le.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=p&&9===a.nodeType&&a.documentElement?(h=(p=a).documentElement,m=!o(p),w!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce((function(e){return h.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=G.test(p.getElementsByClassName),n.getById=ce((function(e){return h.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},g=[],v=[],(n.qsa=G.test(p.querySelectorAll))&&(ce((function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+I+")"),e.querySelectorAll("[id~="+x+"-]").length||v.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=G.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",H)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),t=G.test(h.compareDocumentPosition),b=t||G.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},P=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==w&&b(w,e)?-1:t==p||t.ownerDocument==w&&b(w,t)?1:c?j(c,e)-j(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],l=[t];if(!i||!o)return e==p?-1:t==p?1:i?-1:o?1:c?j(c,e)-j(c,t):0;if(i===o)return de(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;a[r]===l[r];)r++;return r?de(a[r],l[r]):a[r]==w?-1:l[r]==w?1:0},p):p},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!N[t+" "]&&(!g||!g.test(t))&&(!v||!v.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){N(t,!0)}return le(t,p,null,[e]).length>0},le.contains=function(e,t){return(e.ownerDocument||e)!=p&&d(e),b(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=p&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&_.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},le.escape=function(e){return(e+"").replace(re,ie)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(P),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=le.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=le.selectors={cacheLength:50,createPseudo:se,match:Z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Z.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+F+"|$)"))&&T(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=le.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var s,c,f,d,p,h,m=o!==a?"nextSibling":"previousSibling",v=t.parentNode,g=l&&t.nodeName.toLowerCase(),y=!u&&!l,b=!1;if(v){if(o){for(;m;){for(d=t;d=d[m];)if(l?d.nodeName.toLowerCase()===g:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?v.firstChild:v.lastChild],a&&y){for(b=(p=(s=(c=(f=(d=v)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===E&&s[1])&&s[2],d=p&&v.childNodes[p];d=++p&&d&&d[m]||(b=p=0)||h.pop();)if(1===d.nodeType&&++b&&d===t){c[e]=[E,p,b];break}}else if(y&&(b=p=(s=(c=(f=(d=t)[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===E&&s[1]),!1===b)for(;(d=++p&&d&&d[m]||(b=p=0)||h.pop())&&((l?d.nodeName.toLowerCase()!==g:1!==d.nodeType)||!++b||(y&&((c=(f=d[x]||(d[x]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]=[E,b]),d!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=j(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:se((function(e){var t=[],n=[],r=l(e.replace(W,"$1"));return r[x]?se((function(e,t,n,i){for(var o,a=r(e,null,i,[]),l=e.length;l--;)(o=a[l])&&(e[l]=!(t[l]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:se((function(e){return function(t){return le(e,t).length>0}})),contains:se((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:se((function(e){return Q.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve((function(){return[0]})),last:ve((function(e,t){return[t-1]})),eq:ve((function(e,t,n){return[n<0?n+t:n]})),even:ve((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ve((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Ee(e,t,n,r,i){for(var o,a=[],l=0,u=e.length,s=null!=t;l-1&&(o[s]=!(a[s]=f))}}else g=Ee(g===a?g.splice(h,g.length):g),i?i(null,a,g,u):A.apply(a,g)}))}function Te(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],l=a||r.relative[" "],u=a?1:0,c=xe((function(e){return e===t}),l,!0),f=xe((function(e){return j(t,e)>-1}),l,!0),d=[function(e,n,r){var i=!a&&(r||n!==s)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&we(d),u>1&&be(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(W,"$1"),n,u0,i=e.length>0,o=function(o,a,l,u,c){var f,h,v,g=0,y="0",b=o&&[],x=[],w=s,k=o||i&&r.find.TAG("*",c),T=E+=null==w?1:Math.random()||.1,C=k.length;for(c&&(s=a==p||a||c);y!==C&&null!=(f=k[y]);y++){if(i&&f){for(h=0,a||f.ownerDocument==p||(d(f),l=!m);v=e[h++];)if(v(f,a||p,l)){u.push(f);break}c&&(E=T)}n&&((f=!v&&f)&&g--,o&&b.push(f))}if(g+=y,n&&y!==g){for(h=0;v=t[h++];)v(b,x,a,l);if(o){if(g>0)for(;y--;)b[y]||x[y]||(x[y]=D.call(u));x=Ee(x)}A.apply(u,x),c&&!o&&x.length>0&&g+t.length>1&&le.uniqueSort(u)}return c&&(E=T,s=w),b};return n?se(o):o}(o,i))).selector=e}return l},u=le.select=function(e,t,n,i){var o,u,s,c,f,d="function"==typeof e&&e,p=!i&&a(e=d.selector||e);if(n=n||[],1===p.length){if((u=p[0]=p[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&m&&r.relative[u[1].type]){if(!(t=(r.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=Z.needsContext.test(e)?0:u.length;o--&&(s=u[o],!r.relative[c=s.type]);)if((f=r.find[c])&&(i=f(s.matches[0].replace(te,ne),ee.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&be(u)))return A.apply(n,i),n;break}}return(d||l(e,p))(i,t,!m,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=x.split("").sort(P).join("")===x,n.detectDuplicates=!!f,d(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),ce((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||fe("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||fe("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||fe(I,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),le}(r);T.find=S,T.expr=S.selectors,T.expr[":"]=T.expr.pseudos,T.uniqueSort=T.unique=S.uniqueSort,T.text=S.getText,T.isXMLDoc=S.isXML,T.contains=S.contains,T.escapeSelector=S.escape;var N=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&T(e).is(n))break;r.push(e)}return r},P=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},_=T.expr.match.needsContext;function O(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function R(e,t,n){return g(t)?T.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?T.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?T.grep(e,(function(e){return c.call(t,e)>-1!==n})):T.filter(t,e,n)}T.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?T.find.matchesSelector(r,e)?[r]:[]:T.find.matches(e,T.grep(t,(function(e){return 1===e.nodeType})))},T.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(T(e).filter((function(){for(t=0;t1?T.uniqueSort(n):n},filter:function(e){return this.pushStack(R(this,e||[],!1))},not:function(e){return this.pushStack(R(this,e||[],!0))},is:function(e){return!!R(this,"string"==typeof e&&_.test(e)?T(e):e||[],!1).length}});var A,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||A,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof T?t[0]:t,T.merge(this,T.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),D.test(r[1])&&T.isPlainObject(t))for(r in t)g(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(T):T.makeArray(e,this)}).prototype=T.fn,A=T(b);var j=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function F(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&T.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?T.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(T(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),T.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return N(e,"parentNode")},parentsUntil:function(e,t,n){return N(e,"parentNode",n)},next:function(e){return F(e,"nextSibling")},prev:function(e){return F(e,"previousSibling")},nextAll:function(e){return N(e,"nextSibling")},prevAll:function(e){return N(e,"previousSibling")},nextUntil:function(e,t,n){return N(e,"nextSibling",n)},prevUntil:function(e,t,n){return N(e,"previousSibling",n)},siblings:function(e){return P((e.parentNode||{}).firstChild,e)},children:function(e){return P(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(O(e,"template")&&(e=e.content||e),T.merge([],e.childNodes))}},(function(e,t){T.fn[e]=function(n,r){var i=T.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=T.filter(r,i)),this.length>1&&(I[e]||T.uniqueSort(i),j.test(e)&&i.reverse()),this.pushStack(i)}}));var M=/[^\x20\t\r\n\f]+/g;function z(e){return e}function H(e){throw e}function q(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}T.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return T.each(e.match(M)||[],(function(e,n){t[n]=!0})),t}(e):T.extend({},e);var t,n,r,i,o=[],a=[],l=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;l=-1)for(n=a.shift();++l-1;)o.splice(n,1),n<=l&&l--})),this},has:function(e){return e?T.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!r}};return s},T.extend({Deferred:function(e){var t=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return T.Deferred((function(n){T.each(t,(function(t,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,i){var o=0;function a(e,t,n,i){return function(){var l=this,u=arguments,s=function(){var r,s;if(!(e=o&&(n!==H&&(l=void 0,u=[r]),t.rejectWith(l,u))}};e?c():(T.Deferred.getStackHook&&(c.stackTrace=T.Deferred.getStackHook()),r.setTimeout(c))}}return T.Deferred((function(r){t[0][3].add(a(0,r,g(i)?i:z,r.notifyWith)),t[1][3].add(a(0,r,g(e)?e:z)),t[2][3].add(a(0,r,g(n)?n:H))})).promise()},promise:function(e){return null!=e?T.extend(e,i):i}},o={};return T.each(t,(function(e,r){var a=r[2],l=r[5];i[r[1]]=a.add,l&&a.add((function(){n=l}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=l.call(arguments),o=T.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?l.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(q(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||g(i[n]&&i[n].then)))return o.then();for(;n--;)q(i[n],a(n),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&W.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},T.readyException=function(e){r.setTimeout((function(){throw e}))};var U=T.Deferred();function B(){b.removeEventListener("DOMContentLoaded",B),r.removeEventListener("load",B),T.ready()}T.fn.ready=function(e){return U.then(e).catch((function(e){T.readyException(e)})),this},T.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--T.readyWait:T.isReady)||(T.isReady=!0,!0!==e&&--T.readyWait>0||U.resolveWith(b,[T]))}}),T.ready.then=U.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(T.ready):(b.addEventListener("DOMContentLoaded",B),r.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var l=0,u=e.length,s=null==n;if("object"===E(n))for(l in i=!0,n)$(e,t,l,n[l],!0,o,a);else if(void 0!==r&&(i=!0,g(r)||(a=!0),s&&(a?(t.call(e,r),t=null):(s=t,t=function(e,t,n){return s.call(T(e),n)})),t))for(;l1,null,!0)},removeData:function(e){return this.each((function(){J.remove(this,e)}))}}),T.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=G.get(e,t),n&&(!r||Array.isArray(n)?r=G.access(e,t,T.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=T.queue(e,t),r=n.length,i=n.shift(),o=T._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){T.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:T.Callbacks("once memory").add((function(){G.remove(e,[t+"queue",n])}))})}}),T.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ye=/^$|^module$|\/(?:java|ecma)script/i;he=b.createDocumentFragment().appendChild(b.createElement("div")),(me=b.createElement("input")).setAttribute("type","radio"),me.setAttribute("checked","checked"),me.setAttribute("name","t"),he.appendChild(me),v.checkClone=he.cloneNode(!0).cloneNode(!0).lastChild.checked,he.innerHTML="",v.noCloneChecked=!!he.cloneNode(!0).lastChild.defaultValue,he.innerHTML="",v.option=!!he.lastChild;var be={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function xe(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&O(e,t)?T.merge([e],n):n}function we(e,t){for(var n=0,r=e.length;n",""]);var Ee=/<|&#?\w+;/;function ke(e,t,n,r,i){for(var o,a,l,u,s,c,f=t.createDocumentFragment(),d=[],p=0,h=e.length;p-1)i&&i.push(o);else if(s=le(o),a=xe(f.appendChild(o),"script"),s&&we(a),n)for(c=0;o=a[c++];)ye.test(o.type||"")&&n.push(o);return f}var Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return b.activeElement}catch(e){}}()==("focus"===t)}function Pe(e,t,n,r,i,o){var a,l;if("object"==typeof t){for(l in"string"!=typeof n&&(r=r||n,n=void 0),t)Pe(e,l,n,r,t[l],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return T().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=T.guid++)),e.each((function(){T.event.add(this,t,i,r,n)}))}function _e(e,t,n){n?(G.set(e,t,!1),T.event.add(e,t,{namespace:!1,handler:function(e){var r,i,o=G.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(T.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=l.call(arguments),G.set(this,t,o),r=n(this,t),this[t](),o!==(i=G.get(this,t))||r?G.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else o.length&&(G.set(this,t,{value:T.event.trigger(T.extend(o[0],T.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===G.get(e,t)&&T.event.add(e,t,Ce)}T.event={global:{},add:function(e,t,n,r,i){var o,a,l,u,s,c,f,d,p,h,m,v=G.get(e);if(X(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&T.find.matchesSelector(ae,i),n.guid||(n.guid=T.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(t){return void 0!==T&&T.event.triggered!==t.type?T.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(M)||[""]).length;s--;)p=m=(l=Te.exec(t[s])||[])[1],h=(l[2]||"").split(".").sort(),p&&(f=T.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=T.event.special[p]||{},c=T.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&T.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||((d=u[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),T.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,l,u,s,c,f,d,p,h,m,v=G.hasData(e)&&G.get(e);if(v&&(u=v.events)){for(s=(t=(t||"").match(M)||[""]).length;s--;)if(p=m=(l=Te.exec(t[s])||[])[1],h=(l[2]||"").split(".").sort(),p){for(f=T.event.special[p]||{},d=u[p=(r?f.delegateType:f.bindType)||p]||[],l=l[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||l&&!l.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||T.removeEvent(e,p,v.handle),delete u[p])}else for(p in u)T.event.remove(e,p+t[s],n,r,!0);T.isEmptyObject(u)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,l=new Array(arguments.length),u=T.event.fix(e),s=(G.get(this,"events")||Object.create(null))[u.type]||[],c=T.event.special[u.type]||{};for(l[0]=u,t=1;t=1))for(;s!==this;s=s.parentNode||this)if(1===s.nodeType&&("click"!==e.type||!0!==s.disabled)){for(o=[],a={},n=0;n-1:T.find(i,this,null,[s]).length),a[i]&&o.push(r);o.length&&l.push({elem:s,handlers:o})}return s=this,u\s*$/g;function Ae(e,t){return O(e,"table")&&O(11!==t.nodeType?t:t.firstChild,"tr")&&T(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function je(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,r,i,o,a,l;if(1===t.nodeType){if(G.hasData(e)&&(l=G.get(e).events))for(i in G.remove(t,"handle events"),l)for(n=0,r=l[i].length;n1&&"string"==typeof h&&!v.checkClone&&De.test(h))return e.each((function(i){var o=e.eq(i);m&&(t[0]=h.call(this,i,o.html())),Me(o,t,n,r)}));if(d&&(o=(i=ke(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(l=(a=T.map(xe(i,"script"),Le)).length;f0&&we(a,!u&&xe(e,"script")),l},cleanData:function(e){for(var t,n,r,i=T.event.special,o=0;void 0!==(n=e[o]);o++)if(X(n)){if(t=n[G.expando]){if(t.events)for(r in t.events)i[r]?T.event.remove(n,r):T.removeEvent(n,r,t.handle);n[G.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),T.fn.extend({detach:function(e){return ze(this,e,!0)},remove:function(e){return ze(this,e)},text:function(e){return $(this,(function(e){return void 0===e?T.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Me(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ae(this,e).appendChild(e)}))},prepend:function(){return Me(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ae(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Me(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Me(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(T.cleanData(xe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return T.clone(this,e,t)}))},html:function(e){return $(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!be[(ge.exec(e)||["",""])[1].toLowerCase()]){e=T.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-l-.5))||0),u}function nt(e,t,n){var r=qe(e),i=(!v.boxSizingReliable()||n)&&"border-box"===T.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),l="offset"+t[0].toUpperCase()+t.slice(1);if(He.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&O(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===T.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===T.css(e,"boxSizing",!1,r),(o=l in e)&&(a=e[l])),(a=parseFloat(a)||0)+tt(e,t,n||(i?"border":"content"),o,r,a)+"px"}function rt(e,t,n,r,i){return new rt.prototype.init(e,t,n,r,i)}T.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,l=K(t),u=Ye.test(t),s=e.style;if(u||(t=Ke(l)),a=T.cssHooks[t]||T.cssHooks[l],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:s[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ce(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(T.cssNumber[l]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(s[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?s.setProperty(t,n):s[t]=n))}},css:function(e,t,n,r){var i,o,a,l=K(t);return Ye.test(t)||(t=Ke(l)),(a=T.cssHooks[t]||T.cssHooks[l])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Je&&(i=Je[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),T.each(["height","width"],(function(e,t){T.cssHooks[t]={get:function(e,n,r){if(n)return!Xe.test(T.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?nt(e,t,r):We(e,Ge,(function(){return nt(e,t,r)}))},set:function(e,n,r){var i,o=qe(e),a=!v.scrollboxSize()&&"absolute"===o.position,l=(a||r)&&"border-box"===T.css(e,"boxSizing",!1,o),u=r?tt(e,t,r,l,o):0;return l&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-tt(e,t,"border",!1,o)-.5)),u&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=T.css(e,t)),et(0,n,u)}}})),T.cssHooks.marginLeft=$e(v.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),T.each({margin:"",padding:"",border:"Width"},(function(e,t){T.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(T.cssHooks[e+t].set=et)})),T.fn.extend({css:function(e,t){return $(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=qe(e),i=t.length;a1)}}),T.Tween=rt,rt.prototype={constructor:rt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||T.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(T.cssNumber[n]?"":"px")},cur:function(){var e=rt.propHooks[this.prop];return e&&e.get?e.get(this):rt.propHooks._default.get(this)},run:function(e){var t,n=rt.propHooks[this.prop];return this.options.duration?this.pos=t=T.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rt.propHooks._default.set(this),this}},rt.prototype.init.prototype=rt.prototype,rt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=T.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){T.fx.step[e.prop]?T.fx.step[e.prop](e):1!==e.elem.nodeType||!T.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:T.style(e.elem,e.prop,e.now+e.unit)}}},rt.propHooks.scrollTop=rt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},T.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},T.fx=rt.prototype.init,T.fx.step={};var it,ot,at=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function ut(){ot&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ut):r.setTimeout(ut,T.fx.interval),T.fx.tick())}function st(){return r.setTimeout((function(){it=void 0})),it=Date.now()}function ct(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ft(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){T.removeAttr(this,e)}))}}),T.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?T.prop(e,t,n):(1===o&&T.isXMLDoc(e)||(i=T.attrHooks[t.toLowerCase()]||(T.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void T.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=T.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&O(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?T.removeAttr(e,n):e.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=ht[t]||T.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}}));var mt=/^(?:input|select|textarea|button)$/i,vt=/^(?:a|area)$/i;function gt(e){return(e.match(M)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(M)||[]}T.fn.extend({prop:function(e,t){return $(this,T.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[T.propFix[e]||e]}))}}),T.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&T.isXMLDoc(e)||(t=T.propFix[t]||t,i=T.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=T.find.attr(e,"tabindex");return t?parseInt(t,10):mt.test(e.nodeName)||vt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(T.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){T.propFix[this.toLowerCase()]=this})),T.fn.extend({addClass:function(e){var t,n,r,i,o,a,l,u=0;if(g(e))return this.each((function(t){T(this).addClass(e.call(this,t,yt(this)))}));if((t=bt(e)).length)for(;n=this[u++];)if(i=yt(n),r=1===n.nodeType&&" "+gt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(l=gt(r))&&n.setAttribute("class",l)}return this},removeClass:function(e){var t,n,r,i,o,a,l,u=0;if(g(e))return this.each((function(t){T(this).removeClass(e.call(this,t,yt(this)))}));if(!arguments.length)return this.attr("class","");if((t=bt(e)).length)for(;n=this[u++];)if(i=yt(n),r=1===n.nodeType&&" "+gt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(l=gt(r))&&n.setAttribute("class",l)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each((function(n){T(this).toggleClass(e.call(this,n,yt(this),t),t)})):this.each((function(){var t,i,o,a;if(r)for(i=0,o=T(this),a=bt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=yt(this))&&G.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":G.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+gt(yt(n))+" ").indexOf(t)>-1)return!0;return!1}});var xt=/\r/g;T.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=g(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,T(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=T.map(i,(function(e){return null==e?"":e+""}))),(t=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=T.valHooks[i.type]||T.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(xt,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(e){var t=T.find.attr(e,"value");return null!=t?t:gt(T.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,l=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),T.each(["radio","checkbox"],(function(){T.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=T.inArray(T(e).val(),t)>-1}},v.checkOn||(T.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),v.focusin="onfocusin"in r;var wt=/^(?:focusinfocus|focusoutblur)$/,Et=function(e){e.stopPropagation()};T.extend(T.event,{trigger:function(e,t,n,i){var o,a,l,u,s,c,f,d,h=[n||b],m=p.call(e,"type")?e.type:e,v=p.call(e,"namespace")?e.namespace.split("."):[];if(a=d=l=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!wt.test(m+T.event.triggered)&&(m.indexOf(".")>-1&&(v=m.split("."),m=v.shift(),v.sort()),s=m.indexOf(":")<0&&"on"+m,(e=e[T.expando]?e:new T.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=v.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:T.makeArray(t,[e]),f=T.event.special[m]||{},i||!f.trigger||!1!==f.trigger.apply(n,t))){if(!i&&!f.noBubble&&!y(n)){for(u=f.delegateType||m,wt.test(u+m)||(a=a.parentNode);a;a=a.parentNode)h.push(a),l=a;l===(n.ownerDocument||b)&&h.push(l.defaultView||l.parentWindow||r)}for(o=0;(a=h[o++])&&!e.isPropagationStopped();)d=a,e.type=o>1?u:f.bindType||m,(c=(G.get(a,"events")||Object.create(null))[e.type]&&G.get(a,"handle"))&&c.apply(a,t),(c=s&&a[s])&&c.apply&&X(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(h.pop(),t)||!X(n)||s&&g(n[m])&&!y(n)&&((l=n[s])&&(n[s]=null),T.event.triggered=m,e.isPropagationStopped()&&d.addEventListener(m,Et),n[m](),e.isPropagationStopped()&&d.removeEventListener(m,Et),T.event.triggered=void 0,l&&(n[s]=l)),e.result}},simulate:function(e,t,n){var r=T.extend(new T.Event,n,{type:e,isSimulated:!0});T.event.trigger(r,null,t)}}),T.fn.extend({trigger:function(e,t){return this.each((function(){T.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return T.event.trigger(e,t,n,!0)}}),v.focusin||T.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){T.event.simulate(t,e.target,T.event.fix(e))};T.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=G.access(r,t);i||r.addEventListener(e,n,!0),G.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=G.access(r,t)-1;i?G.access(r,t,i):(r.removeEventListener(e,n,!0),G.remove(r,t))}}}));var kt=r.location,Tt={guid:Date.now()},Ct=/\?/;T.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||T.error("Invalid XML: "+(n?T.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var St=/\[\]$/,Nt=/\r?\n/g,Pt=/^(?:submit|button|image|reset|file)$/i,_t=/^(?:input|select|textarea|keygen)/i;function Ot(e,t,n,r){var i;if(Array.isArray(t))T.each(t,(function(t,i){n||St.test(e)?r(e,i):Ot(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==E(t))r(e,t);else for(i in t)Ot(e+"["+i+"]",t[i],n,r)}T.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!T.isPlainObject(e))T.each(e,(function(){i(this.name,this.value)}));else for(n in e)Ot(n,e[n],t,i);return r.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=T.prop(this,"elements");return e?T.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!T(this).is(":disabled")&&_t.test(this.nodeName)&&!Pt.test(e)&&(this.checked||!ve.test(e))})).map((function(e,t){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,(function(e){return{name:t.name,value:e.replace(Nt,"\r\n")}})):{name:t.name,value:n.replace(Nt,"\r\n")}})).get()}});var Dt=/%20/g,Rt=/#.*$/,At=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,jt=/^(?:GET|HEAD)$/,It=/^\/\//,Ft={},Mt={},zt="*/".concat("*"),Ht=b.createElement("a");function qt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Wt(e,t,n,r){var i={},o=e===Mt;function a(l){var u;return i[l]=!0,T.each(e[l]||[],(function(e,l){var s=l(t,n,r);return"string"!=typeof s||o||i[s]?o?!(u=s):void 0:(t.dataTypes.unshift(s),a(s),!1)})),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ut(e,t){var n,r,i=T.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&T.extend(!0,e,r),e}Ht.href=kt.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:kt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(kt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,T.ajaxSettings),t):Ut(T.ajaxSettings,e)},ajaxPrefilter:qt(Ft),ajaxTransport:qt(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,a,l,u,s,c,f,d,p=T.ajaxSetup({},t),h=p.context||p,m=p.context&&(h.nodeType||h.jquery)?T(h):T.event,v=T.Deferred(),g=T.Callbacks("once memory"),y=p.statusCode||{},x={},w={},E="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(s){if(!a)for(a={};t=Lt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return s?o:null},setRequestHeader:function(e,t){return null==s&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==s&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(s)k.always(e[k.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||E;return n&&n.abort(t),C(0,t),this}};if(v.promise(k),p.url=((e||p.url||kt.href)+"").replace(It,kt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(M)||[""],null==p.crossDomain){u=b.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=Ht.protocol+"//"+Ht.host!=u.protocol+"//"+u.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=T.param(p.data,p.traditional)),Wt(Ft,p,t,k),s)return k;for(f in(c=T.event&&p.global)&&0==T.active++&&T.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!jt.test(p.type),i=p.url.replace(Rt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Dt,"+")):(d=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(Ct.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(At,"$1"),d=(Ct.test(i)?"&":"?")+"_="+Tt.guid+++d),p.url=i+d),p.ifModified&&(T.lastModified[i]&&k.setRequestHeader("If-Modified-Since",T.lastModified[i]),T.etag[i]&&k.setRequestHeader("If-None-Match",T.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+zt+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(h,k,p)||s))return k.abort();if(E="abort",g.add(p.complete),k.done(p.success),k.fail(p.error),n=Wt(Mt,p,t,k)){if(k.readyState=1,c&&m.trigger("ajaxSend",[k,p]),s)return k;p.async&&p.timeout>0&&(l=r.setTimeout((function(){k.abort("timeout")}),p.timeout));try{s=!1,n.send(x,C)}catch(e){if(s)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,a,u){var f,d,b,x,w,E=t;s||(s=!0,l&&r.clearTimeout(l),n=void 0,o=u||"",k.readyState=e>0?4:0,f=e>=200&&e<300||304===e,a&&(x=function(e,t,n){for(var r,i,o,a,l=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in l)if(l[i]&&l[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,k,a)),!f&&T.inArray("script",p.dataTypes)>-1&&T.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,a,l,u,s={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)s[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=s[u+" "+o]||s["* "+o]))for(i in s)if((l=i.split(" "))[1]===o&&(a=s[u+" "+l[0]]||s["* "+l[0]])){!0===a?a=s[i]:!0!==s[i]&&(o=l[0],c.unshift(l[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(p,x,k,f),f?(p.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(T.lastModified[i]=w),(w=k.getResponseHeader("etag"))&&(T.etag[i]=w)),204===e||"HEAD"===p.type?E="nocontent":304===e?E="notmodified":(E=x.state,d=x.data,f=!(b=x.error))):(b=E,!e&&E||(E="error",e<0&&(e=0))),k.status=e,k.statusText=(t||E)+"",f?v.resolveWith(h,[d,E,k]):v.rejectWith(h,[k,E,b]),k.statusCode(y),y=void 0,c&&m.trigger(f?"ajaxSuccess":"ajaxError",[k,p,f?d:b]),g.fireWith(h,[k,E]),c&&(m.trigger("ajaxComplete",[k,p]),--T.active||T.event.trigger("ajaxStop")))}return k},getJSON:function(e,t,n){return T.get(e,t,n,"json")},getScript:function(e,t){return T.get(e,void 0,t,"script")}}),T.each(["get","post"],(function(e,t){T[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),T.ajax(T.extend({url:e,type:t,dataType:i,data:n,success:r},T.isPlainObject(e)&&e))}})),T.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),T._evalUrl=function(e,t,n){return T.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){T.globalEval(e,t,n)}})},T.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=T(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return g(e)?this.each((function(t){T(this).wrapInner(e.call(this,t))})):this.each((function(){var t=T(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=g(e);return this.each((function(n){T(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){T(this).replaceWith(this.childNodes)})),this}}),T.expr.pseudos.hidden=function(e){return!T.expr.pseudos.visible(e)},T.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},$t=T.ajaxSettings.xhr();v.cors=!!$t&&"withCredentials"in $t,v.ajax=$t=!!$t,T.ajaxTransport((function(e){var t,n;if(v.cors||$t&&!e.crossDomain)return{send:function(i,o){var a,l=e.xhr();if(l.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)l[a]=e.xhrFields[a];for(a in e.mimeType&&l.overrideMimeType&&l.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)l.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=n=l.onload=l.onerror=l.onabort=l.ontimeout=l.onreadystatechange=null,"abort"===e?l.abort():"error"===e?"number"!=typeof l.status?o(0,"error"):o(l.status,l.statusText):o(Bt[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=t(),n=l.onerror=l.ontimeout=t("error"),void 0!==l.onabort?l.onabort=n:l.onreadystatechange=function(){4===l.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{l.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),T.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return T.globalEval(e),e}}}),T.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),T.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=T("

    AWS Node.js, B2C API, To-Do List

    Authenticated with Cognito, data stored using Dynamo DB, driven by Lambda Functions and with a React UI

    Built with Node.js, the AWS Serverless Framework and managed by an HTTP API Gateway.


    \ No newline at end of file diff --git a/docs/app_awsNodeToDoApi/main.js b/docs/app_awsNodeToDoApi/main.js deleted file mode 100644 index 5c0906c8f..000000000 --- a/docs/app_awsNodeToDoApi/main.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var e,t={178:(e,t,r)=>{"use strict";r(5666);var n=r(7294),a=r(3935),o=r(3727),i=r(5977),l=r(103),c=r(8791),u={UserPoolId:"eu-west-2_s4syVYS6n",ClientId:"60jvm1avgd6t55k4uc15dgu6iq"},s={username:"",description:"",done:!1,targetDate:"",modifiedOn:0},m={show:!0,text:"Hide",class:"bi-dash-square"},d={show:!1,text:"Show",class:"bi-plus-square"},p="hide",f="show",h="copy",y="description",b="/register",v="/login",g="/manage",S="/edit",E="/logout",w="Sorry, there was an error. Please try again.",A=r(682);function C(e){var t=e.children;return n.createElement(A.Z,{fluid:!0,className:"py-4"},t)}function k(e){var t=e.title,r=e.content,a=e.centre;return n.createElement(n.Fragment,null,n.createElement("h1",{className:"".concat(a?"text-center":"")},t),n.createElement("p",null,r))}var T=r(1555),x=r(5005),O=r(2151),R=n.createContext(),I=n.createContext(),j=n.createContext();function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);rt.modifiedOn?-1:0},te=r(3068),re=function(e){var t=e.item;return n.createElement(n.Fragment,null,t.done&&n.createElement(n.Fragment,null,n.createElement("input",{type:"checkbox",checked:!0,disabled:!0}),n.createElement("p",{className:"lead flex-fill ml-3 my-0"},n.createElement("del",null,t.description))))};function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&n.createElement(W.Z,{className:"justify-content-md-center mt-3 ".concat(a?"d-none":"")},n.createElement(T.Z,{lg:10},n.createElement("h4",null,r,n.createElement("a",{className:"float-right text-dark",href:"#",onClick:o},i.text,n.createElement("i",{className:"bi ".concat(i.class," mx-2")}))),n.createElement("hr",{className:"border-dark"}),i.show&&n.createElement("div",{className:"list-group"},t.map((function(e){return n.createElement(oe,{key:e.id,item:e})}))))))};function le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ce(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ce(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0)}),[l.state.items]),n.createElement("div",{className:"toasts-container","aria-live":"polite","aria-atomic":"true",style:{visibility:t?"visible":"hidden"}},n.createElement("div",{className:"toasts-position"},n.createElement(xe,{items:o})))}function Re(e){var t=e.children,r=he((0,n.useReducer)(Te,{items:[]}),2),a={state:r[0],dispatch:r[1]};return n.createElement(n.Fragment,null,n.createElement(ke.Provider,{value:a},t,n.createElement(Oe,null)))}function Ie(e){var t=n.useContext(ke);return(0,n.useEffect)((function(){setTimeout((function(){t.dispatch({type:Ae})}),5e3)}),[]),n.createElement(n.Fragment,null,n.createElement("div",{className:"toast",role:"alert","aria-live":"assertive","aria-atomic":"true",style:{opacity:1}},n.createElement("div",{className:"toast-header"},n.createElement("strong",{className:"mr-auto text-dark lead"},e.item.heading),n.createElement("a",{href:"#",onClick:function(r){return r.preventDefault()&t.dispatch({type:Ce,index:e.index})},className:"text-dark h3 mb-0"},n.createElement("i",{className:"bi bi-x"}))),n.createElement("div",{className:"toast-body"},e.item.body)))}var je=r(8025),Pe=r(3489);function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?t[0]:We}}],null&&Ue(t.prototype,null),r&&Ue(t,r),e}();function Fe(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return 200===e&&4===t}},{key:"isFail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return 200!==e&&4===t}},{key:"request",value:function(e){var t=this,r=e.type,n=e.request,a=e.payload,o=e.headers;return new Promise((function(e,i){var l=new XMLHttpRequest;if(l.onreadystatechange=function(r){var n=r.currentTarget;if(t.isDone(n.status,n.readyState)){var a;try{a=JSON.parse(n.response)}catch(e){a={}}e({success:!0,data:a})}else t.isFail(n.status,n.readyState)&&i({success:!1,data:n})},l.open(r,n),o.length>0)for(var c=0;ce.length)&&(t=e.length);for(var r=0,n=new Array(t);r0},verify:function(e,t){var r=JSON.stringify({token:s}),n=new XMLHttpRequest;n.onreadystatechange=function(r){var n=r.currentTarget;Me.isDone(n.status,n.readyState)?JSON.parse(n.response).result.success?"function"==typeof e&&e():"function"==typeof t&&t():Me.isFail(n.status,n.readyState)&&"function"==typeof t&&t()},n.open("POST",c),n.setRequestHeader("Content-type","application/json"),n.send(r)},onChange:function(e){return m(e)}};return n.createElement(qe.Provider,{value:p},a)}function Ge(e){return function(e){if(Array.isArray(e))return Ve(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Je(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ze(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){l=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}}(e,t)||Je(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Je(e,t){if(e){if("string"==typeof e)return Ve(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ve(e,t):void 0}}function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:w,n=Ge(p);-1===n.indexOf(t)&&n.push(t),f(n),m(!0),r.recaptureIsActive&&(r.setRecaptchaToken(null),r.recaptchaRef.current.reset()),e.setShow(!1)},j=function(){m(!1),f([])},P=function(){var r=new fe.AM(u),n=[new fe.KC({Name:"name",Value:C})];r.signUp(y,S,n,null,(function(r,n){null!=r?I(r.message):(l(!1),j(),e.setShow(!1),t.dispatch({type:we,item:{heading:"Registration Successful!",body:"".concat(C,", you can now login using your credentials.")}}),R.push(v))}))};return n.createElement(W.Z,null,n.createElement(T.Z,{lg:4},n.createElement(O.Z,{noValidate:!0,validated:o,onSubmit:function(t){t.preventDefault(),!t.currentTarget.checkValidity()||r.recaptureIsActive&&!r.isRecaptchValid()?(l(!0),r.recaptureIsActive&&!r.isRecaptchValid()&&I("Please complete the challenge."),t.stopPropagation()):(e.setShow(!0),r.recaptureIsActive?r.verify(P,I):P())}},n.createElement(O.Z.Row,null,n.createElement(O.Z.Group,{as:T.Z},n.createElement(O.Z.Label,null,"Name ",n.createElement(Ze,{message:"Make this fictional and not personal"})),n.createElement(O.Z.Control,{name:"name",id:"name",type:"name",onChange:function(e){return k(e.target.value)},required:!0}),n.createElement(O.Z.Control.Feedback,{type:"invalid"},"Please enter a valid value"))),n.createElement(O.Z.Row,null,n.createElement(O.Z.Group,{as:T.Z},n.createElement(O.Z.Label,null,"Username ",n.createElement(Ze,{message:"This is case insensitive"})),n.createElement(O.Z.Control,{name:"username",id:"username",type:"text",onChange:function(e){return b(e.target.value)},required:!0}),n.createElement(O.Z.Control.Feedback,{type:"invalid"},"Please enter a valid value"))),n.createElement(O.Z.Row,null,n.createElement(O.Z.Group,{as:T.Z},n.createElement(O.Z.Label,null,"Password ",n.createElement(Ze,{message:"Alphanumeric and case sensitive. Use a special character!"})),n.createElement(O.Z.Control,{name:"password",id:"password",type:"password",onChange:function(e){return E(e.target.value)},required:!0}),n.createElement(O.Z.Control.Feedback,{type:"invalid"},"Please enter a valid value"))),r.recaptureIsActive&&n.createElement(O.Z.Row,null,n.createElement(O.Z.Group,{as:T.Z},n.createElement(O.Z.Label,null,"Are you a robot ? ",n.createElement(Ze,{message:"Please complete the challenge"})),n.createElement(De.Z,{ref:r.recaptchaRef,sitekey:r.recaptureSiteKey,onChange:r.onChange}))),n.createElement(O.Z.Row,null,n.createElement(O.Z.Group,{as:T.Z},n.createElement(x.Z,{className:"float-right",id:"submit",variant:"dark",type:"submit"},"Register"))),n.createElement(O.Z.Row,null,n.createElement(O.Z.Group,{as:T.Z},s&&n.createElement(n.Fragment,null,n.createElement("h5",{className:"text-danger"},"There were errors"),n.createElement("ul",{id:"errorFeedback",className:"text-danger"},p.map((function(e,t){return n.createElement("li",{key:t},n.createElement("small",null,e))})))))))))}function $e(){return n.createElement(C,null,n.createElement(k,{title:"Create a user",content:"You must create a user to log in and access the API"}),n.createElement(Be,null,n.createElement(_e,null)))}function Qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r{},2480:()=>{}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var o=r[e]={exports:{}};return t[e].call(o.exports,o,o.exports,n),o.exports}n.m=t,e=[],n.O=(t,r,a,o)=>{if(!r){var i=1/0;for(s=0;s=o)&&Object.keys(n.O).every((e=>n.O[e](r[c])))?r.splice(c--,1):(l=!1,o0&&e[s-1][2]>o;s--)e[s]=e[s-1];e[s]=[r,a,o]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={179:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var a,o,[i,l,c]=r,u=0;for(a in l)n.o(l,a)&&(n.m[a]=l[a]);if(c)var s=c(n);for(t&&t(r);un(178)));a=n.O(a)})(); \ No newline at end of file diff --git a/docs/app_awsNodeToDoApi/vendor.js b/docs/app_awsNodeToDoApi/vendor.js deleted file mode 100644 index 6d07f3d69..000000000 --- a/docs/app_awsNodeToDoApi/vendor.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.js.LICENSE.txt */ -(self.webpackChunkportfolio=self.webpackChunkportfolio||[]).push([[736],{6895:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7294);function i(e){var t=function(e){var t=(0,r.useRef)(e);return(0,r.useEffect)((function(){t.current=e}),[e]),t}(e);return(0,r.useCallback)((function(){return t.current&&t.current.apply(t,arguments)}),[t])}},5654:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),i=function(e){return e&&"function"!=typeof e?function(t){e.current=t}:e};const o=function(e,t){return(0,r.useMemo)((function(){return function(e,t){var n=i(e),r=i(t);return function(e){n&&n(e),r&&r(e)}}(e,t)}),[e,t])}},2043:(e,t,n)=>{"use strict";n.d(t,{sD:()=>i,ws:()=>q,KC:()=>Z,AM:()=>re});var r,i=function(){function e(e){var t=e||{},n=t.ValidationData,r=t.Username,i=t.Password,o=t.AuthParameters,a=t.ClientMetadata;this.validationData=n||{},this.authParameters=o||{},this.clientMetadata=a||{},this.username=r,this.password=i}var t=e.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},e}(),o=n(5905),a=n(8249),s=n.n(a),l=(n(4433),n(2153)),u=n.n(l),c=n(8010),f=n.n(c);if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(6249)}catch(e){}function d(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")}var p=function(){function e(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length}var t=e.prototype;return t.random=function(t){for(var n=[],r=0;r>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")}(this)},e}();const h=m;function m(e,t){null!=e&&this.fromString(e,t)}function v(){return new m(null)}var g,y="undefined"!=typeof navigator;y&&"Microsoft Internet Explorer"==navigator.appName?(m.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var l=32767&this[e],u=this[e++]>>15,c=s*l+u*a;i=((l=a*l+((32767&c)<<15)+n[r]+(1073741823&i))>>>30)+(c>>>15)+s*u+(i>>>30),n[r++]=1073741823&l}return i},g=30):y&&"Netscape"!=navigator.appName?(m.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},g=26):(m.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var l=16383&this[e],u=this[e++]>>14,c=s*l+u*a;i=((l=a*l+((16383&c)<<14)+n[r]+i)>>28)+(c>>14)+s*u,n[r++]=268435455&l}return i},g=28),m.prototype.DB=g,m.prototype.DM=(1<>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function k(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(t,t),t},k.prototype.revert=function(e){var t=v();return e.copyTo(t),this.reduce(t),t},k.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},m.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},m.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},m.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var a=S(e,r);a<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<>this.DB-o):this[this.t-1]|=a<=this.DB&&(o-=this.DB))}this.clamp(),i&&m.ZERO.subTo(this,this)},m.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},m.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},m.prototype.drShiftTo=function(e,t){for(var n=e;n=0;--n)t[n+a+1]=this[n]>>i|s,s=(this[n]&o)<=0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},m.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<>r;for(var a=n+1;a>r;r>0&&(t[this.t-n-1]|=(this.s&o)<>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},m.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i=0;)e[n]=0;for(n=0;n=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},m.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t0?(r.lShiftTo(l,o),i.lShiftTo(l,n)):(r.copyTo(o),i.copyTo(n));var u=o.t,c=o[u-1];if(0!=c){var f=c*(1<1?o[u-2]>>this.F2:0),d=this.FV/f,p=(1<=0&&(n[n.t++]=1,n.subTo(b,n)),m.ONE.dlShiftTo(u,b),b.subTo(o,o);o.t=0;){var w=n[--g]==c?this.DM:Math.floor(n[g]*d+(n[g-1]+h)*p);if((n[g]+=o.am(0,w,n,y,0,u))0&&n.rShiftTo(l,n),a<0&&m.ZERO.subTo(n,n)}}},m.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},m.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},m.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var n,r=(1<0)for(s>s)>0&&(i=!0,o=x(n));a>=0;)s>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=x(n));return i?o:"0"},m.prototype.negate=function(){var e=v();return m.ZERO.subTo(this,e),e},m.prototype.abs=function(){return this.s<0?this.negate():this},m.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},m.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+T(this[this.t-1]^this.s&this.DM)},m.prototype.mod=function(e){var t=v();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(m.ZERO)>0&&e.subTo(t,t),t},m.prototype.equals=function(e){return 0==this.compareTo(e)},m.prototype.add=function(e){var t=v();return this.addTo(e,t),t},m.prototype.subtract=function(e){var t=v();return this.subTo(e,t),t},m.prototype.multiply=function(e){var t=v();return this.multiplyTo(e,t),t},m.prototype.divide=function(e){var t=v();return this.divRemTo(e,t,null),t},m.prototype.modPow=function(e,t,n){var r,i=e.bitLength(),o=C(1),a=new k(t);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6;var s=new Array,l=3,u=r-1,c=(1<1){var f=v();for(a.sqrTo(s[1],f);l<=c;)s[l]=v(),a.mulTo(f,s[l-2],s[l]),l+=2}var d,p,h=e.t-1,m=!0,g=v();for(i=T(e[h])-1;h>=0;){for(i>=u?d=e[h]>>i-u&c:(d=(e[h]&(1<0&&(d|=e[h-1]>>this.DB+i-u)),l=r;0==(1&d);)d>>=1,--l;if((i-=l)<0&&(i+=this.DB,--h),m)s[d].copyTo(o),m=!1;else{for(;l>1;)a.sqrTo(o,g),a.sqrTo(g,o),l-=2;l>0?a.sqrTo(o,g):(p=o,o=g,g=p),a.mulTo(g,s[d],o)}for(;h>=0&&0==(e[h]&1<{"use strict";var r=n(9742),i=n(645),o=n(3950);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return j(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return _(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-l),o=n;o>=0;o--){for(var f=!0,d=0;di&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+f<=n)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);for(var n="",r=0;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,r,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function A(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ii)&&(n=i);for(var o="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function I(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function F(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return o||F(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return o||F(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUInt8=function(e,t){return t||U(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||U(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||U(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||U(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||U(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||U(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||U(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||U(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||U(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||U(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||U(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}},3950:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=l(e),a=o[0],s=o[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),c=0,f=s>0?a-4:a;for(n=0;n>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[c++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,l=r-i;sl?l:s+a));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},4184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},h=s.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,c=e.min(4*l,o);if(l){for(var f=0;f>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var l=r.charAt(64);if(l)for(;i.length%4;)i.push(l);return i.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},8010:function(e,t,n){var r;e.exports=(r=n(8249),n(2153),n(9824),r.HmacSHA256)},9824:function(e,t,n){var r,i,o;e.exports=(i=(r=n(8249)).lib.Base,o=r.enc.Utf8,void(r.algo.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,l=a.words,u=0;u>>2]|=e[i]<<24-i%4*8;t.call(this,r,n)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)},2153:function(e,t,n){var r;e.exports=(r=n(8249),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],l=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(s[i]=n(e.pow(r,.5))),l[i]=n(e.pow(r,1/3)),i++),r++}();var u=[],c=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],f=n[6],d=n[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,v=u[p-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[p]=m+u[p-7]+g+u[p-16]}var y=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&f)+l[p]+u[p];d=f,f=c,c=s,s=a+w|0,a=o,o=i,i=r,r=w+(b+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+c|0,n[6]=n[6]+f|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(c),t.HmacSHA256=o._createHmacHelper(c)}(Math),r.SHA256)},3164:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7216);var i=/([A-Z])/g,o=/^ms-/;function a(e){return function(e){return e.replace(i,"-$1").toLowerCase()}(e).replace(o,"-ms-")}var s=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;const l=function(e,t){var n="",i="";if("string"==typeof t)return e.style.getPropertyValue(a(t))||function(e,t){return function(e){var t=(0,r.Z)(e);return t&&t.defaultView||window}(e).getComputedStyle(e,t)}(e).getPropertyValue(a(t));Object.keys(t).forEach((function(r){var o=t[r];o||0===o?function(e){return!(!e||!s.test(e))}(r)?i+=r+"("+o+") ":n+=a(r)+": "+o+";":e.style.removeProperty(a(r))})),i&&(n+="transform: "+i+";"),e.style.cssText+=";"+n}},4302:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});const r=!("undefined"==typeof window||!window.document||!window.document.createElement);var i=!1,o=!1;try{var a={get passive(){return i=!0},get once(){return o=i=!0}};r&&(window.addEventListener("test",a,a),window.removeEventListener("test",a,!0))}catch(e){}const s=function(e,t,n,r){return function(e,t,n,r){if(r&&"boolean"!=typeof r&&!o){var a=r.once,s=r.capture,l=n;!o&&a&&(l=n.__once||function e(r){this.removeEventListener(t,e,s),n.call(this,r)},n.__once=l),e.addEventListener(t,l,i?r:s)}e.addEventListener(t,n,r)}(e,t,n,r),function(){!function(e,t,n,r){var i=r&&"boolean"!=typeof r?r.capture:r;e.removeEventListener(t,n,i),n.__once&&e.removeEventListener(t,n.__once,i)}(e,t,n,r)}}},7216:(e,t,n)=>{"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:()=>r})},71:(e,t,n)=>{"use strict";n.d(t,{lX:()=>x,q_:()=>A,ob:()=>h,PP:()=>R,Ep:()=>p,Hp:()=>m});var r=n(7462);function i(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,i=e.length;r=0;d--){var p=a[d];"."===p?o(a,d):".."===p?(o(a,d),f++):f&&(o(a,d),f--)}if(!u)for(;f--;f)a.unshift("..");!u||""===a[0]||a[0]&&i(a[0])||a.unshift("");var h=a.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h}(s.pathname,a.pathname)):s.pathname=a.pathname:s.pathname||(s.pathname="/"),s}function m(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&s(e.state,t.state)}function v(){var e=null,t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,i):n.push(i),f({action:r,location:i,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",i=h(e,t,d(),w.location);c.confirmTransitionTo(i,r,n,(function(e){e&&(w.entries[w.index]=i,f({action:r,location:i}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(9864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var i=p(n);i&&i!==h&&e(t,i,r)}var a=c(n);f&&(a=a.concat(f(n)));for(var s=l(t),m=l(n),v=0;v{t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<>1,c=-7,f=n?i-1:0,d=n?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=u}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,u=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*l-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=h,a/=256,u-=8);e[n+p-h]|=128*m}},1143:e=>{"use strict";e.exports=function(e,t,n,r,i,o,a,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,a,s],c=0;(l=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},204:(e,t,n)=>{e.exports=self.fetch||(self.fetch=n(5869).default||n(5869))},6808:(e,t,n)=>{var r,i,o;void 0===(i="function"==typeof(r=o=function(){function e(){for(var e=0,t={};e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,n,r,i,o){var a=r||"<>",s=o||n;if(null==t[n])return new Error("The "+i+" `"+s+"` is required to make `"+a+"` accessible for users of assistive technologies such as screen readers.");for(var l=arguments.length,u=Array(l>5?l-5:0),c=5;c{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,i,o,a){var s=i||"<>",l=a||r;if(null==n[r])return t?new Error("Required "+o+" `"+l+"` was not specified in `"+s+"`."):null;for(var u=arguments.length,c=Array(u>6?u-6:0),f=6;f{"use strict";var r=n(414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8818:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(1368),i=n(8321),o=Function.prototype.bind.call(Function.prototype.call,[].slice),a=n(7294),s=n(5654),l=n(590),u=n(5017);const c=a.createContext(null);var f=["as","onSelect","activeKey","role","onKeyDown"],d=function(){};const p=a.forwardRef((function(e,t){var n,p,h=e.as,m=void 0===h?"ul":h,v=e.onSelect,g=e.activeKey,y=e.role,b=e.onKeyDown,w=(0,i.Z)(e,f),E=(0,a.useReducer)((function(e){return!e}),!1)[1],x=(0,a.useRef)(!1),S=(0,a.useContext)(u.Z),C=(0,a.useContext)(c);C&&(y=y||"tablist",g=C.activeKey,n=C.getControlledId,p=C.getControllerId);var T=(0,a.useRef)(null),k=function(e){var t=T.current;if(!t)return null;var n=("[data-rb-event-key]:not(.disabled)",o(t.querySelectorAll("[data-rb-event-key]:not(.disabled)"))),r=t.querySelector(".active");if(!r)return null;var i=n.indexOf(r);if(-1===i)return null;var a=i+e;return a>=n.length&&(a=0),a<0&&(a=n.length-1),n[a]},P=function(e,t){null!=e&&(v&&v(e,t),S&&S(e,t))};(0,a.useEffect)((function(){if(T.current&&x.current){var e=T.current.querySelector("[data-rb-event-key].active");e&&e.focus()}x.current=!1}));var A=(0,s.Z)(t,T);return a.createElement(u.Z.Provider,{value:P},a.createElement(l.Z.Provider,{value:{role:y,activeKey:(0,u.h)(g),getControlledId:n||d,getControllerId:p||d}},a.createElement(m,(0,r.Z)({},w,{onKeyDown:function(e){var t;switch(b&&b(e),e.key){case"ArrowLeft":case"ArrowUp":t=k(-1);break;case"ArrowRight":case"ArrowDown":t=k(1);break;default:return}t&&(e.preventDefault(),P(t.dataset.rbEventKey,e),x.current=!0,E())},ref:A,role:y}))))}))},8934:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=n(7294),l=n(6895),u=(n(2473),n(590)),c=n(5017),f=["active","className","eventKey","onSelect","onClick","as"],d=s.forwardRef((function(e,t){var n=e.active,o=e.className,d=e.eventKey,p=e.onSelect,h=e.onClick,m=e.as,v=(0,i.Z)(e,f),g=(0,c.h)(d,v.href),y=(0,s.useContext)(c.Z),b=(0,s.useContext)(u.Z),w=n;if(b){v.role||"tablist"!==b.role||(v.role="tab");var E=b.getControllerId(g),x=b.getControlledId(g);v["data-rb-event-key"]=g,v.id=E||v.id,v["aria-controls"]=x||v["aria-controls"],w=null==n&&null!=g?b.activeKey===g:n}"tab"===v.role&&(v.disabled&&(v.tabIndex=-1,v["aria-disabled"]=!0),v["aria-selected"]=w);var S=(0,l.Z)((function(e){h&&h(e),null!=g&&(p&&p(g,e),y&&y(g,e))}));return s.createElement(m,(0,r.Z)({},v,{ref:t,onClick:S,className:a()(o,w&&"active")}))}));d.defaultProps={disabled:!1};const p=d},5005:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=n(7294),l=n(6792),u=n(8358),c=["bsPrefix","variant","size","active","className","block","type","as"],f=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.variant,f=e.size,d=e.active,p=e.className,h=e.block,m=e.type,v=e.as,g=(0,i.Z)(e,c),y=(0,l.vE)(n,"btn"),b=a()(p,y,d&&"active",o&&y+"-"+o,h&&y+"-block",f&&y+"-"+f);if(g.href)return s.createElement(u.Z,(0,r.Z)({},g,{as:v,ref:t,className:a()(b,g.disabled&&"disabled")}));t&&(g.ref=t),m?g.type=m:v||(g.type="button");var w=v||"button";return s.createElement(w,(0,r.Z)({},g,{className:b}))}));f.displayName="Button",f.defaultProps={variant:"primary",active:!1,disabled:!1};const d=f},1555:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=n(7294),l=n(6792),u=["bsPrefix","className","as"],c=["xl","lg","md","sm","xs"],f=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,f=e.as,d=void 0===f?"div":f,p=(0,i.Z)(e,u),h=(0,l.vE)(n,"col"),m=[],v=[];return c.forEach((function(e){var t,n,r,i=p[e];if(delete p[e],"object"==typeof i&&null!=i){var o=i.span;t=void 0===o||o,n=i.offset,r=i.order}else t=i;var a="xs"!==e?"-"+e:"";t&&m.push(!0===t?""+h+a:""+h+a+"-"+t),null!=r&&v.push("order"+a+"-"+r),null!=n&&v.push("offset"+a+"-"+n)})),m.length||m.push(h),s.createElement(d,(0,r.Z)({},p,{ref:t,className:a().apply(void 0,[o].concat(m,v))}))}));f.displayName="Col";const d=f},682:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=n(7294),l=n(6792),u=["bsPrefix","fluid","as","className"],c=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.fluid,c=e.as,f=void 0===c?"div":c,d=e.className,p=(0,i.Z)(e,u),h=(0,l.vE)(n,"container"),m="string"==typeof o?"-"+o:"-fluid";return s.createElement(f,(0,r.Z)({ref:t},p,{className:a()(d,o?""+h+m:h)}))}));c.displayName="Container",c.defaultProps={fluid:!1};const f=c},2151:(e,t,n)=>{"use strict";n.d(t,{Z:()=>X});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=n(7294),l=(n(4391),n(5697)),u=n.n(l),c=["as","className","type","tooltip"],f={type:u().string,tooltip:u().bool,as:u().elementType},d=s.forwardRef((function(e,t){var n=e.as,o=void 0===n?"div":n,l=e.className,u=e.type,f=void 0===u?"valid":u,d=e.tooltip,p=void 0!==d&&d,h=(0,i.Z)(e,c);return s.createElement(o,(0,r.Z)({},h,{ref:t,className:a()(l,f+"-"+(p?"tooltip":"feedback"))}))}));d.displayName="Feedback",d.propTypes=f;const p=d,h=s.createContext({controlId:void 0});var m=n(6792),v=["id","bsPrefix","bsCustomPrefix","className","type","isValid","isInvalid","isStatic","as"],g=s.forwardRef((function(e,t){var n=e.id,o=e.bsPrefix,l=e.bsCustomPrefix,u=e.className,c=e.type,f=void 0===c?"checkbox":c,d=e.isValid,p=void 0!==d&&d,g=e.isInvalid,y=void 0!==g&&g,b=e.isStatic,w=e.as,E=void 0===w?"input":w,x=(0,i.Z)(e,v),S=(0,s.useContext)(h),C=S.controlId,T=S.custom?[l,"custom-control-input"]:[o,"form-check-input"],k=T[0],P=T[1];return o=(0,m.vE)(k,P),s.createElement(E,(0,r.Z)({},x,{ref:t,type:f,id:n||C,className:a()(u,o,p&&"is-valid",y&&"is-invalid",b&&"position-static")}))}));g.displayName="FormCheckInput";const y=g;var b=["bsPrefix","bsCustomPrefix","className","htmlFor"],w=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.bsCustomPrefix,l=e.className,u=e.htmlFor,c=(0,i.Z)(e,b),f=(0,s.useContext)(h),d=f.controlId,p=f.custom?[o,"custom-control-label"]:[n,"form-check-label"],v=p[0],g=p[1];return n=(0,m.vE)(v,g),s.createElement("label",(0,r.Z)({},c,{ref:t,htmlFor:u||d,className:a()(l,n)}))}));w.displayName="FormCheckLabel";const E=w;var x=["id","bsPrefix","bsCustomPrefix","inline","disabled","isValid","isInvalid","feedbackTooltip","feedback","className","style","title","type","label","children","custom","as"],S=s.forwardRef((function(e,t){var n=e.id,o=e.bsPrefix,l=e.bsCustomPrefix,u=e.inline,c=void 0!==u&&u,f=e.disabled,d=void 0!==f&&f,v=e.isValid,g=void 0!==v&&v,b=e.isInvalid,w=void 0!==b&&b,S=e.feedbackTooltip,C=void 0!==S&&S,T=e.feedback,k=e.className,P=e.style,A=e.title,_=void 0===A?"":A,R=e.type,D=void 0===R?"checkbox":R,U=e.label,O=e.children,I=e.custom,N=e.as,F=void 0===N?"input":N,M=(0,i.Z)(e,x),L="switch"===D||I,B=L?[l,"custom-control"]:[o,"form-check"],j=B[0],z=B[1];o=(0,m.vE)(j,z);var Z=(0,s.useContext)(h).controlId,V=(0,s.useMemo)((function(){return{controlId:n||Z,custom:L}}),[Z,L,n]),K=L||null!=U&&!1!==U&&!O,W=s.createElement(y,(0,r.Z)({},M,{type:"switch"===D?"checkbox":D,ref:t,isValid:g,isInvalid:w,isStatic:!K,disabled:d,as:F}));return s.createElement(h.Provider,{value:V},s.createElement("div",{style:P,className:a()(k,o,L&&"custom-"+D,c&&o+"-inline")},O||s.createElement(s.Fragment,null,W,K&&s.createElement(E,{title:_},U),(g||w)&&s.createElement(p,{type:g?"valid":"invalid",tooltip:C},T))))}));S.displayName="FormCheck",S.Input=y,S.Label=E;const C=S;var T=["id","bsPrefix","bsCustomPrefix","className","isValid","isInvalid","lang","as"],k=s.forwardRef((function(e,t){var n=e.id,o=e.bsPrefix,l=e.bsCustomPrefix,u=e.className,c=e.isValid,f=e.isInvalid,d=e.lang,p=e.as,v=void 0===p?"input":p,g=(0,i.Z)(e,T),y=(0,s.useContext)(h),b=y.controlId,w=y.custom?[l,"custom-file-input"]:[o,"form-control-file"],E=w[0],x=w[1];return o=(0,m.vE)(E,x),s.createElement(v,(0,r.Z)({},g,{ref:t,id:n||b,type:"file",lang:d,className:a()(u,o,c&&"is-valid",f&&"is-invalid")}))}));k.displayName="FormFileInput";const P=k;var A=["bsPrefix","bsCustomPrefix","className","htmlFor"],_=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.bsCustomPrefix,l=e.className,u=e.htmlFor,c=(0,i.Z)(e,A),f=(0,s.useContext)(h),d=f.controlId,p=f.custom?[o,"custom-file-label"]:[n,"form-file-label"],v=p[0],g=p[1];return n=(0,m.vE)(v,g),s.createElement("label",(0,r.Z)({},c,{ref:t,htmlFor:u||d,className:a()(l,n),"data-browse":c["data-browse"]}))}));_.displayName="FormFileLabel";const R=_;var D=["id","bsPrefix","bsCustomPrefix","disabled","isValid","isInvalid","feedbackTooltip","feedback","className","style","label","children","custom","lang","data-browse","as","inputAs"],U=s.forwardRef((function(e,t){var n=e.id,o=e.bsPrefix,l=e.bsCustomPrefix,u=e.disabled,c=void 0!==u&&u,f=e.isValid,d=void 0!==f&&f,v=e.isInvalid,g=void 0!==v&&v,y=e.feedbackTooltip,b=void 0!==y&&y,w=e.feedback,E=e.className,x=e.style,S=e.label,C=e.children,T=e.custom,k=e.lang,A=e["data-browse"],_=e.as,U=void 0===_?"div":_,O=e.inputAs,I=void 0===O?"input":O,N=(0,i.Z)(e,D),F=T?[l,"custom"]:[o,"form-file"],M=F[0],L=F[1];o=(0,m.vE)(M,L);var B=(0,s.useContext)(h).controlId,j=(0,s.useMemo)((function(){return{controlId:n||B,custom:T}}),[B,T,n]),z=null!=S&&!1!==S&&!C,Z=s.createElement(P,(0,r.Z)({},N,{ref:t,isValid:d,isInvalid:g,disabled:c,as:I,lang:k}));return s.createElement(h.Provider,{value:j},s.createElement(U,{style:x,className:a()(E,o,T&&"custom-file")},C||s.createElement(s.Fragment,null,T?s.createElement(s.Fragment,null,Z,z&&s.createElement(R,{"data-browse":A},S)):s.createElement(s.Fragment,null,z&&s.createElement(R,null,S),Z),(d||g)&&s.createElement(p,{type:d?"valid":"invalid",tooltip:b},w))))}));U.displayName="FormFile",U.Input=P,U.Label=R;const O=U;n(2473);var I=["bsPrefix","bsCustomPrefix","type","size","htmlSize","id","className","isValid","isInvalid","plaintext","readOnly","custom","as"],N=s.forwardRef((function(e,t){var n,o,l=e.bsPrefix,u=e.bsCustomPrefix,c=e.type,f=e.size,d=e.htmlSize,p=e.id,v=e.className,g=e.isValid,y=void 0!==g&&g,b=e.isInvalid,w=void 0!==b&&b,E=e.plaintext,x=e.readOnly,S=e.custom,C=e.as,T=void 0===C?"input":C,k=(0,i.Z)(e,I),P=(0,s.useContext)(h).controlId,A=S?[u,"custom"]:[l,"form-control"],_=A[0],R=A[1];if(l=(0,m.vE)(_,R),E)(o={})[l+"-plaintext"]=!0,n=o;else if("file"===c){var D;(D={})[l+"-file"]=!0,n=D}else if("range"===c){var U;(U={})[l+"-range"]=!0,n=U}else if("select"===T&&S){var O;(O={})[l+"-select"]=!0,O[l+"-select-"+f]=f,n=O}else{var N;(N={})[l]=!0,N[l+"-"+f]=f,n=N}return s.createElement(T,(0,r.Z)({},k,{type:c,size:d,ref:t,readOnly:x,id:p||P,className:a()(v,n,y&&"is-valid",w&&"is-invalid")}))}));N.displayName="FormControl";const F=Object.assign(N,{Feedback:p});var M=["bsPrefix","className","children","controlId","as"],L=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.children,u=e.controlId,c=e.as,f=void 0===c?"div":c,d=(0,i.Z)(e,M);n=(0,m.vE)(n,"form-group");var p=(0,s.useMemo)((function(){return{controlId:u}}),[u]);return s.createElement(h.Provider,{value:p},s.createElement(f,(0,r.Z)({},d,{ref:t,className:a()(o,n)}),l))}));L.displayName="FormGroup";const B=L;var j=n(1555),z=["as","bsPrefix","column","srOnly","className","htmlFor"],Z=s.forwardRef((function(e,t){var n=e.as,o=void 0===n?"label":n,l=e.bsPrefix,u=e.column,c=e.srOnly,f=e.className,d=e.htmlFor,p=(0,i.Z)(e,z),v=(0,s.useContext)(h).controlId;l=(0,m.vE)(l,"form-label");var g="col-form-label";"string"==typeof u&&(g=g+" "+g+"-"+u);var y=a()(f,l,c&&"sr-only",u&&g);return d=d||v,u?s.createElement(j.Z,(0,r.Z)({ref:t,as:"label",className:y,htmlFor:d},p)):s.createElement(o,(0,r.Z)({ref:t,className:y,htmlFor:d},p))}));Z.displayName="FormLabel",Z.defaultProps={column:!1,srOnly:!1};const V=Z;var K=["bsPrefix","className","as","muted"],W=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.as,u=void 0===l?"small":l,c=e.muted,f=(0,i.Z)(e,K);return n=(0,m.vE)(n,"form-text"),s.createElement(u,(0,r.Z)({},f,{ref:t,className:a()(o,n,c&&"text-muted")}))}));W.displayName="FormText";const H=W;var q=s.forwardRef((function(e,t){return s.createElement(C,(0,r.Z)({},e,{ref:t,type:"switch"}))}));q.displayName="Switch",q.Input=C.Input,q.Label=C.Label;const $=q;var Y=n(4680),Q=["bsPrefix","inline","className","validated","as"],G=(0,Y.Z)("form-row"),J=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.inline,l=e.className,u=e.validated,c=e.as,f=void 0===c?"form":c,d=(0,i.Z)(e,Q);return n=(0,m.vE)(n,"form"),s.createElement(f,(0,r.Z)({},d,{ref:t,className:a()(l,u&&"was-validated",o&&n+"-inline")}))}));J.displayName="Form",J.defaultProps={inline:!1},J.Row=G,J.Group=B,J.Control=F,J.Check=C,J.File=O,J.Switch=$,J.Label=V,J.Text=H;const X=J},2318:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(8321),i=n(1368),o=n(4184),a=n.n(o),s=n(7294),l=n(4680),u=n(6792),c=["bsPrefix","size","hasValidation","className","as"],f=(0,l.Z)("input-group-append"),d=(0,l.Z)("input-group-prepend"),p=(0,l.Z)("input-group-text",{Component:"span"}),h=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.size,l=e.hasValidation,f=e.className,d=e.as,p=void 0===d?"div":d,h=(0,r.Z)(e,c);return n=(0,u.vE)(n,"input-group"),s.createElement(p,(0,i.Z)({ref:t},h,{className:a()(f,n,o&&n+"-"+o,l&&"has-validation")}))}));h.displayName="InputGroup";const m=(0,i.Z)({},h,{Text:p,Radio:function(e){return s.createElement(p,null,s.createElement("input",(0,i.Z)({type:"radio"},e)))},Checkbox:function(e){return s.createElement(p,null,s.createElement("input",(0,i.Z)({type:"checkbox"},e)))},Append:f,Prepend:d})},3068:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=n(7294),l=(n(2473),n(4289)),u=n(6792),c=n(8818),f=n(8934),d=["bsPrefix","active","disabled","className","variant","action","as","onClick"],p=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.active,l=e.disabled,c=e.className,p=e.variant,h=e.action,m=e.as,v=e.onClick,g=(0,i.Z)(e,d);n=(0,u.vE)(n,"list-group-item");var y=(0,s.useCallback)((function(e){if(l)return e.preventDefault(),void e.stopPropagation();v&&v(e)}),[l,v]);return l&&void 0===g.tabIndex&&(g.tabIndex=-1,g["aria-disabled"]=!0),s.createElement(f.Z,(0,r.Z)({ref:t},g,{as:m||(h?g.href?"a":"button":"div"),onClick:y,className:a()(c,n,o&&"active",l&&"disabled",p&&n+"-"+p,h&&n+"-action")}))}));p.defaultProps={variant:void 0,active:!1,disabled:!1},p.displayName="ListGroupItem";const h=p;var m=["className","bsPrefix","variant","horizontal","as"],v=s.forwardRef((function(e,t){var n,o=(0,l.Ch)(e,{activeKey:"onSelect"}),f=o.className,d=o.bsPrefix,p=o.variant,h=o.horizontal,v=o.as,g=void 0===v?"div":v,y=(0,i.Z)(o,m),b=(0,u.vE)(d,"list-group");return n=h?!0===h?"horizontal":"horizontal-"+h:null,s.createElement(c.Z,(0,r.Z)({ref:t},y,{as:g,className:a()(f,b,p&&b+"-"+p,n&&b+"-"+n)}))}));v.defaultProps={variant:void 0,horizontal:void 0},v.displayName="ListGroup",v.Item=h;const g=v},8791:(e,t,n)=>{"use strict";n.d(t,{Z:()=>T});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=(n(4391),n(7294)),l=n(4289),u=n(6792),c=n(4819),f=s.createContext(null);f.displayName="CardContext";const d=f;var p=n(8818),h=["bsPrefix","className","children","as"],m=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.children,c=e.as,f=void 0===c?"div":c,d=(0,i.Z)(e,h);return n=(0,u.vE)(n,"nav-item"),s.createElement(f,(0,r.Z)({},d,{ref:t,className:a()(o,n)}),l)}));m.displayName="NavItem";const v=m;var g=n(8358),y=n(8934),b=["bsPrefix","disabled","className","href","eventKey","onSelect","as"],w={disabled:!1,as:g.Z},E=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.disabled,l=e.className,c=e.href,f=e.eventKey,d=e.onSelect,p=e.as,h=(0,i.Z)(e,b);return n=(0,u.vE)(n,"nav-link"),s.createElement(y.Z,(0,r.Z)({},h,{href:c,ref:t,eventKey:f,as:p,disabled:o,onSelect:d,className:a()(l,n,o&&"disabled")}))}));E.displayName="NavLink",E.defaultProps=w;const x=E;var S=["as","bsPrefix","variant","fill","justify","navbar","navbarScroll","className","children","activeKey"],C=s.forwardRef((function(e,t){var n,o,f,h=(0,l.Ch)(e,{activeKey:"onSelect"}),m=h.as,v=void 0===m?"div":m,g=h.bsPrefix,y=h.variant,b=h.fill,w=h.justify,E=h.navbar,x=h.navbarScroll,C=h.className,T=h.children,k=h.activeKey,P=(0,i.Z)(h,S),A=(0,u.vE)(g,"nav"),_=!1,R=(0,s.useContext)(c.Z),D=(0,s.useContext)(d);return R?(o=R.bsPrefix,_=null==E||E):D&&(f=D.cardHeaderBsPrefix),s.createElement(p.Z,(0,r.Z)({as:v,ref:t,activeKey:k,className:a()(C,(n={},n[A]=!_,n[o+"-nav"]=_,n[o+"-nav-scroll"]=_&&x,n[f+"-"+y]=!!f,n[A+"-"+y]=!!y,n[A+"-fill"]=b,n[A+"-justified"]=w,n))},P),T)}));C.displayName="Nav",C.defaultProps={justify:!1,fill:!1},C.Item=v,C.Link=x;const T=C},590:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7294).createContext(null);r.displayName="NavContext";const i=r},103:(e,t,n)=>{"use strict";n.d(t,{Z:()=>B});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=n(7294),l=n(4289),u=n(4680),c=n(6792),f=["bsPrefix","className","as"],d=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.as,u=(0,i.Z)(e,f);n=(0,c.vE)(n,"navbar-brand");var d=l||(u.href?"a":"span");return s.createElement(d,(0,r.Z)({},u,{ref:t,className:a()(o,n)}))}));d.displayName="NavbarBrand";const p=d;var h,m=n(3164),v=n(660),g=n(492),y=n(6833),b=n(4509),w=["onEnter","onEntering","onEntered","onExit","onExiting","className","children","dimension","getDimensionValue"],E={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function x(e,t){var n=t["offset"+e[0].toUpperCase()+e.slice(1)],r=E[e];return n+parseInt((0,m.Z)(t,r[0]),10)+parseInt((0,m.Z)(t,r[1]),10)}var S=((h={})[v.Wj]="collapse",h[v.Ix]="collapsing",h[v.d0]="collapsing",h[v.cn]="collapse show",h),C={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,getDimensionValue:x},T=s.forwardRef((function(e,t){var n=e.onEnter,o=e.onEntering,l=e.onEntered,u=e.onExit,c=e.onExiting,f=e.className,d=e.children,p=e.dimension,h=void 0===p?"height":p,m=e.getDimensionValue,E=void 0===m?x:m,C=(0,i.Z)(e,w),T="function"==typeof h?h():h,k=(0,s.useMemo)((function(){return(0,y.Z)((function(e){e.style[T]="0"}),n)}),[T,n]),P=(0,s.useMemo)((function(){return(0,y.Z)((function(e){var t="scroll"+T[0].toUpperCase()+T.slice(1);e.style[T]=e[t]+"px"}),o)}),[T,o]),A=(0,s.useMemo)((function(){return(0,y.Z)((function(e){e.style[T]=null}),l)}),[T,l]),_=(0,s.useMemo)((function(){return(0,y.Z)((function(e){e.style[T]=E(T,e)+"px",(0,b.Z)(e)}),u)}),[u,E,T]),R=(0,s.useMemo)((function(){return(0,y.Z)((function(e){e.style[T]=null}),c)}),[T,c]);return s.createElement(v.ZP,(0,r.Z)({ref:t,addEndListener:g.Z},C,{"aria-expanded":C.role?C.in:null,onEnter:k,onEntering:P,onEntered:A,onExit:_,onExiting:R}),(function(e,t){return s.cloneElement(d,(0,r.Z)({},t,{className:a()(f,d.props.className,S[e],"width"===T&&"width")}))}))}));T.defaultProps=C;const k=T;var P=n(4819),A=["children","bsPrefix"],_=s.forwardRef((function(e,t){var n=e.children,o=e.bsPrefix,a=(0,i.Z)(e,A);return o=(0,c.vE)(o,"navbar-collapse"),s.createElement(P.Z.Consumer,null,(function(e){return s.createElement(k,(0,r.Z)({in:!(!e||!e.expanded)},a),s.createElement("div",{ref:t,className:o},n))}))}));_.displayName="NavbarCollapse";const R=_;var D=n(6895),U=["bsPrefix","className","children","label","as","onClick"],O=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,l=e.children,u=e.label,f=e.as,d=void 0===f?"button":f,p=e.onClick,h=(0,i.Z)(e,U);n=(0,c.vE)(n,"navbar-toggler");var m=(0,s.useContext)(P.Z)||{},v=m.onToggle,g=m.expanded,y=(0,D.Z)((function(e){p&&p(e),v&&v()}));return"button"===d&&(h.type="button"),s.createElement(d,(0,r.Z)({},h,{ref:t,onClick:y,"aria-label":u,className:a()(o,n,!g&&"collapsed")}),l||s.createElement("span",{className:n+"-icon"}))}));O.displayName="NavbarToggle",O.defaultProps={label:"Toggle navigation"};const I=O;var N=n(5017),F=["bsPrefix","expand","variant","bg","fixed","sticky","className","children","as","expanded","onToggle","onSelect","collapseOnSelect"],M=(0,u.Z)("navbar-text",{Component:"span"}),L=s.forwardRef((function(e,t){var n=(0,l.Ch)(e,{expanded:"onToggle"}),o=n.bsPrefix,u=n.expand,f=n.variant,d=n.bg,p=n.fixed,h=n.sticky,m=n.className,v=n.children,g=n.as,y=void 0===g?"nav":g,b=n.expanded,w=n.onToggle,E=n.onSelect,x=n.collapseOnSelect,S=(0,i.Z)(n,F),C=(0,c.vE)(o,"navbar"),T=(0,s.useCallback)((function(){E&&E.apply(void 0,arguments),x&&b&&w&&w(!1)}),[E,x,b,w]);void 0===S.role&&"nav"!==y&&(S.role="navigation");var k=C+"-expand";"string"==typeof u&&(k=k+"-"+u);var A=(0,s.useMemo)((function(){return{onToggle:function(){return w&&w(!b)},bsPrefix:C,expanded:!!b}}),[C,b,w]);return s.createElement(P.Z.Provider,{value:A},s.createElement(N.Z.Provider,{value:T},s.createElement(y,(0,r.Z)({ref:t},S,{className:a()(m,C,u&&k,f&&C+"-"+f,d&&"bg-"+d,h&&"sticky-"+h,p&&"fixed-"+p)}),v)))}));L.defaultProps={expand:!0,variant:"light",collapseOnSelect:!1},L.displayName="Navbar",L.Brand=p,L.Toggle=I,L.Collapse=R,L.Text=M;const B=L},4819:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7294).createContext(null);r.displayName="NavbarContext";const i=r},8025:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Xe});var r=n(1368),i=n(8321),o=n(7294),a=n(4184),s=n.n(a);function l(){return(l=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}var c=n(5697),f=n.n(c),d=n(3935);function p(){return(0,o.useState)(null)}var h=n(5654),m="top",v="bottom",g="right",y="left",b="auto",w=[m,v,g,y],E="start",x="end",S="viewport",C="popper",T=w.reduce((function(e,t){return e.concat([t+"-"+E,t+"-"+x])}),[]),k=[].concat(w,[b]).reduce((function(e,t){return e.concat([t,t+"-"+E,t+"-"+x])}),[]),P=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function A(e){return e.split("-")[0]}function _(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function R(e){return e instanceof _(e).Element||e instanceof Element}function D(e){return e instanceof _(e).HTMLElement||e instanceof HTMLElement}function U(e){return"undefined"!=typeof ShadowRoot&&(e instanceof _(e).ShadowRoot||e instanceof ShadowRoot)}var O=Math.round;function I(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;return D(e)&&t&&(r=n.width/e.offsetWidth||1,i=n.height/e.offsetHeight||1),{width:O(n.width/r),height:O(n.height/i),top:O(n.top/i),right:O(n.right/r),bottom:O(n.bottom/i),left:O(n.left/r),x:O(n.left/r),y:O(n.top/i)}}function N(e){var t=I(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&U(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function M(e){return e?(e.nodeName||"").toLowerCase():null}function L(e){return _(e).getComputedStyle(e)}function B(e){return["table","td","th"].indexOf(M(e))>=0}function j(e){return((R(e)?e.ownerDocument:e.document)||window.document).documentElement}function z(e){return"html"===M(e)?e:e.assignedSlot||e.parentNode||(U(e)?e.host:null)||j(e)}function Z(e){return D(e)&&"fixed"!==L(e).position?e.offsetParent:null}function V(e){for(var t=_(e),n=Z(e);n&&B(n)&&"static"===L(n).position;)n=Z(n);return n&&("html"===M(n)||"body"===M(n)&&"static"===L(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&D(e)&&"fixed"===L(e).position)return null;for(var n=z(e);D(n)&&["html","body"].indexOf(M(n))<0;){var r=L(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function K(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}var W=Math.max,H=Math.min,q=Math.round;function $(e,t,n){return W(e,H(t,n))}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Q(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var G={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,c=!0===u?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:q(q(t*r)/r)||0,y:q(q(n*r)/r)||0}}(o):"function"==typeof u?u(o):o,f=c.x,d=void 0===f?0:f,p=c.y,h=void 0===p?0:p,b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),E=y,x=m,S=window;if(l){var C=V(n),T="clientHeight",k="clientWidth";C===_(n)&&"static"!==L(C=j(n)).position&&(T="scrollHeight",k="scrollWidth"),C=C,i===m&&(x=v,h-=C[T]-r.height,h*=s?1:-1),i===y&&(E=g,d-=C[k]-r.width,d*=s?1:-1)}var P,A=Object.assign({position:a},l&&G);return s?Object.assign({},A,((P={})[x]=w?"0":"",P[E]=b?"0":"",P.transform=(S.devicePixelRatio||1)<2?"translate("+d+"px, "+h+"px)":"translate3d("+d+"px, "+h+"px, 0)",P)):Object.assign({},A,((t={})[x]=w?h+"px":"",t[E]=b?d+"px":"",t.transform="",t))}var X={passive:!0},ee={left:"right",right:"left",bottom:"top",top:"bottom"};function te(e){return e.replace(/left|right|bottom|top/g,(function(e){return ee[e]}))}var ne={start:"end",end:"start"};function re(e){return e.replace(/start|end/g,(function(e){return ne[e]}))}function ie(e){var t=_(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function oe(e){return I(j(e)).left+ie(e).scrollLeft}function ae(e){var t=L(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function se(e){return["html","body","#document"].indexOf(M(e))>=0?e.ownerDocument.body:D(e)&&ae(e)?e:se(z(e))}function le(e,t){var n;void 0===t&&(t=[]);var r=se(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=_(r),a=i?[o].concat(o.visualViewport||[],ae(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(le(z(a)))}function ue(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ce(e,t){return t===S?ue(function(e){var t=_(e),n=j(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+oe(e),y:s}}(e)):D(t)?function(e){var t=I(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):ue(function(e){var t,n=j(e),r=ie(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=W(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=W(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+oe(e),l=-r.scrollTop;return"rtl"===L(i||n).direction&&(s+=W(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(j(e)))}function fe(e){return e.split("-")[1]}function de(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?A(i):null,a=i?fe(i):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case m:t={x:s,y:n.y-r.height};break;case v:t={x:s,y:n.y+n.height};break;case g:t={x:n.x+n.width,y:l};break;case y:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?K(o):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case E:t[u]=t[u]-(n[c]/2-r[c]/2);break;case x:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function pe(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,l=void 0===s?S:s,u=n.elementContext,c=void 0===u?C:u,f=n.altBoundary,d=void 0!==f&&f,p=n.padding,h=void 0===p?0:p,y=Y("number"!=typeof h?h:Q(h,w)),b=c===C?"reference":C,E=e.elements.reference,x=e.rects.popper,T=e.elements[d?b:c],k=function(e,t,n){var r="clippingParents"===t?function(e){var t=le(z(e)),n=["absolute","fixed"].indexOf(L(e).position)>=0&&D(e)?V(e):e;return R(n)?t.filter((function(e){return R(e)&&F(e,n)&&"body"!==M(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ce(e,n);return t.top=W(r.top,t.top),t.right=H(r.right,t.right),t.bottom=H(r.bottom,t.bottom),t.left=W(r.left,t.left),t}),ce(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}(R(T)?T:T.contextElement||j(e.elements.popper),a,l),P=I(E),A=de({reference:P,element:x,strategy:"absolute",placement:i}),_=ue(Object.assign({},x,A)),U=c===C?_:P,O={top:k.top-U.top+y.top,bottom:U.bottom-k.bottom+y.bottom,left:k.left-U.left+y.left,right:U.right-k.right+y.right},N=e.modifiersData.offset;if(c===C&&N){var B=N[i];Object.keys(O).forEach((function(e){var t=[g,v].indexOf(e)>=0?1:-1,n=[m,v].indexOf(e)>=0?"y":"x";O[e]+=B[n]*t}))}return O}function he(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function me(e){return[m,g,v,y].some((function(t){return e[t]>=0}))}function ve(e,t,n){void 0===n&&(n=!1);var r,i,o=D(t),a=D(t)&&function(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return 1!==n||1!==r}(t),s=j(t),l=I(e,a),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==M(t)||ae(s))&&(u=(r=t)!==_(r)&&D(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:ie(r)),D(t)?((c=I(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=oe(s))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function ge(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var ye={placement:"bottom",modifiers:[],strategy:"absolute"};function be(){for(var e=arguments.length,t=new Array(e),n=0;n=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[y,g].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=void 0===p||p,x=n.allowedAutoPlacements,S=t.options.placement,C=A(S),P=l||(C!==S&&h?function(e){if(A(e)===b)return[];var t=te(e);return[re(e),t,re(t)]}(S):[te(S)]),_=[S].concat(P).reduce((function(e,n){return e.concat(A(n)===b?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?k:l,c=fe(r),f=c?s?T:T.filter((function(e){return fe(e)===c})):w,d=f.filter((function(e){return u.indexOf(e)>=0}));0===d.length&&(d=f);var p=d.reduce((function(t,n){return t[n]=pe(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[A(n)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:c,rootBoundary:f,padding:u,flipVariations:h,allowedAutoPlacements:x}):n)}),[]),R=t.rects.reference,D=t.rects.popper,U=new Map,O=!0,I=_[0],N=0;N<_.length;N++){var F=_[N],M=A(F),L=fe(F)===E,B=[m,v].indexOf(M)>=0,j=B?"width":"height",z=pe(t,{placement:F,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),Z=B?L?g:y:L?v:m;R[j]>D[j]&&(Z=te(Z));var V=te(Z),K=[];if(o&&K.push(z[M]<=0),s&&K.push(z[Z]<=0,z[V]<=0),K.every((function(e){return e}))){I=F,O=!1;break}U.set(F,K)}if(O)for(var W=function(e){var t=_.find((function(t){var n=U.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return I=t,"break"},H=h?3:1;H>0&&"break"!==W(H);H--);t.placement!==I&&(t.modifiersData[r]._skip=!0,t.placement=I,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,p=void 0===d||d,h=n.tetherOffset,b=void 0===h?0:h,w=pe(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),x=A(t.placement),S=fe(t.placement),C=!S,T=K(x),k="x"===T?"y":"x",P=t.modifiersData.popperOffsets,_=t.rects.reference,R=t.rects.popper,D="function"==typeof b?b(Object.assign({},t.rects,{placement:t.placement})):b,U={x:0,y:0};if(P){if(o||s){var O="y"===T?m:y,I="y"===T?v:g,F="y"===T?"height":"width",M=P[T],L=P[T]+w[O],B=P[T]-w[I],j=p?-R[F]/2:0,z=S===E?_[F]:R[F],Z=S===E?-R[F]:-_[F],q=t.elements.arrow,Y=p&&q?N(q):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},G=Q[O],J=Q[I],X=$(0,_[F],Y[F]),ee=C?_[F]/2-j-X-G-D:z-X-G-D,te=C?-_[F]/2+j+X+J+D:Z+X+J+D,ne=t.elements.arrow&&V(t.elements.arrow),re=ne?"y"===T?ne.clientTop||0:ne.clientLeft||0:0,ie=t.modifiersData.offset?t.modifiersData.offset[t.placement][T]:0,oe=P[T]+ee-ie-re,ae=P[T]+te-ie;if(o){var se=$(p?H(L,oe):L,M,p?W(B,ae):B);P[T]=se,U[T]=se-M}if(s){var le="x"===T?m:y,ue="x"===T?v:g,ce=P[k],de=ce+w[le],he=ce-w[ue],me=$(p?H(de,oe):de,ce,p?W(he,ae):he);P[k]=me,U[k]=me-ce}}t.modifiersData[r]=U}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=A(n.placement),l=K(s),u=[y,g].indexOf(s)>=0?"height":"width";if(o&&a){var c=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Q(e,w))}(i.padding,n),f=N(o),d="y"===l?m:y,p="y"===l?v:g,h=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],b=a[l]-n.rects.reference[l],E=V(o),x=E?"y"===l?E.clientHeight||0:E.clientWidth||0:0,S=h/2-b/2,C=c[d],T=x-f[u]-c[p],k=x/2-f[u]/2+S,P=$(C,k,T),_=l;n.modifiersData[r]=((t={})[_]=P,t.centerOffset=P-k,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&F(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}]}),Ee=function(e){return{position:e,top:"0",left:"0",opacity:"0",pointerEvents:"none"}},xe={name:"applyStyles",enabled:!1},Se={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:function(e){var t=e.state;return function(){var e=t.elements,n=e.reference,r=e.popper;if("removeAttribute"in n){var i=(n.getAttribute("aria-describedby")||"").split(",").filter((function(e){return e.trim()!==r.id}));i.length?n.setAttribute("aria-describedby",i.join(",")):n.removeAttribute("aria-describedby")}}},fn:function(e){var t,n=e.state.elements,r=n.popper,i=n.reference,o=null==(t=r.getAttribute("role"))?void 0:t.toLowerCase();if(r.id&&"tooltip"===o&&"setAttribute"in i){var a=i.getAttribute("aria-describedby");if(a&&-1!==a.split(",").indexOf(r.id))return;i.setAttribute("aria-describedby",a?a+","+r.id:r.id)}}},Ce=[];const Te=function(e,t,n){var r,i,a=void 0===n?{}:n,s=a.enabled,c=void 0===s||s,f=a.placement,d=void 0===f?"bottom":f,p=a.strategy,h=void 0===p?"absolute":p,m=a.modifiers,v=void 0===m?Ce:m,g=u(a,["enabled","placement","strategy","modifiers"]),y=(0,o.useRef)(),b=(0,o.useCallback)((function(){var e;null==(e=y.current)||e.update()}),[]),w=(0,o.useCallback)((function(){var e;null==(e=y.current)||e.forceUpdate()}),[]),E=(r=(0,o.useState)({placement:d,update:b,forceUpdate:w,attributes:{},styles:{popper:Ee(h),arrow:{}}}),i=function(){var e=(0,o.useRef)(!0),t=(0,o.useRef)((function(){return e.current}));return(0,o.useEffect)((function(){return function(){e.current=!1}}),[]),t.current}(),[r[0],(0,o.useCallback)((function(e){if(i())return r[1](e)}),[i,r[1]])]),x=E[0],S=E[1],C=(0,o.useMemo)((function(){return{name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(e){var t=e.state,n={},r={};Object.keys(t.elements).forEach((function(e){n[e]=t.styles[e],r[e]=t.attributes[e]})),S({state:t,styles:n,attributes:r,update:b,forceUpdate:w,placement:t.placement})}}}),[b,w,S]);return(0,o.useEffect)((function(){y.current&&c&&y.current.setOptions({placement:d,strategy:h,modifiers:[].concat(v,[C,xe])})}),[h,d,C,c]),(0,o.useEffect)((function(){if(c&&null!=e&&null!=t)return y.current=we(e,t,l({},g,{placement:d,strategy:h,modifiers:[].concat(v,[Se,C])})),function(){null!=y.current&&(y.current.destroy(),y.current=void 0,S((function(e){return l({},e,{attributes:{},styles:{popper:Ee(h)}})})))}}),[c,e,t]),x};var ke=n(4302),Pe=n(6895),Ae=n(2473),_e=n.n(Ae),Re=n(7216);function De(e){return e&&"setState"in e?d.findDOMNode(e):null!=e?e:null}var Ue=function(){},Oe=function(e){return e&&("current"in e?e.current:e)};var Ie=function(e){var t;return"undefined"==typeof document?null:null==e?(0,Re.Z)().body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),null!=(t=e)&&t.nodeType&&e||null)};function Ne(e,t){var n=(0,o.useState)((function(){return Ie(e)})),r=n[0],i=n[1];if(!r){var a=Ie(e);a&&i(a)}return(0,o.useEffect)((function(){t&&r&&t(r)}),[t,r]),(0,o.useEffect)((function(){var t=Ie(e);t!==r&&i(t)}),[e,r]),r}var Fe=o.forwardRef((function(e,t){var n=e.flip,r=e.offset,i=e.placement,a=e.containerPadding,s=void 0===a?5:a,c=e.popperConfig,f=void 0===c?{}:c,m=e.transition,v=p(),g=v[0],y=v[1],b=p(),w=b[0],E=b[1],x=(0,h.Z)(y,t),S=Ne(e.container),C=Ne(e.target),T=(0,o.useState)(!e.show),k=T[0],P=T[1],A=Te(C,g,function(e){var t,n,r,i,o,a=e.enabled,s=e.enableEvents,u=e.placement,c=e.flip,f=e.offset,d=e.fixed,p=e.containerPadding,h=e.arrowElement,m=e.popperConfig,v=void 0===m?{}:m,g=function(e){var t={};return Array.isArray(e)?(null==e||e.forEach((function(e){t[e.name]=e})),t):e||t}(v.modifiers);return l({},v,{placement:u,enabled:a,strategy:d?"fixed":v.strategy,modifiers:(o=l({},g,{eventListeners:{enabled:s},preventOverflow:l({},g.preventOverflow,{options:p?l({padding:p},null==(t=g.preventOverflow)?void 0:t.options):null==(n=g.preventOverflow)?void 0:n.options}),offset:{options:l({offset:f},null==(r=g.offset)?void 0:r.options)},arrow:l({},g.arrow,{enabled:!!h,options:l({},null==(i=g.arrow)?void 0:i.options,{element:h})}),flip:l({enabled:!!c},g.flip)}),void 0===o&&(o={}),Array.isArray(o)?o:Object.keys(o).map((function(e){return o[e].name=e,o[e]})))})}({placement:i,enableEvents:!!e.show,containerPadding:s||5,flip:n,offset:r,arrowElement:w,popperConfig:f})),_=A.styles,R=A.attributes,D=u(A,["styles","attributes"]);e.show?k&&P(!1):e.transition||k||P(!0);var U,O,I,N,F,M,L,B,j,z,Z,V,K=e.show||m&&!k;if(U=g,O=e.onHide,I={disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent},F=(N=void 0===I?{}:I).disabled,M=N.clickTrigger,L=void 0===M?"click":M,B=(0,o.useRef)(!1),j=O||Ue,z=(0,o.useCallback)((function(e){var t,n,r,i=Oe(U);_e()(!!i,"RootClose captured a close event but does not have a ref to compare it to. useRootClose(), should be passed a ref that resolves to a DOM node"),B.current=!(i&&(r=e,!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey))&&function(e){return 0===e.button}(e)&&(t=i,n=e.target,!(t.contains?t.contains(n):t.compareDocumentPosition?t===n||16&t.compareDocumentPosition(n):void 0)))}),[U]),Z=(0,Pe.Z)((function(e){B.current||j(e)})),V=(0,Pe.Z)((function(e){27===e.keyCode&&j(e)})),(0,o.useEffect)((function(){if(!F&&null!=U){var e,t=window.event,n=(e=Oe(U),(0,Re.Z)(De(e))),r=(0,ke.Z)(n,L,z,!0),i=(0,ke.Z)(n,L,(function(e){e!==t?Z(e):t=void 0})),o=(0,ke.Z)(n,"keyup",(function(e){e!==t?V(e):t=void 0})),a=[];return"ontouchstart"in n.documentElement&&(a=[].slice.call(n.body.children).map((function(e){return(0,ke.Z)(e,"mousemove",Ue)}))),function(){r(),i(),o(),a.forEach((function(e){return e()}))}}}),[U,F,L,z,Z,V]),!K)return null;var W=e.children(l({},D,{show:!!e.show,props:l({},R.popper,{style:_.popper,ref:x}),arrowProps:l({},R.arrow,{style:_.arrow,ref:E})}));if(m){var H=e.onExit,q=e.onExiting,$=e.onEnter,Y=e.onEntering,Q=e.onEntered;W=o.createElement(m,{in:e.show,appear:!0,onExit:H,onExiting:q,onExited:function(){P(!0),e.onExited&&e.onExited.apply(e,arguments)},onEnter:$,onEntering:Y,onEntered:Q},W)}return S?d.createPortal(W,S):null}));Fe.displayName="Overlay",Fe.propTypes={show:f().bool,placement:f().oneOf(k),target:f().any,container:f().any,flip:f().bool,children:f().func.isRequired,containerPadding:f().number,popperConfig:f().object,rootClose:f().bool,rootCloseEvent:f().oneOf(["click","mousedown"]),rootCloseDisabled:f().bool,onHide:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict";n.d(t,{Z:()=>d});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=n(7294),l=n(6792),u=["bsPrefix","className","noGutters","as"],c=["xl","lg","md","sm","xs"],f=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.className,f=e.noGutters,d=e.as,p=void 0===d?"div":d,h=(0,i.Z)(e,u),m=(0,l.vE)(n,"row"),v=m+"-cols",g=[];return c.forEach((function(e){var t,n=h[e];delete h[e];var r="xs"!==e?"-"+e:"";null!=(t=null!=n&&"object"==typeof n?n.cols:n)&&g.push(""+v+r+"-"+t)})),s.createElement(p,(0,r.Z)({ref:t},h,{className:a().apply(void 0,[o,m,f&&"no-gutters"].concat(g))}))}));f.displayName="Row",f.defaultProps={noGutters:!1};const d=f},8358:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(1368),i=n(8321),o=n(7294),a=n(6833),s=["as","disabled","onKeyDown"];function l(e){return!e||"#"===e.trim()}var u=o.forwardRef((function(e,t){var n=e.as,u=void 0===n?"a":n,c=e.disabled,f=e.onKeyDown,d=(0,i.Z)(e,s),p=function(e){var t=d.href,n=d.onClick;(c||l(t))&&e.preventDefault(),c?e.stopPropagation():n&&n(e)};return l(d.href)&&(d.role=d.role||"button",d.href=d.href||"#"),c&&(d.tabIndex=-1,d["aria-disabled"]=!0),o.createElement(u,(0,r.Z)({ref:t},d,{onClick:p,onKeyDown:(0,a.Z)((function(e){" "===e.key&&(e.preventDefault(),p(e))}),f)}))}));u.displayName="SafeAnchor";const c=u},5017:(e,t,n)=>{"use strict";n.d(t,{h:()=>i,Z:()=>o});var r=n(7294),i=function(e,t){return void 0===t&&(t=null),null!=e?String(e):t||null};const o=r.createContext(null)},6792:(e,t,n)=>{"use strict";n.d(t,{vE:()=>o});var r=n(7294),i=r.createContext({});function o(e,t){var n=(0,r.useContext)(i);return e||n[t]||t}i.Consumer,i.Provider},3489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=n(7294),l=(n(5638),n(6792)),u=["bsPrefix","placement","className","style","children","arrowProps","popper","show"],c=s.forwardRef((function(e,t){var n=e.bsPrefix,o=e.placement,c=e.className,f=e.style,d=e.children,p=e.arrowProps,h=(e.popper,e.show,(0,i.Z)(e,u));n=(0,l.vE)(n,"tooltip");var m=((null==o?void 0:o.split("-"))||[])[0];return s.createElement("div",(0,r.Z)({ref:t,style:f,role:"tooltip","x-placement":m,className:a()(c,n,"bs-tooltip-"+m)},h),s.createElement("div",(0,r.Z)({className:"arrow"},p)),s.createElement("div",{className:n+"-inner"},d))}));c.defaultProps={placement:"right"},c.displayName="Tooltip";const f=c},6833:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.d(t,{Z:()=>f});var r=n(1368),i=n(8321),o=n(4184),a=n.n(o),s=/-(.)/g,l=n(7294),u=n(6792),c=["className","bsPrefix","as"];function f(e,t){var n,o,f=void 0===t?{}:t,d=f.displayName,p=void 0===d?(n=e)[0].toUpperCase()+(o=n,o.replace(s,(function(e,t){return t.toUpperCase()}))).slice(1):d,h=f.Component,m=f.defaultProps,v=l.forwardRef((function(t,n){var o=t.className,s=t.bsPrefix,f=t.as,d=void 0===f?h||"div":f,p=(0,i.Z)(t,c),m=(0,u.vE)(s,e);return l.createElement(d,(0,r.Z)({ref:n,className:a()(o,m)},p))}));return v.defaultProps=m,v.displayName=p,v}},492:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(3164),i=n(4302);function o(e,t,n,o){var a,s,l;null==n&&(a=e,l=-1===(s=(0,r.Z)(a,"transitionDuration")||"").indexOf("ms")?1e3:1,n=parseFloat(s)*l||0);var u=function(e,t,n){void 0===n&&(n=5);var r=!1,o=setTimeout((function(){r||function(e,t,n,r){if(void 0===n&&(n=!1),void 0===r&&(r=!0),e){var i=document.createEvent("HTMLEvents");i.initEvent("transitionend",n,r),e.dispatchEvent(i)}}(e,0,!0)}),t+n),a=(0,i.Z)(e,"transitionend",(function(){r=!0}),{once:!0});return function(){clearTimeout(o),a()}}(e,n,o),c=(0,i.Z)(e,"transitionend",t);return function(){u(),c()}}function a(e,t){var n=(0,r.Z)(e,t)||"",i=-1===n.indexOf("ms")?1e3:1;return parseFloat(n)*i}function s(e,t){var n=a(e,"transitionDuration"),r=a(e,"transitionDelay"),i=o(e,(function(n){n.target===e&&(i(),t(n))}),n+r)}},4509:(e,t,n)=>{"use strict";function r(e){e.offsetHeight}n.d(t,{Z:()=>r})},4448:(e,t,n)=>{"use strict";var r=n(7294),i=n(5013),o=n(3840);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n
    ',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",customClass:"",sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},Be="show",Ue="out",Qe={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},Ve="fade",$e="show",Xe="hover",Ke="focus",Ye=function(){function e(e,t){if(void 0===o.default)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=e,this.config=this._getConfig(t),this.tip=null,this._setListeners()}var t=e.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(e){if(this._isEnabled)if(e){var t=this.constructor.DATA_KEY,n=i.default(e.currentTarget).data(t);n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),i.default(e.currentTarget).data(t,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(i.default(this.getTipElement()).hasClass($e))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),i.default.removeData(this.element,this.constructor.DATA_KEY),i.default(this.element).off(this.constructor.EVENT_KEY),i.default(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&i.default(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===i.default(this.element).css("display"))throw new Error("Please use show on visible elements");var t=i.default.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){i.default(this.element).trigger(t);var n=f.findShadowRoot(this.element),r=i.default.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!r)return;var a=this.getTipElement(),l=f.getUID(this.constructor.NAME);a.setAttribute("id",l),this.element.setAttribute("aria-describedby",l),this.setContent(),this.config.animation&&i.default(a).addClass(Ve);var u="function"==typeof this.config.placement?this.config.placement.call(this,a,this.element):this.config.placement,s=this._getAttachment(u);this.addAttachmentClass(s);var c=this._getContainer();i.default(a).data(this.constructor.DATA_KEY,this),i.default.contains(this.element.ownerDocument.documentElement,this.tip)||i.default(a).appendTo(c),i.default(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new o.default(this.element,a,this._getPopperConfig(s)),i.default(a).addClass($e),i.default(a).addClass(this.config.customClass),"ontouchstart"in document.documentElement&&i.default(document.body).children().on("mouseover",null,i.default.noop);var d=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,i.default(e.element).trigger(e.constructor.Event.SHOWN),t===Ue&&e._leave(null,e)};if(i.default(this.tip).hasClass(Ve)){var p=f.getTransitionDurationFromElement(this.tip);i.default(this.tip).one(f.TRANSITION_END,d).emulateTransitionEnd(p)}else d()}},t.hide=function(e){var t=this,n=this.getTipElement(),r=i.default.Event(this.constructor.Event.HIDE),o=function(){t._hoverState!==Be&&n.parentNode&&n.parentNode.removeChild(n),t._cleanTipClass(),t.element.removeAttribute("aria-describedby"),i.default(t.element).trigger(t.constructor.Event.HIDDEN),null!==t._popper&&t._popper.destroy(),e&&e()};if(i.default(this.element).trigger(r),!r.isDefaultPrevented()){if(i.default(n).removeClass($e),"ontouchstart"in document.documentElement&&i.default(document.body).children().off("mouseover",null,i.default.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,i.default(this.tip).hasClass(Ve)){var a=f.getTransitionDurationFromElement(n);i.default(n).one(f.TRANSITION_END,o).emulateTransitionEnd(a)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(e){i.default(this.getTipElement()).addClass("bs-tooltip-"+e)},t.getTipElement=function(){return this.tip=this.tip||i.default(this.config.template)[0],this.tip},t.setContent=function(){var e=this.getTipElement();this.setElementContent(i.default(e.querySelectorAll(".tooltip-inner")),this.getTitle()),i.default(e).removeClass("fade show")},t.setElementContent=function(e,t){"object"!=typeof t||!t.nodeType&&!t.jquery?this.config.html?(this.config.sanitize&&(t=Ie(t,this.config.whiteList,this.config.sanitizeFn)),e.html(t)):e.text(t):this.config.html?i.default(t).parent().is(e)||e.empty().append(t):e.text(i.default(t).text())},t.getTitle=function(){var e=this.element.getAttribute("data-original-title");return e||(e="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),e},t._getPopperConfig=function(e){var t=this;return u({},{placement:e,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(e){e.originalPlacement!==e.placement&&t._handlePopperPlacementChange(e)},onUpdate:function(e){return t._handlePopperPlacementChange(e)}},this.config.popperConfig)},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=u({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:f.isElement(this.config.container)?i.default(this.config.container):i.default(document).find(this.config.container)},t._getAttachment=function(e){return We[e.toUpperCase()]},t._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach((function(t){if("click"===t)i.default(e.element).on(e.constructor.Event.CLICK,e.config.selector,(function(t){return e.toggle(t)}));else if("manual"!==t){var n=t===Xe?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,r=t===Xe?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;i.default(e.element).on(n,e.config.selector,(function(t){return e._enter(t)})).on(r,e.config.selector,(function(t){return e._leave(t)}))}})),this._hideModalHandler=function(){e.element&&e.hide()},i.default(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=u({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var e=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==e)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(e,t){var n=this.constructor.DATA_KEY;(t=t||i.default(e.currentTarget).data(n))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),i.default(e.currentTarget).data(n,t)),e&&(t._activeTrigger["focusin"===e.type?Ke:Xe]=!0),i.default(t.getTipElement()).hasClass($e)||t._hoverState===Be?t._hoverState=Be:(clearTimeout(t._timeout),t._hoverState=Be,t.config.delay&&t.config.delay.show?t._timeout=setTimeout((function(){t._hoverState===Be&&t.show()}),t.config.delay.show):t.show())},t._leave=function(e,t){var n=this.constructor.DATA_KEY;(t=t||i.default(e.currentTarget).data(n))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),i.default(e.currentTarget).data(n,t)),e&&(t._activeTrigger["focusout"===e.type?Ke:Xe]=!1),t._isWithActiveTrigger()||(clearTimeout(t._timeout),t._hoverState=Ue,t.config.delay&&t.config.delay.hide?t._timeout=setTimeout((function(){t._hoverState===Ue&&t.hide()}),t.config.delay.hide):t.hide())},t._isWithActiveTrigger=function(){for(var e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1},t._getConfig=function(e){var t=i.default(this.element).data();return Object.keys(t).forEach((function(e){-1!==He.indexOf(e)&&delete t[e]})),"number"==typeof(e=u({},this.constructor.Default,t,"object"==typeof e&&e?e:{})).delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),f.typeCheckConfig(Le,e,this.constructor.DefaultType),e.sanitize&&(e.template=Ie(e.template,e.whiteList,e.sanitizeFn)),e},t._getDelegateConfig=function(){var e={};if(this.config)for(var t in this.config)this.constructor.Default[t]!==this.config[t]&&(e[t]=this.config[t]);return e},t._cleanTipClass=function(){var e=i.default(this.getTipElement()),t=e.attr("class").match(Fe);null!==t&&t.length&&e.removeClass(t.join(""))},t._handlePopperPlacementChange=function(e){this.tip=e.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(e.placement))},t._fixTransition=function(){var e=this.getTipElement(),t=this.config.animation;null===e.getAttribute("x-placement")&&(i.default(e).removeClass(Ve),this.config.animation=!1,this.hide(),this.show(),this.config.animation=t)},e._jQueryInterface=function(t){return this.each((function(){var n=i.default(this),r=n.data(Re),o="object"==typeof t&&t;if((r||!/dispose|hide/.test(t))&&(r||(r=new e(this,o),n.data(Re,r)),"string"==typeof t)){if(void 0===r[t])throw new TypeError('No method named "'+t+'"');r[t]()}}))},l(e,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return qe}},{key:"NAME",get:function(){return Le}},{key:"DATA_KEY",get:function(){return Re}},{key:"Event",get:function(){return Qe}},{key:"EVENT_KEY",get:function(){return je}},{key:"DefaultType",get:function(){return ze}}]),e}();i.default.fn.tooltip=Ye._jQueryInterface,i.default.fn.tooltip.Constructor=Ye,i.default.fn.tooltip.noConflict=function(){return i.default.fn.tooltip=Me,Ye._jQueryInterface};var Ge="popover",Je="bs.popover",Ze=".bs.popover",et=i.default.fn.popover,tt=new RegExp("(^|\\s)bs-popover\\S+","g"),nt=u({},Ye.Default,{placement:"right",trigger:"click",content:"",template:''}),rt=u({},Ye.DefaultType,{content:"(string|element|function)"}),it={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},ot=function(e){function t(){return e.apply(this,arguments)||this}var n,r;r=e,(n=t).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var o=t.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(e){i.default(this.getTipElement()).addClass("bs-popover-"+e)},o.getTipElement=function(){return this.tip=this.tip||i.default(this.config.template)[0],this.tip},o.setContent=function(){var e=i.default(this.getTipElement());this.setElementContent(e.find(".popover-header"),this.getTitle());var t=this._getContent();"function"==typeof t&&(t=t.call(this.element)),this.setElementContent(e.find(".popover-body"),t),e.removeClass("fade show")},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var e=i.default(this.getTipElement()),t=e.attr("class").match(tt);null!==t&&t.length>0&&e.removeClass(t.join(""))},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this).data(Je),r="object"==typeof e?e:null;if((n||!/dispose|hide/.test(e))&&(n||(n=new t(this,r),i.default(this).data(Je,n)),"string"==typeof e)){if(void 0===n[e])throw new TypeError('No method named "'+e+'"');n[e]()}}))},l(t,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return nt}},{key:"NAME",get:function(){return Ge}},{key:"DATA_KEY",get:function(){return Je}},{key:"Event",get:function(){return it}},{key:"EVENT_KEY",get:function(){return Ze}},{key:"DefaultType",get:function(){return rt}}]),t}(Ye);i.default.fn.popover=ot._jQueryInterface,i.default.fn.popover.Constructor=ot,i.default.fn.popover.noConflict=function(){return i.default.fn.popover=et,ot._jQueryInterface};var at="scrollspy",lt="bs.scrollspy",ut="."+lt,st=i.default.fn[at],ct={offset:10,method:"auto",target:""},ft={offset:"number",method:"string",target:"(string|element)"},dt="active",pt=".nav, .list-group",ht=".nav-link",mt="position",gt=function(){function e(e,t){var n=this;this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(t),this._selector=this._config.target+" "+".nav-link,"+this._config.target+" "+".list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,i.default(this._scrollElement).on("scroll.bs.scrollspy",(function(e){return n._process(e)})),this.refresh(),this._process()}var t=e.prototype;return t.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?"offset":mt,n="auto"===this._config.method?t:this._config.method,r=n===mt?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(e){var t,o=f.getSelectorFromElement(e);if(o&&(t=document.querySelector(o)),t){var a=t.getBoundingClientRect();if(a.width||a.height)return[i.default(t)[n]().top+r,o]}return null})).filter((function(e){return e})).sort((function(e,t){return e[0]-t[0]})).forEach((function(t){e._offsets.push(t[0]),e._targets.push(t[1])}))},t.dispose=function(){i.default.removeData(this._element,lt),i.default(this._scrollElement).off(ut),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},t._getConfig=function(e){if("string"!=typeof(e=u({},ct,"object"==typeof e&&e?e:{})).target&&f.isElement(e.target)){var t=i.default(e.target).attr("id");t||(t=f.getUID(at),i.default(e.target).attr("id",t)),e.target="#"+t}return f.typeCheckConfig(at,e,ft),e},t._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},t._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},t._process=function(){var e=this._getScrollTop()+this._config.offset,t=this._getScrollHeight(),n=this._config.offset+t-this._getOffsetHeight();if(this._scrollHeight!==t&&this.refresh(),e>=n){var r=this._targets[this._targets.length-1];this._activeTarget!==r&&this._activate(r)}else{if(this._activeTarget&&e0)return this._activeTarget=null,void this._clear();for(var i=this._offsets.length;i--;)this._activeTarget!==this._targets[i]&&e>=this._offsets[i]&&(void 0===this._offsets[i+1]||e li > .active",Et=function(){function e(e){this._element=e}var t=e.prototype;return t.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&i.default(this._element).hasClass(bt)||i.default(this._element).hasClass("disabled"))){var t,n,r=i.default(this._element).closest(".nav, .list-group")[0],o=f.getSelectorFromElement(this._element);if(r){var a="UL"===r.nodeName||"OL"===r.nodeName?Tt:xt;n=(n=i.default.makeArray(i.default(r).find(a)))[n.length-1]}var l=i.default.Event("hide.bs.tab",{relatedTarget:this._element}),u=i.default.Event("show.bs.tab",{relatedTarget:n});if(n&&i.default(n).trigger(l),i.default(this._element).trigger(u),!u.isDefaultPrevented()&&!l.isDefaultPrevented()){o&&(t=document.querySelector(o)),this._activate(this._element,r);var s=function(){var t=i.default.Event("hidden.bs.tab",{relatedTarget:e._element}),r=i.default.Event("shown.bs.tab",{relatedTarget:n});i.default(n).trigger(t),i.default(e._element).trigger(r)};t?this._activate(t,t.parentNode,s):s()}}},t.dispose=function(){i.default.removeData(this._element,vt),this._element=null},t._activate=function(e,t,n){var r=this,o=(!t||"UL"!==t.nodeName&&"OL"!==t.nodeName?i.default(t).children(xt):i.default(t).find(Tt))[0],a=n&&o&&i.default(o).hasClass(wt),l=function(){return r._transitionComplete(e,o,n)};if(o&&a){var u=f.getTransitionDurationFromElement(o);i.default(o).removeClass(_t).one(f.TRANSITION_END,l).emulateTransitionEnd(u)}else l()},t._transitionComplete=function(e,t,n){if(t){i.default(t).removeClass(bt);var r=i.default(t.parentNode).find("> .dropdown-menu .active")[0];r&&i.default(r).removeClass(bt),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!1)}if(i.default(e).addClass(bt),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!0),f.reflow(e),e.classList.contains(wt)&&e.classList.add(_t),e.parentNode&&i.default(e.parentNode).hasClass("dropdown-menu")){var o=i.default(e).closest(".dropdown")[0];if(o){var a=[].slice.call(o.querySelectorAll(".dropdown-toggle"));i.default(a).addClass(bt)}e.setAttribute("aria-expanded",!0)}n&&n()},e._jQueryInterface=function(t){return this.each((function(){var n=i.default(this),r=n.data(vt);if(r||(r=new e(this),n.data(vt,r)),"string"==typeof t){if(void 0===r[t])throw new TypeError('No method named "'+t+'"');r[t]()}}))},l(e,null,[{key:"VERSION",get:function(){return"4.6.0"}}]),e}();i.default(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(e){e.preventDefault(),Et._jQueryInterface.call(i.default(this),"show")})),i.default.fn.tab=Et._jQueryInterface,i.default.fn.tab.Constructor=Et,i.default.fn.tab.noConflict=function(){return i.default.fn.tab=yt,Et._jQueryInterface};var St="toast",kt="bs.toast",Ct=i.default.fn.toast,Nt="click.dismiss.bs.toast",At="hide",Dt="show",Pt="showing",Ot={animation:"boolean",autohide:"boolean",delay:"number"},It={animation:!0,autohide:!0,delay:500},Lt=function(){function e(e,t){this._element=e,this._config=this._getConfig(t),this._timeout=null,this._setListeners()}var t=e.prototype;return t.show=function(){var e=this,t=i.default.Event("show.bs.toast");if(i.default(this._element).trigger(t),!t.isDefaultPrevented()){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var n=function(){e._element.classList.remove(Pt),e._element.classList.add(Dt),i.default(e._element).trigger("shown.bs.toast"),e._config.autohide&&(e._timeout=setTimeout((function(){e.hide()}),e._config.delay))};if(this._element.classList.remove(At),f.reflow(this._element),this._element.classList.add(Pt),this._config.animation){var r=f.getTransitionDurationFromElement(this._element);i.default(this._element).one(f.TRANSITION_END,n).emulateTransitionEnd(r)}else n()}},t.hide=function(){if(this._element.classList.contains(Dt)){var e=i.default.Event("hide.bs.toast");i.default(this._element).trigger(e),e.isDefaultPrevented()||this._close()}},t.dispose=function(){this._clearTimeout(),this._element.classList.contains(Dt)&&this._element.classList.remove(Dt),i.default(this._element).off(Nt),i.default.removeData(this._element,kt),this._element=null,this._config=null},t._getConfig=function(e){return e=u({},It,i.default(this._element).data(),"object"==typeof e&&e?e:{}),f.typeCheckConfig(St,e,this.constructor.DefaultType),e},t._setListeners=function(){var e=this;i.default(this._element).on(Nt,'[data-dismiss="toast"]',(function(){return e.hide()}))},t._close=function(){var e=this,t=function(){e._element.classList.add(At),i.default(e._element).trigger("hidden.bs.toast")};if(this._element.classList.remove(Dt),this._config.animation){var n=f.getTransitionDurationFromElement(this._element);i.default(this._element).one(f.TRANSITION_END,t).emulateTransitionEnd(n)}else t()},t._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},e._jQueryInterface=function(t){return this.each((function(){var n=i.default(this),r=n.data(kt);if(r||(r=new e(this,"object"==typeof t&&t),n.data(kt,r)),"string"==typeof t){if(void 0===r[t])throw new TypeError('No method named "'+t+'"');r[t](this)}}))},l(e,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"DefaultType",get:function(){return Ot}},{key:"Default",get:function(){return It}}]),e}();i.default.fn.toast=Lt._jQueryInterface,i.default.fn.toast.Constructor=Lt,i.default.fn.toast.noConflict=function(){return i.default.fn.toast=Ct,Lt._jQueryInterface},e.Alert=h,e.Button=_,e.Carousel=L,e.Collapse=V,e.Dropdown=se,e.Modal=Ae,e.Popover=ot,e.Scrollspy=gt,e.Tab=Et,e.Toast=Lt,e.Tooltip=Ye,e.Util=f,Object.defineProperty(e,"__esModule",{value:!0})}(t,n(755),n(981))},755:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var o=[],a=Object.getPrototypeOf,l=o.slice,u=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},s=o.push,c=o.indexOf,f={},d=f.toString,p=f.hasOwnProperty,h=p.toString,m=h.call(Object),g={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},b=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function _(e,t,n){var r,i,o=(n=n||b).createElement("script");if(o.text=e,t)for(r in w)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[d.call(e)]||"object":typeof e}var T="3.6.0",E=function(e,t){return new E.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}E.fn=E.prototype={jquery:T,constructor:E,length:0,toArray:function(){return l.call(this)},get:function(e){return null==e?l.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=E.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return E.each(this,e)},map:function(e){return this.pushStack(E.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(E.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(E.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),Q=new RegExp(M+"|>"),V=new RegExp(z),$=new RegExp("^"+F+"$"),X={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,Y=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){d()},ae=we((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{I.apply(D=L.call(_.childNodes),_.childNodes),D[_.childNodes.length].nodeType}catch(e){I={apply:D.length?function(e,t){O.apply(e,L.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function le(e,t,r,i){var o,l,s,c,f,h,v,y=t&&t.ownerDocument,_=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==_&&9!==_&&11!==_)return r;if(!i&&(d(t),t=t||p,m)){if(11!==_&&(f=Z.exec(e)))if(o=f[1]){if(9===_){if(!(s=t.getElementById(o)))return r;if(s.id===o)return r.push(s),r}else if(y&&(s=y.getElementById(o))&&b(t,s)&&s.id===o)return r.push(s),r}else{if(f[2])return I.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return I.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!C[e+" "]&&(!g||!g.test(e))&&(1!==_||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===_&&(Q.test(e)||U.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=w)),l=(h=a(e)).length;l--;)h[l]=(c?"#"+c:":scope")+" "+be(h[l]);v=h.join(",")}try{return I.apply(r,y.querySelectorAll(v)),r}catch(t){C(e,!0)}finally{c===w&&t.removeAttribute("id")}}}return u(e.replace(q,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[w]=!0,e}function ce(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function de(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return se((function(t){return t=+t,se((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=le.support={},o=le.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},d=le.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:_;return a!=p&&9===a.nodeType&&a.documentElement?(h=(p=a).documentElement,m=!o(p),_!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce((function(e){return h.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(p.getElementsByClassName),n.getById=ce((function(e){return h.appendChild(e).id=w,!p.getElementsByName||!p.getElementsByName(w).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=J.test(p.querySelectorAll))&&(ce((function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+j+")"),e.querySelectorAll("[id~="+w+"-]").length||g.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=J.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",z)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=J.test(h.compareDocumentPosition),b=t||J.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==_&&b(_,e)?-1:t==p||t.ownerDocument==_&&b(_,t)?1:c?R(c,e)-R(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],l=[t];if(!i||!o)return e==p?-1:t==p?1:i?-1:o?1:c?R(c,e)-R(c,t):0;if(i===o)return de(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;a[r]===l[r];)r++;return r?de(a[r],l[r]):a[r]==_?-1:l[r]==_?1:0},p):p},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(d(e),n.matchesSelector&&m&&!C[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){C(t,!0)}return le(t,p,null,[e]).length>0},le.contains=function(e,t){return(e.ownerDocument||e)!=p&&d(e),b(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=p&&d(e);var i=r.attrHandle[t.toLowerCase()],o=i&&A.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},le.escape=function(e){return(e+"").replace(re,ie)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(N),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=le.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=le.selectors={cacheLength:50,createPseudo:se,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+M+"|$)"))&&E(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=le.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(W," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var s,c,f,d,p,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=l&&t.nodeName.toLowerCase(),y=!u&&!l,b=!1;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(l?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(b=(p=(s=(c=(f=(d=g)[w]||(d[w]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===x&&s[1])&&s[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(b=p=0)||h.pop();)if(1===d.nodeType&&++b&&d===t){c[e]=[x,p,b];break}}else if(y&&(b=p=(s=(c=(f=(d=t)[w]||(d[w]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]||[])[0]===x&&s[1]),!1===b)for(;(d=++p&&d&&d[m]||(b=p=0)||h.pop())&&((l?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++b||(y&&((c=(f=d[w]||(d[w]={}))[d.uniqueID]||(f[d.uniqueID]={}))[e]=[x,b]),d!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=R(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:se((function(e){var t=[],n=[],r=l(e.replace(q,"$1"));return r[w]?se((function(e,t,n,i){for(var o,a=r(e,null,i,[]),l=e.length;l--;)(o=a[l])&&(e[l]=!(t[l]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:se((function(e){return function(t){return le(e,t).length>0}})),contains:se((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:se((function(e){return $.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ge((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xe(e,t,n,r,i){for(var o,a=[],l=0,u=e.length,s=null!=t;l-1&&(o[s]=!(a[s]=f))}}else v=xe(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):I.apply(a,v)}))}function Ee(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],l=a||r.relative[" "],u=a?1:0,c=we((function(e){return e===t}),l,!0),f=we((function(e){return R(t,e)>-1}),l,!0),d=[function(e,n,r){var i=!a&&(r||n!==s)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&_e(d),u>1&&be(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(q,"$1"),n,u0,i=e.length>0,o=function(o,a,l,u,c){var f,h,g,v=0,y="0",b=o&&[],w=[],_=s,T=o||i&&r.find.TAG("*",c),E=x+=null==_?1:Math.random()||.1,S=T.length;for(c&&(s=a==p||a||c);y!==S&&null!=(f=T[y]);y++){if(i&&f){for(h=0,a||f.ownerDocument==p||(d(f),l=!m);g=e[h++];)if(g(f,a||p,l)){u.push(f);break}c&&(x=E)}n&&((f=!g&&f)&&v--,o&&b.push(f))}if(v+=y,n&&y!==v){for(h=0;g=t[h++];)g(b,w,a,l);if(o){if(v>0)for(;y--;)b[y]||w[y]||(w[y]=P.call(u));w=xe(w)}I.apply(u,w),c&&!o&&w.length>0&&v+t.length>1&&le.uniqueSort(u)}return c&&(x=E,s=_),b};return n?se(o):o}(o,i))).selector=e}return l},u=le.select=function(e,t,n,i){var o,u,s,c,f,d="function"==typeof e&&e,p=!i&&a(e=d.selector||e);if(n=n||[],1===p.length){if((u=p[0]=p[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&m&&r.relative[u[1].type]){if(!(t=(r.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;d&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=X.needsContext.test(e)?0:u.length;o--&&(s=u[o],!r.relative[c=s.type]);)if((f=r.find[c])&&(i=f(s.matches[0].replace(te,ne),ee.test(u[0].type)&&ve(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&be(u)))return I.apply(n,i),n;break}}return(d||l(e,p))(i,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=w.split("").sort(N).join("")===w,n.detectDuplicates=!!f,d(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),ce((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||fe("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||fe("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||fe(j,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),le}(r);E.find=k,E.expr=k.selectors,E.expr[":"]=E.expr.pseudos,E.uniqueSort=E.unique=k.uniqueSort,E.text=k.getText,E.isXMLDoc=k.isXML,E.contains=k.contains,E.escapeSelector=k.escape;var C=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&E(e).is(n))break;r.push(e)}return r},N=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},A=E.expr.match.needsContext;function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var P=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function O(e,t,n){return v(t)?E.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?E.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?E.grep(e,(function(e){return c.call(t,e)>-1!==n})):E.filter(t,e,n)}E.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?E.find.matchesSelector(r,e)?[r]:[]:E.find.matches(e,E.grep(t,(function(e){return 1===e.nodeType})))},E.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(E(e).filter((function(){for(t=0;t1?E.uniqueSort(n):n},filter:function(e){return this.pushStack(O(this,e||[],!1))},not:function(e){return this.pushStack(O(this,e||[],!0))},is:function(e){return!!O(this,"string"==typeof e&&A.test(e)?E(e):e||[],!1).length}});var I,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(E.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||I,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof E?t[0]:t,E.merge(this,E.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),P.test(r[1])&&E.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(E):E.makeArray(e,this)}).prototype=E.fn,I=E(b);var R=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function M(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}E.fn.extend({has:function(e){var t=E(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&E.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?E.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(E(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(E.uniqueSort(E.merge(this.get(),E(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),E.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return C(e,"parentNode")},parentsUntil:function(e,t,n){return C(e,"parentNode",n)},next:function(e){return M(e,"nextSibling")},prev:function(e){return M(e,"previousSibling")},nextAll:function(e){return C(e,"nextSibling")},prevAll:function(e){return C(e,"previousSibling")},nextUntil:function(e,t,n){return C(e,"nextSibling",n)},prevUntil:function(e,t,n){return C(e,"previousSibling",n)},siblings:function(e){return N((e.parentNode||{}).firstChild,e)},children:function(e){return N(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(D(e,"template")&&(e=e.content||e),E.merge([],e.childNodes))}},(function(e,t){E.fn[e]=function(n,r){var i=E.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=E.filter(r,i)),this.length>1&&(j[e]||E.uniqueSort(i),R.test(e)&&i.reverse()),this.pushStack(i)}}));var F=/[^\x20\t\r\n\f]+/g;function H(e){return e}function z(e){throw e}function W(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}E.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return E.each(e.match(F)||[],(function(e,n){t[n]=!0})),t}(e):E.extend({},e);var t,n,r,i,o=[],a=[],l=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;l=-1)for(n=a.shift();++l-1;)o.splice(n,1),n<=l&&l--})),this},has:function(e){return e?E.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!r}};return s},E.extend({Deferred:function(e){var t=[["notify","progress",E.Callbacks("memory"),E.Callbacks("memory"),2],["resolve","done",E.Callbacks("once memory"),E.Callbacks("once memory"),0,"resolved"],["reject","fail",E.Callbacks("once memory"),E.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return E.Deferred((function(n){E.each(t,(function(t,r){var i=v(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,i){var o=0;function a(e,t,n,i){return function(){var l=this,u=arguments,s=function(){var r,s;if(!(e=o&&(n!==z&&(l=void 0,u=[r]),t.rejectWith(l,u))}};e?c():(E.Deferred.getStackHook&&(c.stackTrace=E.Deferred.getStackHook()),r.setTimeout(c))}}return E.Deferred((function(r){t[0][3].add(a(0,r,v(i)?i:H,r.notifyWith)),t[1][3].add(a(0,r,v(e)?e:H)),t[2][3].add(a(0,r,v(n)?n:z))})).promise()},promise:function(e){return null!=e?E.extend(e,i):i}},o={};return E.each(t,(function(e,r){var a=r[2],l=r[5];i[r[1]]=a.add,l&&a.add((function(){n=l}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=l.call(arguments),o=E.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?l.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(W(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)W(i[n],a(n),o.reject);return o.promise()}});var q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;E.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&q.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},E.readyException=function(e){r.setTimeout((function(){throw e}))};var B=E.Deferred();function U(){b.removeEventListener("DOMContentLoaded",U),r.removeEventListener("load",U),E.ready()}E.fn.ready=function(e){return B.then(e).catch((function(e){E.readyException(e)})),this},E.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--E.readyWait:E.isReady)||(E.isReady=!0,!0!==e&&--E.readyWait>0||B.resolveWith(b,[E]))}}),E.ready.then=B.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(E.ready):(b.addEventListener("DOMContentLoaded",U),r.addEventListener("load",U));var Q=function(e,t,n,r,i,o,a){var l=0,u=e.length,s=null==n;if("object"===x(n))for(l in i=!0,n)Q(e,t,l,n[l],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),s&&(a?(t.call(e,r),t=null):(s=t,t=function(e,t,n){return s.call(E(e),n)})),t))for(;l1,null,!0)},removeData:function(e){return this.each((function(){Z.remove(this,e)}))}}),E.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,E.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=E.queue(e,t),r=n.length,i=n.shift(),o=E._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){E.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:E.Callbacks("once memory").add((function(){J.remove(e,[t+"queue",n])}))})}}),E.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ye=/^$|^module$|\/(?:java|ecma)script/i;he=b.createDocumentFragment().appendChild(b.createElement("div")),(me=b.createElement("input")).setAttribute("type","radio"),me.setAttribute("checked","checked"),me.setAttribute("name","t"),he.appendChild(me),g.checkClone=he.cloneNode(!0).cloneNode(!0).lastChild.checked,he.innerHTML="",g.noCloneChecked=!!he.cloneNode(!0).lastChild.defaultValue,he.innerHTML="",g.option=!!he.lastChild;var be={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function we(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?E.merge([e],n):n}function _e(e,t){for(var n=0,r=e.length;n",""]);var xe=/<|&#?\w+;/;function Te(e,t,n,r,i){for(var o,a,l,u,s,c,f=t.createDocumentFragment(),d=[],p=0,h=e.length;p-1)i&&i.push(o);else if(s=le(o),a=we(f.appendChild(o),"script"),s&&_e(a),n)for(c=0;o=a[c++];)ye.test(o.type||"")&&n.push(o);return f}var Ee=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function ke(){return!1}function Ce(e,t){return e===function(){try{return b.activeElement}catch(e){}}()==("focus"===t)}function Ne(e,t,n,r,i,o){var a,l;if("object"==typeof t){for(l in"string"!=typeof n&&(r=r||n,n=void 0),t)Ne(e,l,n,r,t[l],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return E().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=E.guid++)),e.each((function(){E.event.add(this,t,i,r,n)}))}function Ae(e,t,n){n?(J.set(e,t,!1),E.event.add(e,t,{namespace:!1,handler:function(e){var r,i,o=J.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(E.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=l.call(arguments),J.set(this,t,o),r=n(this,t),this[t](),o!==(i=J.get(this,t))||r?J.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else o.length&&(J.set(this,t,{value:E.event.trigger(E.extend(o[0],E.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===J.get(e,t)&&E.event.add(e,t,Se)}E.event={global:{},add:function(e,t,n,r,i){var o,a,l,u,s,c,f,d,p,h,m,g=J.get(e);if(Y(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&E.find.matchesSelector(ae,i),n.guid||(n.guid=E.guid++),(u=g.events)||(u=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==E&&E.event.triggered!==t.type?E.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(F)||[""]).length;s--;)p=m=(l=Ee.exec(t[s])||[])[1],h=(l[2]||"").split(".").sort(),p&&(f=E.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=E.event.special[p]||{},c=E.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&E.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||((d=u[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),E.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,l,u,s,c,f,d,p,h,m,g=J.hasData(e)&&J.get(e);if(g&&(u=g.events)){for(s=(t=(t||"").match(F)||[""]).length;s--;)if(p=m=(l=Ee.exec(t[s])||[])[1],h=(l[2]||"").split(".").sort(),p){for(f=E.event.special[p]||{},d=u[p=(r?f.delegateType:f.bindType)||p]||[],l=l[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||l&&!l.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,g.handle)||E.removeEvent(e,p,g.handle),delete u[p])}else for(p in u)E.event.remove(e,p+t[s],n,r,!0);E.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,l=new Array(arguments.length),u=E.event.fix(e),s=(J.get(this,"events")||Object.create(null))[u.type]||[],c=E.event.special[u.type]||{};for(l[0]=u,t=1;t=1))for(;s!==this;s=s.parentNode||this)if(1===s.nodeType&&("click"!==e.type||!0!==s.disabled)){for(o=[],a={},n=0;n-1:E.find(i,this,null,[s]).length),a[i]&&o.push(r);o.length&&l.push({elem:s,handlers:o})}return s=this,u\s*$/g;function Ie(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&E(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function je(e,t){var n,r,i,o,a,l;if(1===t.nodeType){if(J.hasData(e)&&(l=J.get(e).events))for(i in J.remove(t,"handle events"),l)for(n=0,r=l[i].length;n1&&"string"==typeof h&&!g.checkClone&&Pe.test(h))return e.each((function(i){var o=e.eq(i);m&&(t[0]=h.call(this,i,o.html())),Fe(o,t,n,r)}));if(d&&(o=(i=Te(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(l=(a=E.map(we(i,"script"),Le)).length;f0&&_e(a,!u&&we(e,"script")),l},cleanData:function(e){for(var t,n,r,i=E.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?E.event.remove(n,r):E.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),E.fn.extend({detach:function(e){return He(this,e,!0)},remove:function(e){return He(this,e)},text:function(e){return Q(this,(function(e){return void 0===e?E.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Fe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ie(this,e).appendChild(e)}))},prepend:function(){return Fe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ie(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Fe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Fe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(E.cleanData(we(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return E.clone(this,e,t)}))},html:function(e){return Q(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!De.test(e)&&!be[(ve.exec(e)||["",""])[1].toLowerCase()]){e=E.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-l-.5))||0),u}function nt(e,t,n){var r=We(e),i=(!g.boxSizingReliable()||n)&&"border-box"===E.css(e,"boxSizing",!1,r),o=i,a=Ue(e,t,r),l="offset"+t[0].toUpperCase()+t.slice(1);if(ze.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&D(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===E.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===E.css(e,"boxSizing",!1,r),(o=l in e)&&(a=e[l])),(a=parseFloat(a)||0)+tt(e,t,n||(i?"border":"content"),o,r,a)+"px"}function rt(e,t,n,r,i){return new rt.prototype.init(e,t,n,r,i)}E.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ue(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,l=K(t),u=Ge.test(t),s=e.style;if(u||(t=Ke(l)),a=E.cssHooks[t]||E.cssHooks[l],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:s[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ce(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(E.cssNumber[l]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(s[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?s.setProperty(t,n):s[t]=n))}},css:function(e,t,n,r){var i,o,a,l=K(t);return Ge.test(t)||(t=Ke(l)),(a=E.cssHooks[t]||E.cssHooks[l])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ue(e,t,r)),"normal"===i&&t in Ze&&(i=Ze[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),E.each(["height","width"],(function(e,t){E.cssHooks[t]={get:function(e,n,r){if(n)return!Ye.test(E.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?nt(e,t,r):qe(e,Je,(function(){return nt(e,t,r)}))},set:function(e,n,r){var i,o=We(e),a=!g.scrollboxSize()&&"absolute"===o.position,l=(a||r)&&"border-box"===E.css(e,"boxSizing",!1,o),u=r?tt(e,t,r,l,o):0;return l&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-tt(e,t,"border",!1,o)-.5)),u&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=E.css(e,t)),et(0,n,u)}}})),E.cssHooks.marginLeft=Qe(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ue(e,"marginLeft"))||e.getBoundingClientRect().left-qe(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),E.each({margin:"",padding:"",border:"Width"},(function(e,t){E.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(E.cssHooks[e+t].set=et)})),E.fn.extend({css:function(e,t){return Q(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=We(e),i=t.length;a1)}}),E.Tween=rt,rt.prototype={constructor:rt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||E.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(E.cssNumber[n]?"":"px")},cur:function(){var e=rt.propHooks[this.prop];return e&&e.get?e.get(this):rt.propHooks._default.get(this)},run:function(e){var t,n=rt.propHooks[this.prop];return this.options.duration?this.pos=t=E.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rt.propHooks._default.set(this),this}},rt.prototype.init.prototype=rt.prototype,rt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=E.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){E.fx.step[e.prop]?E.fx.step[e.prop](e):1!==e.elem.nodeType||!E.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:E.style(e.elem,e.prop,e.now+e.unit)}}},rt.propHooks.scrollTop=rt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},E.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},E.fx=rt.prototype.init,E.fx.step={};var it,ot,at=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function ut(){ot&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ut):r.setTimeout(ut,E.fx.interval),E.fx.tick())}function st(){return r.setTimeout((function(){it=void 0})),it=Date.now()}function ct(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ft(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){E.removeAttr(this,e)}))}}),E.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?E.prop(e,t,n):(1===o&&E.isXMLDoc(e)||(i=E.attrHooks[t.toLowerCase()]||(E.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void E.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=E.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(F);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?E.removeAttr(e,n):e.setAttribute(n,n),n}},E.each(E.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=ht[t]||E.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}}));var mt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(F)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(F)||[]}E.fn.extend({prop:function(e,t){return Q(this,E.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[E.propFix[e]||e]}))}}),E.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&E.isXMLDoc(e)||(t=E.propFix[t]||t,i=E.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=E.find.attr(e,"tabindex");return t?parseInt(t,10):mt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(E.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),E.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){E.propFix[this.toLowerCase()]=this})),E.fn.extend({addClass:function(e){var t,n,r,i,o,a,l,u=0;if(v(e))return this.each((function(t){E(this).addClass(e.call(this,t,yt(this)))}));if((t=bt(e)).length)for(;n=this[u++];)if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(l=vt(r))&&n.setAttribute("class",l)}return this},removeClass:function(e){var t,n,r,i,o,a,l,u=0;if(v(e))return this.each((function(t){E(this).removeClass(e.call(this,t,yt(this)))}));if(!arguments.length)return this.attr("class","");if((t=bt(e)).length)for(;n=this[u++];)if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(l=vt(r))&&n.setAttribute("class",l)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):v(e)?this.each((function(n){E(this).toggleClass(e.call(this,n,yt(this),t),t)})):this.each((function(){var t,i,o,a;if(r)for(i=0,o=E(this),a=bt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=yt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+vt(yt(n))+" ").indexOf(t)>-1)return!0;return!1}});var wt=/\r/g;E.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=v(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,E(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=E.map(i,(function(e){return null==e?"":e+""}))),(t=E.valHooks[this.type]||E.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=E.valHooks[i.type]||E.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(wt,""):null==n?"":n:void 0}}),E.extend({valHooks:{option:{get:function(e){var t=E.find.attr(e,"value");return null!=t?t:vt(E.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,l=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),E.each(["radio","checkbox"],(function(){E.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=E.inArray(E(e).val(),t)>-1}},g.checkOn||(E.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in r;var _t=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};E.extend(E.event,{trigger:function(e,t,n,i){var o,a,l,u,s,c,f,d,h=[n||b],m=p.call(e,"type")?e.type:e,g=p.call(e,"namespace")?e.namespace.split("."):[];if(a=d=l=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!_t.test(m+E.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),s=m.indexOf(":")<0&&"on"+m,(e=e[E.expando]?e:new E.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:E.makeArray(t,[e]),f=E.event.special[m]||{},i||!f.trigger||!1!==f.trigger.apply(n,t))){if(!i&&!f.noBubble&&!y(n)){for(u=f.delegateType||m,_t.test(u+m)||(a=a.parentNode);a;a=a.parentNode)h.push(a),l=a;l===(n.ownerDocument||b)&&h.push(l.defaultView||l.parentWindow||r)}for(o=0;(a=h[o++])&&!e.isPropagationStopped();)d=a,e.type=o>1?u:f.bindType||m,(c=(J.get(a,"events")||Object.create(null))[e.type]&&J.get(a,"handle"))&&c.apply(a,t),(c=s&&a[s])&&c.apply&&Y(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(h.pop(),t)||!Y(n)||s&&v(n[m])&&!y(n)&&((l=n[s])&&(n[s]=null),E.event.triggered=m,e.isPropagationStopped()&&d.addEventListener(m,xt),n[m](),e.isPropagationStopped()&&d.removeEventListener(m,xt),E.event.triggered=void 0,l&&(n[s]=l)),e.result}},simulate:function(e,t,n){var r=E.extend(new E.Event,n,{type:e,isSimulated:!0});E.event.trigger(r,null,t)}}),E.fn.extend({trigger:function(e,t){return this.each((function(){E.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return E.event.trigger(e,t,n,!0)}}),g.focusin||E.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){E.event.simulate(t,e.target,E.event.fix(e))};E.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}}));var Tt=r.location,Et={guid:Date.now()},St=/\?/;E.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||E.error("Invalid XML: "+(n?E.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var kt=/\[\]$/,Ct=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function Dt(e,t,n,r){var i;if(Array.isArray(t))E.each(t,(function(t,i){n||kt.test(e)?r(e,i):Dt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==x(t))r(e,t);else for(i in t)Dt(e+"["+i+"]",t[i],n,r)}E.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!E.isPlainObject(e))E.each(e,(function(){i(this.name,this.value)}));else for(n in e)Dt(n,e[n],t,i);return r.join("&")},E.fn.extend({serialize:function(){return E.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=E.prop(this,"elements");return e?E.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!E(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!ge.test(e))})).map((function(e,t){var n=E(this).val();return null==n?null:Array.isArray(n)?E.map(n,(function(e){return{name:t.name,value:e.replace(Ct,"\r\n")}})):{name:t.name,value:n.replace(Ct,"\r\n")}})).get()}});var Pt=/%20/g,Ot=/#.*$/,It=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,jt=/^\/\//,Mt={},Ft={},Ht="*/".concat("*"),zt=b.createElement("a");function Wt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(F)||[];if(v(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qt(e,t,n,r){var i={},o=e===Ft;function a(l){var u;return i[l]=!0,E.each(e[l]||[],(function(e,l){var s=l(t,n,r);return"string"!=typeof s||o||i[s]?o?!(u=s):void 0:(t.dataTypes.unshift(s),a(s),!1)})),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Bt(e,t){var n,r,i=E.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&E.extend(!0,e,r),e}zt.href=Tt.href,E.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ht,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":E.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,E.ajaxSettings),t):Bt(E.ajaxSettings,e)},ajaxPrefilter:Wt(Mt),ajaxTransport:Wt(Ft),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,a,l,u,s,c,f,d,p=E.ajaxSetup({},t),h=p.context||p,m=p.context&&(h.nodeType||h.jquery)?E(h):E.event,g=E.Deferred(),v=E.Callbacks("once memory"),y=p.statusCode||{},w={},_={},x="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(s){if(!a)for(a={};t=Lt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return s?o:null},setRequestHeader:function(e,t){return null==s&&(e=_[e.toLowerCase()]=_[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==s&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(s)T.always(e[T.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||x;return n&&n.abort(t),S(0,t),this}};if(g.promise(T),p.url=((e||p.url||Tt.href)+"").replace(jt,Tt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(F)||[""],null==p.crossDomain){u=b.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=zt.protocol+"//"+zt.host!=u.protocol+"//"+u.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=E.param(p.data,p.traditional)),qt(Mt,p,t,T),s)return T;for(f in(c=E.event&&p.global)&&0==E.active++&&E.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Rt.test(p.type),i=p.url.replace(Ot,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Pt,"+")):(d=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(St.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(It,"$1"),d=(St.test(i)?"&":"?")+"_="+Et.guid+++d),p.url=i+d),p.ifModified&&(E.lastModified[i]&&T.setRequestHeader("If-Modified-Since",E.lastModified[i]),E.etag[i]&&T.setRequestHeader("If-None-Match",E.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&T.setRequestHeader("Content-Type",p.contentType),T.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ht+"; q=0.01":""):p.accepts["*"]),p.headers)T.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(h,T,p)||s))return T.abort();if(x="abort",v.add(p.complete),T.done(p.success),T.fail(p.error),n=qt(Ft,p,t,T)){if(T.readyState=1,c&&m.trigger("ajaxSend",[T,p]),s)return T;p.async&&p.timeout>0&&(l=r.setTimeout((function(){T.abort("timeout")}),p.timeout));try{s=!1,n.send(w,S)}catch(e){if(s)throw e;S(-1,e)}}else S(-1,"No Transport");function S(e,t,a,u){var f,d,b,w,_,x=t;s||(s=!0,l&&r.clearTimeout(l),n=void 0,o=u||"",T.readyState=e>0?4:0,f=e>=200&&e<300||304===e,a&&(w=function(e,t,n){for(var r,i,o,a,l=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in l)if(l[i]&&l[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(p,T,a)),!f&&E.inArray("script",p.dataTypes)>-1&&E.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(e,t,n,r){var i,o,a,l,u,s={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)s[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=s[u+" "+o]||s["* "+o]))for(i in s)if((l=i.split(" "))[1]===o&&(a=s[u+" "+l[0]]||s["* "+l[0]])){!0===a?a=s[i]:!0!==s[i]&&(o=l[0],c.unshift(l[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(p,w,T,f),f?(p.ifModified&&((_=T.getResponseHeader("Last-Modified"))&&(E.lastModified[i]=_),(_=T.getResponseHeader("etag"))&&(E.etag[i]=_)),204===e||"HEAD"===p.type?x="nocontent":304===e?x="notmodified":(x=w.state,d=w.data,f=!(b=w.error))):(b=x,!e&&x||(x="error",e<0&&(e=0))),T.status=e,T.statusText=(t||x)+"",f?g.resolveWith(h,[d,x,T]):g.rejectWith(h,[T,x,b]),T.statusCode(y),y=void 0,c&&m.trigger(f?"ajaxSuccess":"ajaxError",[T,p,f?d:b]),v.fireWith(h,[T,x]),c&&(m.trigger("ajaxComplete",[T,p]),--E.active||E.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return E.get(e,t,n,"json")},getScript:function(e,t){return E.get(e,void 0,t,"script")}}),E.each(["get","post"],(function(e,t){E[t]=function(e,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),E.ajax(E.extend({url:e,type:t,dataType:i,data:n,success:r},E.isPlainObject(e)&&e))}})),E.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),E._evalUrl=function(e,t,n){return E.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){E.globalEval(e,t,n)}})},E.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=E(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){E(this).wrapInner(e.call(this,t))})):this.each((function(){var t=E(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){E(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){E(this).replaceWith(this.childNodes)})),this}}),E.expr.pseudos.hidden=function(e){return!E.expr.pseudos.visible(e)},E.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},E.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Qt=E.ajaxSettings.xhr();g.cors=!!Qt&&"withCredentials"in Qt,g.ajax=Qt=!!Qt,E.ajaxTransport((function(e){var t,n;if(g.cors||Qt&&!e.crossDomain)return{send:function(i,o){var a,l=e.xhr();if(l.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)l[a]=e.xhrFields[a];for(a in e.mimeType&&l.overrideMimeType&&l.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)l.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=n=l.onload=l.onerror=l.onabort=l.ontimeout=l.onreadystatechange=null,"abort"===e?l.abort():"error"===e?"number"!=typeof l.status?o(0,"error"):o(l.status,l.statusText):o(Ut[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=t(),n=l.onerror=l.ontimeout=t("error"),void 0!==l.onabort?l.onabort=n:l.onreadystatechange=function(){4===l.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{l.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),E.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),E.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return E.globalEval(e),e}}}),E.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),E.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=E("