diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..b4b20d3d Binary files /dev/null and b/.DS_Store differ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..9ed24326 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,9 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +/target/ \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 00000000..a55e7a17 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000..7adcc25a --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..abac65f2 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 00000000..712ab9d9 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 00000000..d331e7f5 --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 00000000..5cc3c710 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..3effa83a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml new file mode 100644 index 00000000..b0c1c68f --- /dev/null +++ b/.idea/prettier.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 09032612..5b922e11 100644 --- a/README.md +++ b/README.md @@ -1,149 +1,162 @@ -## JaxRS + openAPI +Front ( dans un terminale ) : cd frontend / ng serve +Back ( un autre terminal ) : run-hsqldb-server.bat / show-hsqldb.sh / RestServer.java ( dans src / java et restserv) ) +Créer un service dans le front (rentrer dans front/service) : ng genere service service + +# Ticket Miagester + +Ce projet a été réalisé dans le cadre du cours de Systèmes d'Information Répartis (SIR), et a pour but de mettre en place une application web et mobile permettant aux utilisateurs d'acheter des tickets de concert en ligne. + +## Sommaire +1. [Prérequis](#prérequis) +2. [Installation et lancement](#Installation-et-lancement) +3. [Structure du projet](#structure-du-projet) + - [Arborescence](#arborescence) + - [Domain](#domain) + - [DAO](#dao) + - [Service](#service) + - [DTO](#dto) + - [Ressource](#ressource) + - [JPATest](#JPATEST) + - [Swagger](#swagger) +4. [Qualité du Code](#qualité-du-code) +5. [Configuration](#configuration) +6. [RestServer](#restserver) +7. [A venir](#a-venir) + +## Prérequis + Avant de bien démarrer l'ensemble du projet, assurez-vous les éléments suivants : + - [java 17+](https://www.oracle.com/java/technologies/javase-jdk17-downloads.html) + - [maven](https://maven.apache.org/download.cgi) + - Un IDE compatible (IntelliJ IDEA, Eclipse, VS Code, etc.) + +## Installation et lancement +Cloner le projet +```sh +git clone https://github.com/ChristianPeuffier/JaxRSOpenAPI.git +cd JaxRSOpenAPI +``` +Lancer la base de données +```sh +# Pour Windows +.\run-hsqldb-server.bat -1. Import this project in your IDE, -2. Start the database -3. Start the database viewer -4. Start the backend. There is a main class to start the backend +# Pour Linux et MacOS +./run-hsqldb-server.sh +``` +Pour afficher la base de données +```sh +# Pour Windows +.\show-hsqldb.bat +# Pour Linux et MacOS +./show-hsqldb.sh +``` +Lancer le serveur +Pour lancer le serveur, il suffit de lancer la classe +`RestServer.java`. Cela va démarrer le serveur sur le port **8080**. -# Task Open API Integration +## Structure du projet +### Arborescence +``` +. +├── src +│ ├── main +│ │ ├── java +│ │ │ ├── fr.istic.taa.jaxrs +│ │ │ │ ├── dao +│ │ │ │ ├── domain +│ │ │ │ ├── dto +│ │ │ │ ├── rest +│ │ │ │ ├── service +│ │ │ │ ├── uml +│ │ │ │ ├── JPATest.java +│ │ │ │ ├── RestServer.java +│ │ │ │ ├── TestApplication.java +│ │ ├── resources +│ │ ├── webapp +│ ├── pom.xml +│ ├── README.md +``` +### Domain -Now, we would like to ensure that our API can be discovered. The OpenAPI Initiative (OAI) was created by a consortium of forward-looking industry experts who recognize the immense value of standardizing on how REST APIs are described. As an open governance structure under the Linux Foundation, the OAI is focused on creating, evolving and promoting a vendor neutral description format. +Pour réaliser ce projet, nous avons d'abord commencé par créer le domain, qui regroupe toutes nos classes principales permettant de modéliser les différents objets : **Utilisateur, Organisateur, Administrateur, Evenement, Stats et Ticket**. -APIs form the connecting glue between modern applications. Nearly every application uses APIs to connect with corporate data sources, third party data services or other applications. Creating an open description format for API services that is vendor neutral, portable and open is critical to accelerating the vision of a truly connected world. +Chaque classe est une **entité** qui sera créée dans notre base de données. -To do this integration first, I already add a dependencies to openAPI libraries. +Les classes **Administrateur** et **Organisateur**, qui héritent d'**Utilisateur**, possèdent un `@DiscriminatorValue`. Elle permet d'indiquer, lors de la création d'un administrateur ou d'un organisateur, le type spécifique de l'utilisateur dans la colonne `type_utilisateur`. -```xml - - io.swagger.core.v3 - swagger-jaxrs2-jakarta - 2.2.15 - +Il y a également une énumération **StatutTicket** qui permet de définir les différents statuts d'un ticket. - - io.swagger.core.v3 - swagger-jaxrs2-servlet-initializer-v2 - 2.2.15 - -``` +### Dao -Next you have to add OpenAPI Resource to your application +Dans un second temps, nous avons poursuivi avec la mise en place des classes **DAO.** Elles permettent d’interagir avec la base de données et d’exécuter des opérations **CRUD** sur les entités. -Your application could be something like that. +Grâce à `extends AbstractJpaDao`, les classes bénéficient de la structure générique proposée par JPA qui permet d’effectuer des requêtes sans avoir à réécrire la logique et la persistance pour les requêtes de base, comme `find`, `findAll`, `save`, `update`, `delete`. -```java -@ApplicationPath("/") -public class RestApplication extends Application { +Créer ces classes nous permet également d’isoler la logique d’accès aux données et de séparer les responsabilités dans l'application. - @Override - public Set> getClasses() { - final Set> resources = new HashSet<>(); +### Service +Nos classes service nous permettent de centraliser la logique métier, ce qui nous permet de créer nos différents besoins pour poursuivre l’application. - // SWAGGER endpoints - resources.add(OpenApiResource.class); +Elles servent d’intermédiaire entre la couche DAO et la couche Ressource. - //Your own resources. - resources.add(PersonResource.class); -.... - return resources; - } -} -``` +### Dto -Next start your server, you must have your api description available at [http://localhost:8080/openapi.json](http://localhost:8080/openapi.json) +La couche DTO permet de restituer uniquement les données nécessaires, contrairement à la DAO, qui retourne l’intégralité des données de l’objet. -### Integrate Swagger UI. +Cela permet de limiter l’exposition de données sensibles et améliore la sécurité en évitant d’exposer directement la structure de la base de données. -Next we have to integrate Swagger UI. We will first download it. -https://github.com/swagger-api/swagger-ui +Les données renvoyées sont sous un format json. -Copy dist folder content in src/main/webapp/swagger in your project. +### Ressource -Edit index.html file to automatically load your openapi.json file. +Les classes ressource permettent d’interagir avec la partie web. Elles interagissent avec les classes services et les requêtes HTTP des clients. On utilise les méthodes des services pour récupérer les données souhaitées. -At the end of the index.html, your must have something like that. +### JPATest -```js - // Build a system - const ui = SwaggerUIBundle({ - url: "http://localhost:8080/openapi.json", - dom_id: '#swagger-ui', - - ... -``` +Dans cette classe, nous avons créé des utilisateurs, des événements, etc. Par la suite, si nous avons besoin de créer de nouveaux éléments, nous passerons par Swagger, pour des raisons de simplicité. -Next add a new resources to create a simple http server when your try to access to http://localhost:8080/api/. +### Swagger -This new resources can be developped as follows +Swagger est un outil qui permet de documenter les API REST. Il permet de générer une documentation à partir des annotations JAX-RS. Il est accessible à l'adresse suivante (après avoir lancé le serveur) : -```java -package app.web.rest; +http://localhost:8080/api/ -import java.io.IOException; -import java.nio.file.FileSystems; -import java.nio.file.Files; -import java.util.logging.Logger; +## Qualité du Code -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; +Dans le fichier `pom.xml`, nous avons ajouté plusieurs plugins de reporting pour assurer la qualité du code. Ces plugins incluent : -@Path("/api") -public class SwaggerResource { +- **maven-javadoc-plugin** : génère la documentation du code source. +- **maven-pmd-plugin** : détecte les erreurs potentielles et les mauvaises pratiques. +- **maven-checkstyle-plugin** : applique les règles de style de code. +- **maven-jxr-plugin** : facilite la navigation dans le code source. - private static final Logger logger = Logger.getLogger(SwaggerResource.class.getName()); +Pour générer les rapports, on utilise la commande `mvn clean sit`: - @GET - public byte[] Get1() { - try { - return Files.readAllBytes(FileSystems.getDefault().getPath("src/main/webapp/swagger/index.html")); - } catch (IOException e) { - return null; - } - } +On obtient le rapport sur la page html qui se trouve : `target/site/index.html`. - @GET - @Path("{path:.*}") - public byte[] Get(@PathParam("path") String path) { - try { - return Files.readAllBytes(FileSystems.getDefault().getPath("src/main/webapp/swagger/"+path)); - } catch (IOException e) { - return null; - } - } +## Configuration -} -``` +Elle permet de configurer les ressources de l’application. -Add this new resources in your application +L'annotation `@ApplicationPath("/")` définit le chemin racine de l'API, ce qui signifie que toutes les ressources seront accessibles à partir de l'URL de base du serveur. -```java -@ApplicationPath("/") -public class RestApplication extends Application { +Si on rajoute une classe, nous devons le spécifier ici. +Grâce à ça l’app peut gérer des requêtes REST et générer la documentation pour swagger. - @Override - public Set> getClasses() { - final Set> resources = new HashSet<>(); +## RestServer +La classe `RestServer` initialise et démarre un service sur le port **8080**. Elle déploie l'application `TestApplication`. - // SWAGGER endpoints - resources.add(OpenApiResource.class); - resources.add(PersonResource.class); - //NEW LINE TO ADD - resources.add(SwaggerResource.class); +## A venir - return resources; - } -} -``` +Pour le moment la structure globale du Back-End est en place, il reste à implémenter les fonctionnalités de l'application, telles que la gestion des utilisateurs, des événements, des tickets, etc. -Restart your server and access to http://localhost:8080/api/, you should access to a swagger ui instance that provides documentation on your api. +Dans l'idéal, il faudrait faire un premier jet du front pour pouvoir cibler les logiques métiers à implémenter. -You can follow this guide to show how you can specialise the documentation through annotations. +Il faudrait également ajouter des tests unitaires pour garantir le bon fonctionnement de l'application. -https://github.com/swagger-api/swagger-samples/blob/2.0/java/java-resteasy-appclasses/src/main/java/io/swagger/sample/resource/PetResource.java \ No newline at end of file diff --git a/data/test 2.lck b/data/test 2.lck new file mode 100644 index 00000000..6cb39543 Binary files /dev/null and b/data/test 2.lck differ diff --git a/data/test 2.log b/data/test 2.log new file mode 100644 index 00000000..ef240a0e --- /dev/null +++ b/data/test 2.log @@ -0,0 +1,39 @@ +/*C24*/SET SCHEMA PUBLIC +INSERT INTO TICKET VALUES('2025-04-04',1402,952,13.0E0,602,'ACHETE') +ALTER SEQUENCE PUBLIC.TICKET_SEQ RESTART WITH 1051 +COMMIT +/*C25*/SET SCHEMA PUBLIC +DISCONNECT +/*C24*/DISCONNECT +/*C26*/SET SCHEMA PUBLIC +INSERT INTO TICKET VALUES('2025-04-04',1402,1002,13.0E0,602,'ACHETE') +ALTER SEQUENCE PUBLIC.TICKET_SEQ RESTART WITH 1101 +COMMIT +DISCONNECT +/*C27*/SET SCHEMA PUBLIC +INSERT INTO TICKET VALUES('2025-04-04',1402,1052,13.0E0,602,'ACHETE') +ALTER SEQUENCE PUBLIC.TICKET_SEQ RESTART WITH 1151 +COMMIT +INSERT INTO TICKET VALUES('2025-04-04',1402,1053,13.0E0,602,'ACHETE') +COMMIT +DISCONNECT +/*C28*/SET SCHEMA PUBLIC +DISCONNECT +/*C29*/SET SCHEMA PUBLIC +DISCONNECT +/*C30*/SET SCHEMA PUBLIC +DISCONNECT +/*C32*/SET SCHEMA PUBLIC +DISCONNECT +/*C31*/SET SCHEMA PUBLIC +DISCONNECT +/*C33*/SET SCHEMA PUBLIC +DISCONNECT +/*C34*/SET SCHEMA PUBLIC +DISCONNECT +/*C35*/SET SCHEMA PUBLIC +DISCONNECT +/*C36*/SET SCHEMA PUBLIC +DISCONNECT +/*C23*/SET SCHEMA PUBLIC +DISCONNECT diff --git a/data/test.lck b/data/test.lck new file mode 100644 index 00000000..61486725 Binary files /dev/null and b/data/test.lck differ diff --git a/data/test.log b/data/test.log new file mode 100644 index 00000000..e69de29b diff --git a/data/test.properties b/data/test.properties new file mode 100644 index 00000000..987eaad3 --- /dev/null +++ b/data/test.properties @@ -0,0 +1,5 @@ +#HSQL Database Engine 2.7.2 +#Sun Apr 27 14:03:18 CEST 2025 +tx_timestamp=3855 +modified=no +version=2.7.2 diff --git a/data/test.script b/data/test.script new file mode 100644 index 00000000..a175a1c5 --- /dev/null +++ b/data/test.script @@ -0,0 +1,64 @@ +SET DATABASE UNIQUE NAME HSQLDB94EAC6DC3D +SET DATABASE DEFAULT RESULT MEMORY ROWS 0 +SET DATABASE EVENT LOG LEVEL 0 +SET DATABASE TRANSACTION CONTROL LOCKS +SET DATABASE DEFAULT ISOLATION LEVEL READ COMMITTED +SET DATABASE TRANSACTION ROLLBACK ON CONFLICT TRUE +SET DATABASE TEXT TABLE DEFAULTS '' +SET DATABASE SQL NAMES FALSE +SET DATABASE SQL RESTRICT EXEC FALSE +SET DATABASE SQL REFERENCES FALSE +SET DATABASE SQL SIZE TRUE +SET DATABASE SQL TYPES FALSE +SET DATABASE SQL TDC DELETE TRUE +SET DATABASE SQL TDC UPDATE TRUE +SET DATABASE SQL SYS INDEX NAMES TRUE +SET DATABASE SQL CONCAT NULLS TRUE +SET DATABASE SQL UNIQUE NULLS TRUE +SET DATABASE SQL CONVERT TRUNCATE TRUE +SET DATABASE SQL AVG SCALE 0 +SET DATABASE SQL DOUBLE NAN TRUE +SET FILES WRITE DELAY 500 MILLIS +SET FILES BACKUP INCREMENT TRUE +SET FILES CACHE SIZE 10000 +SET FILES CACHE ROWS 50000 +SET FILES SCALE 32 +SET FILES LOB SCALE 32 +SET FILES DEFRAG 0 +SET FILES NIO TRUE +SET FILES NIO SIZE 256 +SET FILES LOG TRUE +SET FILES LOG SIZE 50 +SET FILES CHECK 3855 +SET DATABASE COLLATION "SQL_TEXT" PAD SPACE +CREATE USER SA PASSWORD DIGEST 'd41d8cd98f00b204e9800998ecf8427e' +ALTER USER SA SET LOCAL TRUE +CREATE SCHEMA PUBLIC AUTHORIZATION DBA +CREATE SEQUENCE PUBLIC.EVENEMENT_SEQ AS INTEGER START WITH 1 INCREMENT BY 50 +CREATE SEQUENCE PUBLIC.STATS_SEQ AS INTEGER START WITH 1 INCREMENT BY 50 +CREATE SEQUENCE PUBLIC.TICKET_SEQ AS INTEGER START WITH 1 INCREMENT BY 50 +CREATE SEQUENCE PUBLIC.UTILISATEUR_SEQ AS INTEGER START WITH 1 INCREMENT BY 50 +CREATE MEMORY TABLE PUBLIC.UTILISATEUR(ID BIGINT NOT NULL PRIMARY KEY,TYPE_UTILISATEUR VARCHAR(31) NOT NULL,EMAIL VARCHAR(100),NOM VARCHAR(100),PASSWORD VARCHAR(100),PRENOM VARCHAR(100)) +CREATE MEMORY TABLE PUBLIC.EVENEMENT(DATE DATE,ID INTEGER NOT NULL PRIMARY KEY,NBMAX INTEGER,NBSOLD INTEGER,PRICE DOUBLE,ORGANISATEUR_ID BIGINT,ARTISTE VARCHAR(100),GENRE VARCHAR(100),NOM VARCHAR(100),DESCRIPTION VARCHAR(1000),LIEU VARCHAR(255),CONSTRAINT FKJH9V630RXBSDFLEX9IJ94RJAI FOREIGN KEY(ORGANISATEUR_ID) REFERENCES PUBLIC.UTILISATEUR(ID)) +CREATE MEMORY TABLE PUBLIC.STATS(EVENEMENT_ID INTEGER,ID INTEGER NOT NULL PRIMARY KEY,CONSTRAINT FKNX30P674YASIT6I7549EJSUQF FOREIGN KEY(EVENEMENT_ID) REFERENCES PUBLIC.EVENEMENT(ID)) +CREATE MEMORY TABLE PUBLIC.TICKET(DATEACHAT DATE,EVENEMENT_ID INTEGER,ID INTEGER NOT NULL PRIMARY KEY,PRIX DOUBLE,UTILISATEUR_ID BIGINT,STATUT VARCHAR(100),CHECK((PUBLIC.TICKET.STATUT) IN (('ACHETE'),('ANNULE'),('REMBOURSE'),('RESERVE'))),CONSTRAINT FK4L049KQ87R4DHKY2RIJK4R0F5 FOREIGN KEY(EVENEMENT_ID) REFERENCES PUBLIC.EVENEMENT(ID),CONSTRAINT FKR6P65RATY6L8VRFSSXRDOLNEE FOREIGN KEY(UTILISATEUR_ID) REFERENCES PUBLIC.UTILISATEUR(ID)) +ALTER SEQUENCE SYSTEM_LOBS.LOB_ID RESTART WITH 1 +ALTER SEQUENCE PUBLIC.EVENEMENT_SEQ RESTART WITH 2001 +ALTER SEQUENCE PUBLIC.STATS_SEQ RESTART WITH 1 +ALTER SEQUENCE PUBLIC.TICKET_SEQ RESTART WITH 1701 +ALTER SEQUENCE PUBLIC.UTILISATEUR_SEQ RESTART WITH 1351 +SET DATABASE DEFAULT INITIAL SCHEMA PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CARDINAL_NUMBER TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.YES_OR_NO TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CHARACTER_DATA TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.SQL_IDENTIFIER TO PUBLIC +GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.TIME_STAMP TO PUBLIC +GRANT DBA TO SA +SET SCHEMA SYSTEM_LOBS +INSERT INTO BLOCKS VALUES(0,2147483647,0) +SET SCHEMA PUBLIC +INSERT INTO UTILISATEUR VALUES(1153,'administrateur','admin@admin.com','admin','$2a$12$z/vqt0YCnnwbm6xBmOaoH.8s6nJlLICJpy/CEyRpvvbC29mdv714S','admin') +INSERT INTO UTILISATEUR VALUES(1252,'organisateur','organisateur@organisateur.com','Organisateur','$2a$12$RNXsnsOCyTUgho6Agly9wO5tn2fbNDCmPTrEY8AO2qxe0DizDCxQi','Organisateur') +INSERT INTO EVENEMENT VALUES('2025-05-31',1902,500,500,40.0E0,1252,'Soprano','Hip-hop','Soprano Freedom Tour','Apr\u00e8s sa folle tourn\u00e9e "Chasseur d''\u00e9toiles" qui l''aura men\u00e9 jusqu''au Stade de France, Soprano revient en 2025 avec le Freedom tour dans toute la France. ','Stade Pierre Mauroy, Villeneuve d''Ascq') +INSERT INTO EVENEMENT VALUES('2026-03-18',1903,650,650,62.0E0,1252,'Florent Pagny','Pop','Florent Pagny, Le retour','Florent Pagny fera son grand retour en 2026 avec une tourn\u00e9e exceptionnelle.\u000aIl revient pr\u00eat \u00e0 partager des moments forts avec son public, o\u00f9 il interpr\u00e9tera tous ses tubes. \u000aC\u2019est \u00e0 partir du mois de janvier que Florent Pagny parcourra les villes de France, Suisse et Belgique lors de s\u00e9ries de concerts exclusifs, avant de pousser les portes de l\u2019Olympia et s\u2019y installer en juin et juillet 2026 pour une r\u00e9sidence in\u00e9dite.\u000a \u000aRendez-vous dans toute la France, en Suisse et en Belgique d\u00e8s janvier 2026.','LDLC Arena, Decines Charpieu') +INSERT INTO EVENEMENT VALUES('2025-04-26',1904,200,200,39.0E0,1252,'Big Ocean','Rock, Pop, Folk','Big Ocean - Underwater','BIG OCEAN n''est pas seulement une nouvelle sensation K-pop - c''est un trio r\u00e9volutionnaire qui prouve que la musique n''a pas de barri\u00e8res. En tant que premier groupe de K-pop malentendant au monde, ils chantent, dansent et captivent le public comme n''importe quels autres idols de premier plan, mais avec une inspiration singuli\u00e8re. Ils nous rappellent ce que cela signifie d\u2019\u00e9couter de la musique : un rythme que l\u2019on entend, mais aussi que l\u2019on voit, ressent et vit.','Caf\u00e9 de la danse, Paris') diff --git a/hsqldb-2.7.2.jar b/hsqldb-2.7.2.jar new file mode 100644 index 00000000..13387392 Binary files /dev/null and b/hsqldb-2.7.2.jar differ diff --git a/pom.xml b/pom.xml index 1b1c1ebe..124eb4fe 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 fr.istic.taa - jaxrs-example + BackConcert jar 1.0-SNAPSHOT jaxrs-example @@ -53,6 +53,9 @@ + + + @@ -83,7 +86,40 @@ swagger-jaxrs2-servlet-initializer-v2 2.2.15 - + + org.webjars + swagger-ui + 4.15.5 + + + org.mindrot + jbcrypt + 0.4 + + + + io.jsonwebtoken + jjwt-api + 0.12.6 + + + io.jsonwebtoken + jjwt-impl + 0.12.6 + runtime + + + io.jsonwebtoken + jjwt-jackson + 0.12.6 + runtime + + + + com.itextpdf + itextpdf + 5.5.13.4 + install @@ -97,7 +133,41 @@ 11 - + + org.apache.maven.plugins + maven-site-plugin + 3.9.1 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.1 + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-jxr-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-pmd-plugin + 3.14.0 + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.1.1 + + + diff --git a/show-hsqldb.bat b/show-hsqldb.bat index 3bf6df25..1e1c01b4 100644 --- a/show-hsqldb.bat +++ b/show-hsqldb.bat @@ -1,2 +1,2 @@ -java -cp ./target/dependency/hsqldb-2.7.2.jar org.hsqldb.util.DatabaseManagerSwing --driver org.hsqldb.jdbcDriver --url jdbc:hsqldb:hsql://localhost/ --user SA +java -cp hsqldb-2.7.2.jar org.hsqldb.util.DatabaseManagerSwing --driver org.hsqldb.jdbcDriver --url jdbc:hsqldb:hsql://localhost/ --user SA diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 00000000..7c451b87 Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/main/.DS_Store b/src/main/.DS_Store new file mode 100644 index 00000000..a66cd56d Binary files /dev/null and b/src/main/.DS_Store differ diff --git a/src/main/java/.DS_Store b/src/main/java/.DS_Store new file mode 100644 index 00000000..d7e14394 Binary files /dev/null and b/src/main/java/.DS_Store differ diff --git a/src/main/java/fr/.DS_Store b/src/main/java/fr/.DS_Store new file mode 100644 index 00000000..0efb9081 Binary files /dev/null and b/src/main/java/fr/.DS_Store differ diff --git a/src/main/java/fr/istic/.DS_Store b/src/main/java/fr/istic/.DS_Store new file mode 100644 index 00000000..c5b8c259 Binary files /dev/null and b/src/main/java/fr/istic/.DS_Store differ diff --git a/src/main/java/fr/istic/taa/.DS_Store b/src/main/java/fr/istic/taa/.DS_Store new file mode 100644 index 00000000..fa333c21 Binary files /dev/null and b/src/main/java/fr/istic/taa/.DS_Store differ diff --git a/src/main/java/fr/istic/taa/jaxrs/.DS_Store b/src/main/java/fr/istic/taa/jaxrs/.DS_Store new file mode 100644 index 00000000..db1a0858 Binary files /dev/null and b/src/main/java/fr/istic/taa/jaxrs/.DS_Store differ diff --git a/src/main/java/fr/istic/taa/jaxrs/JpaTest.java b/src/main/java/fr/istic/taa/jaxrs/JpaTest.java new file mode 100644 index 00000000..057f8824 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/JpaTest.java @@ -0,0 +1,38 @@ +package fr.istic.taa.jaxrs; + +import fr.istic.taa.jaxrs.dao.business.EvenementDAO; +import fr.istic.taa.jaxrs.dao.business.OrganisateurDAO; +import fr.istic.taa.jaxrs.dao.business.UtilisateurDAO; +import fr.istic.taa.jaxrs.dao.generic.EntityManagerHelper; +import fr.istic.taa.jaxrs.domain.Evenement; +import fr.istic.taa.jaxrs.domain.Organisateur; +import fr.istic.taa.jaxrs.domain.Utilisateur; + +import java.sql.Date; +import java.time.ZonedDateTime; + +public final class JpaTest { + + /** + * constructor. + **/ + private JpaTest() { + } + + /** + * @param args the command line arguments + **/ + public static void main(final String[] args) { + + try { + + + + } catch (Exception e) { + e.printStackTrace(); + } + + EntityManagerHelper.closeEntityManagerFactory(); + System.out.println(".. done"); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/RestServer.java b/src/main/java/fr/istic/taa/jaxrs/RestServer.java index d2eeaeb6..121030f7 100644 --- a/src/main/java/fr/istic/taa/jaxrs/RestServer.java +++ b/src/main/java/fr/istic/taa/jaxrs/RestServer.java @@ -6,27 +6,40 @@ import java.util.logging.Logger; /** - * RESTfull microservice, based on JAX-RS and JBoss Undertow - * - */ -public class RestServer { + * RESTfull microservice, based on JAX-RS and JBoss Undertow. + * */ +public final class +RestServer { - private static final Logger logger = Logger.getLogger(RestServer.class.getName()); + private RestServer() { + throw new UnsupportedOperationException("No RestServer instances for you!"); + } + + /** + * Logger. + */ + private static final Logger LOGGER = Logger.getLogger(RestServer.class.getName()); - public static void main( String[] args ) { + /** + * Main method. + * @param args Command line arguments. + */ + public static void main(final String[] args) { UndertowJaxrsServer ut = new UndertowJaxrsServer(); TestApplication ta = new TestApplication(); + final int port = 8080; + ut.deploy(ta); ut.start( Undertow.builder() - .addHttpListener(8080, "localhost") + .addHttpListener(port, "localhost") ); - logger.info("JAX-RS based micro-service running!"); + LOGGER.info("JAX-RS based micro-service running!"); } } diff --git a/src/main/java/fr/istic/taa/jaxrs/TestApplication.java b/src/main/java/fr/istic/taa/jaxrs/TestApplication.java index c479dad0..51302da8 100644 --- a/src/main/java/fr/istic/taa/jaxrs/TestApplication.java +++ b/src/main/java/fr/istic/taa/jaxrs/TestApplication.java @@ -19,24 +19,33 @@ import java.util.HashSet; import java.util.Set; -import fr.istic.taa.jaxrs.rest.PetResource; +import fr.istic.taa.jaxrs.rest.*; +import fr.istic.taa.jaxrs.utils.JwtFilter; +import io.swagger.v3.jaxrs2.integration.resources.AcceptHeaderOpenApiResource; import io.swagger.v3.jaxrs2.integration.resources.OpenApiResource; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Info; import jakarta.ws.rs.ApplicationPath; import jakarta.ws.rs.core.Application; @ApplicationPath("/") -public class TestApplication extends Application { - +@OpenAPIDefinition(info = @Info(title = "Evenement API", version = "1.0", description = "Evenement API")) +public final class TestApplication extends Application { @Override public Set> getClasses() { - final Set> clazzes = new HashSet>(); - + final Set> clazzes = new HashSet<>(); + clazzes.add(SwaggerResource.class); clazzes.add(OpenApiResource.class); - clazzes.add(PetResource.class); -// clazzes.add(AcceptHeaderOpenApiResource.class); - + clazzes.add(AcceptHeaderOpenApiResource.class); + clazzes.add(UtilisateurRessource.class); + clazzes.add(EvenementRessources.class); + clazzes.add(OrganisateurRessources.class); + clazzes.add(TicketRessources.class); + clazzes.add(CorsFilter.class); + clazzes.add(JwtFilter.class); + return clazzes; } diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/business/AdministrateurDAO.java b/src/main/java/fr/istic/taa/jaxrs/dao/business/AdministrateurDAO.java new file mode 100644 index 00000000..1ba9c053 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dao/business/AdministrateurDAO.java @@ -0,0 +1,14 @@ +package fr.istic.taa.jaxrs.dao.business; + +import fr.istic.taa.jaxrs.dao.generic.AbstractJpaDao; +import fr.istic.taa.jaxrs.domain.Administrateur; + +public class AdministrateurDAO extends AbstractJpaDao { + + /** + * Constructor. + */ + public AdministrateurDAO() { + super(Administrateur.class); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/business/EvenementDAO.java b/src/main/java/fr/istic/taa/jaxrs/dao/business/EvenementDAO.java new file mode 100644 index 00000000..c01cd6ad --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dao/business/EvenementDAO.java @@ -0,0 +1,44 @@ +package fr.istic.taa.jaxrs.dao.business; + + +import fr.istic.taa.jaxrs.dao.generic.AbstractJpaDao; +import fr.istic.taa.jaxrs.domain.Evenement; +import fr.istic.taa.jaxrs.domain.Ticket; +import fr.istic.taa.jaxrs.domain.Utilisateur; +import jakarta.persistence.EntityManager; + +import java.util.List; + +public class EvenementDAO extends AbstractJpaDao { + + /** + * Constructor. + */ + public EvenementDAO() { + super(Evenement.class); + } + + /** + * Update nbSold. + */ + public void updateNbSold(final Evenement evenement, final int nbBuy) { + EntityManager em = getEntityManager(); + em.getTransaction().begin(); + em.createQuery( "update Evenement e set e.nbSold = e.nbSold - :nbBuy where e.id = :id") + .setParameter("nbBuy", nbBuy) + .setParameter("id", evenement.getId()) + .executeUpdate(); + em.getTransaction().commit(); + } + + /** + * Get all Evenements from the database. + * @return the created Evenement + */ + public List findByOrganisateurId(Long id) { + EntityManager em = getEntityManager(); + return em.createQuery("select e from Evenement e where e.organisateur.id = :id", Evenement.class) + .setParameter("id", id) + .getResultList(); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/business/OrganisateurDAO.java b/src/main/java/fr/istic/taa/jaxrs/dao/business/OrganisateurDAO.java new file mode 100644 index 00000000..87c92ce9 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dao/business/OrganisateurDAO.java @@ -0,0 +1,15 @@ +package fr.istic.taa.jaxrs.dao.business; + +import fr.istic.taa.jaxrs.dao.generic.AbstractJpaDao; +import fr.istic.taa.jaxrs.domain.Organisateur; + + +public class OrganisateurDAO extends AbstractJpaDao { + + /** + * Constructor. + */ + public OrganisateurDAO() { + super(Organisateur.class); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/business/StatsDAO.java b/src/main/java/fr/istic/taa/jaxrs/dao/business/StatsDAO.java new file mode 100644 index 00000000..1944805c --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dao/business/StatsDAO.java @@ -0,0 +1,18 @@ +package fr.istic.taa.jaxrs.dao.business; + +import fr.istic.taa.jaxrs.dao.generic.AbstractJpaDao; +import fr.istic.taa.jaxrs.domain.Stats; + + + + +public class StatsDAO extends AbstractJpaDao { + + /** + * Constructor. + */ + public StatsDAO() { + super(Stats.class); + } + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/business/TicketDAO.java b/src/main/java/fr/istic/taa/jaxrs/dao/business/TicketDAO.java new file mode 100644 index 00000000..28bf49ad --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dao/business/TicketDAO.java @@ -0,0 +1,43 @@ +package fr.istic.taa.jaxrs.dao.business; + +import fr.istic.taa.jaxrs.dao.generic.AbstractJpaDao; +import fr.istic.taa.jaxrs.domain.Ticket; +import fr.istic.taa.jaxrs.domain.Utilisateur; +import jakarta.persistence.EntityManager; + +import java.util.List; + +public class TicketDAO extends AbstractJpaDao { + + /** + * Constructor. + */ + public TicketDAO() { + super(Ticket.class); + } + + /** + * Find ticket by user id. + * @param userId user id + * @return List of Ticket + */ + public List findByUserId(final Long userId) { + EntityManager em = getEntityManager(); + return em.createQuery("select t from Ticket t where t.utilisateur.id = :userId", Ticket.class) + .setParameter("userId", userId) + .getResultList(); + } + + /** + * Update user id. + * @param ticket ticket + * @param userId user id + */ + public void updateUserId(final Ticket ticket, final Long userId) { + EntityManager em = getEntityManager(); + em.getTransaction().begin(); + ticket.setUtilisateur(em.find(Utilisateur.class, userId)); + em.merge(ticket); + em.getTransaction().commit(); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/business/UtilisateurDAO.java b/src/main/java/fr/istic/taa/jaxrs/dao/business/UtilisateurDAO.java new file mode 100644 index 00000000..9b19b916 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dao/business/UtilisateurDAO.java @@ -0,0 +1,56 @@ +package fr.istic.taa.jaxrs.dao.business; + + +import fr.istic.taa.jaxrs.dao.generic.AbstractJpaDao; +import fr.istic.taa.jaxrs.domain.Utilisateur; +import jakarta.persistence.EntityManager; + +public class UtilisateurDAO extends AbstractJpaDao { + + + /** + * Constructor. + */ + public UtilisateurDAO() { + super(Utilisateur.class); + } + + /** + * Check if an email exist. + * @param email the email to check + * @return true if the email exist, false otherwise + */ + public boolean emailExist(String email) { + EntityManager em = getEntityManager(); + return !em.createQuery("select u from Utilisateur u where u.email = :email", Utilisateur.class) + .setParameter("email", email) + .getResultList().isEmpty(); + } + + /** + * Find an Utilisateur by its email. + * @param email the email of the Utilisateur + * @return the Utilisateur + */ + public Utilisateur findByEmail(String email) { + EntityManager em = getEntityManager(); + return em.createQuery("select u from Utilisateur u where u.email = :email", Utilisateur.class) + .setParameter("email", email) + .getSingleResult(); + } + + /** + * Update the role of an Utilisateur. + * @param utilisateur the Utilisateur to update + */ + public void updateUtilisateur(Utilisateur utilisateur) { + EntityManager em = getEntityManager(); + em.getTransaction().begin(); + em.createQuery("update Utilisateur u set u.typeUtilisateur = :role where u.id = :id") + .setParameter("role", utilisateur.getTypeUtilisateur()) + .setParameter("id", utilisateur.getId()) + .executeUpdate(); + em.getTransaction().commit(); + } + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/business/package-info.java b/src/main/java/fr/istic/taa/jaxrs/dao/business/package-info.java new file mode 100644 index 00000000..bfe6a038 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dao/business/package-info.java @@ -0,0 +1,4 @@ +/** + * Package for business DAOs. + */ +package fr.istic.taa.jaxrs.dao.business; diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/generic/AbstractJpaDao.java b/src/main/java/fr/istic/taa/jaxrs/dao/generic/AbstractJpaDao.java index 6adb209c..e0f54dd6 100644 --- a/src/main/java/fr/istic/taa/jaxrs/dao/generic/AbstractJpaDao.java +++ b/src/main/java/fr/istic/taa/jaxrs/dao/generic/AbstractJpaDao.java @@ -8,53 +8,95 @@ public abstract class AbstractJpaDao implements IGenericDao { - private Class clazz; - - protected EntityManager entityManager; - - public AbstractJpaDao() { - this.entityManager = EntityManagerHelper.getEntityManager(); - } - - public void setClazz(Class clazzToSet) { - this.clazz = clazzToSet; - } - - public T findOne(K id) { - return entityManager.find(clazz, id); - } - - public List findAll() { - return entityManager.createQuery("select e from " + clazz.getName() + " as e",clazz).getResultList(); - } - - public void save(T entity) { - EntityTransaction t = this.entityManager.getTransaction(); - t.begin(); - entityManager.persist(entity); - t.commit(); - - } - - public T update(final T entity) { - EntityTransaction t = this.entityManager.getTransaction(); - t.begin(); - T res = entityManager.merge(entity); - t.commit(); - return res; - - } - - public void delete(T entity) { - EntityTransaction t = this.entityManager.getTransaction(); - t.begin(); - entityManager.remove(entity); - t.commit(); - - } - - public void deleteById(K entityId) { - T entity = findOne(entityId); - delete(entity); - } + /** + * The class of the entity. + */ + private Class clazz; + + /** + * The entity manager. + */ + private final EntityManager entityManager; + + /** + * Constructor. + * @param clazs the class of the entity + */ + protected AbstractJpaDao(final Class clazs) { + this.entityManager = EntityManagerHelper.getEntityManager(); + this.clazz = clazs; + } + + /** + * Set the class of the entity to set. + * @param clazzToSet the class of the entity to set + */ + public void setClazz(final Class clazzToSet) { + this.clazz = clazzToSet; + } + + /** + * Find an entity by its id. + * @param id the id of the entity + * @return the entity of type T + */ + public T findOne(final K id) { + return entityManager.find(clazz, id); + } + + /** + * Find all entities. + * @return a list of entities of type T + */ + public List findAll() { + return entityManager.createQuery("select e from " + clazz.getName() + " as e", clazz).getResultList(); + } + + /** + * Save an entity. + * @param entity the entity to save + */ + public void save(final T entity) { + EntityTransaction t = this.entityManager.getTransaction(); + t.begin(); + entityManager.persist(entity); + t.commit(); + } + + /** + * Update an entity. + * @param entity the entity to update + * @return the updated entity + */ + public T update(final T entity) { + EntityTransaction t = this.entityManager.getTransaction(); + t.begin(); + T res = entityManager.merge(entity); + t.commit(); + return res; + } + + /** + * Delete an entity. + * @param entity the entity to delete + */ + public void delete(final T entity) { + EntityTransaction t = this.entityManager.getTransaction(); + t.begin(); + entityManager.remove(entity); + t.commit(); + } + + /** + * Delete an entity by its id. + * @param entityId the id of the entity to delete + */ + public void deleteById(final K entityId) { + T entity = findOne(entityId); + delete(entity); + } + + public EntityManager getEntityManager() { + return entityManager; + } } diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/generic/EntityManagerHelper.java b/src/main/java/fr/istic/taa/jaxrs/dao/generic/EntityManagerHelper.java index a9950dc2..6b370a12 100644 --- a/src/main/java/fr/istic/taa/jaxrs/dao/generic/EntityManagerHelper.java +++ b/src/main/java/fr/istic/taa/jaxrs/dao/generic/EntityManagerHelper.java @@ -4,47 +4,77 @@ import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.Persistence; -public class EntityManagerHelper { - - private static final EntityManagerFactory emf; - private static final ThreadLocal threadLocal; - - static { - emf = Persistence.createEntityManagerFactory("dev"); - threadLocal = new ThreadLocal(); - } - - public static EntityManager getEntityManager() { - EntityManager em = threadLocal.get(); - - if (em == null) { - em = emf.createEntityManager(); - threadLocal.set(em); - } - return em; - } - - public static void closeEntityManager() { - EntityManager em = threadLocal.get(); - if (em != null) { - em.close(); - threadLocal.set(null); - } - } - - public static void closeEntityManagerFactory() { - emf.close(); - } - - public static void beginTransaction() { - getEntityManager().getTransaction().begin(); - } - - public static void rollback() { - getEntityManager().getTransaction().rollback(); - } - - public static void commit() { - getEntityManager().getTransaction().commit(); - } -} \ No newline at end of file +public final class EntityManagerHelper { + + /** + * EntityManagerFactory. + */ + private static final EntityManagerFactory EMF; + + /** + * ThreadLocal EntityManager. + */ + private static final ThreadLocal THREADLOCAL; + + static { + EMF = Persistence.createEntityManagerFactory("dev"); + THREADLOCAL = new ThreadLocal<>(); + } + + private EntityManagerHelper() { + + } + + /** + * Function to get EntityManager. + * @return EntityManager + */ + static EntityManager getEntityManager() { + EntityManager em = THREADLOCAL.get(); + + if (em == null) { + em = EMF.createEntityManager(); + THREADLOCAL.set(em); + } + return em; + } + + /** + * Function to close EntityManager. + */ + public static void closeEntityManager() { + EntityManager em = THREADLOCAL.get(); + if (em != null) { + em.close(); + THREADLOCAL.remove(); + } + } + + /** + * Function to close EntityManagerFactory. + */ + public static void closeEntityManagerFactory() { + EMF.close(); + } + + /** + * Function to begin transaction. + */ + public static void beginTransaction() { + getEntityManager().getTransaction().begin(); + } + + /** + * Function to commit transaction. + */ + public static void rollback() { + getEntityManager().getTransaction().rollback(); + } + + /** + * Function to commit transaction. + */ + public static void commit() { + getEntityManager().getTransaction().commit(); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/generic/IGenericDao.java b/src/main/java/fr/istic/taa/jaxrs/dao/generic/IGenericDao.java index a19037fd..54e497f0 100644 --- a/src/main/java/fr/istic/taa/jaxrs/dao/generic/IGenericDao.java +++ b/src/main/java/fr/istic/taa/jaxrs/dao/generic/IGenericDao.java @@ -4,16 +4,42 @@ import java.util.List; public interface IGenericDao { - - T findOne(final K id); - + + /** + * Find an entity by its primary key. + * @param id the primary key + * @return the entity + */ + T findOne(K id); + + /** + * Find all entities. + * @return a list of entities + */ List findAll(); - - void save(final T entity); - - T update(final T entity); - - void delete(final T entity); - - void deleteById(final K entityId); -} \ No newline at end of file + + /** + * Save an entity. + * @param entity the entity to save + */ + void save(T entity); + + /** + * Update an entity. + * @param entity the entity to update + * @return the updated entity + */ + T update(T entity); + + /** + * Delete an entity. + * @param entity the entity to delete + */ + void delete(T entity); + + /** + * Delete an entity by its primary key. + * @param entityId the primary key + */ + void deleteById(K entityId); +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dao/generic/package-info.java b/src/main/java/fr/istic/taa/jaxrs/dao/generic/package-info.java new file mode 100644 index 00000000..6cb7d948 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dao/generic/package-info.java @@ -0,0 +1,4 @@ +/** + * Package for generic DAOs. + */ +package fr.istic.taa.jaxrs.dao.generic; diff --git a/src/main/java/fr/istic/taa/jaxrs/domain/Administrateur.java b/src/main/java/fr/istic/taa/jaxrs/domain/Administrateur.java new file mode 100644 index 00000000..4f6bad56 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/domain/Administrateur.java @@ -0,0 +1,18 @@ +package fr.istic.taa.jaxrs.domain; + +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; + +import java.io.Serializable; + +@Entity +@DiscriminatorValue("administrateur") +public class Administrateur extends Utilisateur implements Serializable { + + /** + * Constructor. + */ + public Administrateur() { + super(); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/domain/Evenement.java b/src/main/java/fr/istic/taa/jaxrs/domain/Evenement.java new file mode 100644 index 00000000..070e17b0 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/domain/Evenement.java @@ -0,0 +1,270 @@ +package fr.istic.taa.jaxrs.domain; + +import jakarta.persistence.*; + +import java.io.Serializable; +import java.sql.Date; + +@Entity +@Table(name = "evenement") +public class Evenement implements Serializable { + + /** + * The maximum length for Columns in database. + */ + private static final int MAX_LENGTH = 100; + + /** + * The maximum length for Description Column in database. + */ + private static final int MAX_LENGTH_DESCRIPTION = 1000; + + /** + * The id attribute as an int. + */ + @Id + @GeneratedValue + private int id; + + /** + * The nom attribute as a String. + */ + @Column(length = MAX_LENGTH, name = "nom") + private String nom; + + /** + * The date attribute as a Date. + */ + @Temporal(TemporalType.DATE) + private Date date; + + /** + * The lieu attribute as a String. + */ + @Column(name = "lieu") + private String lieu; + + /** + * The description attribute as a String. + */ + @Column(length = MAX_LENGTH_DESCRIPTION, name = "description") + private String description; + + /** + * The organisateur attribute as an Organisateur. + */ + @ManyToOne + @JoinColumn(name = "organisateur_id") + private Organisateur organisateur; + + /** + * The artiste attribute as a String. + */ + @Column(length = MAX_LENGTH, name = "artiste") + private String artiste; + + /** + * The genre attribute as a String. + */ + @Column(length = MAX_LENGTH, name = "genre") + private String genre; + + /** + * Price of the event. + */ + @Column(length = MAX_LENGTH,name = "price") + private double price; + + /** + * Number of tickets maximum. + */ + @Column(length = MAX_LENGTH,name = "nbMax") + private int nbMax; + + /** + * Number of tickets sold. + */ + @Column(length = MAX_LENGTH,name = "nbSold") + private int nbSold; + + /** + * Getter for the id attribute. + * + * @return the id attribute as an int. + */ + public long getId() { + return id; + } + + /** + * Setter for the id attribute. + * @param paramId the id attribute to set. + */ + public void setId(final int paramId) { + this.id = paramId; + } + + /** + * Getter for the nom attribute. + * @return the nom attribute as a String. + */ + public String getNom() { + return nom; + } + + /** + * Setter for the nom attribute. + * @param paramNom the nom attribute to set. + */ + public void setNom(final String paramNom) { + this.nom = paramNom; + } + + /** + * Getter for the date attribute. + * @return the date attribute as a Date. + */ + public Date getDate() { + return date; + } + + /** + * Setter for the date attribute. + * @param paramDate the date attribute to set. + */ + public void setDate(final Date paramDate) { + this.date = paramDate; + } + + /** + * Getter for the lieu attribute. + * @return the lieu attribute as a String. + */ + public String getLieu() { + return lieu; + } + + /** + * Setter for the lieu attribute. + * @param paramLieu the lieu attribute to set. + */ + public void setLieu(final String paramLieu) { + this.lieu = paramLieu; + } + + /** + * Getter for the description attribute. + * @return the description attribute as a String. + */ + public String getDescription() { + return description; + } + + /** + * Setter for the description attribute. + * @param paramDescription the description attribute to set. + */ + public void setDescription(final String paramDescription) { + this.description = paramDescription; + } + + /** + * Getter for the organisateur attribute. + * @return the organisateur attribute as an Organisateur. + */ + public Organisateur getOrganisateur() { + return organisateur; + } + + /** + * Setter for the organisateur attribute. + * @param paramOrganisateur the organisateur attribute to set. + */ + public void setOrganisateur(final Organisateur paramOrganisateur) { + this.organisateur = paramOrganisateur; + } + + /** + * Getter for the artiste attribute. + * @return the artiste attribute as a String. + */ + public String getArtiste() { + return artiste; + } + + /** + * Setter for the artiste attribute. + * @param paramArtiste the artiste attribute to set. + */ + public void setArtiste(final String paramArtiste) { + this.artiste = paramArtiste; + } + + /** + * Getter for the genre attribute. + * @return the genre attribute as a String. + */ + public String getGenre() { + return genre; + } + + /** + * Setter for the genre attribute. + * @param paramGenre the genre attribute to set. + */ + public void setGenre(final String paramGenre) { + this.genre = paramGenre; + } + + /** + * Getter for the price attribute. + * @return the price attribute as a double. + */ + public double getPrice() { + return price; + } + + /** + * Setter for the price attribute. + * @param paramPrice the price attribute to set. + */ + + public void setPrice(final double paramPrice) { + this.price = paramPrice; + } + + /** + * Getter for the nbMax attribute. + * @return the nbMax attribute as an int. + */ + public int getNbMax() { + return nbMax; + } + + /** + * Setter for the nbMax attribute. + * @param paramNbMax the nbMax attribute to set. + */ + public void setNbMax(final int paramNbMax) { + this.nbMax = paramNbMax; + } + + /** + * Getter for the nbSold attribute. + * @return the nbSold attribute as an int. + */ + public int getNbSold() { + return nbSold; + } + + /** + * Setter for the nbSold attribute. + * @param paramNbSold the nbSold attribute to set. + */ + public void setNbSold(final int paramNbSold) { + this.nbSold = paramNbSold; + } + + + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/domain/Organisateur.java b/src/main/java/fr/istic/taa/jaxrs/domain/Organisateur.java new file mode 100644 index 00000000..18e523ba --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/domain/Organisateur.java @@ -0,0 +1,44 @@ +package fr.istic.taa.jaxrs.domain; + +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@Entity +@DiscriminatorValue("organisateur") +public class Organisateur extends Utilisateur implements Serializable { + + /** + * The list of events. + */ + @OneToMany(mappedBy = "organisateur") + private List evenements; + + /** + * Default constructor. + */ + public Organisateur() { + super(); + this.evenements = new ArrayList<>(); + } + + /** + * Getter for the list of events. + * @return the list of events + */ + public List getEvenements() { + return evenements; + } + + /** + * Setter for the list of events. + * @param paramEvenements the list of events + */ + public void setEvenements(final List paramEvenements) { + this.evenements = paramEvenements; + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/domain/Pet.java b/src/main/java/fr/istic/taa/jaxrs/domain/Pet.java deleted file mode 100644 index c8738b97..00000000 --- a/src/main/java/fr/istic/taa/jaxrs/domain/Pet.java +++ /dev/null @@ -1,44 +0,0 @@ -package fr.istic.taa.jaxrs.domain; - -import java.util.ArrayList; -import java.util.List; - -import io.swagger.v3.oas.models.tags.Tag; -import jakarta.xml.bind.annotation.XmlElement; -import jakarta.xml.bind.annotation.XmlElementWrapper; -import jakarta.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name = "Pet") -public class Pet { - private long id; - private String name; - private List tags = new ArrayList(); - - @XmlElement(name = "id") - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - @XmlElement(name = "name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @XmlElementWrapper(name = "tags") - @XmlElement(name = "tag") - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } -} \ No newline at end of file diff --git a/src/main/java/fr/istic/taa/jaxrs/domain/Stats.java b/src/main/java/fr/istic/taa/jaxrs/domain/Stats.java new file mode 100644 index 00000000..63eadd93 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/domain/Stats.java @@ -0,0 +1,59 @@ +package fr.istic.taa.jaxrs.domain; + +import jakarta.persistence.Id; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; + +import java.io.Serializable; + +@Entity +public class Stats implements Serializable { + + /** + * The id attribute as an int. + */ + @Id + @GeneratedValue + private int id; + + /** + * The evenement attribute as an Evenement. + */ + @ManyToOne + @JoinColumn(name = "evenement_id") + private Evenement evenement; + + /** + * Getter for the number of tickets sold. + * @return the number of tickets sold + */ + public Evenement getEvenement() { + return evenement; + } + + /** + * Setter for the number of tickets sold. + * @param paramEvenement the number of tickets sold + */ + public void setEvenement(final Evenement paramEvenement) { + this.evenement = paramEvenement; + } + + /** + * Getter for the id. + * @return the id + */ + public int getId() { + return id; + } + + /** + * Setter for the id. + * @param paramId the id + */ + public void setId(final int paramId) { + this.id = paramId; + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/domain/StatutTicket.java b/src/main/java/fr/istic/taa/jaxrs/domain/StatutTicket.java new file mode 100644 index 00000000..d101f708 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/domain/StatutTicket.java @@ -0,0 +1,20 @@ +package fr.istic.taa.jaxrs.domain; + +public enum StatutTicket { + /** + * Ticket is sold. + */ + ACHETE, + /** + * Ticket is canceled. + */ + ANNULE, + /** + * Ticket is refunded. + */ + REMBOURSE, + /** + * Ticket is reserved. + */ + RESERVE +} diff --git a/src/main/java/fr/istic/taa/jaxrs/domain/Ticket.java b/src/main/java/fr/istic/taa/jaxrs/domain/Ticket.java new file mode 100644 index 00000000..f3173e2e --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/domain/Ticket.java @@ -0,0 +1,163 @@ +package fr.istic.taa.jaxrs.domain; + +import fr.istic.taa.jaxrs.dto.UtilisateurDTO; +import jakarta.persistence.Id; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.Temporal; +import jakarta.persistence.Enumerated; +import jakarta.persistence.EnumType; +import jakarta.persistence.TemporalType; + +import java.io.Serializable; +import java.sql.Date; + +@Entity +@Table(name = "ticket") +public class Ticket implements Serializable { + + /** + * The maximum length for Columns in database. + */ + private static final int MAX_LENGTH = 100; + + /** + * The id attribute as an int. + */ + @Id + @GeneratedValue + private int id; + + /** + * The utilisateur attribute as an Utilisateur. + */ + @ManyToOne + @JoinColumn(name = "utilisateur_id") + private Utilisateur utilisateur; + + /** + * The evenement attribute as an Evenement. + */ + @ManyToOne + @JoinColumn(name = "evenement_id") + private Evenement evenement; + + /** + * The prix attribute as a Double. + */ + @Column(length = MAX_LENGTH, name = "prix") + private Double prix; + + /** + * The dateAchat attribute as a Date. + */ + @Temporal(TemporalType.DATE) + private Date dateAchat; + + /** + * The statut attribute as a StatutTicket. + */ + @Enumerated(EnumType.STRING) + @Column(length = MAX_LENGTH, name = "statut") + private StatutTicket statut; + + /** + * Getter for the statut. + * @return the statut + */ + public StatutTicket getStatut() { + return statut; + } + + /** + * Setter for the statut. + * @param paramStatut the statut + */ + public void setStatut(final StatutTicket paramStatut) { + this.statut = paramStatut; + } + + /** + * Getter for the date of purchase. + * @return the date of purchase + */ + public Date getDateAchat() { + return dateAchat; + } + + /** + * Setter for the date of purchase. + * @param paramDateAchat the date of purchase + */ + public void setDateAchat(final Date paramDateAchat) { + this.dateAchat = paramDateAchat; + } + + /** + * Getter for the price. + * @return the price + */ + public Double getPrix() { + return prix; + } + + /** + * Setter for the price. + * @param paramPrix the price + */ + public void setPrix(final Double paramPrix) { + this.prix = paramPrix; + } + + /** + * Getter for the event. + * @return the event + */ + public Evenement getEvenement() { + return evenement; + } + + /** + * Setter for the event. + * @param paramEvenement the event + */ + public void setEvenement(final Evenement paramEvenement) { + this.evenement = paramEvenement; + } + + /** + * Getter for the user. + * @return the user + */ + public Utilisateur getUtilisateur() { + return utilisateur; + } + + /** + * Setter for the user. + * @param paramUtilisateur the user + */ + public void setUtilisateur(final Utilisateur paramUtilisateur) { + this.utilisateur = paramUtilisateur; + } + + /** + * Getter for the id. + * @return the id + */ + public int getId() { + return id; + } + + /** + * Setter for the id. + * @param paramId the id + */ + public void setId(final int paramId) { + this.id = paramId; + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/domain/Utilisateur.java b/src/main/java/fr/istic/taa/jaxrs/domain/Utilisateur.java new file mode 100644 index 00000000..1c86a236 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/domain/Utilisateur.java @@ -0,0 +1,195 @@ +package fr.istic.taa.jaxrs.domain; + +import jakarta.persistence.Id; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.DiscriminatorType; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.Size; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Table(name = "utilisateur") +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "type_utilisateur", discriminatorType = DiscriminatorType.STRING) + public class Utilisateur implements Serializable { + + /** + * The maximum length for Columns in database. + */ + private static final int MAX_LENGTH = 100; + + /** + * The id attribute as a long. + */ + @Id + @GeneratedValue + private long id; + + /** + * The nom attribute as a String. + */ + @Column(length = MAX_LENGTH, name = "nom", nullable = false) + private String nom; + + /** + * The prenom attribute as a String. + */ + @Size(min =8) + @Column(length = MAX_LENGTH, name = "prenom", nullable = false) + private String prenom; + + /** + * The email attribute as a String. + */ + @Email + @Column(length = MAX_LENGTH, name = "email", nullable = false) + private String email; + + /** + * The password attribute as a String. + */ + @Column(length = MAX_LENGTH, name = "password", nullable = false) + private String password; + + /** + * The list of tickets. + */ + @OneToMany(mappedBy = "utilisateur") + private List tickets; + + /** + * The type of the user as a String. + */ + @Column(name = "type_utilisateur", insertable = false, updatable = false) + private String typeUtilisateur; + + + /** + * Default constructor. + */ + public Utilisateur() { + this.tickets = new ArrayList<>(); + } + + /** + * Getter for the id. + * @return the id + */ + public long getId() { + return id; + } + + /** + * Setter for the id. + * @param paramId the id + */ + public void setId(final long paramId) { + this.id = paramId; + } + + /** + * Getter for the nom. + * @return the nom + */ + public String getNom() { + return nom; + } + + /** + * Setter for the nom. + * @param paramNom the nom + */ + public void setNom(final String paramNom) { + this.nom = paramNom; + } + + /** + * Getter for the prenom. + * @return the prenom + */ + public String getPrenom() { + return prenom; + } + + /** + * Setter for the prenom. + * @param paramPrenom the prenom + */ + public void setPrenom(final String paramPrenom) { + this.prenom = paramPrenom; + } + + /** + * Getter for the email. + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Setter for the email. + * @param paramEmail the email + */ + public void setEmail(final String paramEmail) { + this.email = paramEmail; + } + + /** + * Getter for the password. + * @return the password + */ + public String getPassword() { + return password; + } + + /** + * Setter for the password. + * @param paramPassword the password + */ + public void setPassword(final String paramPassword) { + this.password = paramPassword; + } + + /** + * Getter for the tickets. + * @return the tickets + */ + public List getTickets() { + return tickets; + } + + /** + * Setter for the tickets. + * @param paramTickets the tickets + */ + public void setTickets(final List paramTickets) { + this.tickets = paramTickets; + } + + /** + * Getter for the typeUtilisateur. + * @return the typeUtilisateur + */ + public String getTypeUtilisateur() { + return typeUtilisateur; + } + + /** + * Setter for the typeUtilisateur. + * @param paramTypeUtilisateur the typeUtilisateur + */ + public void setTypeUtilisateur(final String paramTypeUtilisateur) { + this.typeUtilisateur = paramTypeUtilisateur; + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/domain/package-info.java b/src/main/java/fr/istic/taa/jaxrs/domain/package-info.java new file mode 100644 index 00000000..1f034eb0 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/domain/package-info.java @@ -0,0 +1,4 @@ +/** + * This package contains the domain classes. + */ +package fr.istic.taa.jaxrs.domain; diff --git a/src/main/java/fr/istic/taa/jaxrs/dto/EvenementDTO.java b/src/main/java/fr/istic/taa/jaxrs/dto/EvenementDTO.java new file mode 100644 index 00000000..6f495b96 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dto/EvenementDTO.java @@ -0,0 +1,234 @@ +package fr.istic.taa.jaxrs.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import fr.istic.taa.jaxrs.domain.Evenement; +import java.sql.Date; + +public class EvenementDTO { + + /** + * Name of the event. + */ + private String nom; + /** + * Description of the event. + */ + private String description; + /** + * Date of the event. + */ + private Date date; + /** + * Location of the event. + */ + private String lieu; + /** + * Artiste of the event. + */ + private String artiste; + /** + * Genre of the event. + */ + private String genre; + + /** + * Price of the event. + */ + private double price; + + /** + * ID of the event. + */ + private Long idEvenement; + + /** + * Nb places max of the event. + */ + private int nbMax; + + /** + * Nb places available of the event. + */ + private int nbSold; + + + /** + * Constructor of the event DTO. + * @param evenement the event. + */ + public EvenementDTO(final Evenement evenement) { + this.idEvenement = evenement.getId(); + this.nom = evenement.getNom(); + this.description = evenement.getDescription(); + this.date = Date.valueOf(evenement.getDate().toLocalDate()); + this.lieu = evenement.getLieu(); + this.artiste = evenement.getArtiste(); + this.genre = evenement.getGenre(); + this.price = evenement.getPrice(); + this.nbMax = evenement.getNbMax(); + this.nbSold = evenement.getNbSold(); + } + + /** + * Setter for the name of the event. + * @param paramNom the name of the event + */ + public void setNom(final String paramNom) { + this.nom = paramNom; + } + + /** + * Getter for the name of the event. + * @return the name of the event + */ + public String getNom() { + return nom; + } + + /** + * Setter for the description of the event. + * @param paramDescription the description of the event + */ + public void setDescription(final String paramDescription) { + this.description = paramDescription; + } + + /** + * Getter for the description of the event. + * @return the description of the event + */ + public String getDescription() { + return description; + } + + /** + * Setter for the date of the event. JsonFormat is used to specify the format of the date as Europe/Paris timezone. + * @param paramDate the date of the event + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Europe/Paris") + public void setDate(final Date paramDate) { + this.date = paramDate; + } + + /** + * Getter for the date of the event. JsonFormat is used to specify the format of the date as Europe/Paris timezone. + * @return the date of the event + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Europe/Paris") + public Date getDate() { + return date; + } + + /** + * Setter for the location of the event. + * @param paramLieu the location of the event + */ + public void setLieu(final String paramLieu) { + this.lieu = paramLieu; + } + + /** + * Getter for the location of the event. + * @return the location of the event + */ + public String getLieu() { + return lieu; + } + + /** + * Setter for the artiste of the event. + * @param paramArtiste the artiste of the event + */ + public void setArtiste(final String paramArtiste) { + this.artiste = paramArtiste; + } + + /** + * Getter for the artiste of the event. + * @return the artiste of the event + */ + public String getArtiste() { + return artiste; + } + + /** + * Setter for the genre of the event. + * @param paramGenre the genre of the event + */ + public void setGenre(final String paramGenre) { + this.genre = paramGenre; + } + + /** + * Getter for the genre of the event. + * @return the genre of the event + */ + public String getGenre() { + return genre; + } + + /** + * Setter for the price of the event. + */ + public void setPrice(final double price) { + this.price = price; + } + + /** + * Getter for the price of the event (raw price without formatting). + * @return the raw price of the event + */ + public double getPrice() { + return price; + } + + /** + * Getter for the id of the event. + * + * @return the id of the event + */ + public long getIdEvenement() { + return idEvenement; + } + + /** + * Setter for the id of the event. + * @param paramIdEvenement the id of the event + */ + public void setIdEvenement(final Long paramIdEvenement) { + this.idEvenement = paramIdEvenement; + } + + /** + * Getter for the nbMax of the event. + * @return the nbMax of the event + */ + public int getNbMax() { + return nbMax; + } + + /** + * Setter for the nbMax of the event. + * @param paramNbMax the nbMax of the event + */ + public void setNbMax(final int paramNbMax) { + this.nbMax = paramNbMax; + } + + /** + * Getter for the nbSold of the event. + * @return the nbSold of the event + */ + public int getNbSold() { + return nbSold; + } + + /** + * Setter for the nbSold of the event. + * @param paramNbSold the nbSold of the event + */ + public void setNbSold(final int paramNbSold) { + this.nbSold = paramNbSold; + } + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dto/TicketDTO.java b/src/main/java/fr/istic/taa/jaxrs/dto/TicketDTO.java new file mode 100644 index 00000000..57692e31 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dto/TicketDTO.java @@ -0,0 +1,172 @@ +package fr.istic.taa.jaxrs.dto; + +import fr.istic.taa.jaxrs.domain.StatutTicket; +import fr.istic.taa.jaxrs.domain.Ticket; +import fr.istic.taa.jaxrs.domain.Utilisateur; + +import java.sql.Date; + +public class TicketDTO { + + /** + * ID of the ticket. + */ + private Long id; + + /** + * Ticket status. + */ + private StatutTicket statut; + + /** + * Ticket purchase date. + */ + private Date date; + + /** + * Event location. + */ + private String lieu; + + + /** + * Prix + */ + private Double prix; + + /** + * User. + */ + private UtilisateurDTO utilisateur; + + /** + * Id of the event. + */ + private Long idEvenement; + + /** + * Constructor. + * @param ticket Ticket. + */ + public TicketDTO(final Ticket ticket) { + this.id = (long) ticket.getId(); + this.statut = ticket.getStatut(); + this.date = ticket.getDateAchat(); + this.lieu = ticket.getEvenement().getLieu(); + this.utilisateur = new UtilisateurDTO(ticket.getUtilisateur()); + this.prix = ticket.getPrix(); + this.idEvenement = ticket.getEvenement().getId(); + } + + /** + * Setter for statut. + * @param paramStatut Statut. + */ + public void setStatut(final StatutTicket paramStatut) { + this.statut = paramStatut; + } + + /** + * Getter for statut. + * @return Statut. + */ + public StatutTicket getStatut() { + return statut; + } + + /** + * Setter for date. + * @param paramDate Date. + */ + public void setDate(final Date paramDate) { + this.date = paramDate; + } + + /** + * Getter for date. + * @return Date. + */ + public Date getDate() { + return date; + } + + /** + * Setter for lieu. + * @param paramLieu Lieu. + */ + public void setLieu(final String paramLieu) { + this.lieu = paramLieu; + } + + /** + * Getter for lieu. + * @return Lieu. + */ + public String getLieu() { + return lieu; + } + + /** + * Setter for utilisateur. + * @param paramUtilisateur Utilisateur. + */ + public void setUtilisateur(final Utilisateur paramUtilisateur) { + this.utilisateur = new UtilisateurDTO(paramUtilisateur); + } + + /** + * Getter for utilisateur. + * @return Utilisateur. + */ + public UtilisateurDTO getUtilisateur() { + return utilisateur; + } + + /** + * Getter for prix. + * @return Prix. + */ + public Double getPrix() { + return prix; + } + + /** + * Setter for prix. + * @param paramPrix Prix. + */ + public void setPrix(final Double paramPrix) { + this.prix = paramPrix; + } + + /** + * Getter for id. + * @return ID. + */ + public Long getId() { + return id; + } + + /** + * Setter for id. + * @param paramId ID. + */ + public void setId(final Long paramId) { + this.id = paramId; + } + + /** + * Getter for idEvenement. + * @return ID of the event. + */ + public Long getIdEvenement() { + return idEvenement; + } + + /** + * Setter for idEvenement. + * @param paramIdEvenement ID of the event. + */ + public void setIdEvenement(final Long paramIdEvenement) { + this.idEvenement = paramIdEvenement; + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dto/UtilisateurDTO.java b/src/main/java/fr/istic/taa/jaxrs/dto/UtilisateurDTO.java new file mode 100644 index 00000000..9039ef4e --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dto/UtilisateurDTO.java @@ -0,0 +1,130 @@ +package fr.istic.taa.jaxrs.dto; + +import fr.istic.taa.jaxrs.domain.Utilisateur; + +public class UtilisateurDTO { + + /** + * Name of the user. + */ + private String nom; + + /** + * First name of the user. + */ + private String prenom; + + /** + * Email of the user. + */ + private String email; + + /** + * id of the user. + */ + private Long idUtilisateur; + + /** + * Role of the user. + */ + private String role; + + /** + * Default constructor. + */ + public UtilisateurDTO() { + } + + /** + * Constructor. + * @param utilisateur User. + */ + public UtilisateurDTO(final Utilisateur utilisateur) { + this.nom = utilisateur.getNom(); + this.prenom = utilisateur.getPrenom(); + this.email = utilisateur.getEmail(); + this.idUtilisateur = utilisateur.getId(); + this.role = utilisateur.getTypeUtilisateur(); + } + + /** + * Setter for the name. + * @param paramNom the name + */ + public void setNom(final String paramNom) { + this.nom = paramNom; + } + + /** + * Getter for the name. + * @return the name + */ + public String getNom() { + return nom; + } + + /** + * Setter for the first name. + * @param paramPrenom the first name + */ + public void setPrenom(final String paramPrenom) { + this.prenom = paramPrenom; + } + + /** + * Getter for the first name. + * @return the first name + */ + public String getPrenom() { + return prenom; + } + + /** + * Setter for the email. + * @param paramEmail the email + */ + public void setEmail(final String paramEmail) { + this.email = paramEmail; + } + + /** + * Getter for the email. + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * Setter for the id. + * @param paramId the id + */ + public void setIdUtilisateur(final Long paramId) { + this.idUtilisateur = paramId; + } + + /** + * Getter for the id. + * @return the id + */ + public Long getIdUtilisateur() { + return idUtilisateur; + } + + /** + * Setter for the role. + * @param paramRole the role + */ + public void setRole(final String paramRole) { + this.role = paramRole; + } + + /** + * Getter for the role. + * @return the role + */ + public String getRole() { + return role; + } + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/dto/package-info.java b/src/main/java/fr/istic/taa/jaxrs/dto/package-info.java new file mode 100644 index 00000000..01155608 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/dto/package-info.java @@ -0,0 +1,4 @@ +/** + * This package contains the DTOs (Data Transfer Objects) of the application. + */ +package fr.istic.taa.jaxrs.dto; diff --git a/src/main/java/fr/istic/taa/jaxrs/package-info.java b/src/main/java/fr/istic/taa/jaxrs/package-info.java new file mode 100644 index 00000000..8527009f --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/package-info.java @@ -0,0 +1,4 @@ +/** + * This package contains the main class of the application and subpackages. + */ +package fr.istic.taa.jaxrs; diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/AdministrateurRessources.java b/src/main/java/fr/istic/taa/jaxrs/rest/AdministrateurRessources.java new file mode 100644 index 00000000..83475079 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/rest/AdministrateurRessources.java @@ -0,0 +1,56 @@ +package fr.istic.taa.jaxrs.rest; + +import fr.istic.taa.jaxrs.dao.business.AdministrateurDAO; +import fr.istic.taa.jaxrs.domain.Administrateur; +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.core.Response; + +import java.util.List; + +@Path("administrateur") +@Produces({"application/json"}) +public class AdministrateurRessources { + + /** + * AdministrateurDAO. + */ + private final AdministrateurDAO administrateurDAO = new AdministrateurDAO(); + + + /** + * Get all Administrateurs. GET request with path "/administrateur/". + * @return List of Administrateurs + */ + @GET + @Path("/") + public List getAdministrateur() { + return administrateurDAO.findAll(); + } + + /** + * Get an Administrateur by id. GET request with path "/administrateur/{id}" + * @param id Administrateur id + * @return Administrateur + */ + @GET + @Path("/{id}") + public Administrateur getAdministrateurById(final Long id) { + return administrateurDAO.findOne(id); + } + + /** + * Add an Administrateur. POST request with path "/administrateur/" + * @param admin Administrateur object + * @return Response + */ + @POST + @Consumes + public Response addAdministrateur(@Parameter(description = "User object that needs to be added to the store", required = true) final Administrateur admin) { + return Response.ok().entity("SUCCESS").build(); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/CorsFilter.java b/src/main/java/fr/istic/taa/jaxrs/rest/CorsFilter.java new file mode 100644 index 00000000..68f46bb7 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/rest/CorsFilter.java @@ -0,0 +1,18 @@ +package fr.istic.taa.jaxrs.rest; + +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.container.ContainerResponseFilter; +import jakarta.ws.rs.ext.Provider; +import java.io.IOException; + +@Provider +public class CorsFilter implements ContainerResponseFilter { + @Override + public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { + responseContext.getHeaders().add("Access-Control-Allow-Origin", "http://localhost:4200"); // Autoriser les requêtes depuis Angular + responseContext.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"); // Autoriser ces méthodes HTTP + responseContext.getHeaders().add("Access-Control-Allow-Headers", "origin, content-type, accept, authorization"); + responseContext.getHeaders().add("Access-Control-Allow-Credentials", "true"); // Gérer les cookies/sessions si nécessaire + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/EvenementRessources.java b/src/main/java/fr/istic/taa/jaxrs/rest/EvenementRessources.java new file mode 100644 index 00000000..e45546f2 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/rest/EvenementRessources.java @@ -0,0 +1,145 @@ +package fr.istic.taa.jaxrs.rest; + +import fr.istic.taa.jaxrs.domain.Evenement; +import fr.istic.taa.jaxrs.domain.Organisateur; +import fr.istic.taa.jaxrs.domain.Utilisateur; +import fr.istic.taa.jaxrs.dto.EvenementDTO; +import fr.istic.taa.jaxrs.service.business.EvenementService; +import fr.istic.taa.jaxrs.service.business.UtilisateurService; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.Response; +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.ws.rs.core.SecurityContext; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +@Path("evenement") +@Produces({"application/json"}) +public class EvenementRessources { + + private static final String ORGANISATEUR_ROLE = "organisateur"; + + /** + * The service to interact with the events. + */ + private final EvenementService evenementService = new EvenementService(); + + /** + * Get all the events. Get request at /evenement/ path. + * @return the list of events + */ + @GET + @Path("/") + public List getEvenements() { + return evenementService.getAllEvenements(); + } + + /** + * Get an event by its id. Get request at /evenement/{id} path. + * @param id the id of the event + * @return the event + */ + @GET + @Path("/{id}") + public Response getEvenementById(@PathParam("id") final Long id) { + EvenementDTO evenement = evenementService.getEvenementById(id); + if(evenement == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Evenement not found").build(); + } + return Response.status(Response.Status.OK).entity(evenement).build(); + } + + /** + * Add an event. Post request at /evenement/ path. + * @param event the event to add + * @return the response + */ + @POST + @Consumes("application/json") + @Produces("application/json") + @Path("/add") + public Response addEvenement( + @Parameter(description = "User object that needs to be added to the store", required = true) final Evenement event, + @Context SecurityContext securityContext) + { + if(securityContext.isUserInRole(ORGANISATEUR_ROLE)){ + String email = securityContext.getUserPrincipal().getName(); + UtilisateurService utilisateurService = new UtilisateurService(); + Utilisateur user = utilisateurService.getUtilisateurByEmail(email); + + if (Objects.equals(user.getTypeUtilisateur(), "organisateur")){ + Organisateur org = (Organisateur)user; + event.setOrganisateur(org); + } + + evenementService.save(event); + return Response.status(Response.Status.CREATED).entity(Collections.singletonMap("messageCreated","Evénement Créé")).build(); + } + return Response.status(Response.Status.FORBIDDEN).entity(Collections.singletonMap("messageForbbiden","Vous n'avez pas le droit de créer un événement")).build(); + } + + /** + * Update an event. Post request at /evenement/update a path. + * @param event the event to update + * @return the response + */ + @PUT + @Consumes("application/json") + @Produces("application/json") + @Path("/update") + public Response updateEvenement( + @Parameter(description = "Event object that needs to be update to the store", required = true) final Evenement event, + @Context SecurityContext securityContext) + { + System.out.println(event.getId()); + if(securityContext.isUserInRole(ORGANISATEUR_ROLE)){ + String email = securityContext.getUserPrincipal().getName(); + UtilisateurService utilisateurService = new UtilisateurService(); + Utilisateur user = utilisateurService.getUtilisateurByEmail(email); + + if (user instanceof Organisateur){ + Organisateur org = (Organisateur)user; + event.setOrganisateur(org); + } + } + evenementService.update(event); + return Response.status( Response.Status.OK).entity(Collections.singletonMap("message","Evénement modifié")).build(); + } + + /** + * Delete an event. Delete request at /evenement/{id} path. + * @param id the id of the event to delete + * @return the response + */ + @DELETE + @Path("/delete/{id}") + public Response deleteEvenement(@PathParam("id") final Long id, @Context SecurityContext securityContext) { + if(securityContext.isUserInRole(ORGANISATEUR_ROLE)){ + Evenement event = evenementService.findOne(id); + if (event == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Event not found").build(); + } + evenementService.delete(event); + return Response.status(Response.Status.OK).build();} + return Response.status(Response.Status.FORBIDDEN).entity(Collections.singletonMap("message","Vous n'avez pas le droit de supprimer un événement")).build(); + } + + /** + * Get all the events of an organizer. Get request at /evenement/organisateur/{id} path. + * @param id the id of the organizer + * @return the list of events + */ + @GET + @Path("/organisateur/{id}") + public Response getOrganisateur(@PathParam("id") final Long id) { + List evenements = evenementService.getEvenementByOrganisateur(id); + if(evenements == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Evenements not found").build(); + } + return Response.status(Response.Status.OK).entity(evenements).build(); + } + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/OrganisateurRessources.java b/src/main/java/fr/istic/taa/jaxrs/rest/OrganisateurRessources.java new file mode 100644 index 00000000..48a41bcf --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/rest/OrganisateurRessources.java @@ -0,0 +1,55 @@ +package fr.istic.taa.jaxrs.rest; + +import fr.istic.taa.jaxrs.dao.business.OrganisateurDAO; +import fr.istic.taa.jaxrs.domain.Organisateur; +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.core.Response; + +import java.util.List; + +@Path("organisateur") +@Produces({"application/json"}) +public class OrganisateurRessources { + + /** + * The organisteur DAO. + */ + private final OrganisateurDAO organisateurDAO = new OrganisateurDAO(); + + /** + * Get all organisateurs. Get request with path "/organisateur". + * @return the list of organisateurs + */ + @GET + @Path("/") + public List getOrganisateur() { + return organisateurDAO.findAll(); + } + + /** + * Get an organisateur by its id. Get request with path "/organisateur/{id}". + * @param id the id of the organisateur + * @return the organisateur + */ + @GET + @Path("/{id}") + public Organisateur getOrganisateurById(final Long id) { + return organisateurDAO.findOne(id); + } + + /** + * Add an organisateur. Post request with path "/organisateur". + * @param org the organisateur to add + * @return the response + */ + @POST + @Consumes + public Response addOrganisateur(@Parameter(description = "User object that needs to be added to the store", required = true) final Organisateur org) { + return Response.ok().entity("SUCCESS").build(); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/PetResource.java b/src/main/java/fr/istic/taa/jaxrs/rest/PetResource.java deleted file mode 100644 index 30873955..00000000 --- a/src/main/java/fr/istic/taa/jaxrs/rest/PetResource.java +++ /dev/null @@ -1,38 +0,0 @@ -package fr.istic.taa.jaxrs.rest; - -import fr.istic.taa.jaxrs.domain.Pet; -import io.swagger.v3.oas.annotations.Parameter; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.Response; - -@Path("pet") -@Produces({"application/json", "application/xml"}) -public class PetResource { - - @GET - @Path("/{petId}") - public Pet getPetById(@PathParam("petId") Long petId) { - // return pet - return new Pet(); - } - - @GET - @Path("/") - public Pet getPet(Long petId) { - return new Pet(); - } - - - @POST - @Consumes("application/json") - public Response addPet( - @Parameter(description = "Pet object that needs to be added to the store", required = true) Pet pet) { - // add pet - return Response.ok().entity("SUCCESS").build(); - } -} \ No newline at end of file diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/StatsRessources.java b/src/main/java/fr/istic/taa/jaxrs/rest/StatsRessources.java new file mode 100644 index 00000000..1260afaf --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/rest/StatsRessources.java @@ -0,0 +1,55 @@ +package fr.istic.taa.jaxrs.rest; + +import fr.istic.taa.jaxrs.dao.business.StatsDAO; +import fr.istic.taa.jaxrs.domain.Stats; +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.core.Response; + +import java.util.List; + +@Path("stats") +@Produces({"application/json"}) +public class StatsRessources { + + /** + * Stats DAO. + */ + private final StatsDAO statsDAO = new StatsDAO(); + + /** + * Get all stats. Get request to /stats/. + * @return all stats + */ + @GET + @Path("/") + public List getStats() { + return statsDAO.findAll(); + } + + /** + * Get stats by id. Get request to /stats/{id}. + * @param id the id + * @return the stats + */ + @GET + @Path("/{id}") + public Stats getStatsById(final Long id) { + return statsDAO.findOne(id); + } + + /** + * Add stats. Post request to /stats/. + * @param stats the stats + * @return the response + */ + @POST + @Consumes + public Response addStats(@Parameter(description = "User object that needs to be added to the store", required = true) final Stats stats) { + return Response.ok().entity("SUCCESS").build(); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/SwaggerResource.java b/src/main/java/fr/istic/taa/jaxrs/rest/SwaggerResource.java new file mode 100644 index 00000000..373d7c3e --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/rest/SwaggerResource.java @@ -0,0 +1,44 @@ +package fr.istic.taa.jaxrs.rest; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; + +import java.io.IOException; +import java.nio.file.FileSystems; +import java.nio.file.Files; + + +@Path("/api") +public class SwaggerResource { + + + /** + * Get the index file. + * @return the index file + */ + @GET + public byte[] Get1() { + try { + return Files.readAllBytes(FileSystems.getDefault().getPath("src/main/webapp/swagger/dist/index.html")); + } catch (IOException e) { + return new byte[0]; + } + } + + /** + * Get the file from the path. + * @param path the path + * @return the file + */ + @GET + @Path("{path:.*}") + public byte[] Get(@PathParam("path") final String path) { + try { + return Files.readAllBytes(FileSystems.getDefault().getPath("src/main/webapp/swagger/dist/" + path)); + } catch (IOException e) { + return new byte[0]; + } + } + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/TicketRessources.java b/src/main/java/fr/istic/taa/jaxrs/rest/TicketRessources.java new file mode 100644 index 00000000..dc9a7d88 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/rest/TicketRessources.java @@ -0,0 +1,166 @@ +package fr.istic.taa.jaxrs.rest; + +import fr.istic.taa.jaxrs.domain.Evenement; +import fr.istic.taa.jaxrs.domain.StatutTicket; +import fr.istic.taa.jaxrs.domain.Ticket; +import fr.istic.taa.jaxrs.domain.Utilisateur; +import fr.istic.taa.jaxrs.dto.TicketDTO; +import fr.istic.taa.jaxrs.dto.UtilisateurDTO; +import fr.istic.taa.jaxrs.service.business.EvenementService; +import fr.istic.taa.jaxrs.service.business.TicketService; +import fr.istic.taa.jaxrs.service.business.UtilisateurService; +import fr.istic.taa.jaxrs.utils.TicketToPDF; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.Response; +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.ws.rs.core.SecurityContext; +import java.io.ByteArrayOutputStream; +import java.util.List; + +@Path("ticket") +@Produces({"application/json"}) +public class TicketRessources { + + /** + * Ticket service. + */ + private final TicketService ticketService = new TicketService(); + + + + /** + * Get all tickets. Get request at /ticket/. + * @return List of tickets. + */ + @GET + @Path("/") + public Response getTicket() { + List tickets = ticketService.getAllTickets(); + return Response.ok().entity(tickets).build(); + } + + /** + * Get ticket by id. Get request at /ticket/{id}. + * @param id Ticket id. + * @return Ticket. + */ + @GET + @Path("/{id}") + @Produces("application/json") + public Response getTicketById(@PathParam("id") final Long id) { + Ticket ticket = ticketService.getTicketById(id); + TicketDTO ticketDTO = new TicketDTO(ticket); + return Response.status(Response.Status.OK).entity(ticketDTO).build(); + } + + /** + * Get tickets by user id. Get request at /ticket/user/{id}. + * @param id User id. + * @return List of tickets. + */ + @GET + @Path("/user/{id}") + @Produces("application/json") + public Response getTicketsByUserId(@PathParam("id") final Long id) { + System.out.println("id du user : " + id); + List tickets = ticketService.getTicketsByUserId(id); + if(tickets == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Tickets not found").build(); + } + return Response.status(Response.Status.OK).entity(tickets).build(); + } + + /** + * Create a ticket. Post request at /ticket/. + * @param ticket Ticket to create. + * @return Response. + */ + @POST + @Consumes("application/json") + @Produces("application/pdf") + @Path("/add/{nbBuy}") + public Response addTicket(@Parameter(description = "Ticket to create", required = true) final Ticket ticket, @PathParam("nbBuy") final int nbBuy, @Context SecurityContext securityContext) { + ticket.setStatut(StatutTicket.ACHETE); + + final EvenementService evenementService = new EvenementService(); + Evenement evenement = new Evenement(); + + try { + System.out.println("Création du ticket..."); + ticketService.save(ticket); + System.out.println("id du ticket : " + ticket.getId()); + + Ticket ticketSaved = ticketService.getTicketById((long) ticket.getId()); + System.out.println("Ticket rechargé : " + ticketSaved); + + evenement.setId((int) evenementService.getEvenementById(ticket.getEvenement().getId()).getIdEvenement()); + evenementService.updateNbSold(evenement, nbBuy ); + + ByteArrayOutputStream pdfStream = TicketToPDF.generateTicketPdf(ticketSaved); + if (pdfStream == null || pdfStream.size() == 0) { + System.err.println("PDF généré vide !"); + return Response.serverError().entity("Erreur lors de la génération du PDF").build(); + } + return Response.ok(pdfStream.toByteArray()) + .type("application/pdf") + .header("Content-Disposition", "attachment; filename=ticket_" + ticketSaved.getId() + ".pdf") + .build(); + + } catch (Exception e) { + e.printStackTrace(); + return Response.serverError().entity("Erreur lors de la création du ticket et de son PDF").build(); + } + + } + + /** + * Update a ticket. Post request at /ticket/. + * @param ticket Ticket to update. + * @return Response. + */ + @PUT + @Path("/{id}") + @Consumes("application/json") + @Produces("application/json") + public Response updateTicket(@PathParam("id") final int id, final Ticket ticket) { + ticket.setId(id); + ticketService.updateTicket(ticket); + return Response.status(Response.Status.OK).entity(ticket).build(); + } + + /** + * Delete a ticket. Delete request at /ticket/{id}. + * @param id Ticket id. + * @return Response. + */ + @DELETE + @Path("/{id}") + public Response deleteTicket(@PathParam("id") final long id) { + Ticket ticket = ticketService.findOne(id); + if(ticket == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Ticket not found").build(); + } + ticketService.deleteTicket(ticket); + return Response.status(Response.Status.OK).entity("Ticket deleted").build(); + } + + /** + * Change the user of a ticket. Post request at /ticket/{id}/user/{email}. + * @param newUserEmail New user email. + */ + @POST + @Path("/update/{id}/user/{userId}") + @Consumes("application/json") + public Response changeTicketUser(@PathParam("id") final long idTicket, @PathParam("userId") final String newUserEmail) { + Ticket ticket = ticketService.getTicketById(idTicket); + UtilisateurService userService = new UtilisateurService(); + Utilisateur user = userService.getUtilisateurByEmail(newUserEmail); + UtilisateurDTO newUser = new UtilisateurDTO(user); + if(ticket == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Ticket not found").build(); + } + ticketService.updateUserId(ticket, newUser.getIdUtilisateur()); + return Response.status(Response.Status.OK).entity("Ticket user updated").build(); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/UtilisateurRessource.java b/src/main/java/fr/istic/taa/jaxrs/rest/UtilisateurRessource.java new file mode 100644 index 00000000..8bc4f617 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/rest/UtilisateurRessource.java @@ -0,0 +1,159 @@ +package fr.istic.taa.jaxrs.rest; + +import fr.istic.taa.jaxrs.domain.Utilisateur; +import fr.istic.taa.jaxrs.dto.UtilisateurDTO; +import fr.istic.taa.jaxrs.service.business.UtilisateurService; +import fr.istic.taa.jaxrs.utils.AuthResponse; +import fr.istic.taa.jaxrs.utils.TokenUtil; +import io.swagger.v3.oas.annotations.Parameter; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.SecurityContext; + +import java.util.Collections; +import java.util.List; + +@Path("utilisateur") +@Produces({"application/json"}) +public class UtilisateurRessource { + + /** + * The service for the user. + */ + private final UtilisateurService utilisateurService = new UtilisateurService(); + + /** + * Get the user by id. + * @param id the id + * @return the user + */ + @GET + @Path("/{id}") + public UtilisateurDTO getUserById(@PathParam("id") final Long id){ + + Utilisateur user = utilisateurService.getUtilisateurById(id); + + if(user != null) { + return new UtilisateurDTO(user); + } + return null; + } + + /** + * Get the userDTO by email. + * @return the userDTO + */ + @GET + @Path("/email") + @Produces(MediaType.APPLICATION_JSON) + public Response getUserByEmail(@Context SecurityContext securityContext){ + String email = securityContext.getUserPrincipal().getName(); + + Utilisateur user = utilisateurService.getUtilisateurByEmail(email); + if(user != null) { + UtilisateurDTO userDTO = new UtilisateurDTO(user); + return Response.ok(userDTO).build(); + } + + return Response.status(Response.Status.BAD_REQUEST).entity("Utilisateur non trouvé").build(); + } + + /** + * Get the user's list. + * @return the user's list + */ + @GET + @Path("/") + public List getUser() { + return utilisateurService.getAllUtilisateurs(); + } + + /** + * Add a user. + * @param user the user + * @return the response + */ + @POST + @Consumes("application/json") + @Path("add") + public Response addUser(@Parameter(description = "User object that needs to be added to the store", required = true) final Utilisateur user) { + try { + if (user.getEmail() == null || user.getPassword() == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Email et mot de passe requis").build(); + } else if (user.getNom() == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Nom requis").build(); + } else if (user.getPrenom() == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Prénom requis").build(); + } + String emailValidationResult = utilisateurService.saveUser(user); + if (emailValidationResult.equals("L'email est déjà utilisé")) { + return Response.status(Response.Status.BAD_REQUEST).entity("L'email est déjà utilisé").build(); + } + return Response.status(Response.Status.CREATED) + .entity(Collections.singletonMap("message", "Utilisateur créé avec succès")) + .build(); + + } catch (Exception e) { + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Erreur lors de la création de l'utilisateur").build(); + } + } + + /** + * Login a user. + * @param user the user + * @return the response + */ + @POST + @Path("/login") + @Consumes("application/json") + @Produces("application/json") + public Response login(@Parameter(description = "User login credentials", required = true) final Utilisateur user ){ + try { + if(user.getEmail() == null || user.getPassword() == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Email et mot de passe requis").build(); + } + Utilisateur userFound = utilisateurService.getUtilisateurByEmail(user.getEmail()); + if(userFound == null) { + return Response.status(Response.Status.BAD_REQUEST).entity("Utilisateur non trouvé").build(); + } + + boolean passwordMatch = utilisateurService.checkPassword(user.getEmail(), user.getPassword()); + if(!passwordMatch) { + return Response.status(Response.Status.BAD_REQUEST).entity("Mot de passe incorrect").build(); + } + System.out.println("Role : " + userFound.getTypeUtilisateur()); + String token = TokenUtil.generateToken(userFound.getEmail(), userFound.getTypeUtilisateur()); + return Response.status(Response.Status.OK).entity(new AuthResponse(token, userFound.getId())).build(); + } + catch (Exception e) { + return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("Erreur lors de la connexion").build(); + } + } + + /** + * Update a user role. + * @param user the new user + * @return the response + */ + @PUT + @Consumes("application/json") + @Produces("application/json") + @Path("/updateUser") + public Response updateUser( + @Parameter(description = "User object that needs to be updated", required = true) final UtilisateurDTO user, + @Context SecurityContext securityContext) { + if(securityContext.isUserInRole("administrateur")){ + System.out.println("id : " + user.getIdUtilisateur()); + Utilisateur userToUpdate = utilisateurService.getUtilisateurById(user.getIdUtilisateur()); + userToUpdate.setTypeUtilisateur(user.getRole()); + + utilisateurService.updateUtilisateur(userToUpdate); + return Response.status(Response.Status.OK).entity(Collections.singletonMap("messageUpdate", "Utilisateur mis à jour avec succès")).build(); + } + + return Response.status(Response.Status.FORBIDDEN).entity(Collections.singletonMap("messageForbidden", "Vous n'avez pas le droit de mettre à jour un utilisateur")).build(); + } + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/rest/package-info.java b/src/main/java/fr/istic/taa/jaxrs/rest/package-info.java new file mode 100644 index 00000000..db9e0316 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/rest/package-info.java @@ -0,0 +1,4 @@ +/** + * This package contains the REST resources. + */ +package fr.istic.taa.jaxrs.rest; diff --git a/src/main/java/fr/istic/taa/jaxrs/service/business/EvenementService.java b/src/main/java/fr/istic/taa/jaxrs/service/business/EvenementService.java new file mode 100644 index 00000000..fe10b833 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/service/business/EvenementService.java @@ -0,0 +1,93 @@ +package fr.istic.taa.jaxrs.service.business; + +import fr.istic.taa.jaxrs.dao.business.EvenementDAO; +import fr.istic.taa.jaxrs.dao.business.TicketDAO; +import fr.istic.taa.jaxrs.dao.generic.AbstractJpaDao; +import fr.istic.taa.jaxrs.domain.Evenement; +import fr.istic.taa.jaxrs.domain.Ticket; +import fr.istic.taa.jaxrs.dto.EvenementDTO; +import fr.istic.taa.jaxrs.service.generic.AbstractService; + +import java.util.ArrayList; +import java.util.List; + +public class EvenementService extends AbstractService { + + /** + * Constructor. + */ + public EvenementService() { + super(new EvenementDAO()); + } + + private EvenementDAO evenementDAO = new EvenementDAO(); + + /** + * Get an Evenement from the database by its id. + * @param id the id of the Organisateur + * @return the created Evenement DTO + */ + public EvenementDTO getEvenementById(final Long id) { + Evenement evenement = findOne(id); + if (evenement != null) { + return new EvenementDTO(evenement); + } + return null; + } + + /** + * Get all Evenements from the database. + * @return the created Evenement + */ + public List getAllEvenements() { + List evenements = findAll(); + List evenementDTOs = new ArrayList<>(); + for (Evenement evenement : evenements) { + new EvenementDTO(evenement); + evenementDTOs.add(new EvenementDTO(evenement)); + } + return evenementDTOs; + } + + /** + * Create an Evenement in the database. + * @param evenement the Evenement to create + */ + public void createEvenement(final Evenement evenement) { + save(evenement); + } + + /** + * Update an Evenement in the database. + * @param evenement the Evenement to update + */ + public void updateEvenement(final Evenement evenement) { + update(evenement); + } + + /** + * Delete an Evenement from the database. + * @param evenement the Evenement to delete + */ + public void deleteEvenement(final Evenement evenement) { + delete(evenement); + } + + /** + * Update nbSold of an Evenement. + * @param evenement the Evenement to update + */ + public void updateNbSold(final Evenement evenement, final int nbBuy) { + evenementDAO.updateNbSold(evenement, nbBuy); + } + + + public List getEvenementByOrganisateur(Long id) { + List evenements = evenementDAO.findByOrganisateurId(id); + List evenementDTOs = new ArrayList<>(); + for (Evenement evenement : evenements) { + evenementDTOs.add(new EvenementDTO(evenement)); + } + return evenementDTOs; + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/service/business/TicketService.java b/src/main/java/fr/istic/taa/jaxrs/service/business/TicketService.java new file mode 100644 index 00000000..3fc125eb --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/service/business/TicketService.java @@ -0,0 +1,93 @@ +package fr.istic.taa.jaxrs.service.business; + +import fr.istic.taa.jaxrs.dao.business.TicketDAO; +import fr.istic.taa.jaxrs.domain.Ticket; +import fr.istic.taa.jaxrs.dto.TicketDTO; +import fr.istic.taa.jaxrs.service.generic.AbstractService; + +import java.util.ArrayList; +import java.util.List; + +public class TicketService extends AbstractService { + + private TicketDAO ticketDAO = new TicketDAO(); + + /** + * Constructor. + */ + public TicketService() { + super(new TicketDAO()); + } + + + /** + * Get ticket by id. + * @param id ticket id + * @return TicketDTO + */ + public Ticket getTicketById(final Long id) { + return findOne(id); + } + + /** + * Get all tickets. + * @return List of TicketDTO + */ + public List getAllTickets() { + List tickets = findAll(); + List ticketDTOs = new ArrayList<>(); + for (Ticket ticket : tickets) { + ticketDTOs.add(new TicketDTO(ticket)); + } + return ticketDTOs; + } + + /** + * Get tickets by user id. + * @param userId user id + * @return List of TicketDTO + */ + public List getTicketsByUserId(final Long userId) { + + List tickets = ticketDAO.findByUserId(userId); + List ticketDTOs = new ArrayList<>(); + for (Ticket ticket : tickets) { + ticketDTOs.add(new TicketDTO(ticket)); + } + return ticketDTOs; + } + + /** + * Create a ticket. + * @param ticket ticket to create + */ + public void createTicket(final Ticket ticket) { + save(ticket); + } + + /** + * Update a ticket. + * @param ticket ticket to update + */ + public void updateTicket(final Ticket ticket) { + update(ticket); + } + + /** + * Delete a ticket. + * @param ticket ticket to delete + */ + public void deleteTicket(final Ticket ticket) { + delete(ticket); + } + + /** + * Update user id of a ticket. + * @param ticket ticket to update + * @param userId user id + */ + public void updateUserId(final Ticket ticket, final Long userId) { + ticketDAO.updateUserId(ticket, userId); + } + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/service/business/UtilisateurService.java b/src/main/java/fr/istic/taa/jaxrs/service/business/UtilisateurService.java new file mode 100644 index 00000000..9840ce58 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/service/business/UtilisateurService.java @@ -0,0 +1,91 @@ +package fr.istic.taa.jaxrs.service.business; + +import fr.istic.taa.jaxrs.dao.business.UtilisateurDAO; +import fr.istic.taa.jaxrs.domain.Utilisateur; +import fr.istic.taa.jaxrs.dto.UtilisateurDTO; +import fr.istic.taa.jaxrs.service.generic.AbstractService; +import fr.istic.taa.jaxrs.utils.PasswordUtil; + + +import java.util.ArrayList; +import java.util.List; + +public class UtilisateurService extends AbstractService { + + private final UtilisateurDAO utilisateurDAO = new UtilisateurDAO(); + /** + * Constructor. + */ + public UtilisateurService() { + super(new UtilisateurDAO()); + } + + /** + * Get an Utilisateur by its id. + * @param id the id of the Utilisateur + * @return the created Utilisateur DTO + */ + public Utilisateur getUtilisateurById(final Long id) { + return findOne(id); + } + + /** + * Get all Utilisateurs. + * @return the list of Utilisateur DTO + */ + public List getAllUtilisateurs() { + List utilisateurs = findAll(); + List utilisateurDTOs = new ArrayList<>(); + for (Utilisateur utilisateur : utilisateurs) { + new UtilisateurDTO(utilisateur); + utilisateurDTOs.add(new UtilisateurDTO(utilisateur)); + } + return utilisateurDTOs; + } + + /** + * Create an Utilisateur. + * @param utilisateur the Utilisateur to create + */ + public String saveUser(final Utilisateur utilisateur) { + + if (utilisateurDAO.emailExist(utilisateur.getEmail())) { + return "L'email est déjà utilisé"; + } + + String hashedPassword = PasswordUtil.hashPassword(utilisateur.getPassword()); + utilisateur.setPassword(hashedPassword); + save(utilisateur); + return "Utilisateur créé avec succès"; + } + + /** + * Get an Utilisateur by its email. + * @param email the email of the Utilisateur + * @return the created Utilisateur DTO + */ + public Utilisateur getUtilisateurByEmail(final String email) { + return utilisateurDAO.findByEmail(email); + } + + /** + * Check if password is correct. + * @param email the email of the Utilisateur + * @param password the password to check + * @return true if password is correct, false otherwise + */ + public boolean checkPassword(final String email, final String password) { + Utilisateur utilisateur = utilisateurDAO.findByEmail(email); + return PasswordUtil.checkPassword(password, utilisateur.getPassword()); + } + + /** + * Update an Utilisateur. + * @param utilisateur the Utilisateur to update + */ + public void updateUtilisateur(final Utilisateur utilisateur) { + utilisateurDAO.updateUtilisateur(utilisateur); + } + + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/service/business/package-info.java b/src/main/java/fr/istic/taa/jaxrs/service/business/package-info.java new file mode 100644 index 00000000..9b7b21fc --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/service/business/package-info.java @@ -0,0 +1,4 @@ +/** + * This package contains the business services. + */ +package fr.istic.taa.jaxrs.service.business; diff --git a/src/main/java/fr/istic/taa/jaxrs/service/generic/AbstractService.java b/src/main/java/fr/istic/taa/jaxrs/service/generic/AbstractService.java new file mode 100644 index 00000000..12f4a980 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/service/generic/AbstractService.java @@ -0,0 +1,71 @@ +package fr.istic.taa.jaxrs.service.generic; + +import fr.istic.taa.jaxrs.dao.generic.IGenericDao; +import java.io.Serializable; +import java.util.List; + +public abstract class AbstractService implements IGenericService { + + /** + * GenericDao instance to be used by the service. + */ + private final IGenericDao genericDao; + + /** + * Constructor. + * @param paramGenericDao the generic dao + */ + protected AbstractService(final IGenericDao paramGenericDao) { + this.genericDao = paramGenericDao; + } + + /** + * Get the generic dao. + * @param id the id of the entity + * @return the generic dao + */ + public T findOne(final K id) { + return genericDao.findOne(id); + } + + /** + * Get all entities. + * @return a list of entities of type T + */ + public List findAll() { + return genericDao.findAll(); + } + + /** + * Save an entity. + * @param entity the entity to save + */ + public void save(final T entity) { + genericDao.save(entity); + } + + /** + * Update an entity. + * @param entity the entity to update + * @return the updated entity + */ + public T update(final T entity) { + return genericDao.update(entity); + } + + /** + * Delete an entity. + * @param entity the entity to delete + */ + public void delete(final T entity) { + genericDao.delete(entity); + } + + /** + * Delete an entity by its id. + * @param entityId the id of the entity to delete + */ + public void deleteById(final K entityId) { + genericDao.deleteById(entityId); + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/service/generic/IGenericService.java b/src/main/java/fr/istic/taa/jaxrs/service/generic/IGenericService.java new file mode 100644 index 00000000..38887c63 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/service/generic/IGenericService.java @@ -0,0 +1,44 @@ +package fr.istic.taa.jaxrs.service.generic; + +import java.io.Serializable; + +public interface IGenericService { + + /** + * Find an entity by its primary key. + * @param id the primary key + * @return the entity + */ + T findOne(K id); + + /** + * Find all entities. + * @return a list of entities + */ + Iterable findAll(); + + /** + * Save an entity. + * @param entity the entity to save + */ + void save(T entity); + + /** + * Update an entity. + * @param entity the entity to update + * @return the updated entity + */ + T update(T entity); + + /** + * Delete an entity. + * @param entity the entity to delete + */ + void delete(T entity); + + /** + * Delete an entity by its primary key. + * @param entityId the primary key + */ + void deleteById(K entityId); +} diff --git a/src/main/java/fr/istic/taa/jaxrs/service/generic/package-info.java b/src/main/java/fr/istic/taa/jaxrs/service/generic/package-info.java new file mode 100644 index 00000000..19e85090 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/service/generic/package-info.java @@ -0,0 +1,4 @@ +/** + * Package for generic services. + */ +package fr.istic.taa.jaxrs.service.generic; diff --git a/src/main/java/fr/istic/taa/jaxrs/uml/uml.puml b/src/main/java/fr/istic/taa/jaxrs/uml/uml.puml new file mode 100644 index 00000000..20d08b94 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/uml/uml.puml @@ -0,0 +1,55 @@ +@startuml + +package "domain" { + + class Utilisateur { + -long id + -String nom + -String prenom + -String email + -String password + -List tickets + } + + class Organisateur { + -List evenements + } + + class Administrateur { + } + + class Evenement { + -int id + -String nom + -Date date + -String lieu + -String description + -Organisateur organisateur + -String artiste + -String genre + } + + class Stats { + -int id + -Evenement evenement + +Evenement getEvenement() + } + + class Ticket { + -int id + -Utilisateur utilisateur + -Evenement evenement + -Double prix + -Date dateAchat + -StatutTicket statut + } + + Utilisateur <|-- Organisateur + Utilisateur <|-- Administrateur + Utilisateur "1" -- "0..*" Ticket + Evenement "0..*" -- "1" Organisateur + Evenement "0..*" -- "1" Ticket + Stats "0..*" -- "1" Evenement +} + +@enduml diff --git a/src/main/java/fr/istic/taa/jaxrs/utils/AuthResponse.java b/src/main/java/fr/istic/taa/jaxrs/utils/AuthResponse.java new file mode 100644 index 00000000..29857836 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/utils/AuthResponse.java @@ -0,0 +1,23 @@ +package fr.istic.taa.jaxrs.utils; + +public class AuthResponse { + private String token; + private final Long id; + + public AuthResponse(final String token, final Long id) { + this.token = token; + this.id = id; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public Long getId() { + return id; + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/utils/JwtFilter.java b/src/main/java/fr/istic/taa/jaxrs/utils/JwtFilter.java new file mode 100644 index 00000000..63ff9fed --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/utils/JwtFilter.java @@ -0,0 +1,97 @@ +package fr.istic.taa.jaxrs.utils; + +import io.jsonwebtoken.Claims; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.SecurityContext; +import jakarta.ws.rs.ext.Provider; + +import java.security.Principal; + +@Provider +@Priority(Priorities.AUTHENTICATION) +public class JwtFilter implements ContainerRequestFilter { + + private static final String AUTH_HEADER = "Authorization"; + private static final String BEARER_PREFIX = "Bearer "; + + @Override + public void filter(ContainerRequestContext requestContext) { + + String path = requestContext.getUriInfo().getPath(); + System.out.println(path); + if (path.equals("/utilisateur/login")||path.equals("/utilisateur/add") + || path.equals("/evenement/")) + { + return; + } + + System.out.println("🔍 JWT Filter exécuté !"); + + String authHeader = requestContext.getHeaderString(AUTH_HEADER); + if (authHeader == null || !authHeader.startsWith(BEARER_PREFIX)) { + System.out.println(authHeader); + System.out.println(BEARER_PREFIX); + abortRequest(requestContext, "Token manquant ou incorrect"); + System.out.println("Token manquant ou incorrect"); + return; + } + + String token = authHeader.substring(BEARER_PREFIX.length()); + Claims claims = TokenUtil.validateToken(token); + + if (claims == null) { + abortRequest(requestContext, "Token invalide ou expiré"); + System.out.println("Token invalide ou expiré"); + return; + } + + String email = claims.getSubject(); + String role = claims.get("role", String.class); // Le rôle est récupéré depuis le token + + final Principal principal = () -> { + System.out.println("getName"); + return email; + }; + + final SecurityContext securityContext = requestContext.getSecurityContext(); + requestContext.setSecurityContext(new SecurityContext() { + @Override + public Principal getUserPrincipal() { + System.out.println("getUserPrincipal"); + return principal; + } + + @Override + public boolean isUserInRole(String requestedRole) { + System.out.println("isUserInRole"); + return role != null && role.equals(requestedRole); + } + + @Override + public boolean isSecure() { + System.out.println("isSecure"); + return securityContext.isSecure(); + } + + @Override + public String getAuthenticationScheme() { + System.out.println("getAuthenticationScheme"); + return "Bearer"; + } + }); + } + + + + private void abortRequest(ContainerRequestContext requestContext, String message) { + System.out.println("abortRequest"); + requestContext.abortWith(Response.status(Response.Status.UNAUTHORIZED) + .entity("{\"error\":\"" + message + "\"}") + .build()); + } +} + diff --git a/src/main/java/fr/istic/taa/jaxrs/utils/PasswordUtil.java b/src/main/java/fr/istic/taa/jaxrs/utils/PasswordUtil.java new file mode 100644 index 00000000..980bcc75 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/utils/PasswordUtil.java @@ -0,0 +1,16 @@ +package fr.istic.taa.jaxrs.utils; + +import org.mindrot.jbcrypt.BCrypt; + +public class PasswordUtil { + public static String hashPassword(String password) { + return BCrypt.hashpw(password, BCrypt.gensalt(12)); + } + + public static boolean checkPassword(String password, String hashedPassword) { + System.out.println("hashedPassword: " + hashedPassword); + System.out.println("password: " + password); + return BCrypt.checkpw(password, hashedPassword); + } + +} diff --git a/src/main/java/fr/istic/taa/jaxrs/utils/TicketToPDF.java b/src/main/java/fr/istic/taa/jaxrs/utils/TicketToPDF.java new file mode 100644 index 00000000..55247c24 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/utils/TicketToPDF.java @@ -0,0 +1,94 @@ +package fr.istic.taa.jaxrs.utils; + +import com.itextpdf.text.*; +import com.itextpdf.text.pdf.*; +import com.itextpdf.text.pdf.draw.LineSeparator; +import fr.istic.taa.jaxrs.domain.Ticket; +import fr.istic.taa.jaxrs.dto.EvenementDTO; +import fr.istic.taa.jaxrs.service.business.EvenementService; + +import java.io.ByteArrayOutputStream; + +public class TicketToPDF { + + /** + * Generates a PDF document from a Ticket object. + * + * @param ticket The Ticket object to convert to PDF. + * @return A ByteArrayOutputStream containing the PDF data. + */ + + public static ByteArrayOutputStream generateTicketPdf(Ticket ticket) { + try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + // Création du document + Document document = new Document(); + + PdfWriter.getInstance(document, baos); + + document.open(); + + EvenementService evenementService = new EvenementService(); + System.out.println("Ticket evenement id: " + ticket.getEvenement().getId()); + EvenementDTO evenement = evenementService.getEvenementById(ticket.getEvenement().getId()); + + Font titleFont = new Font(Font.FontFamily.HELVETICA, 18, Font.BOLD, BaseColor.BLUE); + Paragraph title = new Paragraph("🎟️ Ticket de Concert", titleFont); + title.setAlignment(Element.ALIGN_CENTER); + document.add(title); + + document.add(new Chunk(new LineSeparator())); + + PdfPTable table = new PdfPTable(2); + table.setWidthPercentage(100); + table.setHorizontalAlignment(Element.ALIGN_CENTER); + + table.addCell(getStyledCell("Événement :", true)); + table.addCell(getStyledCell(evenement.getNom(), false)); + + table.addCell(getStyledCell("Date :", true)); + table.addCell(getStyledCell(evenement.getDate().toString(), false)); + + table.addCell(getStyledCell("Lieu :", true)); + table.addCell(getStyledCell(evenement.getLieu(), false)); + + table.addCell(getStyledCell("Artiste :", true)); + table.addCell(getStyledCell(evenement.getArtiste(), false)); + + table.addCell(getStyledCell("Prix :", true)); + table.addCell(getStyledCell(ticket.getPrix() + "€", false)); + + document.add(table); + + BarcodeQRCode qrCode = new BarcodeQRCode("Ticket ID: " + ticket.getId(), 100, 100, null); + Image qrCodeImage = qrCode.getImage(); + qrCodeImage.setAlignment(Element.ALIGN_CENTER); + qrCodeImage.scaleToFit(100f, 100f); + document.add(qrCodeImage); + + Font messageFont = new Font(Font.FontFamily.HELVETICA, 12, Font.ITALIC); + Paragraph message = new Paragraph("Merci pour votre achat !\nPrésentez ce ticket à l'entrée.", messageFont); + message.setAlignment(Element.ALIGN_CENTER); + document.add(message); + + document.close(); + + return baos; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + + private static PdfPCell getStyledCell(String text, boolean isHeader) { + text = (text != null) ? text : "Non spécifié"; + + PdfPCell cell = new PdfPCell(new Phrase(text)); + cell.setPadding(5); + if (isHeader) { + cell.setBackgroundColor(BaseColor.LIGHT_GRAY); + cell.setPhrase(new Phrase(text, new Font(Font.FontFamily.HELVETICA, 12, Font.BOLD))); + } + return cell; + } +} diff --git a/src/main/java/fr/istic/taa/jaxrs/utils/TokenUtil.java b/src/main/java/fr/istic/taa/jaxrs/utils/TokenUtil.java new file mode 100644 index 00000000..74372f09 --- /dev/null +++ b/src/main/java/fr/istic/taa/jaxrs/utils/TokenUtil.java @@ -0,0 +1,53 @@ +package fr.istic.taa.jaxrs.utils; + +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import io.jsonwebtoken.security.Keys; + +import java.nio.charset.StandardCharsets; +import java.security.Key; +import java.util.Date; + +public class TokenUtil { + private static final String SECRET_KEY = "ma_clé_secrète_tres_longue_et_securisee_123456"; + + public static String generateToken(String email, String role) { + long expirationTime = 86400000L; + Date now = new Date(); + Date expirationDate = new Date(now.getTime() + expirationTime); + System.out.println("Token expiration time: " + expirationTime); + + Key key = Keys.hmacShaKeyFor(SECRET_KEY.getBytes(StandardCharsets.UTF_8)); + + return Jwts.builder() + .setSubject(email) + .claim("role", role) // Ajouter le rôle de l'utilisateur + .setIssuedAt(now) + .setExpiration(expirationDate) + .signWith(key, SignatureAlgorithm.HS256) + .compact(); + } + + public static Claims validateToken(String token) { + try { + Key key = Keys.hmacShaKeyFor(SECRET_KEY.getBytes(StandardCharsets.UTF_8)); + return Jwts.parser() + .setSigningKey(key) + .build() + .parseClaimsJws(token) + .getBody(); + } catch (Exception e) { + return null; + } + } + + public static String extractEmail(String token) { + Claims claims = validateToken(token); + if (claims != null) { + return claims.getSubject(); + } + return null; + } + +} diff --git a/src/main/webapp/swagger/.agignore b/src/main/webapp/swagger/.agignore new file mode 100644 index 00000000..849ddff3 --- /dev/null +++ b/src/main/webapp/swagger/.agignore @@ -0,0 +1 @@ +dist/ diff --git a/src/main/webapp/swagger/.browserslistrc b/src/main/webapp/swagger/.browserslistrc new file mode 100644 index 00000000..7894c03b --- /dev/null +++ b/src/main/webapp/swagger/.browserslistrc @@ -0,0 +1,29 @@ +[node-production] +maintained node versions + +[node-development] +node 20.3.0 + +[browser-production] +> 1% +last 2 versions +Firefox ESR +not dead + +[browser-development] +last 1 chrome version +last 1 firefox version +last 1 safari version + +[isomorphic-production] +> 1% +last 2 versions +Firefox ESR +not dead +maintained node versions + +[isomorphic-development] +last 1 chrome version +last 1 firefox version +last 1 safari version +node 20.3.0 diff --git a/src/main/webapp/swagger/.commitlintrc.json b/src/main/webapp/swagger/.commitlintrc.json new file mode 100644 index 00000000..a55865b3 --- /dev/null +++ b/src/main/webapp/swagger/.commitlintrc.json @@ -0,0 +1,25 @@ +{ + "extends": [ + "@commitlint/config-conventional" + ], + "rules": { + "header-max-length": [ + 2, + "always", + 69 + ], + "scope-case": [ + 2, + "always", + [ + "camel-case", + "kebab-case", + "upper-case" + ] + ], + "subject-case": [ + 0, + "always" + ] + } +} diff --git a/src/main/webapp/swagger/.dockerignore b/src/main/webapp/swagger/.dockerignore new file mode 100644 index 00000000..47c624e5 --- /dev/null +++ b/src/main/webapp/swagger/.dockerignore @@ -0,0 +1,8 @@ +/.git +/.github +/dev-helpers +/docs +/src +/swagger-ui-dist-package +/test +/node_modules \ No newline at end of file diff --git a/src/main/webapp/swagger/.editorconfig b/src/main/webapp/swagger/.editorconfig new file mode 100644 index 00000000..2d959463 --- /dev/null +++ b/src/main/webapp/swagger/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +end_of_line = lf +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true +[*.md] +trim_trailing_whitespace = false diff --git a/src/main/webapp/swagger/.eslintignore b/src/main/webapp/swagger/.eslintignore new file mode 100644 index 00000000..5e20fb04 --- /dev/null +++ b/src/main/webapp/swagger/.eslintignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +test/e2e-selenium/ diff --git a/src/main/webapp/swagger/.eslintrc b/src/main/webapp/swagger/.eslintrc new file mode 100644 index 00000000..3f24d9af --- /dev/null +++ b/src/main/webapp/swagger/.eslintrc @@ -0,0 +1,38 @@ +parser: "@babel/eslint-parser" +env: + browser: true + node: true + es6: true + jest: true + jest/globals: true +parserOptions: + ecmaFeatures: + jsx: true +extends: + - eslint:recommended + - plugin:react/recommended +plugins: + - react + - import + - jest +settings: + react: + pragma: React + version: '15.0' +rules: + semi: [2, never] + strict: 0 + quotes: [2, double, { avoidEscape: true, allowTemplateLiterals: true }] + no-unused-vars: 2 + no-multi-spaces: 1 + camelcase: 1 + no-use-before-define: [2, nofunc] + no-underscore-dangle: 0 + no-unused-expressions: 1 + comma-dangle: 0 + no-console: [2, { allow: [warn, error] }] + react/jsx-no-bind: 1 + react/jsx-no-target-blank: 2 + react/display-name: 0 + import/no-extraneous-dependencies: 2 + react/jsx-filename-extension: 2 diff --git a/src/main/webapp/swagger/.gitattributes b/src/main/webapp/swagger/.gitattributes new file mode 100644 index 00000000..dad06c52 --- /dev/null +++ b/src/main/webapp/swagger/.gitattributes @@ -0,0 +1 @@ +docker-run.sh text eol=lf diff --git a/src/main/webapp/swagger/.github/ISSUE_TEMPLATE/Bug_report.md b/src/main/webapp/swagger/.github/ISSUE_TEMPLATE/Bug_report.md new file mode 100644 index 00000000..47e0233c --- /dev/null +++ b/src/main/webapp/swagger/.github/ISSUE_TEMPLATE/Bug_report.md @@ -0,0 +1,73 @@ +--- +name: Bug report +about: Report an issue you're experiencing + +--- + + + +### Q&A (please complete the following information) + - OS: [e.g. macOS] + - Browser: [e.g. chrome, safari] + - Version: [e.g. 22] + - Method of installation: [e.g. npm, dist assets] + - Swagger-UI version: [e.g. 3.10.0] + - Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] + +### Content & configuration + + +Example Swagger/OpenAPI definition: +```yaml +# your YAML here +``` + +Swagger-UI configuration options: +```js +SwaggerUI({ + // your config options here +}) +``` + +``` +?yourQueryStringConfig +``` + +### Describe the bug you're encountering + + +### To reproduce... + +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +### Expected behavior + + +### Screenshots + + +### Additional context or thoughts + diff --git a/src/main/webapp/swagger/.github/ISSUE_TEMPLATE/Feature_request.md b/src/main/webapp/swagger/.github/ISSUE_TEMPLATE/Feature_request.md new file mode 100644 index 00000000..2aaa760e --- /dev/null +++ b/src/main/webapp/swagger/.github/ISSUE_TEMPLATE/Feature_request.md @@ -0,0 +1,42 @@ +--- +name: Feature request +about: Suggest a new feature or enhancement for this project + +--- + + ### Content & configuration + +Swagger/OpenAPI definition: + ```yaml + # your YAML here + ``` + + Swagger-UI configuration options: + ```js + SwaggerUI({ + // your config options here + }) + ``` + + ``` + ?yourQueryStringConfig + ``` + + +### Is your feature request related to a problem? + + +### Describe the solution you'd like + + +### Describe alternatives you've considered + + +### Additional context + diff --git a/src/main/webapp/swagger/.github/ISSUE_TEMPLATE/Support.md b/src/main/webapp/swagger/.github/ISSUE_TEMPLATE/Support.md new file mode 100644 index 00000000..81d8b1e5 --- /dev/null +++ b/src/main/webapp/swagger/.github/ISSUE_TEMPLATE/Support.md @@ -0,0 +1,46 @@ +--- +name: Support +about: Ask a question or request help with your implementation. + +--- + + + +### Q&A (please complete the following information) + - OS: [e.g. macOS] + - Browser: [e.g. chrome, safari] + - Version: [e.g. 22] + - Method of installation: [e.g. npm, dist assets] + - Swagger-UI version: [e.g. 3.10.0] + - Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] + +### Content & configuration + + +Swagger/OpenAPI definition: +```yaml +# your YAML here +``` + +Swagger-UI configuration options: +```js +SwaggerUI({ + // your config options here +}) +``` + +``` +?yourQueryStringConfig +``` + +### Screenshots + + +### How can we help? + diff --git a/src/main/webapp/swagger/.github/dependabot.yaml b/src/main/webapp/swagger/.github/dependabot.yaml new file mode 100644 index 00000000..6475663f --- /dev/null +++ b/src/main/webapp/swagger/.github/dependabot.yaml @@ -0,0 +1,35 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "23:00" + commit-message: + prefix: "chore" + include: "scope" + open-pull-requests-limit: 3 + ignore: + # node-fetch must be synced manually + - dependency-name: "node-fetch" + + - package-ecosystem: "docker" + # Look for a `Dockerfile` in the `root` directory + directory: "/" + # Check for updates once a week + schedule: + interval: "weekly" + time: "23:00" + + - package-ecosystem: "github-actions" + target-branch: "master" + directory: "/" + schedule: + interval: "daily" + time: "23:00" + commit-message: + prefix: "chore" + include: "scope" + open-pull-requests-limit: 3 + + diff --git a/src/main/webapp/swagger/.github/lock.yml b/src/main/webapp/swagger/.github/lock.yml new file mode 100644 index 00000000..e0b8c11a --- /dev/null +++ b/src/main/webapp/swagger/.github/lock.yml @@ -0,0 +1,15 @@ +daysUntilLock: 365 +skipCreatedBefore: 2017-03-29 # initial release of Swagger UI 3.0.0 +exemptLabels: [] +lockLabel: "locked-by: lock-bot" +setLockReason: false +only: issues +lockComment: false +# lockComment: | +# Locking due to inactivity. + +# This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content. + +# If you think you're experiencing something similar to what you've found here: please [open a new issue](https://github.com/swagger-api/swagger-ui/issues/new/choose), follow the template, and reference this issue in your report. + +# Thanks! diff --git a/src/main/webapp/swagger/.github/pull_request_template.md b/src/main/webapp/swagger/.github/pull_request_template.md new file mode 100644 index 00000000..64e9cf6f --- /dev/null +++ b/src/main/webapp/swagger/.github/pull_request_template.md @@ -0,0 +1,55 @@ + + +### Description + + + + +### Motivation and Context + + + + + + + +### How Has This Been Tested? + + + + + + +### Screenshots (if appropriate): + + + +## Checklist + + + +### My PR contains... + +- [ ] No code changes (`src/` is unmodified: changes to documentation, CI, metadata, etc.) +- [ ] Dependency changes (any modification to dependencies in `package.json`) +- [ ] Bug fixes (non-breaking change which fixes an issue) +- [ ] Improvements (misc. changes to existing features) +- [ ] Features (non-breaking change which adds functionality) + +### My changes... +- [ ] are breaking changes to a public API (config options, System API, major UI change, etc). +- [ ] are breaking changes to a private API (Redux, component props, utility functions, etc.). +- [ ] are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc). +- [ ] are not breaking changes. + +### Documentation +- [ ] My changes do not require a change to the project documentation. +- [ ] My changes require a change to the project documentation. +- [ ] If yes to above: I have updated the documentation accordingly. + +### Automated tests +- [ ] My changes can not or do not need to be tested. +- [ ] My changes can and should be tested by unit and/or integration tests. +- [ ] If yes to above: I have added tests to cover my changes. +- [ ] If yes to above: I have taken care to cover edge cases in my tests. +- [ ] All new and existing tests passed. diff --git a/src/main/webapp/swagger/.github/workflows/codeql.yml b/src/main/webapp/swagger/.github/workflows/codeql.yml new file mode 100644 index 00000000..464ec9dd --- /dev/null +++ b/src/main/webapp/swagger/.github/workflows/codeql.yml @@ -0,0 +1,63 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '16 04 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Use only 'java' to analyze code written in Java, Kotlin or both + # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + config: | + paths-ignore: + - 'dist/' + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/src/main/webapp/swagger/.github/workflows/dependabot-merge.yml b/src/main/webapp/swagger/.github/workflows/dependabot-merge.yml new file mode 100644 index 00000000..21399882 --- /dev/null +++ b/src/main/webapp/swagger/.github/workflows/dependabot-merge.yml @@ -0,0 +1,40 @@ +name: Merge me! + +on: + pull_request_target: + branches: [ master, next ] + +permissions: + contents: read + +jobs: + merge-me: + name: Merge me! + if: github.actor == 'dependabot[bot]' + runs-on: ubuntu-latest + steps: + # This first step will fail if there's no metadata and so the approval + # will not occur. + - name: Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v2.3.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + # Here the PR gets approved. + - name: Approve a PR + if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }} + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }} + # Finally, tell dependabot to merge the PR if all checks are successful + - name: Instruct dependabot to squash & merge + if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }} + uses: mshick/add-pr-comment@v2 + with: + repo-token: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }} + allow-repeats: true + message: | + @dependabot squash and merge + env: + GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }} diff --git a/src/main/webapp/swagger/.github/workflows/docker-build-push.yml b/src/main/webapp/swagger/.github/workflows/docker-build-push.yml new file mode 100644 index 00000000..5b32e21d --- /dev/null +++ b/src/main/webapp/swagger/.github/workflows/docker-build-push.yml @@ -0,0 +1,143 @@ +# inspired by https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ +name: Build & Push SwaggerUI multi platform Docker image + +on: + workflow_dispatch: + inputs: + git_ref: + description: Git branch, tag or SHA to checkout. + type: string + required: true + docker_tag: + description: Docker tag associated with the `git_ref` + type: string + required: true + + repository_dispatch: + type: [docker_build_push] + +env: + REGISTRY_IMAGE: swaggerapi/swagger-ui + +jobs: + inputs: + name: Normalize inputs + runs-on: ubuntu-latest + outputs: + git_ref: ${{ steps.workflow_dispatch.outputs.git_ref || steps.repository_dispatch.outputs.git_ref }} + docker_tag: ${{ steps.workflow_dispatch.outputs.docker_tag || steps.repository_dispatch.outputs.docker_tag }} + + steps: + - name: Normalize inputs of `workflow_dispatch` event + id: workflow_dispatch + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + echo "git_ref=${{ inputs.git_ref }}" >> "$GITHUB_OUTPUT" + echo "docker_tag=${{ inputs.docker_tag }}" >> "$GITHUB_OUTPUT" + + - name: Normalize inputs of `repository_dispatch` event + id: repository_dispatch + if: ${{ github.event_name == 'repository_dispatch' }} + run: | + echo "git_ref=${{ github.event.client_payload.git_ref }}" >> "$GITHUB_OUTPUT" + echo "docker_tag=${{ github.event.client_payload.docker_tag }}" >> "$GITHUB_OUTPUT" + + + + build: + name: Build & Push SwaggerUI platform specific Docker images + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform: + # linux/amd64 is already built by Jenkins + - linux/arm/v6 + - linux/arm64 + - linux/386 + - linux/ppc64le + needs: + - inputs + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.inputs.outputs.git_ref }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_SB_USERNAME }} + password: ${{ secrets.DOCKERHUB_SB_PASSWORD }} + + - name: Build and push by digest + id: build + uses: docker/build-push-action@v6 + with: + context: . + platforms: ${{ matrix.platform }} + provenance: false + outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Sanitize platform variable + id: sanitize_platform + run: | + SANITIZED_PLATFORM="${{ matrix.platform }}" # Assuming direct usage for simplicity + SANITIZED_PLATFORM="${SANITIZED_PLATFORM//[^a-zA-Z0-9_-]/}" # Remove special chars + echo "SANITIZED_PLATFORM=${SANITIZED_PLATFORM}" # Echo for debug + echo "::set-output name=sanitized_platform::${SANITIZED_PLATFORM}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digest-${{ steps.sanitize_platform.outputs.sanitized_platform }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + name: Merge platform specific Docker image into multi platform image + runs-on: ubuntu-latest + needs: + - inputs + - build + + steps: + - name: Download digests + uses: actions/download-artifact@v4 + with: + pattern: digest-* + path: /tmp/digests + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_SB_USERNAME }} + password: ${{ secrets.DOCKERHUB_SB_PASSWORD }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create -t ${{ env.REGISTRY_IMAGE }}:${{ needs.inputs.outputs.docker_tag }} \ + ${{ env.REGISTRY_IMAGE }}:${{ needs.inputs.outputs.docker_tag }} \ + $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ needs.inputs.outputs.docker_tag }} diff --git a/src/main/webapp/swagger/.github/workflows/docker-image-check.yml b/src/main/webapp/swagger/.github/workflows/docker-image-check.yml new file mode 100644 index 00000000..dd119606 --- /dev/null +++ b/src/main/webapp/swagger/.github/workflows/docker-image-check.yml @@ -0,0 +1,23 @@ +name: Security scan for docker image + +on: + workflow_dispatch: + schedule: + - cron: '30 4 * * *' + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + image-ref: 'docker.swagger.io/swaggerapi/swagger-ui:unstable' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' diff --git a/src/main/webapp/swagger/.github/workflows/nodejs.yml b/src/main/webapp/swagger/.github/workflows/nodejs.yml new file mode 100644 index 00000000..38604fdf --- /dev/null +++ b/src/main/webapp/swagger/.github/workflows/nodejs.yml @@ -0,0 +1,86 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master, next ] + pull_request: + branches: [ master, next ] + +env: + CYPRESS_CACHE_FOLDER: cypress/cache + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Cache Node Modules and Cypress binary + uses: actions/cache@v4 + id: cache-primes + with: + path: | + node_modules + ${{ env.CYPRESS_CACHE_FOLDER }} + key: ${{ runner.os }}-node-and-cypress-${{ hashFiles('package-lock.json') }} + + - name: Install dependencies + if: steps.cache-primes.outputs.cache-hit != 'true' + run: npm ci + + - name: Lint code for errors only + run: npm run lint-errors + + - name: Run all tests + run: npm run test:unit + env: + CI: true + + - name: Build SwaggerUI + run: npm run build + + - name: Test build artifacts + run: npm run test:artifact + + e2e-tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + containers: ['+(a11y|security|bugs)/**/*cy.js', 'features/**/+(o|d)*.cy.js', 'features/**/m*.cy.js', 'features/**/!(o|d|m)*.cy.js'] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Cache Node Modules and Cypress binary + uses: actions/cache@v4 + id: cache-primes + with: + path: | + node_modules + ${{ env.CYPRESS_CACHE_FOLDER }} + key: ${{ runner.os }}-node-and-cypress-${{ hashFiles('package-lock.json') }} + + - name: Install dependencies + if: steps.cache-primes.outputs.cache-hit != 'true' + run: npm ci + + - name: Cypress Test + run: npx start-server-and-test cy:start http://localhost:3204 'npm run cy:run -- --spec "test/e2e-cypress/e2e/${{ matrix.containers }}"' diff --git a/src/main/webapp/swagger/.github/workflows/release-swagger-ui-react.yml b/src/main/webapp/swagger/.github/workflows/release-swagger-ui-react.yml new file mode 100644 index 00000000..e078a03a --- /dev/null +++ b/src/main/webapp/swagger/.github/workflows/release-swagger-ui-react.yml @@ -0,0 +1,79 @@ +name: Build & Release SwaggerUI-React@next + +# single-stage +on: + workflow_dispatch: + branches: + - next + +# multi-stage automation +# on: +# workflow_run: +# workflows: ["Release SwaggerUI@next"] +# types: +# - completed +# branches: [next] + +defaults: + run: + working-directory: flavors/swagger-ui-react/release +jobs: + release-swagger-ui-react: + name: Release SwaggerUI React + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + ref: next + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Prepare SwaggerUI dist + run: | + cd ../../../ + npm ci + npm run build + + - name: Install dependencies (to create package manifest) + run: npm ci + + - name: MKDIR `dist` working directory + run: mkdir -p ../dist + + - name: Copy SwaggerUI dist files to MKDIR + run: | + ls ../dist + cp ../../../dist/swagger-ui-es-bundle-core.js ../dist + cp ../../../dist/swagger-ui-es-bundle-core.js.map ../dist + cp ../../../dist/swagger-ui.css ../dist + cp ../../../dist/swagger-ui.css.map ../dist + + - name: Create a releasable package manifest + run: node create-manifest.js > ../dist/package.json + + - name: Transpile our top-level React Component + run: | + ../../../node_modules/.bin/cross-env BABEL_ENV=commonjs ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.jsx > ../dist/commonjs.js + ../../../node_modules/.bin/cross-env BABEL_ENV=es ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.jsx > ../dist/index.js + + - name: Copy our README into the dist folder for npm + run: cp ../README.md ../dist + + - name: Copy LICENSE & NOTICE into the dist folder for npm + run: | + cp ../../../LICENSE ../dist + cp ../../../NOTICE ../dist + + - name: Run the release from the dist folder + run: | + cd ../dist + pwd + npm publish . --tag alpha + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/src/main/webapp/swagger/.github/workflows/release-swagger-ui.yml b/src/main/webapp/swagger/.github/workflows/release-swagger-ui.yml new file mode 100644 index 00000000..417ff087 --- /dev/null +++ b/src/main/webapp/swagger/.github/workflows/release-swagger-ui.yml @@ -0,0 +1,73 @@ +name: Release SwaggerUI@next + +on: + workflow_dispatch: + branches: + - next + +jobs: + release-swagger-ui: + name: Release SwaggerUI + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + ref: next + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Determine the next release version + uses: cycjimmy/semantic-release-action@v4 + with: + dry_run: true + extra_plugins: | + @semantic-release/git + @semantic-release/exec + env: + GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Nothing to release + if: ${{ env.NEXT_RELEASE_VERSION == '' }} + uses: actions/github-script@v7 + with: + script: | + core.setFailed('Nothing to release') + + - name: Install dependencies + run: npm ci + + - name: Prepare release + run: | + npm run build + + - name: Semantic Release + id: semantic + uses: cycjimmy/semantic-release-action@v4 + with: + dry_run: false + extra_plugins: | + @semantic-release/git + env: + GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Release failed + if: steps.semantic.outputs.new_release_published == 'false' + uses: actions/github-script@v7 + with: + script: | + core.setFailed('Release failed') + + - name: Release published + run: | + echo ${{ steps.semantic.outputs.new_release_version }} + echo ${{ steps.semantic.outputs.new_release_major_version }} + echo ${{ steps.semantic.outputs.new_release_minor_version }} + echo ${{ steps.semantic.outputs.new_release_patch_version }} diff --git a/src/main/webapp/swagger/.gitignore b/src/main/webapp/swagger/.gitignore new file mode 100644 index 00000000..e9578575 --- /dev/null +++ b/src/main/webapp/swagger/.gitignore @@ -0,0 +1,29 @@ +node_modules +.idea +.vscode +.deps_check +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local +.nyc_output +npm-debug.log* +.eslintcache +*.iml +selenium-debug.log +chromedriver.log +test/e2e/db.json +docs/_book +dev-helpers/examples + +# dist +flavors/**/dist/* +/lib +/es +dist/log* +/swagger-ui-*.tgz + +# Cypress +test/e2e-cypress/screenshots +test/e2e-cypress/videos diff --git a/src/main/webapp/swagger/.husky/commit-msg b/src/main/webapp/swagger/.husky/commit-msg new file mode 100644 index 00000000..951570f7 --- /dev/null +++ b/src/main/webapp/swagger/.husky/commit-msg @@ -0,0 +1 @@ +npx commitlint -e diff --git a/src/main/webapp/swagger/.husky/pre-commit b/src/main/webapp/swagger/.husky/pre-commit new file mode 100644 index 00000000..2312dc58 --- /dev/null +++ b/src/main/webapp/swagger/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/src/main/webapp/swagger/.lintstagedrc b/src/main/webapp/swagger/.lintstagedrc new file mode 100644 index 00000000..5189da9a --- /dev/null +++ b/src/main/webapp/swagger/.lintstagedrc @@ -0,0 +1,3 @@ +{ + "*.js": "eslint" +} diff --git a/src/main/webapp/swagger/.npmignore b/src/main/webapp/swagger/.npmignore new file mode 100644 index 00000000..59950fe3 --- /dev/null +++ b/src/main/webapp/swagger/.npmignore @@ -0,0 +1,15 @@ +* +*/ +!README.md +!NOTICE +!package.json +!dist/swagger-ui.js +!dist/swagger-ui.js.map +!dist/swagger-ui-bundle.js +!dist/swagger-ui-standalone-preset.js +!dist/swagger-ui-es-bundle.js +!dist/swagger-ui-es-bundle-core.js +!dist/swagger-ui-es-bundle-core.js.map +!dist/swagger-ui.css +!dist/swagger-ui.css.map +!dist/oauth2-redirect.html diff --git a/src/main/webapp/swagger/.npmrc b/src/main/webapp/swagger/.npmrc new file mode 100644 index 00000000..d508edc4 --- /dev/null +++ b/src/main/webapp/swagger/.npmrc @@ -0,0 +1 @@ +save-prefix="=" diff --git a/src/main/webapp/swagger/.nvmrc b/src/main/webapp/swagger/.nvmrc new file mode 100644 index 00000000..4adfbc35 --- /dev/null +++ b/src/main/webapp/swagger/.nvmrc @@ -0,0 +1 @@ +20.3.0 diff --git a/src/main/webapp/swagger/.prettierrc.yaml b/src/main/webapp/swagger/.prettierrc.yaml new file mode 100644 index 00000000..2e34d757 --- /dev/null +++ b/src/main/webapp/swagger/.prettierrc.yaml @@ -0,0 +1,5 @@ +semi: false +trailingComma: es5 +endOfLine: lf +requirePragma: true +insertPragma: true diff --git a/src/main/webapp/swagger/.releaserc b/src/main/webapp/swagger/.releaserc new file mode 100644 index 00000000..4efddeee --- /dev/null +++ b/src/main/webapp/swagger/.releaserc @@ -0,0 +1,35 @@ +{ + "branches": [ + { + "name": "master" + }, + { + "name": "next", + "channel": "alpha", + "prerelease": "alpha" + } + ], + "tagFormat": "v${version}", + "plugins": [ + "@semantic-release/commit-analyzer", + [ + "@semantic-release/exec", + { + "verifyReleaseCmd": "echo \"NEXT_RELEASE_VERSION=${nextRelease.version}\" >> $GITHUB_ENV" + } + ], + "@semantic-release/release-notes-generator", + "@semantic-release/npm", + "@semantic-release/github", + [ + "@semantic-release/git", + { + "assets": [ + "package.json", + "package-lock.json" + ], + "message": "chore(release): cut the ${nextRelease.version} release\n\n${nextRelease.notes}" + } + ] + ] +} \ No newline at end of file diff --git a/src/main/webapp/swagger/Dockerfile b/src/main/webapp/swagger/Dockerfile new file mode 100644 index 00000000..89a24e58 --- /dev/null +++ b/src/main/webapp/swagger/Dockerfile @@ -0,0 +1,30 @@ +# Looking for information on environment variables? +# We don't declare them here — take a look at our docs. +# https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md + +FROM nginx:1.27.3-alpine + +RUN apk add --update-cache --no-cache "nodejs" + +LABEL maintainer="char0n" + +ENV API_KEY="**None**" \ + SWAGGER_JSON="/app/swagger.json" \ + PORT="8080" \ + PORT_IPV6="" \ + BASE_URL="/" \ + SWAGGER_JSON_URL="" \ + CORS="true" \ + EMBEDDING="false" + +COPY --chown=nginx:nginx --chmod=0666 ./docker/default.conf.template ./docker/cors.conf ./docker/embedding.conf /etc/nginx/templates/ + +COPY --chmod=0666 ./dist/* /usr/share/nginx/html/ +COPY --chmod=0555 ./docker/docker-entrypoint.d/ /docker-entrypoint.d/ +COPY --chmod=0666 ./docker/configurator /usr/share/nginx/configurator + +# Simulates running NGINX as a non root; in future we want to use nginxinc/nginx-unprivileged. +# In future we will have separate unpriviledged images tagged as v5.1.2-unprivileged. +RUN chmod 777 /usr/share/nginx/html/ /etc/nginx/conf.d/ /etc/nginx/conf.d/default.conf /var/cache/nginx/ /var/run/ + +EXPOSE 8080 diff --git a/src/main/webapp/swagger/LICENSE b/src/main/webapp/swagger/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/src/main/webapp/swagger/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/src/main/webapp/swagger/NOTICE b/src/main/webapp/swagger/NOTICE new file mode 100644 index 00000000..ab788a27 --- /dev/null +++ b/src/main/webapp/swagger/NOTICE @@ -0,0 +1,2 @@ +swagger-ui +Copyright 2020-2021 SmartBear Software Inc. diff --git a/src/main/webapp/swagger/README.md b/src/main/webapp/swagger/README.md new file mode 100644 index 00000000..8996042e --- /dev/null +++ b/src/main/webapp/swagger/README.md @@ -0,0 +1,116 @@ +# + +[![NPM version](https://badge.fury.io/js/swagger-ui.svg)](http://badge.fury.io/js/swagger-ui) +[![Build Status](https://jenkins.swagger.io/view/OSS%20-%20JavaScript/job/oss-swagger-ui-master/badge/icon?subject=jenkins%20build)](https://jenkins.swagger.io/view/OSS%20-%20JavaScript/job/oss-swagger-ui-master/) +[![npm audit](https://jenkins.swagger.io/buildStatus/icon?job=oss-swagger-ui-security-audit&subject=npm%20audit)](https://jenkins.swagger.io/job/oss-swagger-ui-security-audit/lastBuild/console) +![total GitHub contributors](https://img.shields.io/github/contributors-anon/swagger-api/swagger-ui.svg) + +![monthly npm installs](https://img.shields.io/npm/dm/swagger-ui.svg?label=npm%20downloads) +![docker registry](https://img.shields.io/badge/docker-docker.swagger.io%2Fswaggerapi%2Fswagger--ui-blue) +![monthly packagist installs](https://img.shields.io/packagist/dm/swagger-api/swagger-ui.svg?label=packagist%20installs) +![gzip size](https://img.shields.io/bundlephobia/minzip/swagger-ui.svg?label=gzip%20size) + +## Introduction +[Swagger UI](https://swagger.io/tools/swagger-ui/) allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without having any of the implementation logic in place. It’s automatically generated from your OpenAPI (formerly known as Swagger) Specification, with the visual documentation making it easy for back end implementation and client side consumption. + +## General +**👉🏼 Want to score an easy open-source contribution?** Check out our [Good first issue](https://github.com/swagger-api/swagger-ui/issues?q=is%3Aissue+is%3Aopen+label%3A%22Good+first+issue%22) label. + +**🕰️ Looking for the older version of Swagger UI?** Refer to the [*2.x* branch](https://github.com/swagger-api/swagger-ui/tree/2.x). + + +This repository publishes three different NPM modules: + +* [swagger-ui](https://www.npmjs.com/package/swagger-ui) is a traditional npm module intended for use in single-page applications that are capable of resolving dependencies (via Webpack, Browserify, etc.). +* [swagger-ui-dist](https://www.npmjs.com/package/swagger-ui-dist) is a dependency-free module that includes everything you need to serve Swagger UI in a server-side project, or a single-page application that can't resolve npm module dependencies. +* [swagger-ui-react](https://www.npmjs.com/package/swagger-ui-react) is Swagger UI packaged as a React component for use in React applications. + +We strongly suggest that you use `swagger-ui` instead of `swagger-ui-dist` if you're building a single-page application, since `swagger-ui-dist` is significantly larger. + +If you are looking for plain ol' HTML/JS/CSS, [download the latest release](https://github.com/swagger-api/swagger-ui/releases/latest) and copy the contents of the `/dist` folder to your server. + + +## Compatibility +The OpenAPI Specification has undergone 5 revisions since initial creation in 2010. Compatibility between Swagger UI and the OpenAPI Specification is as follows: + +| Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes | +|--------------------|--------------|----------------------------------------|-----------------------------------------------------------------------| +| 5.0.0 | 2023-06-12 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0 | [tag v5.0.0](https://github.com/swagger-api/swagger-ui/tree/v5.0.0) | +| 4.0.0 | 2021-11-03 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3 | [tag v4.0.0](https://github.com/swagger-api/swagger-ui/tree/v4.0.0) | +| 3.18.3 | 2018-08-03 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3 | [tag v3.18.3](https://github.com/swagger-api/swagger-ui/tree/v3.18.3) | +| 3.0.21 | 2017-07-26 | 2.0 | [tag v3.0.21](https://github.com/swagger-api/swagger-ui/tree/v3.0.21) | +| 2.2.10 | 2017-01-04 | 1.1, 1.2, 2.0 | [tag v2.2.10](https://github.com/swagger-api/swagger-ui/tree/v2.2.10) | +| 2.1.5 | 2016-07-20 | 1.1, 1.2, 2.0 | [tag v2.1.5](https://github.com/swagger-api/swagger-ui/tree/v2.1.5) | +| 2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) | +| 1.0.13 | 2013-03-08 | 1.1, 1.2 | [tag v1.0.13](https://github.com/swagger-api/swagger-ui/tree/v1.0.13) | +| 1.0.1 | 2011-10-11 | 1.0, 1.1 | [tag v1.0.1](https://github.com/swagger-api/swagger-ui/tree/v1.0.1) | + +## Anonymized analytics + +SwaggerUI uses [Scarf](https://scarf.sh/) to collect [anonymized installation analytics](https://github.com/scarf-sh/scarf-js?tab=readme-ov-file#as-a-user-of-a-package-using-scarf-js-what-information-does-scarf-js-send-about-me). These analytics help support the maintainers of this library and ONLY run during installation. To [opt out](https://github.com/scarf-sh/scarf-js?tab=readme-ov-file#as-a-user-of-a-package-using-scarf-js-how-can-i-opt-out-of-analytics), you can set the `scarfSettings.enabled` field to `false` in your project's `package.json`: + +``` +// package.json +{ + // ... + "scarfSettings": { + "enabled": false + } + // ... +} +``` + +Alternatively, you can set the environment variable `SCARF_ANALYTICS` to `false` as part of the environment that installs your npm packages, e.g., `SCARF_ANALYTICS=false npm install`. + +## Documentation + +#### Usage +- [Installation](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/installation.md) +- [Configuration](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/configuration.md) +- [CORS](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/cors.md) +- [OAuth2](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/oauth2.md) +- [Deep Linking](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/deep-linking.md) +- [Limitations](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/limitations.md) +- [Version detection](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/usage/version-detection.md) + +#### Customization +- [Overview](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/customization/overview.md) +- [Plugin API](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/customization/plugin-api.md) +- [Custom layout](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/customization/custom-layout.md) + +#### Development +- [Setting up](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/development/setting-up.md) +- [Scripts](https://github.com/swagger-api/swagger-ui/blob/HEAD/docs/development/scripts.md) + +#### Contributing +- [Contributing](https://github.com/swagger-api/.github/blob/HEAD/CONTRIBUTING.md) + +##### Integration Tests + +You will need JDK of version 7 or higher as instructed here +https://nightwatchjs.org/guide/getting-started/installation.html#install-selenium-server + +Integration tests can be run locally with `npm run e2e` - be sure you aren't running a dev server when testing! + +### Browser support +Swagger UI works in the latest versions of Chrome, Safari, Firefox, and Edge. + +### Known Issues + +To help with the migration, here are the currently known issues with 3.X. This list will update regularly, and will not include features that were not implemented in previous versions. + +- Only part of the parameters previously supported are available. +- The JSON Form Editor is not implemented. +- Support for `collectionFormat` is partial. +- l10n (translations) is not implemented. +- Relative path support for external files is not implemented. + +## Security contact + +Please disclose any security-related issues or vulnerabilities by emailing [security@swagger.io](mailto:security@swagger.io), instead of using the public issue tracker. + +## License + +SwaggerUI is licensed under [Apache 2.0 license](https://github.com/swagger-api/swagger-ui/blob/master/LICENSE). +SwaggerUI comes with an explicit [NOTICE](https://github.com/swagger-api/swagger-ui/blob/master/NOTICE) file +containing additional legal notices and information. diff --git a/src/main/webapp/swagger/SECURITY.md b/src/main/webapp/swagger/SECURITY.md new file mode 100644 index 00000000..6c1d1172 --- /dev/null +++ b/src/main/webapp/swagger/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +If you believe you've found an exploitable security issue in Swagger UI, +**please don't create a public issue**. + + +## Supported versions + +This is the list of versions of `swagger-ui` which are +currently being supported with security updates. + +| Version | Supported | Notes | +|---------|--------------------|---------------------------------| +| 5.x | :white_check_mark: | Active LTS | +| 4.x | :x: | End-of-life as of August 2023 | +| 3.x | :x: | End-of-life as of November 2021 | +| 2.x | :x: | End-of-life as of 2017 | + +## Reporting a vulnerability + +To report a vulnerability please send an email with the details to [security@swagger.io](mailto:security@swagger.io). + +We'll acknowledge receipt of your report ASAP, and set expectations on how we plan to handle it. diff --git a/src/main/webapp/swagger/babel.config.js b/src/main/webapp/swagger/babel.config.js new file mode 100644 index 00000000..d071bdec --- /dev/null +++ b/src/main/webapp/swagger/babel.config.js @@ -0,0 +1,140 @@ +const browser = { + presets: [ + [ + "@babel/preset-env", + { + debug: false, + modules: "auto", + useBuiltIns: false, + forceAllTransforms: false, + ignoreBrowserslistConfig: false, + } + ], + "@babel/preset-react", + ], + plugins: [ + [ + "@babel/plugin-transform-runtime", + { + corejs: { version: 3, proposals: false }, + absoluteRuntime: false, + helpers: true, + regenerator: false, + version: "^7.22.11", + } + ], + [ + "transform-react-remove-prop-types", + { + additionalLibraries: [ + "react-immutable-proptypes" + ] + } + ], + [ + "babel-plugin-module-resolver", + { + alias: { + root: ".", + core: "./src/core", + } + } + ] + ], +} + +module.exports = { + env: { + commonjs: { + presets: [ + [ + "@babel/preset-env", + { + debug: false, + modules: "commonjs", + loose: true, + useBuiltIns: false, + forceAllTransforms: false, + ignoreBrowserslistConfig: false, + } + ], + "@babel/preset-react", + ], + plugins: [ + [ + "@babel/plugin-transform-runtime", + { + corejs: { version: 3, proposals: false }, + absoluteRuntime: false, + helpers: true, + regenerator: false, + version: "^7.22.11", + } + ], + [ + "transform-react-remove-prop-types", + { + additionalLibraries: [ + "react-immutable-proptypes" + ] + } + ], + [ + "babel-plugin-module-resolver", + { + alias: { + root: ".", + core: "./src/core", + } + } + ] + ], + }, + esm: { + presets: [ + [ + "@babel/env", + { + debug: false, + modules: false, + ignoreBrowserslistConfig: false, + useBuiltIns: false, + } + ], + "@babel/preset-react" + ], + plugins: [ + [ + "@babel/plugin-transform-runtime", + { + corejs: { version: 3, proposals: false }, + absoluteRuntime: false, + helpers: true, + regenerator: false, + version: "^7.22.11", + } + ], + [ + "transform-react-remove-prop-types", + { + additionalLibraries: [ + "react-immutable-proptypes" + ] + } + ], + [ + "babel-plugin-module-resolver", + { + alias: { + root: ".", + core: "./src/core", + } + } + ] + ] + }, + development: browser, + production: browser, + }, +} + diff --git a/src/main/webapp/swagger/composer.json b/src/main/webapp/swagger/composer.json new file mode 100644 index 00000000..76288f67 --- /dev/null +++ b/src/main/webapp/swagger/composer.json @@ -0,0 +1,40 @@ +{ + "name": "swagger-api/swagger-ui", + "description": " Swagger UI is a collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.", + "keywords": [ + "Swagger", + "OpenAPI", + "specification", + "documentation", + "API", + "UI" + ], + "homepage": "http://swagger.io", + "license": "Apache-2.0", + "authors": [ + { + "name": "Anna Bodnia", + "email": "anna.bodnia@gmail.com" + }, + { + "name": "Buu Nguyen", + "email": "buunguyen@gmail.com" + }, + { + "name": "Josh Ponelat", + "email": "jponelat@gmail.com" + }, + { + "name": "Kyle Shockey", + "email": "kyleshockey1@gmail.com" + }, + { + "name": "Robert Barnwell", + "email": "robert@robertismy.name" + }, + { + "name": "Sahar Jafari", + "email": "shr.jafari@gmail.com" + } + ] +} diff --git a/src/main/webapp/swagger/config/.eslintrc b/src/main/webapp/swagger/config/.eslintrc new file mode 100644 index 00000000..85ec7022 --- /dev/null +++ b/src/main/webapp/swagger/config/.eslintrc @@ -0,0 +1,8 @@ +{ + "rules": { + "import/no-unresolved": 0, + "import/extensions": 0, + "quotes": ["error", "single"], + "semi": ["error", "always"] + } +} diff --git a/src/main/webapp/swagger/config/jest/jest.artifact.config.js b/src/main/webapp/swagger/config/jest/jest.artifact.config.js new file mode 100644 index 00000000..47db45f3 --- /dev/null +++ b/src/main/webapp/swagger/config/jest/jest.artifact.config.js @@ -0,0 +1,9 @@ +const path = require('path'); + +module.exports = { + rootDir: path.join(__dirname, '..', '..'), + testEnvironment: 'jsdom', + testMatch: ['**/test/build-artifacts/**/*.js'], + setupFiles: ['/test/unit/jest-shim.js'], + transformIgnorePatterns: ['/node_modules/(?!(swagger-client|react-syntax-highlighter)/)'], +}; diff --git a/src/main/webapp/swagger/config/jest/jest.unit.config.js b/src/main/webapp/swagger/config/jest/jest.unit.config.js new file mode 100644 index 00000000..af5b3ade --- /dev/null +++ b/src/main/webapp/swagger/config/jest/jest.unit.config.js @@ -0,0 +1,23 @@ +const path = require('path'); + +module.exports = { + rootDir: path.join(__dirname, '..', '..'), + testEnvironment: 'jest-environment-jsdom', + testMatch: [ + '**/test/unit/*.js?(x)', + '**/test/unit/**/*.js?(x)', + ], + setupFiles: ['/test/unit/jest-shim.js'], + setupFilesAfterEnv: ['/test/unit/setup.js'], + testPathIgnorePatterns: [ + '/node_modules/', + '/test/build-artifacts/', + '/test/unit/jest-shim.js', + '/test/unit/setup.js', + ], + moduleNameMapper: { + '^.+\\.svg$': 'jest-transform-stub' + }, + transformIgnorePatterns: ['/node_modules/(?!(sinon|react-syntax-highlighter)/)'], + silent: true, // set to `false` to allow console.* calls to be printed +}; diff --git a/src/main/webapp/swagger/cypress.config.js b/src/main/webapp/swagger/cypress.config.js new file mode 100644 index 00000000..a948ea0f --- /dev/null +++ b/src/main/webapp/swagger/cypress.config.js @@ -0,0 +1,19 @@ +const { defineConfig } = require("cypress") + +const startOAuthServer = require("./test/e2e-cypress/support/helpers/oauth2-server") + +module.exports = defineConfig({ + fileServerFolder: "test/e2e-cypress/static", + fixturesFolder: "test/e2e-cypress/fixtures", + screenshotsFolder: "test/e2e-cypress/screenshots", + videosFolder: "test/e2e-cypress/videos", + video: false, + e2e: { + baseUrl: "http://localhost:3230/", + supportFile: "test/e2e-cypress/support/e2e.js", + specPattern: "test/e2e-cypress/e2e/**/*.cy.{js,jsx}", + setupNodeEvents: () => { + startOAuthServer() + }, + }, +}) diff --git a/src/main/webapp/swagger/dev-helpers/dev-helper-initializer.js b/src/main/webapp/swagger/dev-helpers/dev-helper-initializer.js new file mode 100644 index 00000000..ec330dc6 --- /dev/null +++ b/src/main/webapp/swagger/dev-helpers/dev-helper-initializer.js @@ -0,0 +1,33 @@ +/* eslint-disable no-undef */ +window.onload = function() { + window["SwaggerUIBundle"] = window["swagger-ui-bundle"] + window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"] + // Build a system + const ui = SwaggerUIBundle({ + url: "https://petstore.swagger.io/v2/swagger.json", + dom_id: "#swagger-ui", + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl + ], + // requestSnippetsEnabled: true, + layout: "StandaloneLayout" + }) + + window.ui = ui + + ui.initOAuth({ + clientId: "your-client-id", + clientSecret: "your-client-secret-if-required", + realm: "your-realms", + appName: "your-app-name", + scopeSeparator: " ", + scopes: "openid profile email phone address", + additionalQueryStringParams: {}, + useBasicAuthenticationWithAccessCodeGrant: false, + usePkceWithAuthorizationCodeGrant: false + }) +} diff --git a/src/main/webapp/swagger/dev-helpers/index.html b/src/main/webapp/swagger/dev-helpers/index.html new file mode 100644 index 00000000..9432ef74 --- /dev/null +++ b/src/main/webapp/swagger/dev-helpers/index.html @@ -0,0 +1,21 @@ + + + + + + + Swagger UI + + + + + +
+ + + + + + diff --git a/src/main/webapp/swagger/dev-helpers/oauth2-redirect.html b/src/main/webapp/swagger/dev-helpers/oauth2-redirect.html new file mode 100644 index 00000000..87a2eed8 --- /dev/null +++ b/src/main/webapp/swagger/dev-helpers/oauth2-redirect.html @@ -0,0 +1,76 @@ + + + + + + diff --git a/src/main/webapp/swagger/dev-helpers/style.css b/src/main/webapp/swagger/dev-helpers/style.css new file mode 100644 index 00000000..75a5daac --- /dev/null +++ b/src/main/webapp/swagger/dev-helpers/style.css @@ -0,0 +1,19 @@ +html +{ + box-sizing: border-box; + overflow: -moz-scrollbars-vertical; + overflow-y: scroll; +} + +*, +*:before, +*:after +{ + box-sizing: inherit; +} + +body +{ + margin:0; + background: #fafafa; +} diff --git a/src/main/webapp/swagger/dist/favicon-16x16.png b/src/main/webapp/swagger/dist/favicon-16x16.png new file mode 100644 index 00000000..8b194e61 Binary files /dev/null and b/src/main/webapp/swagger/dist/favicon-16x16.png differ diff --git a/src/main/webapp/swagger/dist/favicon-32x32.png b/src/main/webapp/swagger/dist/favicon-32x32.png new file mode 100644 index 00000000..249737fe Binary files /dev/null and b/src/main/webapp/swagger/dist/favicon-32x32.png differ diff --git a/src/main/webapp/swagger/dist/index.css b/src/main/webapp/swagger/dist/index.css new file mode 100644 index 00000000..f2376fda --- /dev/null +++ b/src/main/webapp/swagger/dist/index.css @@ -0,0 +1,16 @@ +html { + box-sizing: border-box; + overflow: -moz-scrollbars-vertical; + overflow-y: scroll; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +body { + margin: 0; + background: #fafafa; +} diff --git a/src/main/webapp/swagger/dist/index.html b/src/main/webapp/swagger/dist/index.html new file mode 100644 index 00000000..84ae62d3 --- /dev/null +++ b/src/main/webapp/swagger/dist/index.html @@ -0,0 +1,19 @@ + + + + + + Swagger UI + + + + + + + +
+ + + + + diff --git a/src/main/webapp/swagger/dist/oauth2-redirect.html b/src/main/webapp/swagger/dist/oauth2-redirect.html new file mode 100644 index 00000000..56409171 --- /dev/null +++ b/src/main/webapp/swagger/dist/oauth2-redirect.html @@ -0,0 +1,79 @@ + + + + Swagger UI: OAuth2 Redirect + + + + + diff --git a/src/main/webapp/swagger/dist/swagger-initializer.js b/src/main/webapp/swagger/dist/swagger-initializer.js new file mode 100644 index 00000000..14639501 --- /dev/null +++ b/src/main/webapp/swagger/dist/swagger-initializer.js @@ -0,0 +1,20 @@ +window.onload = function() { + // + + // the following lines will be replaced by docker/configurator, when it runs in a docker-container + window.ui = SwaggerUIBundle({ + url: "/openapi.json", + dom_id: '#swagger-ui', + deepLinking: true, + presets: [ + SwaggerUIBundle.presets.apis, + SwaggerUIStandalonePreset + ], + plugins: [ + SwaggerUIBundle.plugins.DownloadUrl + ], + layout: "StandaloneLayout" + }); + + // +}; diff --git a/src/main/webapp/swagger/dist/swagger-ui-bundle.js b/src/main/webapp/swagger/dist/swagger-ui-bundle.js new file mode 100644 index 00000000..6d7fc2e4 --- /dev/null +++ b/src/main/webapp/swagger/dist/swagger-ui-bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */ +!function webpackUniversalModuleDefinition(s,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.SwaggerUIBundle=o():s.SwaggerUIBundle=o()}(this,(()=>(()=>{var s,o,i={69119:(s,o)=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.BLANK_URL=o.relativeFirstCharacters=o.whitespaceEscapeCharsRegex=o.urlSchemeRegex=o.ctrlCharactersRegex=o.htmlCtrlEntityRegex=o.htmlEntitiesRegex=o.invalidProtocolRegex=void 0,o.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,o.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,o.htmlCtrlEntityRegex=/&(newline|tab);/gi,o.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,o.urlSchemeRegex=/^.+(:|:)/gim,o.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,o.relativeFirstCharacters=[".","/"],o.BLANK_URL="about:blank"},16750:(s,o,i)=>{"use strict";o.J=void 0;var u=i(69119);function decodeURI(s){try{return decodeURIComponent(s)}catch(o){return s}}o.J=function sanitizeUrl(s){if(!s)return u.BLANK_URL;var o,i,_=decodeURI(s);do{o=(_=decodeURI(_=(i=_,i.replace(u.ctrlCharactersRegex,"").replace(u.htmlEntitiesRegex,(function(s,o){return String.fromCharCode(o)}))).replace(u.htmlCtrlEntityRegex,"").replace(u.ctrlCharactersRegex,"").replace(u.whitespaceEscapeCharsRegex,"").trim())).match(u.ctrlCharactersRegex)||_.match(u.htmlEntitiesRegex)||_.match(u.htmlCtrlEntityRegex)||_.match(u.whitespaceEscapeCharsRegex)}while(o&&o.length>0);var w=_;if(!w)return u.BLANK_URL;if(function isRelativeUrlWithoutProtocol(s){return u.relativeFirstCharacters.indexOf(s[0])>-1}(w))return w;var x=w.match(u.urlSchemeRegex);if(!x)return w;var C=x[0];return u.invalidProtocolRegex.test(C)?u.BLANK_URL:w}},67526:(s,o)=>{"use strict";o.byteLength=function byteLength(s){var o=getLens(s),i=o[0],u=o[1];return 3*(i+u)/4-u},o.toByteArray=function toByteArray(s){var o,i,w=getLens(s),x=w[0],C=w[1],j=new _(function _byteLength(s,o,i){return 3*(o+i)/4-i}(0,x,C)),L=0,B=C>0?x-4:x;for(i=0;i>16&255,j[L++]=o>>8&255,j[L++]=255&o;2===C&&(o=u[s.charCodeAt(i)]<<2|u[s.charCodeAt(i+1)]>>4,j[L++]=255&o);1===C&&(o=u[s.charCodeAt(i)]<<10|u[s.charCodeAt(i+1)]<<4|u[s.charCodeAt(i+2)]>>2,j[L++]=o>>8&255,j[L++]=255&o);return j},o.fromByteArray=function fromByteArray(s){for(var o,u=s.length,_=u%3,w=[],x=16383,C=0,j=u-_;Cj?j:C+x));1===_?(o=s[u-1],w.push(i[o>>2]+i[o<<4&63]+"==")):2===_&&(o=(s[u-2]<<8)+s[u-1],w.push(i[o>>10]+i[o>>4&63]+i[o<<2&63]+"="));return w.join("")};for(var i=[],u=[],_="undefined"!=typeof Uint8Array?Uint8Array:Array,w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",x=0;x<64;++x)i[x]=w[x],u[w.charCodeAt(x)]=x;function getLens(s){var o=s.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=s.indexOf("=");return-1===i&&(i=o),[i,i===o?0:4-i%4]}function encodeChunk(s,o,u){for(var _,w,x=[],C=o;C>18&63]+i[w>>12&63]+i[w>>6&63]+i[63&w]);return x.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},48287:(s,o,i)=>{"use strict";const u=i(67526),_=i(251),w="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=Buffer,o.SlowBuffer=function SlowBuffer(s){+s!=s&&(s=0);return Buffer.alloc(+s)},o.INSPECT_MAX_BYTES=50;const x=2147483647;function createBuffer(s){if(s>x)throw new RangeError('The value "'+s+'" is invalid for option "size"');const o=new Uint8Array(s);return Object.setPrototypeOf(o,Buffer.prototype),o}function Buffer(s,o,i){if("number"==typeof s){if("string"==typeof o)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(s)}return from(s,o,i)}function from(s,o,i){if("string"==typeof s)return function fromString(s,o){"string"==typeof o&&""!==o||(o="utf8");if(!Buffer.isEncoding(o))throw new TypeError("Unknown encoding: "+o);const i=0|byteLength(s,o);let u=createBuffer(i);const _=u.write(s,o);_!==i&&(u=u.slice(0,_));return u}(s,o);if(ArrayBuffer.isView(s))return function fromArrayView(s){if(isInstance(s,Uint8Array)){const o=new Uint8Array(s);return fromArrayBuffer(o.buffer,o.byteOffset,o.byteLength)}return fromArrayLike(s)}(s);if(null==s)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s);if(isInstance(s,ArrayBuffer)||s&&isInstance(s.buffer,ArrayBuffer))return fromArrayBuffer(s,o,i);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(s,SharedArrayBuffer)||s&&isInstance(s.buffer,SharedArrayBuffer)))return fromArrayBuffer(s,o,i);if("number"==typeof s)throw new TypeError('The "value" argument must not be of type number. Received type number');const u=s.valueOf&&s.valueOf();if(null!=u&&u!==s)return Buffer.from(u,o,i);const _=function fromObject(s){if(Buffer.isBuffer(s)){const o=0|checked(s.length),i=createBuffer(o);return 0===i.length||s.copy(i,0,0,o),i}if(void 0!==s.length)return"number"!=typeof s.length||numberIsNaN(s.length)?createBuffer(0):fromArrayLike(s);if("Buffer"===s.type&&Array.isArray(s.data))return fromArrayLike(s.data)}(s);if(_)return _;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof s[Symbol.toPrimitive])return Buffer.from(s[Symbol.toPrimitive]("string"),o,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s)}function assertSize(s){if("number"!=typeof s)throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function allocUnsafe(s){return assertSize(s),createBuffer(s<0?0:0|checked(s))}function fromArrayLike(s){const o=s.length<0?0:0|checked(s.length),i=createBuffer(o);for(let u=0;u=x)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+x.toString(16)+" bytes");return 0|s}function byteLength(s,o){if(Buffer.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||isInstance(s,ArrayBuffer))return s.byteLength;if("string"!=typeof s)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof s);const i=s.length,u=arguments.length>2&&!0===arguments[2];if(!u&&0===i)return 0;let _=!1;for(;;)switch(o){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return utf8ToBytes(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return base64ToBytes(s).length;default:if(_)return u?-1:utf8ToBytes(s).length;o=(""+o).toLowerCase(),_=!0}}function slowToString(s,o,i){let u=!1;if((void 0===o||o<0)&&(o=0),o>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(o>>>=0))return"";for(s||(s="utf8");;)switch(s){case"hex":return hexSlice(this,o,i);case"utf8":case"utf-8":return utf8Slice(this,o,i);case"ascii":return asciiSlice(this,o,i);case"latin1":case"binary":return latin1Slice(this,o,i);case"base64":return base64Slice(this,o,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,o,i);default:if(u)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),u=!0}}function swap(s,o,i){const u=s[o];s[o]=s[i],s[i]=u}function bidirectionalIndexOf(s,o,i,u,_){if(0===s.length)return-1;if("string"==typeof i?(u=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),numberIsNaN(i=+i)&&(i=_?0:s.length-1),i<0&&(i=s.length+i),i>=s.length){if(_)return-1;i=s.length-1}else if(i<0){if(!_)return-1;i=0}if("string"==typeof o&&(o=Buffer.from(o,u)),Buffer.isBuffer(o))return 0===o.length?-1:arrayIndexOf(s,o,i,u,_);if("number"==typeof o)return o&=255,"function"==typeof Uint8Array.prototype.indexOf?_?Uint8Array.prototype.indexOf.call(s,o,i):Uint8Array.prototype.lastIndexOf.call(s,o,i):arrayIndexOf(s,[o],i,u,_);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(s,o,i,u,_){let w,x=1,C=s.length,j=o.length;if(void 0!==u&&("ucs2"===(u=String(u).toLowerCase())||"ucs-2"===u||"utf16le"===u||"utf-16le"===u)){if(s.length<2||o.length<2)return-1;x=2,C/=2,j/=2,i/=2}function read(s,o){return 1===x?s[o]:s.readUInt16BE(o*x)}if(_){let u=-1;for(w=i;wC&&(i=C-j),w=i;w>=0;w--){let i=!0;for(let u=0;u_&&(u=_):u=_;const w=o.length;let x;for(u>w/2&&(u=w/2),x=0;x>8,_=i%256,w.push(_),w.push(u);return w}(o,s.length-i),s,i,u)}function base64Slice(s,o,i){return 0===o&&i===s.length?u.fromByteArray(s):u.fromByteArray(s.slice(o,i))}function utf8Slice(s,o,i){i=Math.min(s.length,i);const u=[];let _=o;for(;_239?4:o>223?3:o>191?2:1;if(_+x<=i){let i,u,C,j;switch(x){case 1:o<128&&(w=o);break;case 2:i=s[_+1],128==(192&i)&&(j=(31&o)<<6|63&i,j>127&&(w=j));break;case 3:i=s[_+1],u=s[_+2],128==(192&i)&&128==(192&u)&&(j=(15&o)<<12|(63&i)<<6|63&u,j>2047&&(j<55296||j>57343)&&(w=j));break;case 4:i=s[_+1],u=s[_+2],C=s[_+3],128==(192&i)&&128==(192&u)&&128==(192&C)&&(j=(15&o)<<18|(63&i)<<12|(63&u)<<6|63&C,j>65535&&j<1114112&&(w=j))}}null===w?(w=65533,x=1):w>65535&&(w-=65536,u.push(w>>>10&1023|55296),w=56320|1023&w),u.push(w),_+=x}return function decodeCodePointsArray(s){const o=s.length;if(o<=C)return String.fromCharCode.apply(String,s);let i="",u=0;for(;uu.length?(Buffer.isBuffer(o)||(o=Buffer.from(o)),o.copy(u,_)):Uint8Array.prototype.set.call(u,o,_);else{if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(u,_)}_+=o.length}return u},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){const s=this.length;if(s%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let o=0;oi&&(s+=" ... "),""},w&&(Buffer.prototype[w]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(s,o,i,u,_){if(isInstance(s,Uint8Array)&&(s=Buffer.from(s,s.offset,s.byteLength)),!Buffer.isBuffer(s))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof s);if(void 0===o&&(o=0),void 0===i&&(i=s?s.length:0),void 0===u&&(u=0),void 0===_&&(_=this.length),o<0||i>s.length||u<0||_>this.length)throw new RangeError("out of range index");if(u>=_&&o>=i)return 0;if(u>=_)return-1;if(o>=i)return 1;if(this===s)return 0;let w=(_>>>=0)-(u>>>=0),x=(i>>>=0)-(o>>>=0);const C=Math.min(w,x),j=this.slice(u,_),L=s.slice(o,i);for(let s=0;s>>=0,isFinite(i)?(i>>>=0,void 0===u&&(u="utf8")):(u=i,i=void 0)}const _=this.length-o;if((void 0===i||i>_)&&(i=_),s.length>0&&(i<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");u||(u="utf8");let w=!1;for(;;)switch(u){case"hex":return hexWrite(this,s,o,i);case"utf8":case"utf-8":return utf8Write(this,s,o,i);case"ascii":case"latin1":case"binary":return asciiWrite(this,s,o,i);case"base64":return base64Write(this,s,o,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,s,o,i);default:if(w)throw new TypeError("Unknown encoding: "+u);u=(""+u).toLowerCase(),w=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function asciiSlice(s,o,i){let u="";i=Math.min(s.length,i);for(let _=o;_u)&&(i=u);let _="";for(let u=o;ui)throw new RangeError("Trying to access beyond buffer length")}function checkInt(s,o,i,u,_,w){if(!Buffer.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(o>_||os.length)throw new RangeError("Index out of range")}function wrtBigUInt64LE(s,o,i,u,_){checkIntBI(o,u,_,s,i,7);let w=Number(o&BigInt(4294967295));s[i++]=w,w>>=8,s[i++]=w,w>>=8,s[i++]=w,w>>=8,s[i++]=w;let x=Number(o>>BigInt(32)&BigInt(4294967295));return s[i++]=x,x>>=8,s[i++]=x,x>>=8,s[i++]=x,x>>=8,s[i++]=x,i}function wrtBigUInt64BE(s,o,i,u,_){checkIntBI(o,u,_,s,i,7);let w=Number(o&BigInt(4294967295));s[i+7]=w,w>>=8,s[i+6]=w,w>>=8,s[i+5]=w,w>>=8,s[i+4]=w;let x=Number(o>>BigInt(32)&BigInt(4294967295));return s[i+3]=x,x>>=8,s[i+2]=x,x>>=8,s[i+1]=x,x>>=8,s[i]=x,i+8}function checkIEEE754(s,o,i,u,_,w){if(i+u>s.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function writeFloat(s,o,i,u,w){return o=+o,i>>>=0,w||checkIEEE754(s,0,i,4),_.write(s,o,i,u,23,4),i+4}function writeDouble(s,o,i,u,w){return o=+o,i>>>=0,w||checkIEEE754(s,0,i,8),_.write(s,o,i,u,52,8),i+8}Buffer.prototype.slice=function slice(s,o){const i=this.length;(s=~~s)<0?(s+=i)<0&&(s=0):s>i&&(s=i),(o=void 0===o?i:~~o)<0?(o+=i)<0&&(o=0):o>i&&(o=i),o>>=0,o>>>=0,i||checkOffset(s,o,this.length);let u=this[s],_=1,w=0;for(;++w>>=0,o>>>=0,i||checkOffset(s,o,this.length);let u=this[s+--o],_=1;for(;o>0&&(_*=256);)u+=this[s+--o]*_;return u},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(s,o){return s>>>=0,o||checkOffset(s,1,this.length),this[s]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(s,o){return s>>>=0,o||checkOffset(s,2,this.length),this[s]|this[s+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(s,o){return s>>>=0,o||checkOffset(s,2,this.length),this[s]<<8|this[s+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(s,o){return s>>>=0,o||checkOffset(s,4,this.length),(this[s]|this[s+1]<<8|this[s+2]<<16)+16777216*this[s+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(s,o){return s>>>=0,o||checkOffset(s,4,this.length),16777216*this[s]+(this[s+1]<<16|this[s+2]<<8|this[s+3])},Buffer.prototype.readBigUInt64LE=defineBigIntMethod((function readBigUInt64LE(s){validateNumber(s>>>=0,"offset");const o=this[s],i=this[s+7];void 0!==o&&void 0!==i||boundsError(s,this.length-8);const u=o+256*this[++s]+65536*this[++s]+this[++s]*2**24,_=this[++s]+256*this[++s]+65536*this[++s]+i*2**24;return BigInt(u)+(BigInt(_)<>>=0,"offset");const o=this[s],i=this[s+7];void 0!==o&&void 0!==i||boundsError(s,this.length-8);const u=o*2**24+65536*this[++s]+256*this[++s]+this[++s],_=this[++s]*2**24+65536*this[++s]+256*this[++s]+i;return(BigInt(u)<>>=0,o>>>=0,i||checkOffset(s,o,this.length);let u=this[s],_=1,w=0;for(;++w=_&&(u-=Math.pow(2,8*o)),u},Buffer.prototype.readIntBE=function readIntBE(s,o,i){s>>>=0,o>>>=0,i||checkOffset(s,o,this.length);let u=o,_=1,w=this[s+--u];for(;u>0&&(_*=256);)w+=this[s+--u]*_;return _*=128,w>=_&&(w-=Math.pow(2,8*o)),w},Buffer.prototype.readInt8=function readInt8(s,o){return s>>>=0,o||checkOffset(s,1,this.length),128&this[s]?-1*(255-this[s]+1):this[s]},Buffer.prototype.readInt16LE=function readInt16LE(s,o){s>>>=0,o||checkOffset(s,2,this.length);const i=this[s]|this[s+1]<<8;return 32768&i?4294901760|i:i},Buffer.prototype.readInt16BE=function readInt16BE(s,o){s>>>=0,o||checkOffset(s,2,this.length);const i=this[s+1]|this[s]<<8;return 32768&i?4294901760|i:i},Buffer.prototype.readInt32LE=function readInt32LE(s,o){return s>>>=0,o||checkOffset(s,4,this.length),this[s]|this[s+1]<<8|this[s+2]<<16|this[s+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(s,o){return s>>>=0,o||checkOffset(s,4,this.length),this[s]<<24|this[s+1]<<16|this[s+2]<<8|this[s+3]},Buffer.prototype.readBigInt64LE=defineBigIntMethod((function readBigInt64LE(s){validateNumber(s>>>=0,"offset");const o=this[s],i=this[s+7];void 0!==o&&void 0!==i||boundsError(s,this.length-8);const u=this[s+4]+256*this[s+5]+65536*this[s+6]+(i<<24);return(BigInt(u)<>>=0,"offset");const o=this[s],i=this[s+7];void 0!==o&&void 0!==i||boundsError(s,this.length-8);const u=(o<<24)+65536*this[++s]+256*this[++s]+this[++s];return(BigInt(u)<>>=0,o||checkOffset(s,4,this.length),_.read(this,s,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(s,o){return s>>>=0,o||checkOffset(s,4,this.length),_.read(this,s,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(s,o){return s>>>=0,o||checkOffset(s,8,this.length),_.read(this,s,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(s,o){return s>>>=0,o||checkOffset(s,8,this.length),_.read(this,s,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(s,o,i,u){if(s=+s,o>>>=0,i>>>=0,!u){checkInt(this,s,o,i,Math.pow(2,8*i)-1,0)}let _=1,w=0;for(this[o]=255&s;++w>>=0,i>>>=0,!u){checkInt(this,s,o,i,Math.pow(2,8*i)-1,0)}let _=i-1,w=1;for(this[o+_]=255&s;--_>=0&&(w*=256);)this[o+_]=s/w&255;return o+i},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,1,255,0),this[o]=255&s,o+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,2,65535,0),this[o]=255&s,this[o+1]=s>>>8,o+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,2,65535,0),this[o]=s>>>8,this[o+1]=255&s,o+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,4,4294967295,0),this[o+3]=s>>>24,this[o+2]=s>>>16,this[o+1]=s>>>8,this[o]=255&s,o+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,4,4294967295,0),this[o]=s>>>24,this[o+1]=s>>>16,this[o+2]=s>>>8,this[o+3]=255&s,o+4},Buffer.prototype.writeBigUInt64LE=defineBigIntMethod((function writeBigUInt64LE(s,o=0){return wrtBigUInt64LE(this,s,o,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeBigUInt64BE=defineBigIntMethod((function writeBigUInt64BE(s,o=0){return wrtBigUInt64BE(this,s,o,BigInt(0),BigInt("0xffffffffffffffff"))})),Buffer.prototype.writeIntLE=function writeIntLE(s,o,i,u){if(s=+s,o>>>=0,!u){const u=Math.pow(2,8*i-1);checkInt(this,s,o,i,u-1,-u)}let _=0,w=1,x=0;for(this[o]=255&s;++_>>=0,!u){const u=Math.pow(2,8*i-1);checkInt(this,s,o,i,u-1,-u)}let _=i-1,w=1,x=0;for(this[o+_]=255&s;--_>=0&&(w*=256);)s<0&&0===x&&0!==this[o+_+1]&&(x=1),this[o+_]=(s/w|0)-x&255;return o+i},Buffer.prototype.writeInt8=function writeInt8(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,1,127,-128),s<0&&(s=255+s+1),this[o]=255&s,o+1},Buffer.prototype.writeInt16LE=function writeInt16LE(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,2,32767,-32768),this[o]=255&s,this[o+1]=s>>>8,o+2},Buffer.prototype.writeInt16BE=function writeInt16BE(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,2,32767,-32768),this[o]=s>>>8,this[o+1]=255&s,o+2},Buffer.prototype.writeInt32LE=function writeInt32LE(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,4,2147483647,-2147483648),this[o]=255&s,this[o+1]=s>>>8,this[o+2]=s>>>16,this[o+3]=s>>>24,o+4},Buffer.prototype.writeInt32BE=function writeInt32BE(s,o,i){return s=+s,o>>>=0,i||checkInt(this,s,o,4,2147483647,-2147483648),s<0&&(s=4294967295+s+1),this[o]=s>>>24,this[o+1]=s>>>16,this[o+2]=s>>>8,this[o+3]=255&s,o+4},Buffer.prototype.writeBigInt64LE=defineBigIntMethod((function writeBigInt64LE(s,o=0){return wrtBigUInt64LE(this,s,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeBigInt64BE=defineBigIntMethod((function writeBigInt64BE(s,o=0){return wrtBigUInt64BE(this,s,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),Buffer.prototype.writeFloatLE=function writeFloatLE(s,o,i){return writeFloat(this,s,o,!0,i)},Buffer.prototype.writeFloatBE=function writeFloatBE(s,o,i){return writeFloat(this,s,o,!1,i)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(s,o,i){return writeDouble(this,s,o,!0,i)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(s,o,i){return writeDouble(this,s,o,!1,i)},Buffer.prototype.copy=function copy(s,o,i,u){if(!Buffer.isBuffer(s))throw new TypeError("argument should be a Buffer");if(i||(i=0),u||0===u||(u=this.length),o>=s.length&&(o=s.length),o||(o=0),u>0&&u=this.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("sourceEnd out of bounds");u>this.length&&(u=this.length),s.length-o>>=0,i=void 0===i?this.length:i>>>0,s||(s=0),"number"==typeof s)for(_=o;_=u+4;i-=3)o=`_${s.slice(i-3,i)}${o}`;return`${s.slice(0,i)}${o}`}function checkIntBI(s,o,i,u,_,w){if(s>i||s3?0===o||o===BigInt(0)?`>= 0${u} and < 2${u} ** ${8*(w+1)}${u}`:`>= -(2${u} ** ${8*(w+1)-1}${u}) and < 2 ** ${8*(w+1)-1}${u}`:`>= ${o}${u} and <= ${i}${u}`,new j.ERR_OUT_OF_RANGE("value",_,s)}!function checkBounds(s,o,i){validateNumber(o,"offset"),void 0!==s[o]&&void 0!==s[o+i]||boundsError(o,s.length-(i+1))}(u,_,w)}function validateNumber(s,o){if("number"!=typeof s)throw new j.ERR_INVALID_ARG_TYPE(o,"number",s)}function boundsError(s,o,i){if(Math.floor(s)!==s)throw validateNumber(s,i),new j.ERR_OUT_OF_RANGE(i||"offset","an integer",s);if(o<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${o}`,s)}E("ERR_BUFFER_OUT_OF_BOUNDS",(function(s){return s?`${s} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),E("ERR_INVALID_ARG_TYPE",(function(s,o){return`The "${s}" argument must be of type number. Received type ${typeof o}`}),TypeError),E("ERR_OUT_OF_RANGE",(function(s,o,i){let u=`The value of "${s}" is out of range.`,_=i;return Number.isInteger(i)&&Math.abs(i)>2**32?_=addNumericalSeparator(String(i)):"bigint"==typeof i&&(_=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(_=addNumericalSeparator(_)),_+="n"),u+=` It must be ${o}. Received ${_}`,u}),RangeError);const L=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(s,o){let i;o=o||1/0;const u=s.length;let _=null;const w=[];for(let x=0;x55295&&i<57344){if(!_){if(i>56319){(o-=3)>-1&&w.push(239,191,189);continue}if(x+1===u){(o-=3)>-1&&w.push(239,191,189);continue}_=i;continue}if(i<56320){(o-=3)>-1&&w.push(239,191,189),_=i;continue}i=65536+(_-55296<<10|i-56320)}else _&&(o-=3)>-1&&w.push(239,191,189);if(_=null,i<128){if((o-=1)<0)break;w.push(i)}else if(i<2048){if((o-=2)<0)break;w.push(i>>6|192,63&i|128)}else if(i<65536){if((o-=3)<0)break;w.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((o-=4)<0)break;w.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return w}function base64ToBytes(s){return u.toByteArray(function base64clean(s){if((s=(s=s.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;s.length%4!=0;)s+="=";return s}(s))}function blitBuffer(s,o,i,u){let _;for(_=0;_=o.length||_>=s.length);++_)o[_+i]=s[_];return _}function isInstance(s,o){return s instanceof o||null!=s&&null!=s.constructor&&null!=s.constructor.name&&s.constructor.name===o.name}function numberIsNaN(s){return s!=s}const B=function(){const s="0123456789abcdef",o=new Array(256);for(let i=0;i<16;++i){const u=16*i;for(let _=0;_<16;++_)o[u+_]=s[i]+s[_]}return o}();function defineBigIntMethod(s){return"undefined"==typeof BigInt?BufferBigIntNotDefined:s}function BufferBigIntNotDefined(){throw new Error("BigInt not supported")}},17965:(s,o,i)=>{"use strict";var u=i(16426),_={"text/plain":"Text","text/html":"Url",default:"Text"};s.exports=function copy(s,o){var i,w,x,C,j,L,B=!1;o||(o={}),i=o.debug||!1;try{if(x=u(),C=document.createRange(),j=document.getSelection(),(L=document.createElement("span")).textContent=s,L.ariaHidden="true",L.style.all="unset",L.style.position="fixed",L.style.top=0,L.style.clip="rect(0, 0, 0, 0)",L.style.whiteSpace="pre",L.style.webkitUserSelect="text",L.style.MozUserSelect="text",L.style.msUserSelect="text",L.style.userSelect="text",L.addEventListener("copy",(function(u){if(u.stopPropagation(),o.format)if(u.preventDefault(),void 0===u.clipboardData){i&&console.warn("unable to use e.clipboardData"),i&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var w=_[o.format]||_.default;window.clipboardData.setData(w,s)}else u.clipboardData.clearData(),u.clipboardData.setData(o.format,s);o.onCopy&&(u.preventDefault(),o.onCopy(u.clipboardData))})),document.body.appendChild(L),C.selectNodeContents(L),j.addRange(C),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");B=!0}catch(u){i&&console.error("unable to copy using execCommand: ",u),i&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(o.format||"text",s),o.onCopy&&o.onCopy(window.clipboardData),B=!0}catch(u){i&&console.error("unable to copy using clipboardData: ",u),i&&console.error("falling back to prompt"),w=function format(s){var o=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,o)}("message"in o?o.message:"Copy to clipboard: #{key}, Enter"),window.prompt(w,s)}}finally{j&&("function"==typeof j.removeRange?j.removeRange(C):j.removeAllRanges()),L&&document.body.removeChild(L),x()}return B}},2205:function(s,o,i){var u;u=void 0!==i.g?i.g:this,s.exports=function(s){if(s.CSS&&s.CSS.escape)return s.CSS.escape;var cssEscape=function(s){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var o,i=String(s),u=i.length,_=-1,w="",x=i.charCodeAt(0);++_=1&&o<=31||127==o||0==_&&o>=48&&o<=57||1==_&&o>=48&&o<=57&&45==x?"\\"+o.toString(16)+" ":0==_&&1==u&&45==o||!(o>=128||45==o||95==o||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122)?"\\"+i.charAt(_):i.charAt(_):w+="�";return w};return s.CSS||(s.CSS={}),s.CSS.escape=cssEscape,cssEscape}(u)},81919:(s,o,i)=>{"use strict";var u=i(48287).Buffer;function isSpecificValue(s){return s instanceof u||s instanceof Date||s instanceof RegExp}function cloneSpecificValue(s){if(s instanceof u){var o=u.alloc?u.alloc(s.length):new u(s.length);return s.copy(o),o}if(s instanceof Date)return new Date(s.getTime());if(s instanceof RegExp)return new RegExp(s);throw new Error("Unexpected situation")}function deepCloneArray(s){var o=[];return s.forEach((function(s,i){"object"==typeof s&&null!==s?Array.isArray(s)?o[i]=deepCloneArray(s):isSpecificValue(s)?o[i]=cloneSpecificValue(s):o[i]=_({},s):o[i]=s})),o}function safeGetProperty(s,o){return"__proto__"===o?void 0:s[o]}var _=s.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var s,o,i=arguments[0];return Array.prototype.slice.call(arguments,1).forEach((function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach((function(w){return o=safeGetProperty(i,w),(s=safeGetProperty(u,w))===i?void 0:"object"!=typeof s||null===s?void(i[w]=s):Array.isArray(s)?void(i[w]=deepCloneArray(s)):isSpecificValue(s)?void(i[w]=cloneSpecificValue(s)):"object"!=typeof o||null===o||Array.isArray(o)?void(i[w]=_({},s)):void(i[w]=_(o,s))}))})),i}},14744:s=>{"use strict";var o=function isMergeableObject(s){return function isNonNullObject(s){return!!s&&"object"==typeof s}(s)&&!function isSpecial(s){var o=Object.prototype.toString.call(s);return"[object RegExp]"===o||"[object Date]"===o||function isReactElement(s){return s.$$typeof===i}(s)}(s)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function cloneUnlessOtherwiseSpecified(s,o){return!1!==o.clone&&o.isMergeableObject(s)?deepmerge(function emptyTarget(s){return Array.isArray(s)?[]:{}}(s),s,o):s}function defaultArrayMerge(s,o,i){return s.concat(o).map((function(s){return cloneUnlessOtherwiseSpecified(s,i)}))}function getKeys(s){return Object.keys(s).concat(function getEnumerableOwnPropertySymbols(s){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(s).filter((function(o){return Object.propertyIsEnumerable.call(s,o)})):[]}(s))}function propertyIsOnObject(s,o){try{return o in s}catch(s){return!1}}function mergeObject(s,o,i){var u={};return i.isMergeableObject(s)&&getKeys(s).forEach((function(o){u[o]=cloneUnlessOtherwiseSpecified(s[o],i)})),getKeys(o).forEach((function(_){(function propertyIsUnsafe(s,o){return propertyIsOnObject(s,o)&&!(Object.hasOwnProperty.call(s,o)&&Object.propertyIsEnumerable.call(s,o))})(s,_)||(propertyIsOnObject(s,_)&&i.isMergeableObject(o[_])?u[_]=function getMergeFunction(s,o){if(!o.customMerge)return deepmerge;var i=o.customMerge(s);return"function"==typeof i?i:deepmerge}(_,i)(s[_],o[_],i):u[_]=cloneUnlessOtherwiseSpecified(o[_],i))})),u}function deepmerge(s,i,u){(u=u||{}).arrayMerge=u.arrayMerge||defaultArrayMerge,u.isMergeableObject=u.isMergeableObject||o,u.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var _=Array.isArray(i);return _===Array.isArray(s)?_?u.arrayMerge(s,i,u):mergeObject(s,i,u):cloneUnlessOtherwiseSpecified(i,u)}deepmerge.all=function deepmergeAll(s,o){if(!Array.isArray(s))throw new Error("first argument should be an array");return s.reduce((function(s,i){return deepmerge(s,i,o)}),{})};var u=deepmerge;s.exports=u},42838:function(s){s.exports=function(){"use strict";const{entries:s,setPrototypeOf:o,isFrozen:i,getPrototypeOf:u,getOwnPropertyDescriptor:_}=Object;let{freeze:w,seal:x,create:C}=Object,{apply:j,construct:L}="undefined"!=typeof Reflect&&Reflect;w||(w=function freeze(s){return s}),x||(x=function seal(s){return s}),j||(j=function apply(s,o,i){return s.apply(o,i)}),L||(L=function construct(s,o){return new s(...o)});const B=unapply(Array.prototype.forEach),$=unapply(Array.prototype.pop),V=unapply(Array.prototype.push),U=unapply(String.prototype.toLowerCase),z=unapply(String.prototype.toString),Y=unapply(String.prototype.match),Z=unapply(String.prototype.replace),ee=unapply(String.prototype.indexOf),ie=unapply(String.prototype.trim),ae=unapply(Object.prototype.hasOwnProperty),ce=unapply(RegExp.prototype.test),le=unconstruct(TypeError);function unapply(s){return function(o){for(var i=arguments.length,u=new Array(i>1?i-1:0),_=1;_2&&void 0!==arguments[2]?arguments[2]:U;o&&o(s,null);let w=u.length;for(;w--;){let o=u[w];if("string"==typeof o){const s=_(o);s!==o&&(i(u)||(u[w]=s),o=s)}s[o]=!0}return s}function cleanArray(s){for(let o=0;o/gm),$e=x(/\${[\w\W]*}/gm),ze=x(/^data-[\-\w.\u00B7-\uFFFF]/),We=x(/^aria-[\-\w]+$/),He=x(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ye=x(/^(?:\w+script|data):/i),Xe=x(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qe=x(/^html$/i),et=x(/^[a-z][.\w]*(-[.\w]+)+$/i);var tt=Object.freeze({__proto__:null,MUSTACHE_EXPR:Re,ERB_EXPR:qe,TMPLIT_EXPR:$e,DATA_ATTR:ze,ARIA_ATTR:We,IS_ALLOWED_URI:He,IS_SCRIPT_OR_DATA:Ye,ATTR_WHITESPACE:Xe,DOCTYPE_NAME:Qe,CUSTOM_ELEMENT:et});const rt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},nt=function getGlobal(){return"undefined"==typeof window?null:window},st=function _createTrustedTypesPolicy(s,o){if("object"!=typeof s||"function"!=typeof s.createPolicy)return null;let i=null;const u="data-tt-policy-suffix";o&&o.hasAttribute(u)&&(i=o.getAttribute(u));const _="dompurify"+(i?"#"+i:"");try{return s.createPolicy(_,{createHTML:s=>s,createScriptURL:s=>s})}catch(s){return console.warn("TrustedTypes policy "+_+" could not be created."),null}};function createDOMPurify(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nt();const DOMPurify=s=>createDOMPurify(s);if(DOMPurify.version="3.1.6",DOMPurify.removed=[],!o||!o.document||o.document.nodeType!==rt.document)return DOMPurify.isSupported=!1,DOMPurify;let{document:i}=o;const u=i,_=u.currentScript,{DocumentFragment:x,HTMLTemplateElement:j,Node:L,Element:Re,NodeFilter:qe,NamedNodeMap:$e=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:ze,DOMParser:We,trustedTypes:Ye}=o,Xe=Re.prototype,et=lookupGetter(Xe,"cloneNode"),ot=lookupGetter(Xe,"remove"),it=lookupGetter(Xe,"nextSibling"),at=lookupGetter(Xe,"childNodes"),ct=lookupGetter(Xe,"parentNode");if("function"==typeof j){const s=i.createElement("template");s.content&&s.content.ownerDocument&&(i=s.content.ownerDocument)}let lt,ut="";const{implementation:pt,createNodeIterator:ht,createDocumentFragment:dt,getElementsByTagName:mt}=i,{importNode:gt}=u;let yt={};DOMPurify.isSupported="function"==typeof s&&"function"==typeof ct&&pt&&void 0!==pt.createHTMLDocument;const{MUSTACHE_EXPR:vt,ERB_EXPR:bt,TMPLIT_EXPR:_t,DATA_ATTR:St,ARIA_ATTR:wt,IS_SCRIPT_OR_DATA:Et,ATTR_WHITESPACE:xt,CUSTOM_ELEMENT:kt}=tt;let{IS_ALLOWED_URI:Ot}=tt,Ct=null;const At=addToSet({},[...pe,...de,...fe,...be,...Se]);let jt=null;const It=addToSet({},[...we,...xe,...Pe,...Te]);let Pt=Object.seal(C(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Nt=null,Tt=null,Mt=!0,Rt=!0,Dt=!1,Lt=!0,Ft=!1,Bt=!0,qt=!1,$t=!1,Vt=!1,Ut=!1,zt=!1,Wt=!1,Jt=!0,Ht=!1;const Kt="user-content-";let Gt=!0,Yt=!1,Xt={},Qt=null;const Zt=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let er=null;const tr=addToSet({},["audio","video","img","source","image","track"]);let rr=null;const nr=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),sr="http://www.w3.org/1998/Math/MathML",ir="http://www.w3.org/2000/svg",ar="http://www.w3.org/1999/xhtml";let cr=ar,lr=!1,ur=null;const pr=addToSet({},[sr,ir,ar],z);let dr=null;const fr=["application/xhtml+xml","text/html"],mr="text/html";let gr=null,yr=null;const vr=i.createElement("form"),br=function isRegexOrFunction(s){return s instanceof RegExp||s instanceof Function},_r=function _parseConfig(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!yr||yr!==s){if(s&&"object"==typeof s||(s={}),s=clone(s),dr=-1===fr.indexOf(s.PARSER_MEDIA_TYPE)?mr:s.PARSER_MEDIA_TYPE,gr="application/xhtml+xml"===dr?z:U,Ct=ae(s,"ALLOWED_TAGS")?addToSet({},s.ALLOWED_TAGS,gr):At,jt=ae(s,"ALLOWED_ATTR")?addToSet({},s.ALLOWED_ATTR,gr):It,ur=ae(s,"ALLOWED_NAMESPACES")?addToSet({},s.ALLOWED_NAMESPACES,z):pr,rr=ae(s,"ADD_URI_SAFE_ATTR")?addToSet(clone(nr),s.ADD_URI_SAFE_ATTR,gr):nr,er=ae(s,"ADD_DATA_URI_TAGS")?addToSet(clone(tr),s.ADD_DATA_URI_TAGS,gr):tr,Qt=ae(s,"FORBID_CONTENTS")?addToSet({},s.FORBID_CONTENTS,gr):Zt,Nt=ae(s,"FORBID_TAGS")?addToSet({},s.FORBID_TAGS,gr):{},Tt=ae(s,"FORBID_ATTR")?addToSet({},s.FORBID_ATTR,gr):{},Xt=!!ae(s,"USE_PROFILES")&&s.USE_PROFILES,Mt=!1!==s.ALLOW_ARIA_ATTR,Rt=!1!==s.ALLOW_DATA_ATTR,Dt=s.ALLOW_UNKNOWN_PROTOCOLS||!1,Lt=!1!==s.ALLOW_SELF_CLOSE_IN_ATTR,Ft=s.SAFE_FOR_TEMPLATES||!1,Bt=!1!==s.SAFE_FOR_XML,qt=s.WHOLE_DOCUMENT||!1,Ut=s.RETURN_DOM||!1,zt=s.RETURN_DOM_FRAGMENT||!1,Wt=s.RETURN_TRUSTED_TYPE||!1,Vt=s.FORCE_BODY||!1,Jt=!1!==s.SANITIZE_DOM,Ht=s.SANITIZE_NAMED_PROPS||!1,Gt=!1!==s.KEEP_CONTENT,Yt=s.IN_PLACE||!1,Ot=s.ALLOWED_URI_REGEXP||He,cr=s.NAMESPACE||ar,Pt=s.CUSTOM_ELEMENT_HANDLING||{},s.CUSTOM_ELEMENT_HANDLING&&br(s.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Pt.tagNameCheck=s.CUSTOM_ELEMENT_HANDLING.tagNameCheck),s.CUSTOM_ELEMENT_HANDLING&&br(s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Pt.attributeNameCheck=s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),s.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Pt.allowCustomizedBuiltInElements=s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ft&&(Rt=!1),zt&&(Ut=!0),Xt&&(Ct=addToSet({},Se),jt=[],!0===Xt.html&&(addToSet(Ct,pe),addToSet(jt,we)),!0===Xt.svg&&(addToSet(Ct,de),addToSet(jt,xe),addToSet(jt,Te)),!0===Xt.svgFilters&&(addToSet(Ct,fe),addToSet(jt,xe),addToSet(jt,Te)),!0===Xt.mathMl&&(addToSet(Ct,be),addToSet(jt,Pe),addToSet(jt,Te))),s.ADD_TAGS&&(Ct===At&&(Ct=clone(Ct)),addToSet(Ct,s.ADD_TAGS,gr)),s.ADD_ATTR&&(jt===It&&(jt=clone(jt)),addToSet(jt,s.ADD_ATTR,gr)),s.ADD_URI_SAFE_ATTR&&addToSet(rr,s.ADD_URI_SAFE_ATTR,gr),s.FORBID_CONTENTS&&(Qt===Zt&&(Qt=clone(Qt)),addToSet(Qt,s.FORBID_CONTENTS,gr)),Gt&&(Ct["#text"]=!0),qt&&addToSet(Ct,["html","head","body"]),Ct.table&&(addToSet(Ct,["tbody"]),delete Nt.tbody),s.TRUSTED_TYPES_POLICY){if("function"!=typeof s.TRUSTED_TYPES_POLICY.createHTML)throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof s.TRUSTED_TYPES_POLICY.createScriptURL)throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');lt=s.TRUSTED_TYPES_POLICY,ut=lt.createHTML("")}else void 0===lt&&(lt=st(Ye,_)),null!==lt&&"string"==typeof ut&&(ut=lt.createHTML(""));w&&w(s),yr=s}},Sr=addToSet({},["mi","mo","mn","ms","mtext"]),wr=addToSet({},["foreignobject","annotation-xml"]),Er=addToSet({},["title","style","font","a","script"]),xr=addToSet({},[...de,...fe,...ye]),kr=addToSet({},[...be,..._e]),Or=function _checkValidNamespace(s){let o=ct(s);o&&o.tagName||(o={namespaceURI:cr,tagName:"template"});const i=U(s.tagName),u=U(o.tagName);return!!ur[s.namespaceURI]&&(s.namespaceURI===ir?o.namespaceURI===ar?"svg"===i:o.namespaceURI===sr?"svg"===i&&("annotation-xml"===u||Sr[u]):Boolean(xr[i]):s.namespaceURI===sr?o.namespaceURI===ar?"math"===i:o.namespaceURI===ir?"math"===i&&wr[u]:Boolean(kr[i]):s.namespaceURI===ar?!(o.namespaceURI===ir&&!wr[u])&&!(o.namespaceURI===sr&&!Sr[u])&&!kr[i]&&(Er[i]||!xr[i]):!("application/xhtml+xml"!==dr||!ur[s.namespaceURI]))},Cr=function _forceRemove(s){V(DOMPurify.removed,{element:s});try{ct(s).removeChild(s)}catch(o){ot(s)}},Ar=function _removeAttribute(s,o){try{V(DOMPurify.removed,{attribute:o.getAttributeNode(s),from:o})}catch(s){V(DOMPurify.removed,{attribute:null,from:o})}if(o.removeAttribute(s),"is"===s&&!jt[s])if(Ut||zt)try{Cr(o)}catch(s){}else try{o.setAttribute(s,"")}catch(s){}},jr=function _initDocument(s){let o=null,u=null;if(Vt)s=""+s;else{const o=Y(s,/^[\r\n\t ]+/);u=o&&o[0]}"application/xhtml+xml"===dr&&cr===ar&&(s=''+s+"");const _=lt?lt.createHTML(s):s;if(cr===ar)try{o=(new We).parseFromString(_,dr)}catch(s){}if(!o||!o.documentElement){o=pt.createDocument(cr,"template",null);try{o.documentElement.innerHTML=lr?ut:_}catch(s){}}const w=o.body||o.documentElement;return s&&u&&w.insertBefore(i.createTextNode(u),w.childNodes[0]||null),cr===ar?mt.call(o,qt?"html":"body")[0]:qt?o.documentElement:w},Ir=function _createNodeIterator(s){return ht.call(s.ownerDocument||s,s,qe.SHOW_ELEMENT|qe.SHOW_COMMENT|qe.SHOW_TEXT|qe.SHOW_PROCESSING_INSTRUCTION|qe.SHOW_CDATA_SECTION,null)},Pr=function _isClobbered(s){return s instanceof ze&&("string"!=typeof s.nodeName||"string"!=typeof s.textContent||"function"!=typeof s.removeChild||!(s.attributes instanceof $e)||"function"!=typeof s.removeAttribute||"function"!=typeof s.setAttribute||"string"!=typeof s.namespaceURI||"function"!=typeof s.insertBefore||"function"!=typeof s.hasChildNodes)},Nr=function _isNode(s){return"function"==typeof L&&s instanceof L},Tr=function _executeHook(s,o,i){yt[s]&&B(yt[s],(s=>{s.call(DOMPurify,o,i,yr)}))},Mr=function _sanitizeElements(s){let o=null;if(Tr("beforeSanitizeElements",s,null),Pr(s))return Cr(s),!0;const i=gr(s.nodeName);if(Tr("uponSanitizeElement",s,{tagName:i,allowedTags:Ct}),s.hasChildNodes()&&!Nr(s.firstElementChild)&&ce(/<[/\w]/g,s.innerHTML)&&ce(/<[/\w]/g,s.textContent))return Cr(s),!0;if(s.nodeType===rt.progressingInstruction)return Cr(s),!0;if(Bt&&s.nodeType===rt.comment&&ce(/<[/\w]/g,s.data))return Cr(s),!0;if(!Ct[i]||Nt[i]){if(!Nt[i]&&Dr(i)){if(Pt.tagNameCheck instanceof RegExp&&ce(Pt.tagNameCheck,i))return!1;if(Pt.tagNameCheck instanceof Function&&Pt.tagNameCheck(i))return!1}if(Gt&&!Qt[i]){const o=ct(s)||s.parentNode,i=at(s)||s.childNodes;if(i&&o)for(let u=i.length-1;u>=0;--u){const _=et(i[u],!0);_.__removalCount=(s.__removalCount||0)+1,o.insertBefore(_,it(s))}}return Cr(s),!0}return s instanceof Re&&!Or(s)?(Cr(s),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!ce(/<\/no(script|embed|frames)/i,s.innerHTML)?(Ft&&s.nodeType===rt.text&&(o=s.textContent,B([vt,bt,_t],(s=>{o=Z(o,s," ")})),s.textContent!==o&&(V(DOMPurify.removed,{element:s.cloneNode()}),s.textContent=o)),Tr("afterSanitizeElements",s,null),!1):(Cr(s),!0)},Rr=function _isValidAttribute(s,o,u){if(Jt&&("id"===o||"name"===o)&&(u in i||u in vr))return!1;if(Rt&&!Tt[o]&&ce(St,o));else if(Mt&&ce(wt,o));else if(!jt[o]||Tt[o]){if(!(Dr(s)&&(Pt.tagNameCheck instanceof RegExp&&ce(Pt.tagNameCheck,s)||Pt.tagNameCheck instanceof Function&&Pt.tagNameCheck(s))&&(Pt.attributeNameCheck instanceof RegExp&&ce(Pt.attributeNameCheck,o)||Pt.attributeNameCheck instanceof Function&&Pt.attributeNameCheck(o))||"is"===o&&Pt.allowCustomizedBuiltInElements&&(Pt.tagNameCheck instanceof RegExp&&ce(Pt.tagNameCheck,u)||Pt.tagNameCheck instanceof Function&&Pt.tagNameCheck(u))))return!1}else if(rr[o]);else if(ce(Ot,Z(u,xt,"")));else if("src"!==o&&"xlink:href"!==o&&"href"!==o||"script"===s||0!==ee(u,"data:")||!er[s])if(Dt&&!ce(Et,Z(u,xt,"")));else if(u)return!1;return!0},Dr=function _isBasicCustomElement(s){return"annotation-xml"!==s&&Y(s,kt)},Lr=function _sanitizeAttributes(s){Tr("beforeSanitizeAttributes",s,null);const{attributes:o}=s;if(!o)return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:jt};let u=o.length;for(;u--;){const _=o[u],{name:w,namespaceURI:x,value:C}=_,j=gr(w);let L="value"===w?C:ie(C);if(i.attrName=j,i.attrValue=L,i.keepAttr=!0,i.forceKeepAttr=void 0,Tr("uponSanitizeAttribute",s,i),L=i.attrValue,Bt&&ce(/((--!?|])>)|<\/(style|title)/i,L)){Ar(w,s);continue}if(i.forceKeepAttr)continue;if(Ar(w,s),!i.keepAttr)continue;if(!Lt&&ce(/\/>/i,L)){Ar(w,s);continue}Ft&&B([vt,bt,_t],(s=>{L=Z(L,s," ")}));const V=gr(s.nodeName);if(Rr(V,j,L)){if(!Ht||"id"!==j&&"name"!==j||(Ar(w,s),L=Kt+L),lt&&"object"==typeof Ye&&"function"==typeof Ye.getAttributeType)if(x);else switch(Ye.getAttributeType(V,j)){case"TrustedHTML":L=lt.createHTML(L);break;case"TrustedScriptURL":L=lt.createScriptURL(L)}try{x?s.setAttributeNS(x,w,L):s.setAttribute(w,L),Pr(s)?Cr(s):$(DOMPurify.removed)}catch(s){}}}Tr("afterSanitizeAttributes",s,null)},Fr=function _sanitizeShadowDOM(s){let o=null;const i=Ir(s);for(Tr("beforeSanitizeShadowDOM",s,null);o=i.nextNode();)Tr("uponSanitizeShadowNode",o,null),Mr(o)||(o.content instanceof x&&_sanitizeShadowDOM(o.content),Lr(o));Tr("afterSanitizeShadowDOM",s,null)};return DOMPurify.sanitize=function(s){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,_=null,w=null,C=null;if(lr=!s,lr&&(s="\x3c!--\x3e"),"string"!=typeof s&&!Nr(s)){if("function"!=typeof s.toString)throw le("toString is not a function");if("string"!=typeof(s=s.toString()))throw le("dirty is not a string, aborting")}if(!DOMPurify.isSupported)return s;if($t||_r(o),DOMPurify.removed=[],"string"==typeof s&&(Yt=!1),Yt){if(s.nodeName){const o=gr(s.nodeName);if(!Ct[o]||Nt[o])throw le("root node is forbidden and cannot be sanitized in-place")}}else if(s instanceof L)i=jr("\x3c!----\x3e"),_=i.ownerDocument.importNode(s,!0),_.nodeType===rt.element&&"BODY"===_.nodeName||"HTML"===_.nodeName?i=_:i.appendChild(_);else{if(!Ut&&!Ft&&!qt&&-1===s.indexOf("<"))return lt&&Wt?lt.createHTML(s):s;if(i=jr(s),!i)return Ut?null:Wt?ut:""}i&&Vt&&Cr(i.firstChild);const j=Ir(Yt?s:i);for(;w=j.nextNode();)Mr(w)||(w.content instanceof x&&Fr(w.content),Lr(w));if(Yt)return s;if(Ut){if(zt)for(C=dt.call(i.ownerDocument);i.firstChild;)C.appendChild(i.firstChild);else C=i;return(jt.shadowroot||jt.shadowrootmode)&&(C=gt.call(u,C,!0)),C}let $=qt?i.outerHTML:i.innerHTML;return qt&&Ct["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&ce(Qe,i.ownerDocument.doctype.name)&&($="\n"+$),Ft&&B([vt,bt,_t],(s=>{$=Z($,s," ")})),lt&&Wt?lt.createHTML($):$},DOMPurify.setConfig=function(){_r(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),$t=!0},DOMPurify.clearConfig=function(){yr=null,$t=!1},DOMPurify.isValidAttribute=function(s,o,i){yr||_r({});const u=gr(s),_=gr(o);return Rr(u,_,i)},DOMPurify.addHook=function(s,o){"function"==typeof o&&(yt[s]=yt[s]||[],V(yt[s],o))},DOMPurify.removeHook=function(s){if(yt[s])return $(yt[s])},DOMPurify.removeHooks=function(s){yt[s]&&(yt[s]=[])},DOMPurify.removeAllHooks=function(){yt={}},DOMPurify}return createDOMPurify()}()},78004:s=>{"use strict";class SubRange{constructor(s,o){this.low=s,this.high=o,this.length=1+o-s}overlaps(s){return!(this.highs.high)}touches(s){return!(this.high+1s.high)}add(s){return new SubRange(Math.min(this.low,s.low),Math.max(this.high,s.high))}subtract(s){return s.low<=this.low&&s.high>=this.high?[]:s.low>this.low&&s.highs+o.length),0)}add(s,o){var _add=s=>{for(var o=0;o{for(var o=0;o{for(var o=0;o{for(var i=o.low;i<=o.high;)s.push(i),i++;return s}),[])}subranges(){return this.ranges.map((s=>({low:s.low,high:s.high,length:1+s.high-s.low})))}}s.exports=DRange},37007:s=>{"use strict";var o,i="object"==typeof Reflect?Reflect:null,u=i&&"function"==typeof i.apply?i.apply:function ReflectApply(s,o,i){return Function.prototype.apply.call(s,o,i)};o=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function ReflectOwnKeys(s){return Object.getOwnPropertyNames(s).concat(Object.getOwnPropertySymbols(s))}:function ReflectOwnKeys(s){return Object.getOwnPropertyNames(s)};var _=Number.isNaN||function NumberIsNaN(s){return s!=s};function EventEmitter(){EventEmitter.init.call(this)}s.exports=EventEmitter,s.exports.once=function once(s,o){return new Promise((function(i,u){function errorListener(i){s.removeListener(o,resolver),u(i)}function resolver(){"function"==typeof s.removeListener&&s.removeListener("error",errorListener),i([].slice.call(arguments))}eventTargetAgnosticAddListener(s,o,resolver,{once:!0}),"error"!==o&&function addErrorHandlerIfEventEmitter(s,o,i){"function"==typeof s.on&&eventTargetAgnosticAddListener(s,"error",o,i)}(s,errorListener,{once:!0})}))},EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var w=10;function checkListener(s){if("function"!=typeof s)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof s)}function _getMaxListeners(s){return void 0===s._maxListeners?EventEmitter.defaultMaxListeners:s._maxListeners}function _addListener(s,o,i,u){var _,w,x;if(checkListener(i),void 0===(w=s._events)?(w=s._events=Object.create(null),s._eventsCount=0):(void 0!==w.newListener&&(s.emit("newListener",o,i.listener?i.listener:i),w=s._events),x=w[o]),void 0===x)x=w[o]=i,++s._eventsCount;else if("function"==typeof x?x=w[o]=u?[i,x]:[x,i]:u?x.unshift(i):x.push(i),(_=_getMaxListeners(s))>0&&x.length>_&&!x.warned){x.warned=!0;var C=new Error("Possible EventEmitter memory leak detected. "+x.length+" "+String(o)+" listeners added. Use emitter.setMaxListeners() to increase limit");C.name="MaxListenersExceededWarning",C.emitter=s,C.type=o,C.count=x.length,function ProcessEmitWarning(s){console&&console.warn&&console.warn(s)}(C)}return s}function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(s,o,i){var u={fired:!1,wrapFn:void 0,target:s,type:o,listener:i},_=onceWrapper.bind(u);return _.listener=i,u.wrapFn=_,_}function _listeners(s,o,i){var u=s._events;if(void 0===u)return[];var _=u[o];return void 0===_?[]:"function"==typeof _?i?[_.listener||_]:[_]:i?function unwrapListeners(s){for(var o=new Array(s.length),i=0;i0&&(x=o[0]),x instanceof Error)throw x;var C=new Error("Unhandled error."+(x?" ("+x.message+")":""));throw C.context=x,C}var j=w[s];if(void 0===j)return!1;if("function"==typeof j)u(j,this,o);else{var L=j.length,B=arrayClone(j,L);for(i=0;i=0;w--)if(i[w]===o||i[w].listener===o){x=i[w].listener,_=w;break}if(_<0)return this;0===_?i.shift():function spliceOne(s,o){for(;o+1=0;u--)this.removeListener(s,o[u]);return this},EventEmitter.prototype.listeners=function listeners(s){return _listeners(this,s,!0)},EventEmitter.prototype.rawListeners=function rawListeners(s){return _listeners(this,s,!1)},EventEmitter.listenerCount=function(s,o){return"function"==typeof s.listenerCount?s.listenerCount(o):listenerCount.call(s,o)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?o(this._events):[]}},85587:(s,o,i)=>{"use strict";var u=i(26311),_=create(Error);function create(s){return FormattedError.displayName=s.displayName||s.name,FormattedError;function FormattedError(o){return o&&(o=u.apply(null,arguments)),new s(o)}}s.exports=_,_.eval=create(EvalError),_.range=create(RangeError),_.reference=create(ReferenceError),_.syntax=create(SyntaxError),_.type=create(TypeError),_.uri=create(URIError),_.create=create},26311:s=>{!function(){var o;function format(s){for(var o,i,u,_,w=1,x=[].slice.call(arguments),C=0,j=s.length,L="",B=!1,$=!1,nextArg=function(){return x[w++]},slurpNumber=function(){for(var i="";/\d/.test(s[C]);)i+=s[C++],o=s[C];return i.length>0?parseInt(i):null};C{function deepFreeze(s){return s instanceof Map?s.clear=s.delete=s.set=function(){throw new Error("map is read-only")}:s instanceof Set&&(s.add=s.clear=s.delete=function(){throw new Error("set is read-only")}),Object.freeze(s),Object.getOwnPropertyNames(s).forEach((function(o){var i=s[o];"object"!=typeof i||Object.isFrozen(i)||deepFreeze(i)})),s}var o=deepFreeze,i=deepFreeze;o.default=i;class Response{constructor(s){void 0===s.data&&(s.data={}),this.data=s.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function escapeHTML(s){return s.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function inherit(s,...o){const i=Object.create(null);for(const o in s)i[o]=s[o];return o.forEach((function(s){for(const o in s)i[o]=s[o]})),i}const emitsWrappingTags=s=>!!s.kind;class HTMLRenderer{constructor(s,o){this.buffer="",this.classPrefix=o.classPrefix,s.walk(this)}addText(s){this.buffer+=escapeHTML(s)}openNode(s){if(!emitsWrappingTags(s))return;let o=s.kind;s.sublanguage||(o=`${this.classPrefix}${o}`),this.span(o)}closeNode(s){emitsWrappingTags(s)&&(this.buffer+="")}value(){return this.buffer}span(s){this.buffer+=``}}class TokenTree{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(s){this.top.children.push(s)}openNode(s){const o={kind:s,children:[]};this.add(o),this.stack.push(o)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(s){return this.constructor._walk(s,this.rootNode)}static _walk(s,o){return"string"==typeof o?s.addText(o):o.children&&(s.openNode(o),o.children.forEach((o=>this._walk(s,o))),s.closeNode(o)),s}static _collapse(s){"string"!=typeof s&&s.children&&(s.children.every((s=>"string"==typeof s))?s.children=[s.children.join("")]:s.children.forEach((s=>{TokenTree._collapse(s)})))}}class TokenTreeEmitter extends TokenTree{constructor(s){super(),this.options=s}addKeyword(s,o){""!==s&&(this.openNode(o),this.addText(s),this.closeNode())}addText(s){""!==s&&this.add(s)}addSublanguage(s,o){const i=s.root;i.kind=o,i.sublanguage=!0,this.add(i)}toHTML(){return new HTMLRenderer(this,this.options).value()}finalize(){return!0}}function source(s){return s?"string"==typeof s?s:s.source:null}const u=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;const _="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",x="\\b\\d+(\\.\\d+)?",C="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",j="\\b(0b[01]+)",L={begin:"\\\\[\\s\\S]",relevance:0},B={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[L]},$={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[L]},V={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT=function(s,o,i={}){const u=inherit({className:"comment",begin:s,end:o,contains:[]},i);return u.contains.push(V),u.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),u},U=COMMENT("//","$"),z=COMMENT("/\\*","\\*/"),Y=COMMENT("#","$"),Z={className:"number",begin:x,relevance:0},ee={className:"number",begin:C,relevance:0},ie={className:"number",begin:j,relevance:0},ae={className:"number",begin:x+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},ce={begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[L,{begin:/\[/,end:/\]/,relevance:0,contains:[L]}]}]},le={className:"title",begin:_,relevance:0},pe={className:"title",begin:w,relevance:0},de={begin:"\\.\\s*"+w,relevance:0};var fe=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:_,UNDERSCORE_IDENT_RE:w,NUMBER_RE:x,C_NUMBER_RE:C,BINARY_NUMBER_RE:j,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(s={})=>{const o=/^#![ ]*\//;return s.binary&&(s.begin=function concat(...s){return s.map((s=>source(s))).join("")}(o,/.*\b/,s.binary,/\b.*/)),inherit({className:"meta",begin:o,end:/$/,relevance:0,"on:begin":(s,o)=>{0!==s.index&&o.ignoreMatch()}},s)},BACKSLASH_ESCAPE:L,APOS_STRING_MODE:B,QUOTE_STRING_MODE:$,PHRASAL_WORDS_MODE:V,COMMENT,C_LINE_COMMENT_MODE:U,C_BLOCK_COMMENT_MODE:z,HASH_COMMENT_MODE:Y,NUMBER_MODE:Z,C_NUMBER_MODE:ee,BINARY_NUMBER_MODE:ie,CSS_NUMBER_MODE:ae,REGEXP_MODE:ce,TITLE_MODE:le,UNDERSCORE_TITLE_MODE:pe,METHOD_GUARD:de,END_SAME_AS_BEGIN:function(s){return Object.assign(s,{"on:begin":(s,o)=>{o.data._beginMatch=s[1]},"on:end":(s,o)=>{o.data._beginMatch!==s[1]&&o.ignoreMatch()}})}});function skipIfhasPrecedingDot(s,o){"."===s.input[s.index-1]&&o.ignoreMatch()}function beginKeywords(s,o){o&&s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",s.__beforeBegin=skipIfhasPrecedingDot,s.keywords=s.keywords||s.beginKeywords,delete s.beginKeywords,void 0===s.relevance&&(s.relevance=0))}function compileIllegal(s,o){Array.isArray(s.illegal)&&(s.illegal=function either(...s){return"("+s.map((s=>source(s))).join("|")+")"}(...s.illegal))}function compileMatch(s,o){if(s.match){if(s.begin||s.end)throw new Error("begin & end are not supported with match");s.begin=s.match,delete s.match}}function compileRelevance(s,o){void 0===s.relevance&&(s.relevance=1)}const ye=["of","and","for","in","not","or","if","then","parent","list","value"];function compileKeywords(s,o,i="keyword"){const u={};return"string"==typeof s?compileList(i,s.split(" ")):Array.isArray(s)?compileList(i,s):Object.keys(s).forEach((function(i){Object.assign(u,compileKeywords(s[i],o,i))})),u;function compileList(s,i){o&&(i=i.map((s=>s.toLowerCase()))),i.forEach((function(o){const i=o.split("|");u[i[0]]=[s,scoreForKeyword(i[0],i[1])]}))}}function scoreForKeyword(s,o){return o?Number(o):function commonKeyword(s){return ye.includes(s.toLowerCase())}(s)?0:1}function compileLanguage(s,{plugins:o}){function langRe(o,i){return new RegExp(source(o),"m"+(s.case_insensitive?"i":"")+(i?"g":""))}class MultiRegex{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,o){o.position=this.position++,this.matchIndexes[this.matchAt]=o,this.regexes.push([o,s]),this.matchAt+=function countMatchGroups(s){return new RegExp(s.toString()+"|").exec("").length-1}(s)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const s=this.regexes.map((s=>s[1]));this.matcherRe=langRe(function join(s,o="|"){let i=0;return s.map((s=>{i+=1;const o=i;let _=source(s),w="";for(;_.length>0;){const s=u.exec(_);if(!s){w+=_;break}w+=_.substring(0,s.index),_=_.substring(s.index+s[0].length),"\\"===s[0][0]&&s[1]?w+="\\"+String(Number(s[1])+o):(w+=s[0],"("===s[0]&&i++)}return w})).map((s=>`(${s})`)).join(o)}(s),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const o=this.matcherRe.exec(s);if(!o)return null;const i=o.findIndex(((s,o)=>o>0&&void 0!==s)),u=this.matchIndexes[i];return o.splice(0,i),Object.assign(o,u)}}class ResumableMultiRegex{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];const o=new MultiRegex;return this.rules.slice(s).forEach((([s,i])=>o.addRule(s,i))),o.compile(),this.multiRegexes[s]=o,o}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(s,o){this.rules.push([s,o]),"begin"===o.type&&this.count++}exec(s){const o=this.getMatcher(this.regexIndex);o.lastIndex=this.lastIndex;let i=o.exec(s);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const o=this.getMatcher(0);o.lastIndex=this.lastIndex+1,i=o.exec(s)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(s.compilerExtensions||(s.compilerExtensions=[]),s.contains&&s.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return s.classNameAliases=inherit(s.classNameAliases||{}),function compileMode(o,i){const u=o;if(o.isCompiled)return u;[compileMatch].forEach((s=>s(o,i))),s.compilerExtensions.forEach((s=>s(o,i))),o.__beforeBegin=null,[beginKeywords,compileIllegal,compileRelevance].forEach((s=>s(o,i))),o.isCompiled=!0;let _=null;if("object"==typeof o.keywords&&(_=o.keywords.$pattern,delete o.keywords.$pattern),o.keywords&&(o.keywords=compileKeywords(o.keywords,s.case_insensitive)),o.lexemes&&_)throw new Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return _=_||o.lexemes||/\w+/,u.keywordPatternRe=langRe(_,!0),i&&(o.begin||(o.begin=/\B|\b/),u.beginRe=langRe(o.begin),o.endSameAsBegin&&(o.end=o.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(u.endRe=langRe(o.end)),u.terminatorEnd=source(o.end)||"",o.endsWithParent&&i.terminatorEnd&&(u.terminatorEnd+=(o.end?"|":"")+i.terminatorEnd)),o.illegal&&(u.illegalRe=langRe(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((function(s){return function expandOrCloneMode(s){s.variants&&!s.cachedVariants&&(s.cachedVariants=s.variants.map((function(o){return inherit(s,{variants:null},o)})));if(s.cachedVariants)return s.cachedVariants;if(dependencyOnParent(s))return inherit(s,{starts:s.starts?inherit(s.starts):null});if(Object.isFrozen(s))return inherit(s);return s}("self"===s?o:s)}))),o.contains.forEach((function(s){compileMode(s,u)})),o.starts&&compileMode(o.starts,i),u.matcher=function buildModeRegex(s){const o=new ResumableMultiRegex;return s.contains.forEach((s=>o.addRule(s.begin,{rule:s,type:"begin"}))),s.terminatorEnd&&o.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&o.addRule(s.illegal,{type:"illegal"}),o}(u),u}(s)}function dependencyOnParent(s){return!!s&&(s.endsWithParent||dependencyOnParent(s.starts))}function BuildVuePlugin(s){const o={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!s.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,escapeHTML(this.code);let o={};return this.autoDetect?(o=s.highlightAuto(this.code),this.detectedLanguage=o.language):(o=s.highlight(this.language,this.code,this.ignoreIllegals),this.detectedLanguage=this.language),o.value},autoDetect(){return!this.language||function hasValueOrEmptyAttribute(s){return Boolean(s||""===s)}(this.autodetect)},ignoreIllegals:()=>!0},render(s){return s("pre",{},[s("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{Component:o,VuePlugin:{install(s){s.component("highlightjs",o)}}}}const be={"after:highlightElement":({el:s,result:o,text:i})=>{const u=nodeStream(s);if(!u.length)return;const _=document.createElement("div");_.innerHTML=o.value,o.value=function mergeStreams(s,o,i){let u=0,_="";const w=[];function selectStream(){return s.length&&o.length?s[0].offset!==o[0].offset?s[0].offset"}function close(s){_+=""}function render(s){("start"===s.event?open:close)(s.node)}for(;s.length||o.length;){let o=selectStream();if(_+=escapeHTML(i.substring(u,o[0].offset)),u=o[0].offset,o===s){w.reverse().forEach(close);do{render(o.splice(0,1)[0]),o=selectStream()}while(o===s&&o.length&&o[0].offset===u);w.reverse().forEach(open)}else"start"===o[0].event?w.push(o[0].node):w.pop(),render(o.splice(0,1)[0])}return _+escapeHTML(i.substr(u))}(u,nodeStream(_),i)}};function tag(s){return s.nodeName.toLowerCase()}function nodeStream(s){const o=[];return function _nodeStream(s,i){for(let u=s.firstChild;u;u=u.nextSibling)3===u.nodeType?i+=u.nodeValue.length:1===u.nodeType&&(o.push({event:"start",offset:i,node:u}),i=_nodeStream(u,i),tag(u).match(/br|hr|img|input/)||o.push({event:"stop",offset:i,node:u}));return i}(s,0),o}const _e={},error=s=>{console.error(s)},warn=(s,...o)=>{console.log(`WARN: ${s}`,...o)},deprecated=(s,o)=>{_e[`${s}/${o}`]||(console.log(`Deprecated as of ${s}. ${o}`),_e[`${s}/${o}`]=!0)},Se=escapeHTML,we=inherit,xe=Symbol("nomatch");var Pe=function(s){const i=Object.create(null),u=Object.create(null),_=[];let w=!0;const x=/(^(<[^>]+>|\t|)+|\n)/gm,C="Could not find the language '{}', did you forget to load/include a language module?",j={disableAutodetect:!0,name:"Plain text",contains:[]};let L={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:TokenTreeEmitter};function shouldNotHighlight(s){return L.noHighlightRe.test(s)}function highlight(s,o,i,u){let _="",w="";"object"==typeof o?(_=s,i=o.ignoreIllegals,w=o.language,u=void 0):(deprecated("10.7.0","highlight(lang, code, ...args) has been deprecated."),deprecated("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),w=s,_=o);const x={code:_,language:w};fire("before:highlight",x);const C=x.result?x.result:_highlight(x.language,x.code,i,u);return C.code=x.code,fire("after:highlight",C),C}function _highlight(s,o,u,x){function keywordData(s,o){const i=B.case_insensitive?o[0].toLowerCase():o[0];return Object.prototype.hasOwnProperty.call(s.keywords,i)&&s.keywords[i]}function processBuffer(){null!=U.subLanguage?function processSubLanguage(){if(""===Z)return;let s=null;if("string"==typeof U.subLanguage){if(!i[U.subLanguage])return void Y.addText(Z);s=_highlight(U.subLanguage,Z,!0,z[U.subLanguage]),z[U.subLanguage]=s.top}else s=highlightAuto(Z,U.subLanguage.length?U.subLanguage:null);U.relevance>0&&(ee+=s.relevance),Y.addSublanguage(s.emitter,s.language)}():function processKeywords(){if(!U.keywords)return void Y.addText(Z);let s=0;U.keywordPatternRe.lastIndex=0;let o=U.keywordPatternRe.exec(Z),i="";for(;o;){i+=Z.substring(s,o.index);const u=keywordData(U,o);if(u){const[s,_]=u;if(Y.addText(i),i="",ee+=_,s.startsWith("_"))i+=o[0];else{const i=B.classNameAliases[s]||s;Y.addKeyword(o[0],i)}}else i+=o[0];s=U.keywordPatternRe.lastIndex,o=U.keywordPatternRe.exec(Z)}i+=Z.substr(s),Y.addText(i)}(),Z=""}function startNewMode(s){return s.className&&Y.openNode(B.classNameAliases[s.className]||s.className),U=Object.create(s,{parent:{value:U}}),U}function endOfMode(s,o,i){let u=function startsWith(s,o){const i=s&&s.exec(o);return i&&0===i.index}(s.endRe,i);if(u){if(s["on:end"]){const i=new Response(s);s["on:end"](o,i),i.isMatchIgnored&&(u=!1)}if(u){for(;s.endsParent&&s.parent;)s=s.parent;return s}}if(s.endsWithParent)return endOfMode(s.parent,o,i)}function doIgnore(s){return 0===U.matcher.regexIndex?(Z+=s[0],1):(ce=!0,0)}function doBeginMatch(s){const o=s[0],i=s.rule,u=new Response(i),_=[i.__beforeBegin,i["on:begin"]];for(const i of _)if(i&&(i(s,u),u.isMatchIgnored))return doIgnore(o);return i&&i.endSameAsBegin&&(i.endRe=function escape(s){return new RegExp(s.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}(o)),i.skip?Z+=o:(i.excludeBegin&&(Z+=o),processBuffer(),i.returnBegin||i.excludeBegin||(Z=o)),startNewMode(i),i.returnBegin?0:o.length}function doEndMatch(s){const i=s[0],u=o.substr(s.index),_=endOfMode(U,s,u);if(!_)return xe;const w=U;w.skip?Z+=i:(w.returnEnd||w.excludeEnd||(Z+=i),processBuffer(),w.excludeEnd&&(Z=i));do{U.className&&Y.closeNode(),U.skip||U.subLanguage||(ee+=U.relevance),U=U.parent}while(U!==_.parent);return _.starts&&(_.endSameAsBegin&&(_.starts.endRe=_.endRe),startNewMode(_.starts)),w.returnEnd?0:i.length}let j={};function processLexeme(i,_){const x=_&&_[0];if(Z+=i,null==x)return processBuffer(),0;if("begin"===j.type&&"end"===_.type&&j.index===_.index&&""===x){if(Z+=o.slice(_.index,_.index+1),!w){const o=new Error("0 width match regex");throw o.languageName=s,o.badRule=j.rule,o}return 1}if(j=_,"begin"===_.type)return doBeginMatch(_);if("illegal"===_.type&&!u){const s=new Error('Illegal lexeme "'+x+'" for mode "'+(U.className||"")+'"');throw s.mode=U,s}if("end"===_.type){const s=doEndMatch(_);if(s!==xe)return s}if("illegal"===_.type&&""===x)return 1;if(ae>1e5&&ae>3*_.index){throw new Error("potential infinite loop, way more iterations than matches")}return Z+=x,x.length}const B=getLanguage(s);if(!B)throw error(C.replace("{}",s)),new Error('Unknown language: "'+s+'"');const $=compileLanguage(B,{plugins:_});let V="",U=x||$;const z={},Y=new L.__emitter(L);!function processContinuations(){const s=[];for(let o=U;o!==B;o=o.parent)o.className&&s.unshift(o.className);s.forEach((s=>Y.openNode(s)))}();let Z="",ee=0,ie=0,ae=0,ce=!1;try{for(U.matcher.considerAll();;){ae++,ce?ce=!1:U.matcher.considerAll(),U.matcher.lastIndex=ie;const s=U.matcher.exec(o);if(!s)break;const i=processLexeme(o.substring(ie,s.index),s);ie=s.index+i}return processLexeme(o.substr(ie)),Y.closeAllNodes(),Y.finalize(),V=Y.toHTML(),{relevance:Math.floor(ee),value:V,language:s,illegal:!1,emitter:Y,top:U}}catch(i){if(i.message&&i.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:i.message,context:o.slice(ie-100,ie+100),mode:i.mode},sofar:V,relevance:0,value:Se(o),emitter:Y};if(w)return{illegal:!1,relevance:0,value:Se(o),emitter:Y,language:s,top:U,errorRaised:i};throw i}}function highlightAuto(s,o){o=o||L.languages||Object.keys(i);const u=function justTextHighlightResult(s){const o={relevance:0,emitter:new L.__emitter(L),value:Se(s),illegal:!1,top:j};return o.emitter.addText(s),o}(s),_=o.filter(getLanguage).filter(autoDetection).map((o=>_highlight(o,s,!1)));_.unshift(u);const w=_.sort(((s,o)=>{if(s.relevance!==o.relevance)return o.relevance-s.relevance;if(s.language&&o.language){if(getLanguage(s.language).supersetOf===o.language)return 1;if(getLanguage(o.language).supersetOf===s.language)return-1}return 0})),[x,C]=w,B=x;return B.second_best=C,B}const B={"before:highlightElement":({el:s})=>{L.useBR&&(s.innerHTML=s.innerHTML.replace(/\n/g,"").replace(//g,"\n"))},"after:highlightElement":({result:s})=>{L.useBR&&(s.value=s.value.replace(/\n/g,"
"))}},$=/^(<[^>]+>|\t)+/gm,V={"after:highlightElement":({result:s})=>{L.tabReplace&&(s.value=s.value.replace($,(s=>s.replace(/\t/g,L.tabReplace))))}};function highlightElement(s){let o=null;const i=function blockLanguage(s){let o=s.className+" ";o+=s.parentNode?s.parentNode.className:"";const i=L.languageDetectRe.exec(o);if(i){const o=getLanguage(i[1]);return o||(warn(C.replace("{}",i[1])),warn("Falling back to no-highlight mode for this block.",s)),o?i[1]:"no-highlight"}return o.split(/\s+/).find((s=>shouldNotHighlight(s)||getLanguage(s)))}(s);if(shouldNotHighlight(i))return;fire("before:highlightElement",{el:s,language:i}),o=s;const _=o.textContent,w=i?highlight(_,{language:i,ignoreIllegals:!0}):highlightAuto(_);fire("after:highlightElement",{el:s,result:w,text:_}),s.innerHTML=w.value,function updateClassName(s,o,i){const _=o?u[o]:i;s.classList.add("hljs"),_&&s.classList.add(_)}(s,i,w.language),s.result={language:w.language,re:w.relevance,relavance:w.relevance},w.second_best&&(s.second_best={language:w.second_best.language,re:w.second_best.relevance,relavance:w.second_best.relevance})}const initHighlighting=()=>{if(initHighlighting.called)return;initHighlighting.called=!0,deprecated("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead.");document.querySelectorAll("pre code").forEach(highlightElement)};let U=!1;function highlightAll(){if("loading"===document.readyState)return void(U=!0);document.querySelectorAll("pre code").forEach(highlightElement)}function getLanguage(s){return s=(s||"").toLowerCase(),i[s]||i[u[s]]}function registerAliases(s,{languageName:o}){"string"==typeof s&&(s=[s]),s.forEach((s=>{u[s.toLowerCase()]=o}))}function autoDetection(s){const o=getLanguage(s);return o&&!o.disableAutodetect}function fire(s,o){const i=s;_.forEach((function(s){s[i]&&s[i](o)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function boot(){U&&highlightAll()}),!1),Object.assign(s,{highlight,highlightAuto,highlightAll,fixMarkup:function deprecateFixMarkup(s){return deprecated("10.2.0","fixMarkup will be removed entirely in v11.0"),deprecated("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"),function fixMarkup(s){return L.tabReplace||L.useBR?s.replace(x,(s=>"\n"===s?L.useBR?"
":s:L.tabReplace?s.replace(/\t/g,L.tabReplace):s)):s}(s)},highlightElement,highlightBlock:function deprecateHighlightBlock(s){return deprecated("10.7.0","highlightBlock will be removed entirely in v12.0"),deprecated("10.7.0","Please use highlightElement now."),highlightElement(s)},configure:function configure(s){s.useBR&&(deprecated("10.3.0","'useBR' will be removed entirely in v11.0"),deprecated("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")),L=we(L,s)},initHighlighting,initHighlightingOnLoad:function initHighlightingOnLoad(){deprecated("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."),U=!0},registerLanguage:function registerLanguage(o,u){let _=null;try{_=u(s)}catch(s){if(error("Language definition for '{}' could not be registered.".replace("{}",o)),!w)throw s;error(s),_=j}_.name||(_.name=o),i[o]=_,_.rawDefinition=u.bind(null,s),_.aliases&®isterAliases(_.aliases,{languageName:o})},unregisterLanguage:function unregisterLanguage(s){delete i[s];for(const o of Object.keys(u))u[o]===s&&delete u[o]},listLanguages:function listLanguages(){return Object.keys(i)},getLanguage,registerAliases,requireLanguage:function requireLanguage(s){deprecated("10.4.0","requireLanguage will be removed entirely in v11."),deprecated("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844");const o=getLanguage(s);if(o)return o;throw new Error("The '{}' language is required, but not loaded.".replace("{}",s))},autoDetection,inherit:we,addPlugin:function addPlugin(s){!function upgradePluginAPI(s){s["before:highlightBlock"]&&!s["before:highlightElement"]&&(s["before:highlightElement"]=o=>{s["before:highlightBlock"](Object.assign({block:o.el},o))}),s["after:highlightBlock"]&&!s["after:highlightElement"]&&(s["after:highlightElement"]=o=>{s["after:highlightBlock"](Object.assign({block:o.el},o))})}(s),_.push(s)},vuePlugin:BuildVuePlugin(s).VuePlugin}),s.debugMode=function(){w=!1},s.safeMode=function(){w=!0},s.versionString="10.7.3";for(const s in fe)"object"==typeof fe[s]&&o(fe[s]);return Object.assign(s,fe),s.addPlugin(B),s.addPlugin(be),s.addPlugin(V),s}({});s.exports=Pe},35344:s=>{function concat(...s){return s.map((s=>function source(s){return s?"string"==typeof s?s:s.source:null}(s))).join("")}s.exports=function bash(s){const o={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[o]}]};Object.assign(o,{className:"variable",variants:[{begin:concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const u={className:"subst",begin:/\$\(/,end:/\)/,contains:[s.BACKSLASH_ESCAPE]},_={begin:/<<-?\s*(?=\w+)/,starts:{contains:[s.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},w={className:"string",begin:/"/,end:/"/,contains:[s.BACKSLASH_ESCAPE,o,u]};u.contains.push(w);const x={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},s.NUMBER_MODE,o]},C=s.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),j={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[s.inherit(s.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp"},contains:[C,s.SHEBANG(),j,x,s.HASH_COMMENT_MODE,_,w,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},o]}}},73402:s=>{function concat(...s){return s.map((s=>function source(s){return s?"string"==typeof s?s:s.source:null}(s))).join("")}s.exports=function http(s){const o="HTTP/(2|1\\.[01])",i={className:"attribute",begin:concat("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},u=[i,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+o+" \\d{3})",end:/$/,contains:[{className:"meta",begin:o},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:u}},{begin:"(?=^[A-Z]+ (.*?) "+o+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:o},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:u}},s.inherit(i,{relevance:0})]}}},95089:s=>{const o="[A-Za-z$_][0-9A-Za-z$_]*",i=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],u=["true","false","null","undefined","NaN","Infinity"],_=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function lookahead(s){return concat("(?=",s,")")}function concat(...s){return s.map((s=>function source(s){return s?"string"==typeof s?s:s.source:null}(s))).join("")}s.exports=function javascript(s){const w=o,x="<>",C="",j={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(s,o)=>{const i=s[0].length+s.index,u=s.input[i];"<"!==u?">"===u&&(((s,{after:o})=>{const i="",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:s.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:L,contains:le}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:x,end:C},{begin:j.begin,"on:begin":j.isTrulyOpeningTag,end:j.end}],subLanguage:"xml",contains:[{begin:j.begin,end:j.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:L,contains:["self",s.inherit(s.TITLE_MODE,{begin:w}),pe],illegal:/%/},{beginKeywords:"while if switch catch for"},{className:"function",begin:s.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,contains:[pe,s.inherit(s.TITLE_MODE,{begin:w})]},{variants:[{begin:"\\."+w},{begin:"\\$"+w}],relevance:0},{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{beginKeywords:"extends"},s.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/,end:/[{;]/,excludeEnd:!0,contains:[s.inherit(s.TITLE_MODE,{begin:w}),"self",pe]},{begin:"(get|set)\\s+(?="+w+"\\()",end:/\{/,keywords:"get set",contains:[s.inherit(s.TITLE_MODE,{begin:w}),{begin:/\(\)/},pe]},{begin:/\$[(.]/}]}}},65772:s=>{s.exports=function json(s){const o={literal:"true false null"},i=[s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE],u=[s.QUOTE_STRING_MODE,s.C_NUMBER_MODE],_={end:",",endsWithParent:!0,excludeEnd:!0,contains:u,keywords:o},w={begin:/\{/,end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/,contains:[s.BACKSLASH_ESCAPE],illegal:"\\n"},s.inherit(_,{begin:/:/})].concat(i),illegal:"\\S"},x={begin:"\\[",end:"\\]",contains:[s.inherit(_)],illegal:"\\S"};return u.push(w,x),i.forEach((function(s){u.push(s)})),{name:"JSON",contains:u,keywords:o,illegal:"\\S"}}},26571:s=>{s.exports=function powershell(s){const o={$pattern:/-?[A-z\.\-]+\b/,keyword:"if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter",built_in:"ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write"},i={begin:"`[\\s\\S]",relevance:0},u={className:"variable",variants:[{begin:/\$\B/},{className:"keyword",begin:/\$this/},{begin:/\$[\w\d][\w\d_:]*/}]},_={className:"string",variants:[{begin:/"/,end:/"/},{begin:/@"/,end:/^"@/}],contains:[i,u,{className:"variable",begin:/\$[A-z]/,end:/[^A-z]/}]},w={className:"string",variants:[{begin:/'/,end:/'/},{begin:/@'/,end:/^'@/}]},x=s.inherit(s.COMMENT(null,null),{variants:[{begin:/#/,end:/$/},{begin:/<#/,end:/#>/}],contains:[{className:"doctag",variants:[{begin:/\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/},{begin:/\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/}]}]}),C={className:"built_in",variants:[{begin:"(".concat("Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where",")+(-)[\\w\\d]+")}]},j={className:"class",beginKeywords:"class enum",end:/\s*[{]/,excludeEnd:!0,relevance:0,contains:[s.TITLE_MODE]},L={className:"function",begin:/function\s+/,end:/\s*\{|$/,excludeEnd:!0,returnBegin:!0,relevance:0,contains:[{begin:"function",relevance:0,className:"keyword"},{className:"title",begin:/\w[\w\d]*((-)[\w\d]+)*/,relevance:0},{begin:/\(/,end:/\)/,className:"params",relevance:0,contains:[u]}]},B={begin:/using\s/,end:/$/,returnBegin:!0,contains:[_,w,{className:"keyword",begin:/(using|assembly|command|module|namespace|type)/}]},$={variants:[{className:"operator",begin:"(".concat("-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor",")\\b")},{className:"literal",begin:/(-)[\w\d]+/,relevance:0}]},V={className:"function",begin:/\[.*\]\s*[\w]+[ ]??\(/,end:/$/,returnBegin:!0,relevance:0,contains:[{className:"keyword",begin:"(".concat(o.keyword.toString().replace(/\s/g,"|"),")\\b"),endsParent:!0,relevance:0},s.inherit(s.TITLE_MODE,{endsParent:!0})]},U=[V,x,i,s.NUMBER_MODE,_,w,C,u,{className:"literal",begin:/\$(null|true|false)\b/},{className:"selector-tag",begin:/@\B/,relevance:0}],z={begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[].concat("self",U,{begin:"("+["string","char","byte","int","long","bool","decimal","single","double","DateTime","xml","array","hashtable","void"].join("|")+")",className:"built_in",relevance:0},{className:"type",begin:/[\.\w\d]+/,relevance:0})};return V.contains.unshift(z),{name:"PowerShell",aliases:["ps","ps1"],case_insensitive:!0,keywords:o,contains:U.concat(j,L,B,$,z)}}},17285:s=>{function source(s){return s?"string"==typeof s?s:s.source:null}function lookahead(s){return concat("(?=",s,")")}function concat(...s){return s.map((s=>source(s))).join("")}function either(...s){return"("+s.map((s=>source(s))).join("|")+")"}s.exports=function xml(s){const o=concat(/[A-Z_]/,function optional(s){return concat("(",s,")?")}(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},_=s.inherit(u,{begin:/\(/,end:/\)/}),w=s.inherit(s.APOS_STRING_MODE,{className:"meta-string"}),x=s.inherit(s.QUOTE_STRING_MODE,{className:"meta-string"}),C={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[u,x,w,_,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[u,_,x,w]}]}]},s.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[C],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[C],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:o,relevance:0,starts:C}]},{className:"tag",begin:concat(/<\//,lookahead(concat(o,/>/))),contains:[{className:"name",begin:o,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}},17533:s=>{s.exports=function yaml(s){var o="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",u={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[s.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},_=s.inherit(u,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),w={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},x={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},C={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},j={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},L=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+s.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+s.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},s.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},w,{className:"number",begin:s.C_NUMBER_RE+"\\b",relevance:0},C,j,u],B=[...L];return B.pop(),B.push(_),x.contains=B,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:L}}},251:(s,o)=>{o.read=function(s,o,i,u,_){var w,x,C=8*_-u-1,j=(1<>1,B=-7,$=i?_-1:0,V=i?-1:1,U=s[o+$];for($+=V,w=U&(1<<-B)-1,U>>=-B,B+=C;B>0;w=256*w+s[o+$],$+=V,B-=8);for(x=w&(1<<-B)-1,w>>=-B,B+=u;B>0;x=256*x+s[o+$],$+=V,B-=8);if(0===w)w=1-L;else{if(w===j)return x?NaN:1/0*(U?-1:1);x+=Math.pow(2,u),w-=L}return(U?-1:1)*x*Math.pow(2,w-u)},o.write=function(s,o,i,u,_,w){var x,C,j,L=8*w-_-1,B=(1<>1,V=23===_?Math.pow(2,-24)-Math.pow(2,-77):0,U=u?0:w-1,z=u?1:-1,Y=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(C=isNaN(o)?1:0,x=B):(x=Math.floor(Math.log(o)/Math.LN2),o*(j=Math.pow(2,-x))<1&&(x--,j*=2),(o+=x+$>=1?V/j:V*Math.pow(2,1-$))*j>=2&&(x++,j/=2),x+$>=B?(C=0,x=B):x+$>=1?(C=(o*j-1)*Math.pow(2,_),x+=$):(C=o*Math.pow(2,$-1)*Math.pow(2,_),x=0));_>=8;s[i+U]=255&C,U+=z,C/=256,_-=8);for(x=x<<_|C,L+=_;L>0;s[i+U]=255&x,U+=z,x/=256,L-=8);s[i+U-z]|=128*Y}},9404:function(s){s.exports=function(){"use strict";var s=Array.prototype.slice;function createClass(s,o){o&&(s.prototype=Object.create(o.prototype)),s.prototype.constructor=s}function Iterable(s){return isIterable(s)?s:Seq(s)}function KeyedIterable(s){return isKeyed(s)?s:KeyedSeq(s)}function IndexedIterable(s){return isIndexed(s)?s:IndexedSeq(s)}function SetIterable(s){return isIterable(s)&&!isAssociative(s)?s:SetSeq(s)}function isIterable(s){return!(!s||!s[o])}function isKeyed(s){return!(!s||!s[i])}function isIndexed(s){return!(!s||!s[u])}function isAssociative(s){return isKeyed(s)||isIndexed(s)}function isOrdered(s){return!(!s||!s[_])}createClass(KeyedIterable,Iterable),createClass(IndexedIterable,Iterable),createClass(SetIterable,Iterable),Iterable.isIterable=isIterable,Iterable.isKeyed=isKeyed,Iterable.isIndexed=isIndexed,Iterable.isAssociative=isAssociative,Iterable.isOrdered=isOrdered,Iterable.Keyed=KeyedIterable,Iterable.Indexed=IndexedIterable,Iterable.Set=SetIterable;var o="@@__IMMUTABLE_ITERABLE__@@",i="@@__IMMUTABLE_KEYED__@@",u="@@__IMMUTABLE_INDEXED__@@",_="@@__IMMUTABLE_ORDERED__@@",w="delete",x=5,C=1<>>0;if(""+i!==o||4294967295===i)return NaN;o=i}return o<0?ensureSize(s)+o:o}function returnTrue(){return!0}function wholeSlice(s,o,i){return(0===s||void 0!==i&&s<=-i)&&(void 0===o||void 0!==i&&o>=i)}function resolveBegin(s,o){return resolveIndex(s,o,0)}function resolveEnd(s,o){return resolveIndex(s,o,o)}function resolveIndex(s,o,i){return void 0===s?i:s<0?Math.max(0,o+s):void 0===o?s:Math.min(o,s)}var V=0,U=1,z=2,Y="function"==typeof Symbol&&Symbol.iterator,Z="@@iterator",ee=Y||Z;function Iterator(s){this.next=s}function iteratorValue(s,o,i,u){var _=0===s?o:1===s?i:[o,i];return u?u.value=_:u={value:_,done:!1},u}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(s){return!!getIteratorFn(s)}function isIterator(s){return s&&"function"==typeof s.next}function getIterator(s){var o=getIteratorFn(s);return o&&o.call(s)}function getIteratorFn(s){var o=s&&(Y&&s[Y]||s[Z]);if("function"==typeof o)return o}function isArrayLike(s){return s&&"number"==typeof s.length}function Seq(s){return null==s?emptySequence():isIterable(s)?s.toSeq():seqFromValue(s)}function KeyedSeq(s){return null==s?emptySequence().toKeyedSeq():isIterable(s)?isKeyed(s)?s.toSeq():s.fromEntrySeq():keyedSeqFromValue(s)}function IndexedSeq(s){return null==s?emptySequence():isIterable(s)?isKeyed(s)?s.entrySeq():s.toIndexedSeq():indexedSeqFromValue(s)}function SetSeq(s){return(null==s?emptySequence():isIterable(s)?isKeyed(s)?s.entrySeq():s:indexedSeqFromValue(s)).toSetSeq()}Iterator.prototype.toString=function(){return"[Iterator]"},Iterator.KEYS=V,Iterator.VALUES=U,Iterator.ENTRIES=z,Iterator.prototype.inspect=Iterator.prototype.toSource=function(){return this.toString()},Iterator.prototype[ee]=function(){return this},createClass(Seq,Iterable),Seq.of=function(){return Seq(arguments)},Seq.prototype.toSeq=function(){return this},Seq.prototype.toString=function(){return this.__toString("Seq {","}")},Seq.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Seq.prototype.__iterate=function(s,o){return seqIterate(this,s,o,!0)},Seq.prototype.__iterator=function(s,o){return seqIterator(this,s,o,!0)},createClass(KeyedSeq,Seq),KeyedSeq.prototype.toKeyedSeq=function(){return this},createClass(IndexedSeq,Seq),IndexedSeq.of=function(){return IndexedSeq(arguments)},IndexedSeq.prototype.toIndexedSeq=function(){return this},IndexedSeq.prototype.toString=function(){return this.__toString("Seq [","]")},IndexedSeq.prototype.__iterate=function(s,o){return seqIterate(this,s,o,!1)},IndexedSeq.prototype.__iterator=function(s,o){return seqIterator(this,s,o,!1)},createClass(SetSeq,Seq),SetSeq.of=function(){return SetSeq(arguments)},SetSeq.prototype.toSetSeq=function(){return this},Seq.isSeq=isSeq,Seq.Keyed=KeyedSeq,Seq.Set=SetSeq,Seq.Indexed=IndexedSeq;var ie,ae,ce,le="@@__IMMUTABLE_SEQ__@@";function ArraySeq(s){this._array=s,this.size=s.length}function ObjectSeq(s){var o=Object.keys(s);this._object=s,this._keys=o,this.size=o.length}function IterableSeq(s){this._iterable=s,this.size=s.length||s.size}function IteratorSeq(s){this._iterator=s,this._iteratorCache=[]}function isSeq(s){return!(!s||!s[le])}function emptySequence(){return ie||(ie=new ArraySeq([]))}function keyedSeqFromValue(s){var o=Array.isArray(s)?new ArraySeq(s).fromEntrySeq():isIterator(s)?new IteratorSeq(s).fromEntrySeq():hasIterator(s)?new IterableSeq(s).fromEntrySeq():"object"==typeof s?new ObjectSeq(s):void 0;if(!o)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+s);return o}function indexedSeqFromValue(s){var o=maybeIndexedSeqFromValue(s);if(!o)throw new TypeError("Expected Array or iterable object of values: "+s);return o}function seqFromValue(s){var o=maybeIndexedSeqFromValue(s)||"object"==typeof s&&new ObjectSeq(s);if(!o)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+s);return o}function maybeIndexedSeqFromValue(s){return isArrayLike(s)?new ArraySeq(s):isIterator(s)?new IteratorSeq(s):hasIterator(s)?new IterableSeq(s):void 0}function seqIterate(s,o,i,u){var _=s._cache;if(_){for(var w=_.length-1,x=0;x<=w;x++){var C=_[i?w-x:x];if(!1===o(C[1],u?C[0]:x,s))return x+1}return x}return s.__iterateUncached(o,i)}function seqIterator(s,o,i,u){var _=s._cache;if(_){var w=_.length-1,x=0;return new Iterator((function(){var s=_[i?w-x:x];return x++>w?iteratorDone():iteratorValue(o,u?s[0]:x-1,s[1])}))}return s.__iteratorUncached(o,i)}function fromJS(s,o){return o?fromJSWith(o,s,"",{"":s}):fromJSDefault(s)}function fromJSWith(s,o,i,u){return Array.isArray(o)?s.call(u,i,IndexedSeq(o).map((function(i,u){return fromJSWith(s,i,u,o)}))):isPlainObj(o)?s.call(u,i,KeyedSeq(o).map((function(i,u){return fromJSWith(s,i,u,o)}))):o}function fromJSDefault(s){return Array.isArray(s)?IndexedSeq(s).map(fromJSDefault).toList():isPlainObj(s)?KeyedSeq(s).map(fromJSDefault).toMap():s}function isPlainObj(s){return s&&(s.constructor===Object||void 0===s.constructor)}function is(s,o){if(s===o||s!=s&&o!=o)return!0;if(!s||!o)return!1;if("function"==typeof s.valueOf&&"function"==typeof o.valueOf){if((s=s.valueOf())===(o=o.valueOf())||s!=s&&o!=o)return!0;if(!s||!o)return!1}return!("function"!=typeof s.equals||"function"!=typeof o.equals||!s.equals(o))}function deepEqual(s,o){if(s===o)return!0;if(!isIterable(o)||void 0!==s.size&&void 0!==o.size&&s.size!==o.size||void 0!==s.__hash&&void 0!==o.__hash&&s.__hash!==o.__hash||isKeyed(s)!==isKeyed(o)||isIndexed(s)!==isIndexed(o)||isOrdered(s)!==isOrdered(o))return!1;if(0===s.size&&0===o.size)return!0;var i=!isAssociative(s);if(isOrdered(s)){var u=s.entries();return o.every((function(s,o){var _=u.next().value;return _&&is(_[1],s)&&(i||is(_[0],o))}))&&u.next().done}var _=!1;if(void 0===s.size)if(void 0===o.size)"function"==typeof s.cacheResult&&s.cacheResult();else{_=!0;var w=s;s=o,o=w}var x=!0,C=o.__iterate((function(o,u){if(i?!s.has(o):_?!is(o,s.get(u,L)):!is(s.get(u,L),o))return x=!1,!1}));return x&&s.size===C}function Repeat(s,o){if(!(this instanceof Repeat))return new Repeat(s,o);if(this._value=s,this.size=void 0===o?1/0:Math.max(0,o),0===this.size){if(ae)return ae;ae=this}}function invariant(s,o){if(!s)throw new Error(o)}function Range(s,o,i){if(!(this instanceof Range))return new Range(s,o,i);if(invariant(0!==i,"Cannot step a Range by 0"),s=s||0,void 0===o&&(o=1/0),i=void 0===i?1:Math.abs(i),ou?iteratorDone():iteratorValue(s,_,i[o?u-_++:_++])}))},createClass(ObjectSeq,KeyedSeq),ObjectSeq.prototype.get=function(s,o){return void 0===o||this.has(s)?this._object[s]:o},ObjectSeq.prototype.has=function(s){return this._object.hasOwnProperty(s)},ObjectSeq.prototype.__iterate=function(s,o){for(var i=this._object,u=this._keys,_=u.length-1,w=0;w<=_;w++){var x=u[o?_-w:w];if(!1===s(i[x],x,this))return w+1}return w},ObjectSeq.prototype.__iterator=function(s,o){var i=this._object,u=this._keys,_=u.length-1,w=0;return new Iterator((function(){var x=u[o?_-w:w];return w++>_?iteratorDone():iteratorValue(s,x,i[x])}))},ObjectSeq.prototype[_]=!0,createClass(IterableSeq,IndexedSeq),IterableSeq.prototype.__iterateUncached=function(s,o){if(o)return this.cacheResult().__iterate(s,o);var i=getIterator(this._iterable),u=0;if(isIterator(i))for(var _;!(_=i.next()).done&&!1!==s(_.value,u++,this););return u},IterableSeq.prototype.__iteratorUncached=function(s,o){if(o)return this.cacheResult().__iterator(s,o);var i=getIterator(this._iterable);if(!isIterator(i))return new Iterator(iteratorDone);var u=0;return new Iterator((function(){var o=i.next();return o.done?o:iteratorValue(s,u++,o.value)}))},createClass(IteratorSeq,IndexedSeq),IteratorSeq.prototype.__iterateUncached=function(s,o){if(o)return this.cacheResult().__iterate(s,o);for(var i,u=this._iterator,_=this._iteratorCache,w=0;w<_.length;)if(!1===s(_[w],w++,this))return w;for(;!(i=u.next()).done;){var x=i.value;if(_[w]=x,!1===s(x,w++,this))break}return w},IteratorSeq.prototype.__iteratorUncached=function(s,o){if(o)return this.cacheResult().__iterator(s,o);var i=this._iterator,u=this._iteratorCache,_=0;return new Iterator((function(){if(_>=u.length){var o=i.next();if(o.done)return o;u[_]=o.value}return iteratorValue(s,_,u[_++])}))},createClass(Repeat,IndexedSeq),Repeat.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Repeat.prototype.get=function(s,o){return this.has(s)?this._value:o},Repeat.prototype.includes=function(s){return is(this._value,s)},Repeat.prototype.slice=function(s,o){var i=this.size;return wholeSlice(s,o,i)?this:new Repeat(this._value,resolveEnd(o,i)-resolveBegin(s,i))},Repeat.prototype.reverse=function(){return this},Repeat.prototype.indexOf=function(s){return is(this._value,s)?0:-1},Repeat.prototype.lastIndexOf=function(s){return is(this._value,s)?this.size:-1},Repeat.prototype.__iterate=function(s,o){for(var i=0;i=0&&o=0&&ii?iteratorDone():iteratorValue(s,w++,x)}))},Range.prototype.equals=function(s){return s instanceof Range?this._start===s._start&&this._end===s._end&&this._step===s._step:deepEqual(this,s)},createClass(Collection,Iterable),createClass(KeyedCollection,Collection),createClass(IndexedCollection,Collection),createClass(SetCollection,Collection),Collection.Keyed=KeyedCollection,Collection.Indexed=IndexedCollection,Collection.Set=SetCollection;var pe="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function imul(s,o){var i=65535&(s|=0),u=65535&(o|=0);return i*u+((s>>>16)*u+i*(o>>>16)<<16>>>0)|0};function smi(s){return s>>>1&1073741824|3221225471&s}function hash(s){if(!1===s||null==s)return 0;if("function"==typeof s.valueOf&&(!1===(s=s.valueOf())||null==s))return 0;if(!0===s)return 1;var o=typeof s;if("number"===o){if(s!=s||s===1/0)return 0;var i=0|s;for(i!==s&&(i^=4294967295*s);s>4294967295;)i^=s/=4294967295;return smi(i)}if("string"===o)return s.length>we?cachedHashString(s):hashString(s);if("function"==typeof s.hashCode)return s.hashCode();if("object"===o)return hashJSObj(s);if("function"==typeof s.toString)return hashString(s.toString());throw new Error("Value type "+o+" cannot be hashed.")}function cachedHashString(s){var o=Te[s];return void 0===o&&(o=hashString(s),Pe===xe&&(Pe=0,Te={}),Pe++,Te[s]=o),o}function hashString(s){for(var o=0,i=0;i0)switch(s.nodeType){case 1:return s.uniqueID;case 9:return s.documentElement&&s.documentElement.uniqueID}}var ye,be="function"==typeof WeakMap;be&&(ye=new WeakMap);var _e=0,Se="__immutablehash__";"function"==typeof Symbol&&(Se=Symbol(Se));var we=16,xe=255,Pe=0,Te={};function assertNotInfinite(s){invariant(s!==1/0,"Cannot perform this action with an infinite size.")}function Map(s){return null==s?emptyMap():isMap(s)&&!isOrdered(s)?s:emptyMap().withMutations((function(o){var i=KeyedIterable(s);assertNotInfinite(i.size),i.forEach((function(s,i){return o.set(i,s)}))}))}function isMap(s){return!(!s||!s[qe])}createClass(Map,KeyedCollection),Map.of=function(){var o=s.call(arguments,0);return emptyMap().withMutations((function(s){for(var i=0;i=o.length)throw new Error("Missing value for key: "+o[i]);s.set(o[i],o[i+1])}}))},Map.prototype.toString=function(){return this.__toString("Map {","}")},Map.prototype.get=function(s,o){return this._root?this._root.get(0,void 0,s,o):o},Map.prototype.set=function(s,o){return updateMap(this,s,o)},Map.prototype.setIn=function(s,o){return this.updateIn(s,L,(function(){return o}))},Map.prototype.remove=function(s){return updateMap(this,s,L)},Map.prototype.deleteIn=function(s){return this.updateIn(s,(function(){return L}))},Map.prototype.update=function(s,o,i){return 1===arguments.length?s(this):this.updateIn([s],o,i)},Map.prototype.updateIn=function(s,o,i){i||(i=o,o=void 0);var u=updateInDeepMap(this,forceIterator(s),o,i);return u===L?void 0:u},Map.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},Map.prototype.merge=function(){return mergeIntoMapWith(this,void 0,arguments)},Map.prototype.mergeWith=function(o){return mergeIntoMapWith(this,o,s.call(arguments,1))},Map.prototype.mergeIn=function(o){var i=s.call(arguments,1);return this.updateIn(o,emptyMap(),(function(s){return"function"==typeof s.merge?s.merge.apply(s,i):i[i.length-1]}))},Map.prototype.mergeDeep=function(){return mergeIntoMapWith(this,deepMerger,arguments)},Map.prototype.mergeDeepWith=function(o){var i=s.call(arguments,1);return mergeIntoMapWith(this,deepMergerWith(o),i)},Map.prototype.mergeDeepIn=function(o){var i=s.call(arguments,1);return this.updateIn(o,emptyMap(),(function(s){return"function"==typeof s.mergeDeep?s.mergeDeep.apply(s,i):i[i.length-1]}))},Map.prototype.sort=function(s){return OrderedMap(sortFactory(this,s))},Map.prototype.sortBy=function(s,o){return OrderedMap(sortFactory(this,o,s))},Map.prototype.withMutations=function(s){var o=this.asMutable();return s(o),o.wasAltered()?o.__ensureOwner(this.__ownerID):this},Map.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)},Map.prototype.asImmutable=function(){return this.__ensureOwner()},Map.prototype.wasAltered=function(){return this.__altered},Map.prototype.__iterator=function(s,o){return new MapIterator(this,s,o)},Map.prototype.__iterate=function(s,o){var i=this,u=0;return this._root&&this._root.iterate((function(o){return u++,s(o[1],o[0],i)}),o),u},Map.prototype.__ensureOwner=function(s){return s===this.__ownerID?this:s?makeMap(this.size,this._root,s,this.__hash):(this.__ownerID=s,this.__altered=!1,this)},Map.isMap=isMap;var Re,qe="@@__IMMUTABLE_MAP__@@",$e=Map.prototype;function ArrayMapNode(s,o){this.ownerID=s,this.entries=o}function BitmapIndexedNode(s,o,i){this.ownerID=s,this.bitmap=o,this.nodes=i}function HashArrayMapNode(s,o,i){this.ownerID=s,this.count=o,this.nodes=i}function HashCollisionNode(s,o,i){this.ownerID=s,this.keyHash=o,this.entries=i}function ValueNode(s,o,i){this.ownerID=s,this.keyHash=o,this.entry=i}function MapIterator(s,o,i){this._type=o,this._reverse=i,this._stack=s._root&&mapIteratorFrame(s._root)}function mapIteratorValue(s,o){return iteratorValue(s,o[0],o[1])}function mapIteratorFrame(s,o){return{node:s,index:0,__prev:o}}function makeMap(s,o,i,u){var _=Object.create($e);return _.size=s,_._root=o,_.__ownerID=i,_.__hash=u,_.__altered=!1,_}function emptyMap(){return Re||(Re=makeMap(0))}function updateMap(s,o,i){var u,_;if(s._root){var w=MakeRef(B),x=MakeRef($);if(u=updateNode(s._root,s.__ownerID,0,void 0,o,i,w,x),!x.value)return s;_=s.size+(w.value?i===L?-1:1:0)}else{if(i===L)return s;_=1,u=new ArrayMapNode(s.__ownerID,[[o,i]])}return s.__ownerID?(s.size=_,s._root=u,s.__hash=void 0,s.__altered=!0,s):u?makeMap(_,u):emptyMap()}function updateNode(s,o,i,u,_,w,x,C){return s?s.update(o,i,u,_,w,x,C):w===L?s:(SetRef(C),SetRef(x),new ValueNode(o,u,[_,w]))}function isLeafNode(s){return s.constructor===ValueNode||s.constructor===HashCollisionNode}function mergeIntoNode(s,o,i,u,_){if(s.keyHash===u)return new HashCollisionNode(o,u,[s.entry,_]);var w,C=(0===i?s.keyHash:s.keyHash>>>i)&j,L=(0===i?u:u>>>i)&j;return new BitmapIndexedNode(o,1<>>=1)x[j]=1&i?o[w++]:void 0;return x[u]=_,new HashArrayMapNode(s,w+1,x)}function mergeIntoMapWith(s,o,i){for(var u=[],_=0;_>1&1431655765))+(s>>2&858993459))+(s>>4)&252645135,s+=s>>8,127&(s+=s>>16)}function setIn(s,o,i,u){var _=u?s:arrCopy(s);return _[o]=i,_}function spliceIn(s,o,i,u){var _=s.length+1;if(u&&o+1===_)return s[o]=i,s;for(var w=new Array(_),x=0,C=0;C<_;C++)C===o?(w[C]=i,x=-1):w[C]=s[C+x];return w}function spliceOut(s,o,i){var u=s.length-1;if(i&&o===u)return s.pop(),s;for(var _=new Array(u),w=0,x=0;x=ze)return createNodes(s,j,u,_);var U=s&&s===this.ownerID,z=U?j:arrCopy(j);return V?C?B===$-1?z.pop():z[B]=z.pop():z[B]=[u,_]:z.push([u,_]),U?(this.entries=z,this):new ArrayMapNode(s,z)}},BitmapIndexedNode.prototype.get=function(s,o,i,u){void 0===o&&(o=hash(i));var _=1<<((0===s?o:o>>>s)&j),w=this.bitmap;return w&_?this.nodes[popCount(w&_-1)].get(s+x,o,i,u):u},BitmapIndexedNode.prototype.update=function(s,o,i,u,_,w,C){void 0===i&&(i=hash(u));var B=(0===o?i:i>>>o)&j,$=1<=We)return expandNodes(s,Y,V,B,ee);if(U&&!ee&&2===Y.length&&isLeafNode(Y[1^z]))return Y[1^z];if(U&&ee&&1===Y.length&&isLeafNode(ee))return ee;var ie=s&&s===this.ownerID,ae=U?ee?V:V^$:V|$,ce=U?ee?setIn(Y,z,ee,ie):spliceOut(Y,z,ie):spliceIn(Y,z,ee,ie);return ie?(this.bitmap=ae,this.nodes=ce,this):new BitmapIndexedNode(s,ae,ce)},HashArrayMapNode.prototype.get=function(s,o,i,u){void 0===o&&(o=hash(i));var _=(0===s?o:o>>>s)&j,w=this.nodes[_];return w?w.get(s+x,o,i,u):u},HashArrayMapNode.prototype.update=function(s,o,i,u,_,w,C){void 0===i&&(i=hash(u));var B=(0===o?i:i>>>o)&j,$=_===L,V=this.nodes,U=V[B];if($&&!U)return this;var z=updateNode(U,s,o+x,i,u,_,w,C);if(z===U)return this;var Y=this.count;if(U){if(!z&&--Y0&&u=0&&s>>o&j;if(u>=this.array.length)return new VNode([],s);var _,w=0===u;if(o>0){var C=this.array[u];if((_=C&&C.removeBefore(s,o-x,i))===C&&w)return this}if(w&&!_)return this;var L=editableVNode(this,s);if(!w)for(var B=0;B>>o&j;if(_>=this.array.length)return this;if(o>0){var w=this.array[_];if((u=w&&w.removeAfter(s,o-x,i))===w&&_===this.array.length-1)return this}var C=editableVNode(this,s);return C.array.splice(_+1),u&&(C.array[_]=u),C};var Qe,et,tt={};function iterateList(s,o){var i=s._origin,u=s._capacity,_=getTailOffset(u),w=s._tail;return iterateNodeOrLeaf(s._root,s._level,0);function iterateNodeOrLeaf(s,o,i){return 0===o?iterateLeaf(s,i):iterateNode(s,o,i)}function iterateLeaf(s,x){var j=x===_?w&&w.array:s&&s.array,L=x>i?0:i-x,B=u-x;return B>C&&(B=C),function(){if(L===B)return tt;var s=o?--B:L++;return j&&j[s]}}function iterateNode(s,_,w){var j,L=s&&s.array,B=w>i?0:i-w>>_,$=1+(u-w>>_);return $>C&&($=C),function(){for(;;){if(j){var s=j();if(s!==tt)return s;j=null}if(B===$)return tt;var i=o?--$:B++;j=iterateNodeOrLeaf(L&&L[i],_-x,w+(i<<_))}}}}function makeList(s,o,i,u,_,w,x){var C=Object.create(Xe);return C.size=o-s,C._origin=s,C._capacity=o,C._level=i,C._root=u,C._tail=_,C.__ownerID=w,C.__hash=x,C.__altered=!1,C}function emptyList(){return Qe||(Qe=makeList(0,0,x))}function updateList(s,o,i){if((o=wrapIndex(s,o))!=o)return s;if(o>=s.size||o<0)return s.withMutations((function(s){o<0?setListBounds(s,o).set(0,i):setListBounds(s,0,o+1).set(o,i)}));o+=s._origin;var u=s._tail,_=s._root,w=MakeRef($);return o>=getTailOffset(s._capacity)?u=updateVNode(u,s.__ownerID,0,o,i,w):_=updateVNode(_,s.__ownerID,s._level,o,i,w),w.value?s.__ownerID?(s._root=_,s._tail=u,s.__hash=void 0,s.__altered=!0,s):makeList(s._origin,s._capacity,s._level,_,u):s}function updateVNode(s,o,i,u,_,w){var C,L=u>>>i&j,B=s&&L0){var $=s&&s.array[L],V=updateVNode($,o,i-x,u,_,w);return V===$?s:((C=editableVNode(s,o)).array[L]=V,C)}return B&&s.array[L]===_?s:(SetRef(w),C=editableVNode(s,o),void 0===_&&L===C.array.length-1?C.array.pop():C.array[L]=_,C)}function editableVNode(s,o){return o&&s&&o===s.ownerID?s:new VNode(s?s.array.slice():[],o)}function listNodeFor(s,o){if(o>=getTailOffset(s._capacity))return s._tail;if(o<1<0;)i=i.array[o>>>u&j],u-=x;return i}}function setListBounds(s,o,i){void 0!==o&&(o|=0),void 0!==i&&(i|=0);var u=s.__ownerID||new OwnerID,_=s._origin,w=s._capacity,C=_+o,L=void 0===i?w:i<0?w+i:_+i;if(C===_&&L===w)return s;if(C>=L)return s.clear();for(var B=s._level,$=s._root,V=0;C+V<0;)$=new VNode($&&$.array.length?[void 0,$]:[],u),V+=1<<(B+=x);V&&(C+=V,_+=V,L+=V,w+=V);for(var U=getTailOffset(w),z=getTailOffset(L);z>=1<U?new VNode([],u):Y;if(Y&&z>U&&Cx;ie-=x){var ae=U>>>ie&j;ee=ee.array[ae]=editableVNode(ee.array[ae],u)}ee.array[U>>>x&j]=Y}if(L=z)C-=z,L-=z,B=x,$=null,Z=Z&&Z.removeBefore(u,0,C);else if(C>_||z>>B&j;if(ce!==z>>>B&j)break;ce&&(V+=(1<_&&($=$.removeBefore(u,B,C-V)),$&&z_&&(_=C.size),isIterable(x)||(C=C.map((function(s){return fromJS(s)}))),u.push(C)}return _>s.size&&(s=s.setSize(_)),mergeIntoCollectionWith(s,o,u)}function getTailOffset(s){return s>>x<=C&&x.size>=2*w.size?(u=(_=x.filter((function(s,o){return void 0!==s&&j!==o}))).toKeyedSeq().map((function(s){return s[0]})).flip().toMap(),s.__ownerID&&(u.__ownerID=_.__ownerID=s.__ownerID)):(u=w.remove(o),_=j===x.size-1?x.pop():x.set(j,void 0))}else if(B){if(i===x.get(j)[1])return s;u=w,_=x.set(j,[o,i])}else u=w.set(o,x.size),_=x.set(x.size,[o,i]);return s.__ownerID?(s.size=u.size,s._map=u,s._list=_,s.__hash=void 0,s):makeOrderedMap(u,_)}function ToKeyedSequence(s,o){this._iter=s,this._useKeys=o,this.size=s.size}function ToIndexedSequence(s){this._iter=s,this.size=s.size}function ToSetSequence(s){this._iter=s,this.size=s.size}function FromEntriesSequence(s){this._iter=s,this.size=s.size}function flipFactory(s){var o=makeSequence(s);return o._iter=s,o.size=s.size,o.flip=function(){return s},o.reverse=function(){var o=s.reverse.apply(this);return o.flip=function(){return s.reverse()},o},o.has=function(o){return s.includes(o)},o.includes=function(o){return s.has(o)},o.cacheResult=cacheResultThrough,o.__iterateUncached=function(o,i){var u=this;return s.__iterate((function(s,i){return!1!==o(i,s,u)}),i)},o.__iteratorUncached=function(o,i){if(o===z){var u=s.__iterator(o,i);return new Iterator((function(){var s=u.next();if(!s.done){var o=s.value[0];s.value[0]=s.value[1],s.value[1]=o}return s}))}return s.__iterator(o===U?V:U,i)},o}function mapFactory(s,o,i){var u=makeSequence(s);return u.size=s.size,u.has=function(o){return s.has(o)},u.get=function(u,_){var w=s.get(u,L);return w===L?_:o.call(i,w,u,s)},u.__iterateUncached=function(u,_){var w=this;return s.__iterate((function(s,_,x){return!1!==u(o.call(i,s,_,x),_,w)}),_)},u.__iteratorUncached=function(u,_){var w=s.__iterator(z,_);return new Iterator((function(){var _=w.next();if(_.done)return _;var x=_.value,C=x[0];return iteratorValue(u,C,o.call(i,x[1],C,s),_)}))},u}function reverseFactory(s,o){var i=makeSequence(s);return i._iter=s,i.size=s.size,i.reverse=function(){return s},s.flip&&(i.flip=function(){var o=flipFactory(s);return o.reverse=function(){return s.flip()},o}),i.get=function(i,u){return s.get(o?i:-1-i,u)},i.has=function(i){return s.has(o?i:-1-i)},i.includes=function(o){return s.includes(o)},i.cacheResult=cacheResultThrough,i.__iterate=function(o,i){var u=this;return s.__iterate((function(s,i){return o(s,i,u)}),!i)},i.__iterator=function(o,i){return s.__iterator(o,!i)},i}function filterFactory(s,o,i,u){var _=makeSequence(s);return u&&(_.has=function(u){var _=s.get(u,L);return _!==L&&!!o.call(i,_,u,s)},_.get=function(u,_){var w=s.get(u,L);return w!==L&&o.call(i,w,u,s)?w:_}),_.__iterateUncached=function(_,w){var x=this,C=0;return s.__iterate((function(s,w,j){if(o.call(i,s,w,j))return C++,_(s,u?w:C-1,x)}),w),C},_.__iteratorUncached=function(_,w){var x=s.__iterator(z,w),C=0;return new Iterator((function(){for(;;){var w=x.next();if(w.done)return w;var j=w.value,L=j[0],B=j[1];if(o.call(i,B,L,s))return iteratorValue(_,u?L:C++,B,w)}}))},_}function countByFactory(s,o,i){var u=Map().asMutable();return s.__iterate((function(_,w){u.update(o.call(i,_,w,s),0,(function(s){return s+1}))})),u.asImmutable()}function groupByFactory(s,o,i){var u=isKeyed(s),_=(isOrdered(s)?OrderedMap():Map()).asMutable();s.__iterate((function(w,x){_.update(o.call(i,w,x,s),(function(s){return(s=s||[]).push(u?[x,w]:w),s}))}));var w=iterableClass(s);return _.map((function(o){return reify(s,w(o))}))}function sliceFactory(s,o,i,u){var _=s.size;if(void 0!==o&&(o|=0),void 0!==i&&(i===1/0?i=_:i|=0),wholeSlice(o,i,_))return s;var w=resolveBegin(o,_),x=resolveEnd(i,_);if(w!=w||x!=x)return sliceFactory(s.toSeq().cacheResult(),o,i,u);var C,j=x-w;j==j&&(C=j<0?0:j);var L=makeSequence(s);return L.size=0===C?C:s.size&&C||void 0,!u&&isSeq(s)&&C>=0&&(L.get=function(o,i){return(o=wrapIndex(this,o))>=0&&oC)return iteratorDone();var s=_.next();return u||o===U?s:iteratorValue(o,j-1,o===V?void 0:s.value[1],s)}))},L}function takeWhileFactory(s,o,i){var u=makeSequence(s);return u.__iterateUncached=function(u,_){var w=this;if(_)return this.cacheResult().__iterate(u,_);var x=0;return s.__iterate((function(s,_,C){return o.call(i,s,_,C)&&++x&&u(s,_,w)})),x},u.__iteratorUncached=function(u,_){var w=this;if(_)return this.cacheResult().__iterator(u,_);var x=s.__iterator(z,_),C=!0;return new Iterator((function(){if(!C)return iteratorDone();var s=x.next();if(s.done)return s;var _=s.value,j=_[0],L=_[1];return o.call(i,L,j,w)?u===z?s:iteratorValue(u,j,L,s):(C=!1,iteratorDone())}))},u}function skipWhileFactory(s,o,i,u){var _=makeSequence(s);return _.__iterateUncached=function(_,w){var x=this;if(w)return this.cacheResult().__iterate(_,w);var C=!0,j=0;return s.__iterate((function(s,w,L){if(!C||!(C=o.call(i,s,w,L)))return j++,_(s,u?w:j-1,x)})),j},_.__iteratorUncached=function(_,w){var x=this;if(w)return this.cacheResult().__iterator(_,w);var C=s.__iterator(z,w),j=!0,L=0;return new Iterator((function(){var s,w,B;do{if((s=C.next()).done)return u||_===U?s:iteratorValue(_,L++,_===V?void 0:s.value[1],s);var $=s.value;w=$[0],B=$[1],j&&(j=o.call(i,B,w,x))}while(j);return _===z?s:iteratorValue(_,w,B,s)}))},_}function concatFactory(s,o){var i=isKeyed(s),u=[s].concat(o).map((function(s){return isIterable(s)?i&&(s=KeyedIterable(s)):s=i?keyedSeqFromValue(s):indexedSeqFromValue(Array.isArray(s)?s:[s]),s})).filter((function(s){return 0!==s.size}));if(0===u.length)return s;if(1===u.length){var _=u[0];if(_===s||i&&isKeyed(_)||isIndexed(s)&&isIndexed(_))return _}var w=new ArraySeq(u);return i?w=w.toKeyedSeq():isIndexed(s)||(w=w.toSetSeq()),(w=w.flatten(!0)).size=u.reduce((function(s,o){if(void 0!==s){var i=o.size;if(void 0!==i)return s+i}}),0),w}function flattenFactory(s,o,i){var u=makeSequence(s);return u.__iterateUncached=function(u,_){var w=0,x=!1;function flatDeep(s,C){var j=this;s.__iterate((function(s,_){return(!o||C0}function zipWithFactory(s,o,i){var u=makeSequence(s);return u.size=new ArraySeq(i).map((function(s){return s.size})).min(),u.__iterate=function(s,o){for(var i,u=this.__iterator(U,o),_=0;!(i=u.next()).done&&!1!==s(i.value,_++,this););return _},u.__iteratorUncached=function(s,u){var _=i.map((function(s){return s=Iterable(s),getIterator(u?s.reverse():s)})),w=0,x=!1;return new Iterator((function(){var i;return x||(i=_.map((function(s){return s.next()})),x=i.some((function(s){return s.done}))),x?iteratorDone():iteratorValue(s,w++,o.apply(null,i.map((function(s){return s.value}))))}))},u}function reify(s,o){return isSeq(s)?o:s.constructor(o)}function validateEntry(s){if(s!==Object(s))throw new TypeError("Expected [K, V] tuple: "+s)}function resolveSize(s){return assertNotInfinite(s.size),ensureSize(s)}function iterableClass(s){return isKeyed(s)?KeyedIterable:isIndexed(s)?IndexedIterable:SetIterable}function makeSequence(s){return Object.create((isKeyed(s)?KeyedSeq:isIndexed(s)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Seq.prototype.cacheResult.call(this)}function defaultComparator(s,o){return s>o?1:s=0;i--)o={value:arguments[i],next:o};return this.__ownerID?(this.size=s,this._head=o,this.__hash=void 0,this.__altered=!0,this):makeStack(s,o)},Stack.prototype.pushAll=function(s){if(0===(s=IndexedIterable(s)).size)return this;assertNotInfinite(s.size);var o=this.size,i=this._head;return s.reverse().forEach((function(s){o++,i={value:s,next:i}})),this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):makeStack(o,i)},Stack.prototype.pop=function(){return this.slice(1)},Stack.prototype.unshift=function(){return this.push.apply(this,arguments)},Stack.prototype.unshiftAll=function(s){return this.pushAll(s)},Stack.prototype.shift=function(){return this.pop.apply(this,arguments)},Stack.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},Stack.prototype.slice=function(s,o){if(wholeSlice(s,o,this.size))return this;var i=resolveBegin(s,this.size);if(resolveEnd(o,this.size)!==this.size)return IndexedCollection.prototype.slice.call(this,s,o);for(var u=this.size-i,_=this._head;i--;)_=_.next;return this.__ownerID?(this.size=u,this._head=_,this.__hash=void 0,this.__altered=!0,this):makeStack(u,_)},Stack.prototype.__ensureOwner=function(s){return s===this.__ownerID?this:s?makeStack(this.size,this._head,s,this.__hash):(this.__ownerID=s,this.__altered=!1,this)},Stack.prototype.__iterate=function(s,o){if(o)return this.reverse().__iterate(s);for(var i=0,u=this._head;u&&!1!==s(u.value,i++,this);)u=u.next;return i},Stack.prototype.__iterator=function(s,o){if(o)return this.reverse().__iterator(s);var i=0,u=this._head;return new Iterator((function(){if(u){var o=u.value;return u=u.next,iteratorValue(s,i++,o)}return iteratorDone()}))},Stack.isStack=isStack;var ct,lt="@@__IMMUTABLE_STACK__@@",ut=Stack.prototype;function makeStack(s,o,i,u){var _=Object.create(ut);return _.size=s,_._head=o,_.__ownerID=i,_.__hash=u,_.__altered=!1,_}function emptyStack(){return ct||(ct=makeStack(0))}function mixin(s,o){var keyCopier=function(i){s.prototype[i]=o[i]};return Object.keys(o).forEach(keyCopier),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(o).forEach(keyCopier),s}ut[lt]=!0,ut.withMutations=$e.withMutations,ut.asMutable=$e.asMutable,ut.asImmutable=$e.asImmutable,ut.wasAltered=$e.wasAltered,Iterable.Iterator=Iterator,mixin(Iterable,{toArray:function(){assertNotInfinite(this.size);var s=new Array(this.size||0);return this.valueSeq().__iterate((function(o,i){s[i]=o})),s},toIndexedSeq:function(){return new ToIndexedSequence(this)},toJS:function(){return this.toSeq().map((function(s){return s&&"function"==typeof s.toJS?s.toJS():s})).__toJS()},toJSON:function(){return this.toSeq().map((function(s){return s&&"function"==typeof s.toJSON?s.toJSON():s})).__toJS()},toKeyedSeq:function(){return new ToKeyedSequence(this,!0)},toMap:function(){return Map(this.toKeyedSeq())},toObject:function(){assertNotInfinite(this.size);var s={};return this.__iterate((function(o,i){s[i]=o})),s},toOrderedMap:function(){return OrderedMap(this.toKeyedSeq())},toOrderedSet:function(){return OrderedSet(isKeyed(this)?this.valueSeq():this)},toSet:function(){return Set(isKeyed(this)?this.valueSeq():this)},toSetSeq:function(){return new ToSetSequence(this)},toSeq:function(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Stack(isKeyed(this)?this.valueSeq():this)},toList:function(){return List(isKeyed(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(s,o){return 0===this.size?s+o:s+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+o},concat:function(){return reify(this,concatFactory(this,s.call(arguments,0)))},includes:function(s){return this.some((function(o){return is(o,s)}))},entries:function(){return this.__iterator(z)},every:function(s,o){assertNotInfinite(this.size);var i=!0;return this.__iterate((function(u,_,w){if(!s.call(o,u,_,w))return i=!1,!1})),i},filter:function(s,o){return reify(this,filterFactory(this,s,o,!0))},find:function(s,o,i){var u=this.findEntry(s,o);return u?u[1]:i},forEach:function(s,o){return assertNotInfinite(this.size),this.__iterate(o?s.bind(o):s)},join:function(s){assertNotInfinite(this.size),s=void 0!==s?""+s:",";var o="",i=!0;return this.__iterate((function(u){i?i=!1:o+=s,o+=null!=u?u.toString():""})),o},keys:function(){return this.__iterator(V)},map:function(s,o){return reify(this,mapFactory(this,s,o))},reduce:function(s,o,i){var u,_;return assertNotInfinite(this.size),arguments.length<2?_=!0:u=o,this.__iterate((function(o,w,x){_?(_=!1,u=o):u=s.call(i,u,o,w,x)})),u},reduceRight:function(s,o,i){var u=this.toKeyedSeq().reverse();return u.reduce.apply(u,arguments)},reverse:function(){return reify(this,reverseFactory(this,!0))},slice:function(s,o){return reify(this,sliceFactory(this,s,o,!0))},some:function(s,o){return!this.every(not(s),o)},sort:function(s){return reify(this,sortFactory(this,s))},values:function(){return this.__iterator(U)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(s,o){return ensureSize(s?this.toSeq().filter(s,o):this)},countBy:function(s,o){return countByFactory(this,s,o)},equals:function(s){return deepEqual(this,s)},entrySeq:function(){var s=this;if(s._cache)return new ArraySeq(s._cache);var o=s.toSeq().map(entryMapper).toIndexedSeq();return o.fromEntrySeq=function(){return s.toSeq()},o},filterNot:function(s,o){return this.filter(not(s),o)},findEntry:function(s,o,i){var u=i;return this.__iterate((function(i,_,w){if(s.call(o,i,_,w))return u=[_,i],!1})),u},findKey:function(s,o){var i=this.findEntry(s,o);return i&&i[0]},findLast:function(s,o,i){return this.toKeyedSeq().reverse().find(s,o,i)},findLastEntry:function(s,o,i){return this.toKeyedSeq().reverse().findEntry(s,o,i)},findLastKey:function(s,o){return this.toKeyedSeq().reverse().findKey(s,o)},first:function(){return this.find(returnTrue)},flatMap:function(s,o){return reify(this,flatMapFactory(this,s,o))},flatten:function(s){return reify(this,flattenFactory(this,s,!0))},fromEntrySeq:function(){return new FromEntriesSequence(this)},get:function(s,o){return this.find((function(o,i){return is(i,s)}),void 0,o)},getIn:function(s,o){for(var i,u=this,_=forceIterator(s);!(i=_.next()).done;){var w=i.value;if((u=u&&u.get?u.get(w,L):L)===L)return o}return u},groupBy:function(s,o){return groupByFactory(this,s,o)},has:function(s){return this.get(s,L)!==L},hasIn:function(s){return this.getIn(s,L)!==L},isSubset:function(s){return s="function"==typeof s.includes?s:Iterable(s),this.every((function(o){return s.includes(o)}))},isSuperset:function(s){return(s="function"==typeof s.isSubset?s:Iterable(s)).isSubset(this)},keyOf:function(s){return this.findKey((function(o){return is(o,s)}))},keySeq:function(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(s){return this.toKeyedSeq().reverse().keyOf(s)},max:function(s){return maxFactory(this,s)},maxBy:function(s,o){return maxFactory(this,o,s)},min:function(s){return maxFactory(this,s?neg(s):defaultNegComparator)},minBy:function(s,o){return maxFactory(this,o?neg(o):defaultNegComparator,s)},rest:function(){return this.slice(1)},skip:function(s){return this.slice(Math.max(0,s))},skipLast:function(s){return reify(this,this.toSeq().reverse().skip(s).reverse())},skipWhile:function(s,o){return reify(this,skipWhileFactory(this,s,o,!0))},skipUntil:function(s,o){return this.skipWhile(not(s),o)},sortBy:function(s,o){return reify(this,sortFactory(this,o,s))},take:function(s){return this.slice(0,Math.max(0,s))},takeLast:function(s){return reify(this,this.toSeq().reverse().take(s).reverse())},takeWhile:function(s,o){return reify(this,takeWhileFactory(this,s,o))},takeUntil:function(s,o){return this.takeWhile(not(s),o)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=hashIterable(this))}});var pt=Iterable.prototype;pt[o]=!0,pt[ee]=pt.values,pt.__toJS=pt.toArray,pt.__toStringMapper=quoteString,pt.inspect=pt.toSource=function(){return this.toString()},pt.chain=pt.flatMap,pt.contains=pt.includes,mixin(KeyedIterable,{flip:function(){return reify(this,flipFactory(this))},mapEntries:function(s,o){var i=this,u=0;return reify(this,this.toSeq().map((function(_,w){return s.call(o,[w,_],u++,i)})).fromEntrySeq())},mapKeys:function(s,o){var i=this;return reify(this,this.toSeq().flip().map((function(u,_){return s.call(o,u,_,i)})).flip())}});var ht=KeyedIterable.prototype;function keyMapper(s,o){return o}function entryMapper(s,o){return[o,s]}function not(s){return function(){return!s.apply(this,arguments)}}function neg(s){return function(){return-s.apply(this,arguments)}}function quoteString(s){return"string"==typeof s?JSON.stringify(s):String(s)}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(s,o){return so?-1:0}function hashIterable(s){if(s.size===1/0)return 0;var o=isOrdered(s),i=isKeyed(s),u=o?1:0;return murmurHashOfSize(s.__iterate(i?o?function(s,o){u=31*u+hashMerge(hash(s),hash(o))|0}:function(s,o){u=u+hashMerge(hash(s),hash(o))|0}:o?function(s){u=31*u+hash(s)|0}:function(s){u=u+hash(s)|0}),u)}function murmurHashOfSize(s,o){return o=pe(o,3432918353),o=pe(o<<15|o>>>-15,461845907),o=pe(o<<13|o>>>-13,5),o=pe((o=o+3864292196^s)^o>>>16,2246822507),o=smi((o=pe(o^o>>>13,3266489909))^o>>>16)}function hashMerge(s,o){return s^o+2654435769+(s<<6)+(s>>2)}return ht[i]=!0,ht[ee]=pt.entries,ht.__toJS=pt.toObject,ht.__toStringMapper=function(s,o){return JSON.stringify(o)+": "+quoteString(s)},mixin(IndexedIterable,{toKeyedSeq:function(){return new ToKeyedSequence(this,!1)},filter:function(s,o){return reify(this,filterFactory(this,s,o,!1))},findIndex:function(s,o){var i=this.findEntry(s,o);return i?i[0]:-1},indexOf:function(s){var o=this.keyOf(s);return void 0===o?-1:o},lastIndexOf:function(s){var o=this.lastKeyOf(s);return void 0===o?-1:o},reverse:function(){return reify(this,reverseFactory(this,!1))},slice:function(s,o){return reify(this,sliceFactory(this,s,o,!1))},splice:function(s,o){var i=arguments.length;if(o=Math.max(0|o,0),0===i||2===i&&!o)return this;s=resolveBegin(s,s<0?this.count():this.size);var u=this.slice(0,s);return reify(this,1===i?u:u.concat(arrCopy(arguments,2),this.slice(s+o)))},findLastIndex:function(s,o){var i=this.findLastEntry(s,o);return i?i[0]:-1},first:function(){return this.get(0)},flatten:function(s){return reify(this,flattenFactory(this,s,!1))},get:function(s,o){return(s=wrapIndex(this,s))<0||this.size===1/0||void 0!==this.size&&s>this.size?o:this.find((function(o,i){return i===s}),void 0,o)},has:function(s){return(s=wrapIndex(this,s))>=0&&(void 0!==this.size?this.size===1/0||s{"function"==typeof Object.create?s.exports=function inherits(s,o){o&&(s.super_=o,s.prototype=Object.create(o.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}))}:s.exports=function inherits(s,o){if(o){s.super_=o;var TempCtor=function(){};TempCtor.prototype=o.prototype,s.prototype=new TempCtor,s.prototype.constructor=s}}},5419:s=>{s.exports=function(s,o,i,u){var _=new Blob(void 0!==u?[u,s]:[s],{type:i||"application/octet-stream"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(_,o);else{var w=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(_):window.webkitURL.createObjectURL(_),x=document.createElement("a");x.style.display="none",x.href=w,x.setAttribute("download",o),void 0===x.download&&x.setAttribute("target","_blank"),document.body.appendChild(x),x.click(),setTimeout((function(){document.body.removeChild(x),window.URL.revokeObjectURL(w)}),200)}}},20181:(s,o,i)=>{var u=/^\s+|\s+$/g,_=/^[-+]0x[0-9a-f]+$/i,w=/^0b[01]+$/i,x=/^0o[0-7]+$/i,C=parseInt,j="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,L="object"==typeof self&&self&&self.Object===Object&&self,B=j||L||Function("return this")(),$=Object.prototype.toString,V=Math.max,U=Math.min,now=function(){return B.Date.now()};function isObject(s){var o=typeof s;return!!s&&("object"==o||"function"==o)}function toNumber(s){if("number"==typeof s)return s;if(function isSymbol(s){return"symbol"==typeof s||function isObjectLike(s){return!!s&&"object"==typeof s}(s)&&"[object Symbol]"==$.call(s)}(s))return NaN;if(isObject(s)){var o="function"==typeof s.valueOf?s.valueOf():s;s=isObject(o)?o+"":o}if("string"!=typeof s)return 0===s?s:+s;s=s.replace(u,"");var i=w.test(s);return i||x.test(s)?C(s.slice(2),i?2:8):_.test(s)?NaN:+s}s.exports=function debounce(s,o,i){var u,_,w,x,C,j,L=0,B=!1,$=!1,z=!0;if("function"!=typeof s)throw new TypeError("Expected a function");function invokeFunc(o){var i=u,w=_;return u=_=void 0,L=o,x=s.apply(w,i)}function shouldInvoke(s){var i=s-j;return void 0===j||i>=o||i<0||$&&s-L>=w}function timerExpired(){var s=now();if(shouldInvoke(s))return trailingEdge(s);C=setTimeout(timerExpired,function remainingWait(s){var i=o-(s-j);return $?U(i,w-(s-L)):i}(s))}function trailingEdge(s){return C=void 0,z&&u?invokeFunc(s):(u=_=void 0,x)}function debounced(){var s=now(),i=shouldInvoke(s);if(u=arguments,_=this,j=s,i){if(void 0===C)return function leadingEdge(s){return L=s,C=setTimeout(timerExpired,o),B?invokeFunc(s):x}(j);if($)return C=setTimeout(timerExpired,o),invokeFunc(j)}return void 0===C&&(C=setTimeout(timerExpired,o)),x}return o=toNumber(o)||0,isObject(i)&&(B=!!i.leading,w=($="maxWait"in i)?V(toNumber(i.maxWait)||0,o):w,z="trailing"in i?!!i.trailing:z),debounced.cancel=function cancel(){void 0!==C&&clearTimeout(C),L=0,u=j=_=C=void 0},debounced.flush=function flush(){return void 0===C?x:trailingEdge(now())},debounced}},55580:(s,o,i)=>{var u=i(56110)(i(9325),"DataView");s.exports=u},21549:(s,o,i)=>{var u=i(22032),_=i(63862),w=i(66721),x=i(12749),C=i(35749);function Hash(s){var o=-1,i=null==s?0:s.length;for(this.clear();++o{var u=i(39344),_=i(94033);function LazyWrapper(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}LazyWrapper.prototype=u(_.prototype),LazyWrapper.prototype.constructor=LazyWrapper,s.exports=LazyWrapper},80079:(s,o,i)=>{var u=i(63702),_=i(70080),w=i(24739),x=i(48655),C=i(31175);function ListCache(s){var o=-1,i=null==s?0:s.length;for(this.clear();++o{var u=i(39344),_=i(94033);function LodashWrapper(s,o){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=void 0}LodashWrapper.prototype=u(_.prototype),LodashWrapper.prototype.constructor=LodashWrapper,s.exports=LodashWrapper},68223:(s,o,i)=>{var u=i(56110)(i(9325),"Map");s.exports=u},53661:(s,o,i)=>{var u=i(63040),_=i(17670),w=i(90289),x=i(4509),C=i(72949);function MapCache(s){var o=-1,i=null==s?0:s.length;for(this.clear();++o{var u=i(56110)(i(9325),"Promise");s.exports=u},76545:(s,o,i)=>{var u=i(56110)(i(9325),"Set");s.exports=u},38859:(s,o,i)=>{var u=i(53661),_=i(31380),w=i(51459);function SetCache(s){var o=-1,i=null==s?0:s.length;for(this.__data__=new u;++o{var u=i(80079),_=i(51420),w=i(90938),x=i(63605),C=i(29817),j=i(80945);function Stack(s){var o=this.__data__=new u(s);this.size=o.size}Stack.prototype.clear=_,Stack.prototype.delete=w,Stack.prototype.get=x,Stack.prototype.has=C,Stack.prototype.set=j,s.exports=Stack},51873:(s,o,i)=>{var u=i(9325).Symbol;s.exports=u},37828:(s,o,i)=>{var u=i(9325).Uint8Array;s.exports=u},28303:(s,o,i)=>{var u=i(56110)(i(9325),"WeakMap");s.exports=u},91033:s=>{s.exports=function apply(s,o,i){switch(i.length){case 0:return s.call(o);case 1:return s.call(o,i[0]);case 2:return s.call(o,i[0],i[1]);case 3:return s.call(o,i[0],i[1],i[2])}return s.apply(o,i)}},83729:s=>{s.exports=function arrayEach(s,o){for(var i=-1,u=null==s?0:s.length;++i{s.exports=function arrayFilter(s,o){for(var i=-1,u=null==s?0:s.length,_=0,w=[];++i{var u=i(96131);s.exports=function arrayIncludes(s,o){return!!(null==s?0:s.length)&&u(s,o,0)>-1}},70695:(s,o,i)=>{var u=i(78096),_=i(72428),w=i(56449),x=i(3656),C=i(30361),j=i(37167),L=Object.prototype.hasOwnProperty;s.exports=function arrayLikeKeys(s,o){var i=w(s),B=!i&&_(s),$=!i&&!B&&x(s),V=!i&&!B&&!$&&j(s),U=i||B||$||V,z=U?u(s.length,String):[],Y=z.length;for(var Z in s)!o&&!L.call(s,Z)||U&&("length"==Z||$&&("offset"==Z||"parent"==Z)||V&&("buffer"==Z||"byteLength"==Z||"byteOffset"==Z)||C(Z,Y))||z.push(Z);return z}},34932:s=>{s.exports=function arrayMap(s,o){for(var i=-1,u=null==s?0:s.length,_=Array(u);++i{s.exports=function arrayPush(s,o){for(var i=-1,u=o.length,_=s.length;++i{s.exports=function arrayReduce(s,o,i,u){var _=-1,w=null==s?0:s.length;for(u&&w&&(i=s[++_]);++_{s.exports=function arraySome(s,o){for(var i=-1,u=null==s?0:s.length;++i{s.exports=function asciiToArray(s){return s.split("")}},1733:s=>{var o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;s.exports=function asciiWords(s){return s.match(o)||[]}},87805:(s,o,i)=>{var u=i(43360),_=i(75288);s.exports=function assignMergeValue(s,o,i){(void 0!==i&&!_(s[o],i)||void 0===i&&!(o in s))&&u(s,o,i)}},16547:(s,o,i)=>{var u=i(43360),_=i(75288),w=Object.prototype.hasOwnProperty;s.exports=function assignValue(s,o,i){var x=s[o];w.call(s,o)&&_(x,i)&&(void 0!==i||o in s)||u(s,o,i)}},26025:(s,o,i)=>{var u=i(75288);s.exports=function assocIndexOf(s,o){for(var i=s.length;i--;)if(u(s[i][0],o))return i;return-1}},74733:(s,o,i)=>{var u=i(21791),_=i(95950);s.exports=function baseAssign(s,o){return s&&u(o,_(o),s)}},43838:(s,o,i)=>{var u=i(21791),_=i(37241);s.exports=function baseAssignIn(s,o){return s&&u(o,_(o),s)}},43360:(s,o,i)=>{var u=i(93243);s.exports=function baseAssignValue(s,o,i){"__proto__"==o&&u?u(s,o,{configurable:!0,enumerable:!0,value:i,writable:!0}):s[o]=i}},9999:(s,o,i)=>{var u=i(37217),_=i(83729),w=i(16547),x=i(74733),C=i(43838),j=i(93290),L=i(23007),B=i(92271),$=i(48948),V=i(50002),U=i(83349),z=i(5861),Y=i(76189),Z=i(77199),ee=i(35529),ie=i(56449),ae=i(3656),ce=i(87730),le=i(23805),pe=i(38440),de=i(95950),fe=i(37241),ye="[object Arguments]",be="[object Function]",_e="[object Object]",Se={};Se[ye]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object DataView]"]=Se["[object Boolean]"]=Se["[object Date]"]=Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Map]"]=Se["[object Number]"]=Se[_e]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object Symbol]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Error]"]=Se[be]=Se["[object WeakMap]"]=!1,s.exports=function baseClone(s,o,i,we,xe,Pe){var Te,Re=1&o,qe=2&o,$e=4&o;if(i&&(Te=xe?i(s,we,xe,Pe):i(s)),void 0!==Te)return Te;if(!le(s))return s;var ze=ie(s);if(ze){if(Te=Y(s),!Re)return L(s,Te)}else{var We=z(s),He=We==be||"[object GeneratorFunction]"==We;if(ae(s))return j(s,Re);if(We==_e||We==ye||He&&!xe){if(Te=qe||He?{}:ee(s),!Re)return qe?$(s,C(Te,s)):B(s,x(Te,s))}else{if(!Se[We])return xe?s:{};Te=Z(s,We,Re)}}Pe||(Pe=new u);var Ye=Pe.get(s);if(Ye)return Ye;Pe.set(s,Te),pe(s)?s.forEach((function(u){Te.add(baseClone(u,o,i,u,s,Pe))})):ce(s)&&s.forEach((function(u,_){Te.set(_,baseClone(u,o,i,_,s,Pe))}));var Xe=ze?void 0:($e?qe?U:V:qe?fe:de)(s);return _(Xe||s,(function(u,_){Xe&&(u=s[_=u]),w(Te,_,baseClone(u,o,i,_,s,Pe))})),Te}},39344:(s,o,i)=>{var u=i(23805),_=Object.create,w=function(){function object(){}return function(s){if(!u(s))return{};if(_)return _(s);object.prototype=s;var o=new object;return object.prototype=void 0,o}}();s.exports=w},80909:(s,o,i)=>{var u=i(30641),_=i(38329)(u);s.exports=_},2523:s=>{s.exports=function baseFindIndex(s,o,i,u){for(var _=s.length,w=i+(u?1:-1);u?w--:++w<_;)if(o(s[w],w,s))return w;return-1}},83120:(s,o,i)=>{var u=i(14528),_=i(45891);s.exports=function baseFlatten(s,o,i,w,x){var C=-1,j=s.length;for(i||(i=_),x||(x=[]);++C0&&i(L)?o>1?baseFlatten(L,o-1,i,w,x):u(x,L):w||(x[x.length]=L)}return x}},86649:(s,o,i)=>{var u=i(83221)();s.exports=u},30641:(s,o,i)=>{var u=i(86649),_=i(95950);s.exports=function baseForOwn(s,o){return s&&u(s,o,_)}},47422:(s,o,i)=>{var u=i(31769),_=i(77797);s.exports=function baseGet(s,o){for(var i=0,w=(o=u(o,s)).length;null!=s&&i{var u=i(14528),_=i(56449);s.exports=function baseGetAllKeys(s,o,i){var w=o(s);return _(s)?w:u(w,i(s))}},72552:(s,o,i)=>{var u=i(51873),_=i(659),w=i(59350),x=u?u.toStringTag:void 0;s.exports=function baseGetTag(s){return null==s?void 0===s?"[object Undefined]":"[object Null]":x&&x in Object(s)?_(s):w(s)}},20426:s=>{var o=Object.prototype.hasOwnProperty;s.exports=function baseHas(s,i){return null!=s&&o.call(s,i)}},28077:s=>{s.exports=function baseHasIn(s,o){return null!=s&&o in Object(s)}},96131:(s,o,i)=>{var u=i(2523),_=i(85463),w=i(76959);s.exports=function baseIndexOf(s,o,i){return o==o?w(s,o,i):u(s,_,i)}},27534:(s,o,i)=>{var u=i(72552),_=i(40346);s.exports=function baseIsArguments(s){return _(s)&&"[object Arguments]"==u(s)}},60270:(s,o,i)=>{var u=i(87068),_=i(40346);s.exports=function baseIsEqual(s,o,i,w,x){return s===o||(null==s||null==o||!_(s)&&!_(o)?s!=s&&o!=o:u(s,o,i,w,baseIsEqual,x))}},87068:(s,o,i)=>{var u=i(37217),_=i(25911),w=i(21986),x=i(50689),C=i(5861),j=i(56449),L=i(3656),B=i(37167),$="[object Arguments]",V="[object Array]",U="[object Object]",z=Object.prototype.hasOwnProperty;s.exports=function baseIsEqualDeep(s,o,i,Y,Z,ee){var ie=j(s),ae=j(o),ce=ie?V:C(s),le=ae?V:C(o),pe=(ce=ce==$?U:ce)==U,de=(le=le==$?U:le)==U,fe=ce==le;if(fe&&L(s)){if(!L(o))return!1;ie=!0,pe=!1}if(fe&&!pe)return ee||(ee=new u),ie||B(s)?_(s,o,i,Y,Z,ee):w(s,o,ce,i,Y,Z,ee);if(!(1&i)){var ye=pe&&z.call(s,"__wrapped__"),be=de&&z.call(o,"__wrapped__");if(ye||be){var _e=ye?s.value():s,Se=be?o.value():o;return ee||(ee=new u),Z(_e,Se,i,Y,ee)}}return!!fe&&(ee||(ee=new u),x(s,o,i,Y,Z,ee))}},29172:(s,o,i)=>{var u=i(5861),_=i(40346);s.exports=function baseIsMap(s){return _(s)&&"[object Map]"==u(s)}},41799:(s,o,i)=>{var u=i(37217),_=i(60270);s.exports=function baseIsMatch(s,o,i,w){var x=i.length,C=x,j=!w;if(null==s)return!C;for(s=Object(s);x--;){var L=i[x];if(j&&L[2]?L[1]!==s[L[0]]:!(L[0]in s))return!1}for(;++x{s.exports=function baseIsNaN(s){return s!=s}},45083:(s,o,i)=>{var u=i(1882),_=i(87296),w=i(23805),x=i(47473),C=/^\[object .+?Constructor\]$/,j=Function.prototype,L=Object.prototype,B=j.toString,$=L.hasOwnProperty,V=RegExp("^"+B.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");s.exports=function baseIsNative(s){return!(!w(s)||_(s))&&(u(s)?V:C).test(x(s))}},16038:(s,o,i)=>{var u=i(5861),_=i(40346);s.exports=function baseIsSet(s){return _(s)&&"[object Set]"==u(s)}},4901:(s,o,i)=>{var u=i(72552),_=i(30294),w=i(40346),x={};x["[object Float32Array]"]=x["[object Float64Array]"]=x["[object Int8Array]"]=x["[object Int16Array]"]=x["[object Int32Array]"]=x["[object Uint8Array]"]=x["[object Uint8ClampedArray]"]=x["[object Uint16Array]"]=x["[object Uint32Array]"]=!0,x["[object Arguments]"]=x["[object Array]"]=x["[object ArrayBuffer]"]=x["[object Boolean]"]=x["[object DataView]"]=x["[object Date]"]=x["[object Error]"]=x["[object Function]"]=x["[object Map]"]=x["[object Number]"]=x["[object Object]"]=x["[object RegExp]"]=x["[object Set]"]=x["[object String]"]=x["[object WeakMap]"]=!1,s.exports=function baseIsTypedArray(s){return w(s)&&_(s.length)&&!!x[u(s)]}},15389:(s,o,i)=>{var u=i(93663),_=i(87978),w=i(83488),x=i(56449),C=i(50583);s.exports=function baseIteratee(s){return"function"==typeof s?s:null==s?w:"object"==typeof s?x(s)?_(s[0],s[1]):u(s):C(s)}},88984:(s,o,i)=>{var u=i(55527),_=i(3650),w=Object.prototype.hasOwnProperty;s.exports=function baseKeys(s){if(!u(s))return _(s);var o=[];for(var i in Object(s))w.call(s,i)&&"constructor"!=i&&o.push(i);return o}},72903:(s,o,i)=>{var u=i(23805),_=i(55527),w=i(90181),x=Object.prototype.hasOwnProperty;s.exports=function baseKeysIn(s){if(!u(s))return w(s);var o=_(s),i=[];for(var C in s)("constructor"!=C||!o&&x.call(s,C))&&i.push(C);return i}},94033:s=>{s.exports=function baseLodash(){}},93663:(s,o,i)=>{var u=i(41799),_=i(10776),w=i(67197);s.exports=function baseMatches(s){var o=_(s);return 1==o.length&&o[0][2]?w(o[0][0],o[0][1]):function(i){return i===s||u(i,s,o)}}},87978:(s,o,i)=>{var u=i(60270),_=i(58156),w=i(80631),x=i(28586),C=i(30756),j=i(67197),L=i(77797);s.exports=function baseMatchesProperty(s,o){return x(s)&&C(o)?j(L(s),o):function(i){var x=_(i,s);return void 0===x&&x===o?w(i,s):u(o,x,3)}}},85250:(s,o,i)=>{var u=i(37217),_=i(87805),w=i(86649),x=i(42824),C=i(23805),j=i(37241),L=i(14974);s.exports=function baseMerge(s,o,i,B,$){s!==o&&w(o,(function(w,j){if($||($=new u),C(w))x(s,o,j,i,baseMerge,B,$);else{var V=B?B(L(s,j),w,j+"",s,o,$):void 0;void 0===V&&(V=w),_(s,j,V)}}),j)}},42824:(s,o,i)=>{var u=i(87805),_=i(93290),w=i(71961),x=i(23007),C=i(35529),j=i(72428),L=i(56449),B=i(83693),$=i(3656),V=i(1882),U=i(23805),z=i(11331),Y=i(37167),Z=i(14974),ee=i(69884);s.exports=function baseMergeDeep(s,o,i,ie,ae,ce,le){var pe=Z(s,i),de=Z(o,i),fe=le.get(de);if(fe)u(s,i,fe);else{var ye=ce?ce(pe,de,i+"",s,o,le):void 0,be=void 0===ye;if(be){var _e=L(de),Se=!_e&&$(de),we=!_e&&!Se&&Y(de);ye=de,_e||Se||we?L(pe)?ye=pe:B(pe)?ye=x(pe):Se?(be=!1,ye=_(de,!0)):we?(be=!1,ye=w(de,!0)):ye=[]:z(de)||j(de)?(ye=pe,j(pe)?ye=ee(pe):U(pe)&&!V(pe)||(ye=C(de))):be=!1}be&&(le.set(de,ye),ae(ye,de,ie,ce,le),le.delete(de)),u(s,i,ye)}}},47237:s=>{s.exports=function baseProperty(s){return function(o){return null==o?void 0:o[s]}}},17255:(s,o,i)=>{var u=i(47422);s.exports=function basePropertyDeep(s){return function(o){return u(o,s)}}},54552:s=>{s.exports=function basePropertyOf(s){return function(o){return null==s?void 0:s[o]}}},85558:s=>{s.exports=function baseReduce(s,o,i,u,_){return _(s,(function(s,_,w){i=u?(u=!1,s):o(i,s,_,w)})),i}},69302:(s,o,i)=>{var u=i(83488),_=i(56757),w=i(32865);s.exports=function baseRest(s,o){return w(_(s,o,u),s+"")}},73170:(s,o,i)=>{var u=i(16547),_=i(31769),w=i(30361),x=i(23805),C=i(77797);s.exports=function baseSet(s,o,i,j){if(!x(s))return s;for(var L=-1,B=(o=_(o,s)).length,$=B-1,V=s;null!=V&&++L{var u=i(83488),_=i(48152),w=_?function(s,o){return _.set(s,o),s}:u;s.exports=w},19570:(s,o,i)=>{var u=i(37334),_=i(93243),w=i(83488),x=_?function(s,o){return _(s,"toString",{configurable:!0,enumerable:!1,value:u(o),writable:!0})}:w;s.exports=x},25160:s=>{s.exports=function baseSlice(s,o,i){var u=-1,_=s.length;o<0&&(o=-o>_?0:_+o),(i=i>_?_:i)<0&&(i+=_),_=o>i?0:i-o>>>0,o>>>=0;for(var w=Array(_);++u<_;)w[u]=s[u+o];return w}},90916:(s,o,i)=>{var u=i(80909);s.exports=function baseSome(s,o){var i;return u(s,(function(s,u,_){return!(i=o(s,u,_))})),!!i}},78096:s=>{s.exports=function baseTimes(s,o){for(var i=-1,u=Array(s);++i{var u=i(51873),_=i(34932),w=i(56449),x=i(44394),C=u?u.prototype:void 0,j=C?C.toString:void 0;s.exports=function baseToString(s){if("string"==typeof s)return s;if(w(s))return _(s,baseToString)+"";if(x(s))return j?j.call(s):"";var o=s+"";return"0"==o&&1/s==-1/0?"-0":o}},54128:(s,o,i)=>{var u=i(31800),_=/^\s+/;s.exports=function baseTrim(s){return s?s.slice(0,u(s)+1).replace(_,""):s}},27301:s=>{s.exports=function baseUnary(s){return function(o){return s(o)}}},19931:(s,o,i)=>{var u=i(31769),_=i(68090),w=i(68969),x=i(77797);s.exports=function baseUnset(s,o){return o=u(o,s),null==(s=w(s,o))||delete s[x(_(o))]}},51234:s=>{s.exports=function baseZipObject(s,o,i){for(var u=-1,_=s.length,w=o.length,x={};++u<_;){var C=u{s.exports=function cacheHas(s,o){return s.has(o)}},31769:(s,o,i)=>{var u=i(56449),_=i(28586),w=i(61802),x=i(13222);s.exports=function castPath(s,o){return u(s)?s:_(s,o)?[s]:w(x(s))}},28754:(s,o,i)=>{var u=i(25160);s.exports=function castSlice(s,o,i){var _=s.length;return i=void 0===i?_:i,!o&&i>=_?s:u(s,o,i)}},49653:(s,o,i)=>{var u=i(37828);s.exports=function cloneArrayBuffer(s){var o=new s.constructor(s.byteLength);return new u(o).set(new u(s)),o}},93290:(s,o,i)=>{s=i.nmd(s);var u=i(9325),_=o&&!o.nodeType&&o,w=_&&s&&!s.nodeType&&s,x=w&&w.exports===_?u.Buffer:void 0,C=x?x.allocUnsafe:void 0;s.exports=function cloneBuffer(s,o){if(o)return s.slice();var i=s.length,u=C?C(i):new s.constructor(i);return s.copy(u),u}},76169:(s,o,i)=>{var u=i(49653);s.exports=function cloneDataView(s,o){var i=o?u(s.buffer):s.buffer;return new s.constructor(i,s.byteOffset,s.byteLength)}},73201:s=>{var o=/\w*$/;s.exports=function cloneRegExp(s){var i=new s.constructor(s.source,o.exec(s));return i.lastIndex=s.lastIndex,i}},93736:(s,o,i)=>{var u=i(51873),_=u?u.prototype:void 0,w=_?_.valueOf:void 0;s.exports=function cloneSymbol(s){return w?Object(w.call(s)):{}}},71961:(s,o,i)=>{var u=i(49653);s.exports=function cloneTypedArray(s,o){var i=o?u(s.buffer):s.buffer;return new s.constructor(i,s.byteOffset,s.length)}},91596:s=>{var o=Math.max;s.exports=function composeArgs(s,i,u,_){for(var w=-1,x=s.length,C=u.length,j=-1,L=i.length,B=o(x-C,0),$=Array(L+B),V=!_;++j{var o=Math.max;s.exports=function composeArgsRight(s,i,u,_){for(var w=-1,x=s.length,C=-1,j=u.length,L=-1,B=i.length,$=o(x-j,0),V=Array($+B),U=!_;++w<$;)V[w]=s[w];for(var z=w;++L{s.exports=function copyArray(s,o){var i=-1,u=s.length;for(o||(o=Array(u));++i{var u=i(16547),_=i(43360);s.exports=function copyObject(s,o,i,w){var x=!i;i||(i={});for(var C=-1,j=o.length;++C{var u=i(21791),_=i(4664);s.exports=function copySymbols(s,o){return u(s,_(s),o)}},48948:(s,o,i)=>{var u=i(21791),_=i(86375);s.exports=function copySymbolsIn(s,o){return u(s,_(s),o)}},55481:(s,o,i)=>{var u=i(9325)["__core-js_shared__"];s.exports=u},58523:s=>{s.exports=function countHolders(s,o){for(var i=s.length,u=0;i--;)s[i]===o&&++u;return u}},20999:(s,o,i)=>{var u=i(69302),_=i(36800);s.exports=function createAssigner(s){return u((function(o,i){var u=-1,w=i.length,x=w>1?i[w-1]:void 0,C=w>2?i[2]:void 0;for(x=s.length>3&&"function"==typeof x?(w--,x):void 0,C&&_(i[0],i[1],C)&&(x=w<3?void 0:x,w=1),o=Object(o);++u{var u=i(64894);s.exports=function createBaseEach(s,o){return function(i,_){if(null==i)return i;if(!u(i))return s(i,_);for(var w=i.length,x=o?w:-1,C=Object(i);(o?x--:++x{s.exports=function createBaseFor(s){return function(o,i,u){for(var _=-1,w=Object(o),x=u(o),C=x.length;C--;){var j=x[s?C:++_];if(!1===i(w[j],j,w))break}return o}}},11842:(s,o,i)=>{var u=i(82819),_=i(9325);s.exports=function createBind(s,o,i){var w=1&o,x=u(s);return function wrapper(){return(this&&this!==_&&this instanceof wrapper?x:s).apply(w?i:this,arguments)}}},12507:(s,o,i)=>{var u=i(28754),_=i(49698),w=i(63912),x=i(13222);s.exports=function createCaseFirst(s){return function(o){o=x(o);var i=_(o)?w(o):void 0,C=i?i[0]:o.charAt(0),j=i?u(i,1).join(""):o.slice(1);return C[s]()+j}}},45539:(s,o,i)=>{var u=i(40882),_=i(50828),w=i(66645),x=RegExp("['’]","g");s.exports=function createCompounder(s){return function(o){return u(w(_(o).replace(x,"")),s,"")}}},82819:(s,o,i)=>{var u=i(39344),_=i(23805);s.exports=function createCtor(s){return function(){var o=arguments;switch(o.length){case 0:return new s;case 1:return new s(o[0]);case 2:return new s(o[0],o[1]);case 3:return new s(o[0],o[1],o[2]);case 4:return new s(o[0],o[1],o[2],o[3]);case 5:return new s(o[0],o[1],o[2],o[3],o[4]);case 6:return new s(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new s(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var i=u(s.prototype),w=s.apply(i,o);return _(w)?w:i}}},77078:(s,o,i)=>{var u=i(91033),_=i(82819),w=i(37471),x=i(18073),C=i(11287),j=i(36306),L=i(9325);s.exports=function createCurry(s,o,i){var B=_(s);return function wrapper(){for(var _=arguments.length,$=Array(_),V=_,U=C(wrapper);V--;)$[V]=arguments[V];var z=_<3&&$[0]!==U&&$[_-1]!==U?[]:j($,U);return(_-=z.length){var u=i(15389),_=i(64894),w=i(95950);s.exports=function createFind(s){return function(o,i,x){var C=Object(o);if(!_(o)){var j=u(i,3);o=w(o),i=function(s){return j(C[s],s,C)}}var L=s(o,i,x);return L>-1?C[j?o[L]:L]:void 0}}},37471:(s,o,i)=>{var u=i(91596),_=i(53320),w=i(58523),x=i(82819),C=i(18073),j=i(11287),L=i(68294),B=i(36306),$=i(9325);s.exports=function createHybrid(s,o,i,V,U,z,Y,Z,ee,ie){var ae=128&o,ce=1&o,le=2&o,pe=24&o,de=512&o,fe=le?void 0:x(s);return function wrapper(){for(var ye=arguments.length,be=Array(ye),_e=ye;_e--;)be[_e]=arguments[_e];if(pe)var Se=j(wrapper),we=w(be,Se);if(V&&(be=u(be,V,U,pe)),z&&(be=_(be,z,Y,pe)),ye-=we,pe&&ye1&&be.reverse(),ae&&ee{var u=i(91033),_=i(82819),w=i(9325);s.exports=function createPartial(s,o,i,x){var C=1&o,j=_(s);return function wrapper(){for(var o=-1,_=arguments.length,L=-1,B=x.length,$=Array(B+_),V=this&&this!==w&&this instanceof wrapper?j:s;++L{var u=i(85087),_=i(54641),w=i(70981);s.exports=function createRecurry(s,o,i,x,C,j,L,B,$,V){var U=8&o;o|=U?32:64,4&(o&=~(U?64:32))||(o&=-4);var z=[s,o,C,U?j:void 0,U?L:void 0,U?void 0:j,U?void 0:L,B,$,V],Y=i.apply(void 0,z);return u(s)&&_(Y,z),Y.placeholder=x,w(Y,s,o)}},66977:(s,o,i)=>{var u=i(68882),_=i(11842),w=i(77078),x=i(37471),C=i(24168),j=i(37381),L=i(3209),B=i(54641),$=i(70981),V=i(61489),U=Math.max;s.exports=function createWrap(s,o,i,z,Y,Z,ee,ie){var ae=2&o;if(!ae&&"function"!=typeof s)throw new TypeError("Expected a function");var ce=z?z.length:0;if(ce||(o&=-97,z=Y=void 0),ee=void 0===ee?ee:U(V(ee),0),ie=void 0===ie?ie:V(ie),ce-=Y?Y.length:0,64&o){var le=z,pe=Y;z=Y=void 0}var de=ae?void 0:j(s),fe=[s,o,i,z,Y,le,pe,Z,ee,ie];if(de&&L(fe,de),s=fe[0],o=fe[1],i=fe[2],z=fe[3],Y=fe[4],!(ie=fe[9]=void 0===fe[9]?ae?0:s.length:U(fe[9]-ce,0))&&24&o&&(o&=-25),o&&1!=o)ye=8==o||16==o?w(s,o,ie):32!=o&&33!=o||Y.length?x.apply(void 0,fe):C(s,o,i,z);else var ye=_(s,o,i);return $((de?u:B)(ye,fe),s,o)}},53138:(s,o,i)=>{var u=i(11331);s.exports=function customOmitClone(s){return u(s)?void 0:s}},24647:(s,o,i)=>{var u=i(54552)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});s.exports=u},93243:(s,o,i)=>{var u=i(56110),_=function(){try{var s=u(Object,"defineProperty");return s({},"",{}),s}catch(s){}}();s.exports=_},25911:(s,o,i)=>{var u=i(38859),_=i(14248),w=i(19219);s.exports=function equalArrays(s,o,i,x,C,j){var L=1&i,B=s.length,$=o.length;if(B!=$&&!(L&&$>B))return!1;var V=j.get(s),U=j.get(o);if(V&&U)return V==o&&U==s;var z=-1,Y=!0,Z=2&i?new u:void 0;for(j.set(s,o),j.set(o,s);++z{var u=i(51873),_=i(37828),w=i(75288),x=i(25911),C=i(20317),j=i(84247),L=u?u.prototype:void 0,B=L?L.valueOf:void 0;s.exports=function equalByTag(s,o,i,u,L,$,V){switch(i){case"[object DataView]":if(s.byteLength!=o.byteLength||s.byteOffset!=o.byteOffset)return!1;s=s.buffer,o=o.buffer;case"[object ArrayBuffer]":return!(s.byteLength!=o.byteLength||!$(new _(s),new _(o)));case"[object Boolean]":case"[object Date]":case"[object Number]":return w(+s,+o);case"[object Error]":return s.name==o.name&&s.message==o.message;case"[object RegExp]":case"[object String]":return s==o+"";case"[object Map]":var U=C;case"[object Set]":var z=1&u;if(U||(U=j),s.size!=o.size&&!z)return!1;var Y=V.get(s);if(Y)return Y==o;u|=2,V.set(s,o);var Z=x(U(s),U(o),u,L,$,V);return V.delete(s),Z;case"[object Symbol]":if(B)return B.call(s)==B.call(o)}return!1}},50689:(s,o,i)=>{var u=i(50002),_=Object.prototype.hasOwnProperty;s.exports=function equalObjects(s,o,i,w,x,C){var j=1&i,L=u(s),B=L.length;if(B!=u(o).length&&!j)return!1;for(var $=B;$--;){var V=L[$];if(!(j?V in o:_.call(o,V)))return!1}var U=C.get(s),z=C.get(o);if(U&&z)return U==o&&z==s;var Y=!0;C.set(s,o),C.set(o,s);for(var Z=j;++${var u=i(35970),_=i(56757),w=i(32865);s.exports=function flatRest(s){return w(_(s,void 0,u),s+"")}},34840:(s,o,i)=>{var u="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;s.exports=u},50002:(s,o,i)=>{var u=i(82199),_=i(4664),w=i(95950);s.exports=function getAllKeys(s){return u(s,w,_)}},83349:(s,o,i)=>{var u=i(82199),_=i(86375),w=i(37241);s.exports=function getAllKeysIn(s){return u(s,w,_)}},37381:(s,o,i)=>{var u=i(48152),_=i(63950),w=u?function(s){return u.get(s)}:_;s.exports=w},62284:(s,o,i)=>{var u=i(84629),_=Object.prototype.hasOwnProperty;s.exports=function getFuncName(s){for(var o=s.name+"",i=u[o],w=_.call(u,o)?i.length:0;w--;){var x=i[w],C=x.func;if(null==C||C==s)return x.name}return o}},11287:s=>{s.exports=function getHolder(s){return s.placeholder}},12651:(s,o,i)=>{var u=i(74218);s.exports=function getMapData(s,o){var i=s.__data__;return u(o)?i["string"==typeof o?"string":"hash"]:i.map}},10776:(s,o,i)=>{var u=i(30756),_=i(95950);s.exports=function getMatchData(s){for(var o=_(s),i=o.length;i--;){var w=o[i],x=s[w];o[i]=[w,x,u(x)]}return o}},56110:(s,o,i)=>{var u=i(45083),_=i(10392);s.exports=function getNative(s,o){var i=_(s,o);return u(i)?i:void 0}},28879:(s,o,i)=>{var u=i(74335)(Object.getPrototypeOf,Object);s.exports=u},659:(s,o,i)=>{var u=i(51873),_=Object.prototype,w=_.hasOwnProperty,x=_.toString,C=u?u.toStringTag:void 0;s.exports=function getRawTag(s){var o=w.call(s,C),i=s[C];try{s[C]=void 0;var u=!0}catch(s){}var _=x.call(s);return u&&(o?s[C]=i:delete s[C]),_}},4664:(s,o,i)=>{var u=i(79770),_=i(63345),w=Object.prototype.propertyIsEnumerable,x=Object.getOwnPropertySymbols,C=x?function(s){return null==s?[]:(s=Object(s),u(x(s),(function(o){return w.call(s,o)})))}:_;s.exports=C},86375:(s,o,i)=>{var u=i(14528),_=i(28879),w=i(4664),x=i(63345),C=Object.getOwnPropertySymbols?function(s){for(var o=[];s;)u(o,w(s)),s=_(s);return o}:x;s.exports=C},5861:(s,o,i)=>{var u=i(55580),_=i(68223),w=i(32804),x=i(76545),C=i(28303),j=i(72552),L=i(47473),B="[object Map]",$="[object Promise]",V="[object Set]",U="[object WeakMap]",z="[object DataView]",Y=L(u),Z=L(_),ee=L(w),ie=L(x),ae=L(C),ce=j;(u&&ce(new u(new ArrayBuffer(1)))!=z||_&&ce(new _)!=B||w&&ce(w.resolve())!=$||x&&ce(new x)!=V||C&&ce(new C)!=U)&&(ce=function(s){var o=j(s),i="[object Object]"==o?s.constructor:void 0,u=i?L(i):"";if(u)switch(u){case Y:return z;case Z:return B;case ee:return $;case ie:return V;case ae:return U}return o}),s.exports=ce},10392:s=>{s.exports=function getValue(s,o){return null==s?void 0:s[o]}},75251:s=>{var o=/\{\n\/\* \[wrapped with (.+)\] \*/,i=/,? & /;s.exports=function getWrapDetails(s){var u=s.match(o);return u?u[1].split(i):[]}},49326:(s,o,i)=>{var u=i(31769),_=i(72428),w=i(56449),x=i(30361),C=i(30294),j=i(77797);s.exports=function hasPath(s,o,i){for(var L=-1,B=(o=u(o,s)).length,$=!1;++L{var o=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");s.exports=function hasUnicode(s){return o.test(s)}},45434:s=>{var o=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;s.exports=function hasUnicodeWord(s){return o.test(s)}},22032:(s,o,i)=>{var u=i(81042);s.exports=function hashClear(){this.__data__=u?u(null):{},this.size=0}},63862:s=>{s.exports=function hashDelete(s){var o=this.has(s)&&delete this.__data__[s];return this.size-=o?1:0,o}},66721:(s,o,i)=>{var u=i(81042),_=Object.prototype.hasOwnProperty;s.exports=function hashGet(s){var o=this.__data__;if(u){var i=o[s];return"__lodash_hash_undefined__"===i?void 0:i}return _.call(o,s)?o[s]:void 0}},12749:(s,o,i)=>{var u=i(81042),_=Object.prototype.hasOwnProperty;s.exports=function hashHas(s){var o=this.__data__;return u?void 0!==o[s]:_.call(o,s)}},35749:(s,o,i)=>{var u=i(81042);s.exports=function hashSet(s,o){var i=this.__data__;return this.size+=this.has(s)?0:1,i[s]=u&&void 0===o?"__lodash_hash_undefined__":o,this}},76189:s=>{var o=Object.prototype.hasOwnProperty;s.exports=function initCloneArray(s){var i=s.length,u=new s.constructor(i);return i&&"string"==typeof s[0]&&o.call(s,"index")&&(u.index=s.index,u.input=s.input),u}},77199:(s,o,i)=>{var u=i(49653),_=i(76169),w=i(73201),x=i(93736),C=i(71961);s.exports=function initCloneByTag(s,o,i){var j=s.constructor;switch(o){case"[object ArrayBuffer]":return u(s);case"[object Boolean]":case"[object Date]":return new j(+s);case"[object DataView]":return _(s,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return C(s,i);case"[object Map]":case"[object Set]":return new j;case"[object Number]":case"[object String]":return new j(s);case"[object RegExp]":return w(s);case"[object Symbol]":return x(s)}}},35529:(s,o,i)=>{var u=i(39344),_=i(28879),w=i(55527);s.exports=function initCloneObject(s){return"function"!=typeof s.constructor||w(s)?{}:u(_(s))}},62060:s=>{var o=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;s.exports=function insertWrapDetails(s,i){var u=i.length;if(!u)return s;var _=u-1;return i[_]=(u>1?"& ":"")+i[_],i=i.join(u>2?", ":" "),s.replace(o,"{\n/* [wrapped with "+i+"] */\n")}},45891:(s,o,i)=>{var u=i(51873),_=i(72428),w=i(56449),x=u?u.isConcatSpreadable:void 0;s.exports=function isFlattenable(s){return w(s)||_(s)||!!(x&&s&&s[x])}},30361:s=>{var o=/^(?:0|[1-9]\d*)$/;s.exports=function isIndex(s,i){var u=typeof s;return!!(i=null==i?9007199254740991:i)&&("number"==u||"symbol"!=u&&o.test(s))&&s>-1&&s%1==0&&s{var u=i(75288),_=i(64894),w=i(30361),x=i(23805);s.exports=function isIterateeCall(s,o,i){if(!x(i))return!1;var C=typeof o;return!!("number"==C?_(i)&&w(o,i.length):"string"==C&&o in i)&&u(i[o],s)}},28586:(s,o,i)=>{var u=i(56449),_=i(44394),w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,x=/^\w*$/;s.exports=function isKey(s,o){if(u(s))return!1;var i=typeof s;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=s&&!_(s))||(x.test(s)||!w.test(s)||null!=o&&s in Object(o))}},74218:s=>{s.exports=function isKeyable(s){var o=typeof s;return"string"==o||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==s:null===s}},85087:(s,o,i)=>{var u=i(30980),_=i(37381),w=i(62284),x=i(53758);s.exports=function isLaziable(s){var o=w(s),i=x[o];if("function"!=typeof i||!(o in u.prototype))return!1;if(s===i)return!0;var C=_(i);return!!C&&s===C[0]}},87296:(s,o,i)=>{var u,_=i(55481),w=(u=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"";s.exports=function isMasked(s){return!!w&&w in s}},55527:s=>{var o=Object.prototype;s.exports=function isPrototype(s){var i=s&&s.constructor;return s===("function"==typeof i&&i.prototype||o)}},30756:(s,o,i)=>{var u=i(23805);s.exports=function isStrictComparable(s){return s==s&&!u(s)}},63702:s=>{s.exports=function listCacheClear(){this.__data__=[],this.size=0}},70080:(s,o,i)=>{var u=i(26025),_=Array.prototype.splice;s.exports=function listCacheDelete(s){var o=this.__data__,i=u(o,s);return!(i<0)&&(i==o.length-1?o.pop():_.call(o,i,1),--this.size,!0)}},24739:(s,o,i)=>{var u=i(26025);s.exports=function listCacheGet(s){var o=this.__data__,i=u(o,s);return i<0?void 0:o[i][1]}},48655:(s,o,i)=>{var u=i(26025);s.exports=function listCacheHas(s){return u(this.__data__,s)>-1}},31175:(s,o,i)=>{var u=i(26025);s.exports=function listCacheSet(s,o){var i=this.__data__,_=u(i,s);return _<0?(++this.size,i.push([s,o])):i[_][1]=o,this}},63040:(s,o,i)=>{var u=i(21549),_=i(80079),w=i(68223);s.exports=function mapCacheClear(){this.size=0,this.__data__={hash:new u,map:new(w||_),string:new u}}},17670:(s,o,i)=>{var u=i(12651);s.exports=function mapCacheDelete(s){var o=u(this,s).delete(s);return this.size-=o?1:0,o}},90289:(s,o,i)=>{var u=i(12651);s.exports=function mapCacheGet(s){return u(this,s).get(s)}},4509:(s,o,i)=>{var u=i(12651);s.exports=function mapCacheHas(s){return u(this,s).has(s)}},72949:(s,o,i)=>{var u=i(12651);s.exports=function mapCacheSet(s,o){var i=u(this,s),_=i.size;return i.set(s,o),this.size+=i.size==_?0:1,this}},20317:s=>{s.exports=function mapToArray(s){var o=-1,i=Array(s.size);return s.forEach((function(s,u){i[++o]=[u,s]})),i}},67197:s=>{s.exports=function matchesStrictComparable(s,o){return function(i){return null!=i&&(i[s]===o&&(void 0!==o||s in Object(i)))}}},62224:(s,o,i)=>{var u=i(50104);s.exports=function memoizeCapped(s){var o=u(s,(function(s){return 500===i.size&&i.clear(),s})),i=o.cache;return o}},3209:(s,o,i)=>{var u=i(91596),_=i(53320),w=i(36306),x="__lodash_placeholder__",C=128,j=Math.min;s.exports=function mergeData(s,o){var i=s[1],L=o[1],B=i|L,$=B<131,V=L==C&&8==i||L==C&&256==i&&s[7].length<=o[8]||384==L&&o[7].length<=o[8]&&8==i;if(!$&&!V)return s;1&L&&(s[2]=o[2],B|=1&i?0:4);var U=o[3];if(U){var z=s[3];s[3]=z?u(z,U,o[4]):U,s[4]=z?w(s[3],x):o[4]}return(U=o[5])&&(z=s[5],s[5]=z?_(z,U,o[6]):U,s[6]=z?w(s[5],x):o[6]),(U=o[7])&&(s[7]=U),L&C&&(s[8]=null==s[8]?o[8]:j(s[8],o[8])),null==s[9]&&(s[9]=o[9]),s[0]=o[0],s[1]=B,s}},48152:(s,o,i)=>{var u=i(28303),_=u&&new u;s.exports=_},81042:(s,o,i)=>{var u=i(56110)(Object,"create");s.exports=u},3650:(s,o,i)=>{var u=i(74335)(Object.keys,Object);s.exports=u},90181:s=>{s.exports=function nativeKeysIn(s){var o=[];if(null!=s)for(var i in Object(s))o.push(i);return o}},86009:(s,o,i)=>{s=i.nmd(s);var u=i(34840),_=o&&!o.nodeType&&o,w=_&&s&&!s.nodeType&&s,x=w&&w.exports===_&&u.process,C=function(){try{var s=w&&w.require&&w.require("util").types;return s||x&&x.binding&&x.binding("util")}catch(s){}}();s.exports=C},59350:s=>{var o=Object.prototype.toString;s.exports=function objectToString(s){return o.call(s)}},74335:s=>{s.exports=function overArg(s,o){return function(i){return s(o(i))}}},56757:(s,o,i)=>{var u=i(91033),_=Math.max;s.exports=function overRest(s,o,i){return o=_(void 0===o?s.length-1:o,0),function(){for(var w=arguments,x=-1,C=_(w.length-o,0),j=Array(C);++x{var u=i(47422),_=i(25160);s.exports=function parent(s,o){return o.length<2?s:u(s,_(o,0,-1))}},84629:s=>{s.exports={}},68294:(s,o,i)=>{var u=i(23007),_=i(30361),w=Math.min;s.exports=function reorder(s,o){for(var i=s.length,x=w(o.length,i),C=u(s);x--;){var j=o[x];s[x]=_(j,i)?C[j]:void 0}return s}},36306:s=>{var o="__lodash_placeholder__";s.exports=function replaceHolders(s,i){for(var u=-1,_=s.length,w=0,x=[];++u<_;){var C=s[u];C!==i&&C!==o||(s[u]=o,x[w++]=u)}return x}},9325:(s,o,i)=>{var u=i(34840),_="object"==typeof self&&self&&self.Object===Object&&self,w=u||_||Function("return this")();s.exports=w},14974:s=>{s.exports=function safeGet(s,o){if(("constructor"!==o||"function"!=typeof s[o])&&"__proto__"!=o)return s[o]}},31380:s=>{s.exports=function setCacheAdd(s){return this.__data__.set(s,"__lodash_hash_undefined__"),this}},51459:s=>{s.exports=function setCacheHas(s){return this.__data__.has(s)}},54641:(s,o,i)=>{var u=i(68882),_=i(51811)(u);s.exports=_},84247:s=>{s.exports=function setToArray(s){var o=-1,i=Array(s.size);return s.forEach((function(s){i[++o]=s})),i}},32865:(s,o,i)=>{var u=i(19570),_=i(51811)(u);s.exports=_},70981:(s,o,i)=>{var u=i(75251),_=i(62060),w=i(32865),x=i(75948);s.exports=function setWrapToString(s,o,i){var C=o+"";return w(s,_(C,x(u(C),i)))}},51811:s=>{var o=Date.now;s.exports=function shortOut(s){var i=0,u=0;return function(){var _=o(),w=16-(_-u);if(u=_,w>0){if(++i>=800)return arguments[0]}else i=0;return s.apply(void 0,arguments)}}},51420:(s,o,i)=>{var u=i(80079);s.exports=function stackClear(){this.__data__=new u,this.size=0}},90938:s=>{s.exports=function stackDelete(s){var o=this.__data__,i=o.delete(s);return this.size=o.size,i}},63605:s=>{s.exports=function stackGet(s){return this.__data__.get(s)}},29817:s=>{s.exports=function stackHas(s){return this.__data__.has(s)}},80945:(s,o,i)=>{var u=i(80079),_=i(68223),w=i(53661);s.exports=function stackSet(s,o){var i=this.__data__;if(i instanceof u){var x=i.__data__;if(!_||x.length<199)return x.push([s,o]),this.size=++i.size,this;i=this.__data__=new w(x)}return i.set(s,o),this.size=i.size,this}},76959:s=>{s.exports=function strictIndexOf(s,o,i){for(var u=i-1,_=s.length;++u<_;)if(s[u]===o)return u;return-1}},63912:(s,o,i)=>{var u=i(61074),_=i(49698),w=i(42054);s.exports=function stringToArray(s){return _(s)?w(s):u(s)}},61802:(s,o,i)=>{var u=i(62224),_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w=/\\(\\)?/g,x=u((function(s){var o=[];return 46===s.charCodeAt(0)&&o.push(""),s.replace(_,(function(s,i,u,_){o.push(u?_.replace(w,"$1"):i||s)})),o}));s.exports=x},77797:(s,o,i)=>{var u=i(44394);s.exports=function toKey(s){if("string"==typeof s||u(s))return s;var o=s+"";return"0"==o&&1/s==-1/0?"-0":o}},47473:s=>{var o=Function.prototype.toString;s.exports=function toSource(s){if(null!=s){try{return o.call(s)}catch(s){}try{return s+""}catch(s){}}return""}},31800:s=>{var o=/\s/;s.exports=function trimmedEndIndex(s){for(var i=s.length;i--&&o.test(s.charAt(i)););return i}},42054:s=>{var o="\\ud800-\\udfff",i="["+o+"]",u="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",_="\\ud83c[\\udffb-\\udfff]",w="[^"+o+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",C="[\\ud800-\\udbff][\\udc00-\\udfff]",j="(?:"+u+"|"+_+")"+"?",L="[\\ufe0e\\ufe0f]?",B=L+j+("(?:\\u200d(?:"+[w,x,C].join("|")+")"+L+j+")*"),$="(?:"+[w+u+"?",u,x,C,i].join("|")+")",V=RegExp(_+"(?="+_+")|"+$+B,"g");s.exports=function unicodeToArray(s){return s.match(V)||[]}},22225:s=>{var o="\\ud800-\\udfff",i="\\u2700-\\u27bf",u="a-z\\xdf-\\xf6\\xf8-\\xff",_="A-Z\\xc0-\\xd6\\xd8-\\xde",w="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",x="["+w+"]",C="\\d+",j="["+i+"]",L="["+u+"]",B="[^"+o+w+C+i+u+_+"]",$="(?:\\ud83c[\\udde6-\\uddff]){2}",V="[\\ud800-\\udbff][\\udc00-\\udfff]",U="["+_+"]",z="(?:"+L+"|"+B+")",Y="(?:"+U+"|"+B+")",Z="(?:['’](?:d|ll|m|re|s|t|ve))?",ee="(?:['’](?:D|LL|M|RE|S|T|VE))?",ie="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ae="[\\ufe0e\\ufe0f]?",ce=ae+ie+("(?:\\u200d(?:"+["[^"+o+"]",$,V].join("|")+")"+ae+ie+")*"),le="(?:"+[j,$,V].join("|")+")"+ce,pe=RegExp([U+"?"+L+"+"+Z+"(?="+[x,U,"$"].join("|")+")",Y+"+"+ee+"(?="+[x,U+z,"$"].join("|")+")",U+"?"+z+"+"+Z,U+"+"+ee,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",C,le].join("|"),"g");s.exports=function unicodeWords(s){return s.match(pe)||[]}},75948:(s,o,i)=>{var u=i(83729),_=i(15325),w=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];s.exports=function updateWrapDetails(s,o){return u(w,(function(i){var u="_."+i[0];o&i[1]&&!_(s,u)&&s.push(u)})),s.sort()}},80257:(s,o,i)=>{var u=i(30980),_=i(56017),w=i(23007);s.exports=function wrapperClone(s){if(s instanceof u)return s.clone();var o=new _(s.__wrapped__,s.__chain__);return o.__actions__=w(s.__actions__),o.__index__=s.__index__,o.__values__=s.__values__,o}},64626:(s,o,i)=>{var u=i(66977);s.exports=function ary(s,o,i){return o=i?void 0:o,o=s&&null==o?s.length:o,u(s,128,void 0,void 0,void 0,void 0,o)}},84058:(s,o,i)=>{var u=i(14792),_=i(45539)((function(s,o,i){return o=o.toLowerCase(),s+(i?u(o):o)}));s.exports=_},14792:(s,o,i)=>{var u=i(13222),_=i(55808);s.exports=function capitalize(s){return _(u(s).toLowerCase())}},32629:(s,o,i)=>{var u=i(9999);s.exports=function clone(s){return u(s,4)}},37334:s=>{s.exports=function constant(s){return function(){return s}}},49747:(s,o,i)=>{var u=i(66977);function curry(s,o,i){var _=u(s,8,void 0,void 0,void 0,void 0,void 0,o=i?void 0:o);return _.placeholder=curry.placeholder,_}curry.placeholder={},s.exports=curry},38221:(s,o,i)=>{var u=i(23805),_=i(10124),w=i(99374),x=Math.max,C=Math.min;s.exports=function debounce(s,o,i){var j,L,B,$,V,U,z=0,Y=!1,Z=!1,ee=!0;if("function"!=typeof s)throw new TypeError("Expected a function");function invokeFunc(o){var i=j,u=L;return j=L=void 0,z=o,$=s.apply(u,i)}function shouldInvoke(s){var i=s-U;return void 0===U||i>=o||i<0||Z&&s-z>=B}function timerExpired(){var s=_();if(shouldInvoke(s))return trailingEdge(s);V=setTimeout(timerExpired,function remainingWait(s){var i=o-(s-U);return Z?C(i,B-(s-z)):i}(s))}function trailingEdge(s){return V=void 0,ee&&j?invokeFunc(s):(j=L=void 0,$)}function debounced(){var s=_(),i=shouldInvoke(s);if(j=arguments,L=this,U=s,i){if(void 0===V)return function leadingEdge(s){return z=s,V=setTimeout(timerExpired,o),Y?invokeFunc(s):$}(U);if(Z)return clearTimeout(V),V=setTimeout(timerExpired,o),invokeFunc(U)}return void 0===V&&(V=setTimeout(timerExpired,o)),$}return o=w(o)||0,u(i)&&(Y=!!i.leading,B=(Z="maxWait"in i)?x(w(i.maxWait)||0,o):B,ee="trailing"in i?!!i.trailing:ee),debounced.cancel=function cancel(){void 0!==V&&clearTimeout(V),z=0,j=U=L=V=void 0},debounced.flush=function flush(){return void 0===V?$:trailingEdge(_())},debounced}},50828:(s,o,i)=>{var u=i(24647),_=i(13222),w=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,x=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");s.exports=function deburr(s){return(s=_(s))&&s.replace(w,u).replace(x,"")}},75288:s=>{s.exports=function eq(s,o){return s===o||s!=s&&o!=o}},60680:(s,o,i)=>{var u=i(13222),_=/[\\^$.*+?()[\]{}|]/g,w=RegExp(_.source);s.exports=function escapeRegExp(s){return(s=u(s))&&w.test(s)?s.replace(_,"\\$&"):s}},7309:(s,o,i)=>{var u=i(62006)(i(24713));s.exports=u},24713:(s,o,i)=>{var u=i(2523),_=i(15389),w=i(61489),x=Math.max;s.exports=function findIndex(s,o,i){var C=null==s?0:s.length;if(!C)return-1;var j=null==i?0:w(i);return j<0&&(j=x(C+j,0)),u(s,_(o,3),j)}},35970:(s,o,i)=>{var u=i(83120);s.exports=function flatten(s){return(null==s?0:s.length)?u(s,1):[]}},73424:(s,o,i)=>{var u=i(16962),_=i(2874),w=Array.prototype.push;function baseAry(s,o){return 2==o?function(o,i){return s(o,i)}:function(o){return s(o)}}function cloneArray(s){for(var o=s?s.length:0,i=Array(o);o--;)i[o]=s[o];return i}function wrapImmutable(s,o){return function(){var i=arguments.length;if(i){for(var u=Array(i);i--;)u[i]=arguments[i];var _=u[0]=o.apply(void 0,u);return s.apply(void 0,u),_}}}s.exports=function baseConvert(s,o,i,x){var C="function"==typeof o,j=o===Object(o);if(j&&(x=i,i=o,o=void 0),null==i)throw new TypeError;x||(x={});var L=!("cap"in x)||x.cap,B=!("curry"in x)||x.curry,$=!("fixed"in x)||x.fixed,V=!("immutable"in x)||x.immutable,U=!("rearg"in x)||x.rearg,z=C?i:_,Y="curry"in x&&x.curry,Z="fixed"in x&&x.fixed,ee="rearg"in x&&x.rearg,ie=C?i.runInContext():void 0,ae=C?i:{ary:s.ary,assign:s.assign,clone:s.clone,curry:s.curry,forEach:s.forEach,isArray:s.isArray,isError:s.isError,isFunction:s.isFunction,isWeakMap:s.isWeakMap,iteratee:s.iteratee,keys:s.keys,rearg:s.rearg,toInteger:s.toInteger,toPath:s.toPath},ce=ae.ary,le=ae.assign,pe=ae.clone,de=ae.curry,fe=ae.forEach,ye=ae.isArray,be=ae.isError,_e=ae.isFunction,Se=ae.isWeakMap,we=ae.keys,xe=ae.rearg,Pe=ae.toInteger,Te=ae.toPath,Re=we(u.aryMethod),qe={castArray:function(s){return function(){var o=arguments[0];return ye(o)?s(cloneArray(o)):s.apply(void 0,arguments)}},iteratee:function(s){return function(){var o=arguments[1],i=s(arguments[0],o),u=i.length;return L&&"number"==typeof o?(o=o>2?o-2:1,u&&u<=o?i:baseAry(i,o)):i}},mixin:function(s){return function(o){var i=this;if(!_e(i))return s(i,Object(o));var u=[];return fe(we(o),(function(s){_e(o[s])&&u.push([s,i.prototype[s]])})),s(i,Object(o)),fe(u,(function(s){var o=s[1];_e(o)?i.prototype[s[0]]=o:delete i.prototype[s[0]]})),i}},nthArg:function(s){return function(o){var i=o<0?1:Pe(o)+1;return de(s(o),i)}},rearg:function(s){return function(o,i){var u=i?i.length:0;return de(s(o,i),u)}},runInContext:function(o){return function(i){return baseConvert(s,o(i),x)}}};function castCap(s,o){if(L){var i=u.iterateeRearg[s];if(i)return function iterateeRearg(s,o){return overArg(s,(function(s){var i=o.length;return function baseArity(s,o){return 2==o?function(o,i){return s.apply(void 0,arguments)}:function(o){return s.apply(void 0,arguments)}}(xe(baseAry(s,i),o),i)}))}(o,i);var _=!C&&u.iterateeAry[s];if(_)return function iterateeAry(s,o){return overArg(s,(function(s){return"function"==typeof s?baseAry(s,o):s}))}(o,_)}return o}function castFixed(s,o,i){if($&&(Z||!u.skipFixed[s])){var _=u.methodSpread[s],x=_&&_.start;return void 0===x?ce(o,i):function flatSpread(s,o){return function(){for(var i=arguments.length,u=i-1,_=Array(i);i--;)_[i]=arguments[i];var x=_[o],C=_.slice(0,o);return x&&w.apply(C,x),o!=u&&w.apply(C,_.slice(o+1)),s.apply(this,C)}}(o,x)}return o}function castRearg(s,o,i){return U&&i>1&&(ee||!u.skipRearg[s])?xe(o,u.methodRearg[s]||u.aryRearg[i]):o}function cloneByPath(s,o){for(var i=-1,u=(o=Te(o)).length,_=u-1,w=pe(Object(s)),x=w;null!=x&&++i1?de(o,i):o}(0,_=castCap(w,_),s),!1}})),!_})),_||(_=x),_==o&&(_=Y?de(_,1):function(){return o.apply(this,arguments)}),_.convert=createConverter(w,o),_.placeholder=o.placeholder=i,_}if(!j)return wrap(o,i,z);var $e=i,ze=[];return fe(Re,(function(s){fe(u.aryMethod[s],(function(s){var o=$e[u.remap[s]||s];o&&ze.push([s,wrap(s,o,$e)])}))})),fe(we($e),(function(s){var o=$e[s];if("function"==typeof o){for(var i=ze.length;i--;)if(ze[i][0]==s)return;o.convert=createConverter(s,o),ze.push([s,o])}})),fe(ze,(function(s){$e[s[0]]=s[1]})),$e.convert=function convertLib(s){return $e.runInContext.convert(s)(void 0)},$e.placeholder=$e,fe(we($e),(function(s){fe(u.realToAlias[s]||[],(function(o){$e[o]=$e[s]}))})),$e}},16962:(s,o)=>{o.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},o.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},o.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},o.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},o.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},o.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},o.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},o.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},o.realToAlias=function(){var s=Object.prototype.hasOwnProperty,i=o.aliasToReal,u={};for(var _ in i){var w=i[_];s.call(u,w)?u[w].push(_):u[w]=[_]}return u}(),o.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},o.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},o.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},47934:(s,o,i)=>{s.exports={ary:i(64626),assign:i(74733),clone:i(32629),curry:i(49747),forEach:i(83729),isArray:i(56449),isError:i(23546),isFunction:i(1882),isWeakMap:i(47886),iteratee:i(33855),keys:i(88984),rearg:i(84195),toInteger:i(61489),toPath:i(42072)}},56367:(s,o,i)=>{s.exports=i(77731)},79920:(s,o,i)=>{var u=i(73424),_=i(47934);s.exports=function convert(s,o,i){return u(_,s,o,i)}},2874:s=>{s.exports={}},77731:(s,o,i)=>{var u=i(79920)("set",i(63560));u.placeholder=i(2874),s.exports=u},58156:(s,o,i)=>{var u=i(47422);s.exports=function get(s,o,i){var _=null==s?void 0:u(s,o);return void 0===_?i:_}},61448:(s,o,i)=>{var u=i(20426),_=i(49326);s.exports=function has(s,o){return null!=s&&_(s,o,u)}},80631:(s,o,i)=>{var u=i(28077),_=i(49326);s.exports=function hasIn(s,o){return null!=s&&_(s,o,u)}},83488:s=>{s.exports=function identity(s){return s}},72428:(s,o,i)=>{var u=i(27534),_=i(40346),w=Object.prototype,x=w.hasOwnProperty,C=w.propertyIsEnumerable,j=u(function(){return arguments}())?u:function(s){return _(s)&&x.call(s,"callee")&&!C.call(s,"callee")};s.exports=j},56449:s=>{var o=Array.isArray;s.exports=o},64894:(s,o,i)=>{var u=i(1882),_=i(30294);s.exports=function isArrayLike(s){return null!=s&&_(s.length)&&!u(s)}},83693:(s,o,i)=>{var u=i(64894),_=i(40346);s.exports=function isArrayLikeObject(s){return _(s)&&u(s)}},53812:(s,o,i)=>{var u=i(72552),_=i(40346);s.exports=function isBoolean(s){return!0===s||!1===s||_(s)&&"[object Boolean]"==u(s)}},3656:(s,o,i)=>{s=i.nmd(s);var u=i(9325),_=i(89935),w=o&&!o.nodeType&&o,x=w&&s&&!s.nodeType&&s,C=x&&x.exports===w?u.Buffer:void 0,j=(C?C.isBuffer:void 0)||_;s.exports=j},62193:(s,o,i)=>{var u=i(88984),_=i(5861),w=i(72428),x=i(56449),C=i(64894),j=i(3656),L=i(55527),B=i(37167),$=Object.prototype.hasOwnProperty;s.exports=function isEmpty(s){if(null==s)return!0;if(C(s)&&(x(s)||"string"==typeof s||"function"==typeof s.splice||j(s)||B(s)||w(s)))return!s.length;var o=_(s);if("[object Map]"==o||"[object Set]"==o)return!s.size;if(L(s))return!u(s).length;for(var i in s)if($.call(s,i))return!1;return!0}},2404:(s,o,i)=>{var u=i(60270);s.exports=function isEqual(s,o){return u(s,o)}},23546:(s,o,i)=>{var u=i(72552),_=i(40346),w=i(11331);s.exports=function isError(s){if(!_(s))return!1;var o=u(s);return"[object Error]"==o||"[object DOMException]"==o||"string"==typeof s.message&&"string"==typeof s.name&&!w(s)}},1882:(s,o,i)=>{var u=i(72552),_=i(23805);s.exports=function isFunction(s){if(!_(s))return!1;var o=u(s);return"[object Function]"==o||"[object GeneratorFunction]"==o||"[object AsyncFunction]"==o||"[object Proxy]"==o}},30294:s=>{s.exports=function isLength(s){return"number"==typeof s&&s>-1&&s%1==0&&s<=9007199254740991}},87730:(s,o,i)=>{var u=i(29172),_=i(27301),w=i(86009),x=w&&w.isMap,C=x?_(x):u;s.exports=C},5187:s=>{s.exports=function isNull(s){return null===s}},98023:(s,o,i)=>{var u=i(72552),_=i(40346);s.exports=function isNumber(s){return"number"==typeof s||_(s)&&"[object Number]"==u(s)}},23805:s=>{s.exports=function isObject(s){var o=typeof s;return null!=s&&("object"==o||"function"==o)}},40346:s=>{s.exports=function isObjectLike(s){return null!=s&&"object"==typeof s}},11331:(s,o,i)=>{var u=i(72552),_=i(28879),w=i(40346),x=Function.prototype,C=Object.prototype,j=x.toString,L=C.hasOwnProperty,B=j.call(Object);s.exports=function isPlainObject(s){if(!w(s)||"[object Object]"!=u(s))return!1;var o=_(s);if(null===o)return!0;var i=L.call(o,"constructor")&&o.constructor;return"function"==typeof i&&i instanceof i&&j.call(i)==B}},38440:(s,o,i)=>{var u=i(16038),_=i(27301),w=i(86009),x=w&&w.isSet,C=x?_(x):u;s.exports=C},85015:(s,o,i)=>{var u=i(72552),_=i(56449),w=i(40346);s.exports=function isString(s){return"string"==typeof s||!_(s)&&w(s)&&"[object String]"==u(s)}},44394:(s,o,i)=>{var u=i(72552),_=i(40346);s.exports=function isSymbol(s){return"symbol"==typeof s||_(s)&&"[object Symbol]"==u(s)}},37167:(s,o,i)=>{var u=i(4901),_=i(27301),w=i(86009),x=w&&w.isTypedArray,C=x?_(x):u;s.exports=C},47886:(s,o,i)=>{var u=i(5861),_=i(40346);s.exports=function isWeakMap(s){return _(s)&&"[object WeakMap]"==u(s)}},33855:(s,o,i)=>{var u=i(9999),_=i(15389);s.exports=function iteratee(s){return _("function"==typeof s?s:u(s,1))}},95950:(s,o,i)=>{var u=i(70695),_=i(88984),w=i(64894);s.exports=function keys(s){return w(s)?u(s):_(s)}},37241:(s,o,i)=>{var u=i(70695),_=i(72903),w=i(64894);s.exports=function keysIn(s){return w(s)?u(s,!0):_(s)}},68090:s=>{s.exports=function last(s){var o=null==s?0:s.length;return o?s[o-1]:void 0}},50104:(s,o,i)=>{var u=i(53661);function memoize(s,o){if("function"!=typeof s||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");var memoized=function(){var i=arguments,u=o?o.apply(this,i):i[0],_=memoized.cache;if(_.has(u))return _.get(u);var w=s.apply(this,i);return memoized.cache=_.set(u,w)||_,w};return memoized.cache=new(memoize.Cache||u),memoized}memoize.Cache=u,s.exports=memoize},55364:(s,o,i)=>{var u=i(85250),_=i(20999)((function(s,o,i){u(s,o,i)}));s.exports=_},6048:s=>{s.exports=function negate(s){if("function"!=typeof s)throw new TypeError("Expected a function");return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}},63950:s=>{s.exports=function noop(){}},10124:(s,o,i)=>{var u=i(9325);s.exports=function(){return u.Date.now()}},90179:(s,o,i)=>{var u=i(34932),_=i(9999),w=i(19931),x=i(31769),C=i(21791),j=i(53138),L=i(38816),B=i(83349),$=L((function(s,o){var i={};if(null==s)return i;var L=!1;o=u(o,(function(o){return o=x(o,s),L||(L=o.length>1),o})),C(s,B(s),i),L&&(i=_(i,7,j));for(var $=o.length;$--;)w(i,o[$]);return i}));s.exports=$},50583:(s,o,i)=>{var u=i(47237),_=i(17255),w=i(28586),x=i(77797);s.exports=function property(s){return w(s)?u(x(s)):_(s)}},84195:(s,o,i)=>{var u=i(66977),_=i(38816),w=_((function(s,o){return u(s,256,void 0,void 0,void 0,o)}));s.exports=w},40860:(s,o,i)=>{var u=i(40882),_=i(80909),w=i(15389),x=i(85558),C=i(56449);s.exports=function reduce(s,o,i){var j=C(s)?u:x,L=arguments.length<3;return j(s,w(o,4),i,L,_)}},63560:(s,o,i)=>{var u=i(73170);s.exports=function set(s,o,i){return null==s?s:u(s,o,i)}},42426:(s,o,i)=>{var u=i(14248),_=i(15389),w=i(90916),x=i(56449),C=i(36800);s.exports=function some(s,o,i){var j=x(s)?u:w;return i&&C(s,o,i)&&(o=void 0),j(s,_(o,3))}},63345:s=>{s.exports=function stubArray(){return[]}},89935:s=>{s.exports=function stubFalse(){return!1}},17400:(s,o,i)=>{var u=i(99374),_=1/0;s.exports=function toFinite(s){return s?(s=u(s))===_||s===-1/0?17976931348623157e292*(s<0?-1:1):s==s?s:0:0===s?s:0}},61489:(s,o,i)=>{var u=i(17400);s.exports=function toInteger(s){var o=u(s),i=o%1;return o==o?i?o-i:o:0}},80218:(s,o,i)=>{var u=i(13222);s.exports=function toLower(s){return u(s).toLowerCase()}},99374:(s,o,i)=>{var u=i(54128),_=i(23805),w=i(44394),x=/^[-+]0x[0-9a-f]+$/i,C=/^0b[01]+$/i,j=/^0o[0-7]+$/i,L=parseInt;s.exports=function toNumber(s){if("number"==typeof s)return s;if(w(s))return NaN;if(_(s)){var o="function"==typeof s.valueOf?s.valueOf():s;s=_(o)?o+"":o}if("string"!=typeof s)return 0===s?s:+s;s=u(s);var i=C.test(s);return i||j.test(s)?L(s.slice(2),i?2:8):x.test(s)?NaN:+s}},42072:(s,o,i)=>{var u=i(34932),_=i(23007),w=i(56449),x=i(44394),C=i(61802),j=i(77797),L=i(13222);s.exports=function toPath(s){return w(s)?u(s,j):x(s)?[s]:_(C(L(s)))}},69884:(s,o,i)=>{var u=i(21791),_=i(37241);s.exports=function toPlainObject(s){return u(s,_(s))}},13222:(s,o,i)=>{var u=i(77556);s.exports=function toString(s){return null==s?"":u(s)}},55808:(s,o,i)=>{var u=i(12507)("toUpperCase");s.exports=u},66645:(s,o,i)=>{var u=i(1733),_=i(45434),w=i(13222),x=i(22225);s.exports=function words(s,o,i){return s=w(s),void 0===(o=i?void 0:o)?_(s)?x(s):u(s):s.match(o)||[]}},53758:(s,o,i)=>{var u=i(30980),_=i(56017),w=i(94033),x=i(56449),C=i(40346),j=i(80257),L=Object.prototype.hasOwnProperty;function lodash(s){if(C(s)&&!x(s)&&!(s instanceof u)){if(s instanceof _)return s;if(L.call(s,"__wrapped__"))return j(s)}return new _(s)}lodash.prototype=w.prototype,lodash.prototype.constructor=lodash,s.exports=lodash},47248:(s,o,i)=>{var u=i(16547),_=i(51234);s.exports=function zipObject(s,o){return _(s||[],o||[],u)}},43768:(s,o,i)=>{"use strict";var u=i(45981),_=i(85587);o.highlight=highlight,o.highlightAuto=function highlightAuto(s,o){var i,x,C,j,L=o||{},B=L.subset||u.listLanguages(),$=L.prefix,V=B.length,U=-1;null==$&&($=w);if("string"!=typeof s)throw _("Expected `string` for value, got `%s`",s);x={relevance:0,language:null,value:[]},i={relevance:0,language:null,value:[]};for(;++Ux.relevance&&(x=C),C.relevance>i.relevance&&(x=i,i=C));x.language&&(i.secondBest=x);return i},o.registerLanguage=function registerLanguage(s,o){u.registerLanguage(s,o)},o.listLanguages=function listLanguages(){return u.listLanguages()},o.registerAlias=function registerAlias(s,o){var i,_=s;o&&((_={})[s]=o);for(i in _)u.registerAliases(_[i],{languageName:i})},Emitter.prototype.addText=function text(s){var o,i,u=this.stack;if(""===s)return;o=u[u.length-1],(i=o.children[o.children.length-1])&&"text"===i.type?i.value+=s:o.children.push({type:"text",value:s})},Emitter.prototype.addKeyword=function addKeyword(s,o){this.openNode(o),this.addText(s),this.closeNode()},Emitter.prototype.addSublanguage=function addSublanguage(s,o){var i=this.stack,u=i[i.length-1],_=s.rootNode.children,w=o?{type:"element",tagName:"span",properties:{className:[o]},children:_}:_;u.children=u.children.concat(w)},Emitter.prototype.openNode=function open(s){var o=this.stack,i=this.options.classPrefix+s,u=o[o.length-1],_={type:"element",tagName:"span",properties:{className:[i]},children:[]};u.children.push(_),o.push(_)},Emitter.prototype.closeNode=function close(){this.stack.pop()},Emitter.prototype.closeAllNodes=noop,Emitter.prototype.finalize=noop,Emitter.prototype.toHTML=function toHtmlNoop(){return""};var w="hljs-";function highlight(s,o,i){var x,C=u.configure({}),j=(i||{}).prefix;if("string"!=typeof s)throw _("Expected `string` for name, got `%s`",s);if(!u.getLanguage(s))throw _("Unknown language: `%s` is not registered",s);if("string"!=typeof o)throw _("Expected `string` for value, got `%s`",o);if(null==j&&(j=w),u.configure({__emitter:Emitter,classPrefix:j}),x=u.highlight(o,{language:s,ignoreIllegals:!0}),u.configure(C||{}),x.errorRaised)throw x.errorRaised;return{relevance:x.relevance,language:x.language,value:x.emitter.rootNode.children}}function Emitter(s){this.options=s,this.rootNode={children:[]},this.stack=[this.rootNode]}function noop(){}},92340:(s,o,i)=>{const u=i(6048);function coerceElementMatchingCallback(s){return"string"==typeof s?o=>o.element===s:s.constructor&&s.extend?o=>o instanceof s:s}class ArraySlice{constructor(s){this.elements=s||[]}toValue(){return this.elements.map((s=>s.toValue()))}map(s,o){return this.elements.map(s,o)}flatMap(s,o){return this.map(s,o).reduce(((s,o)=>s.concat(o)),[])}compactMap(s,o){const i=[];return this.forEach((u=>{const _=s.bind(o)(u);_&&i.push(_)})),i}filter(s,o){return s=coerceElementMatchingCallback(s),new ArraySlice(this.elements.filter(s,o))}reject(s,o){return s=coerceElementMatchingCallback(s),new ArraySlice(this.elements.filter(u(s),o))}find(s,o){return s=coerceElementMatchingCallback(s),this.elements.find(s,o)}forEach(s,o){this.elements.forEach(s,o)}reduce(s,o){return this.elements.reduce(s,o)}includes(s){return this.elements.some((o=>o.equals(s)))}shift(){return this.elements.shift()}unshift(s){this.elements.unshift(this.refract(s))}push(s){return this.elements.push(this.refract(s)),this}add(s){this.push(s)}get(s){return this.elements[s]}getValue(s){const o=this.elements[s];if(o)return o.toValue()}get length(){return this.elements.length}get isEmpty(){return 0===this.elements.length}get first(){return this.elements[0]}}"undefined"!=typeof Symbol&&(ArraySlice.prototype[Symbol.iterator]=function symbol(){return this.elements[Symbol.iterator]()}),s.exports=ArraySlice},55973:s=>{class KeyValuePair{constructor(s,o){this.key=s,this.value=o}clone(){const s=new KeyValuePair;return this.key&&(s.key=this.key.clone()),this.value&&(s.value=this.value.clone()),s}}s.exports=KeyValuePair},3110:(s,o,i)=>{const u=i(5187),_=i(85015),w=i(98023),x=i(53812),C=i(23805),j=i(85105),L=i(86804);class Namespace{constructor(s){this.elementMap={},this.elementDetection=[],this.Element=L.Element,this.KeyValuePair=L.KeyValuePair,s&&s.noDefault||this.useDefault(),this._attributeElementKeys=[],this._attributeElementArrayKeys=[]}use(s){return s.namespace&&s.namespace({base:this}),s.load&&s.load({base:this}),this}useDefault(){return this.register("null",L.NullElement).register("string",L.StringElement).register("number",L.NumberElement).register("boolean",L.BooleanElement).register("array",L.ArrayElement).register("object",L.ObjectElement).register("member",L.MemberElement).register("ref",L.RefElement).register("link",L.LinkElement),this.detect(u,L.NullElement,!1).detect(_,L.StringElement,!1).detect(w,L.NumberElement,!1).detect(x,L.BooleanElement,!1).detect(Array.isArray,L.ArrayElement,!1).detect(C,L.ObjectElement,!1),this}register(s,o){return this._elements=void 0,this.elementMap[s]=o,this}unregister(s){return this._elements=void 0,delete this.elementMap[s],this}detect(s,o,i){return void 0===i||i?this.elementDetection.unshift([s,o]):this.elementDetection.push([s,o]),this}toElement(s){if(s instanceof this.Element)return s;let o;for(let i=0;i{const o=s[0].toUpperCase()+s.substr(1);this._elements[o]=this.elementMap[s]}))),this._elements}get serialiser(){return new j(this)}}j.prototype.Namespace=Namespace,s.exports=Namespace},10866:(s,o,i)=>{const u=i(6048),_=i(92340);class ObjectSlice extends _{map(s,o){return this.elements.map((i=>s.bind(o)(i.value,i.key,i)))}filter(s,o){return new ObjectSlice(this.elements.filter((i=>s.bind(o)(i.value,i.key,i))))}reject(s,o){return this.filter(u(s.bind(o)))}forEach(s,o){return this.elements.forEach(((i,u)=>{s.bind(o)(i.value,i.key,i,u)}))}keys(){return this.map(((s,o)=>o.toValue()))}values(){return this.map((s=>s.toValue()))}}s.exports=ObjectSlice},86804:(s,o,i)=>{const u=i(10316),_=i(41067),w=i(71167),x=i(40239),C=i(12242),j=i(6233),L=i(87726),B=i(61045),$=i(86303),V=i(14540),U=i(92340),z=i(10866),Y=i(55973);function refract(s){if(s instanceof u)return s;if("string"==typeof s)return new w(s);if("number"==typeof s)return new x(s);if("boolean"==typeof s)return new C(s);if(null===s)return new _;if(Array.isArray(s))return new j(s.map(refract));if("object"==typeof s){return new B(s)}return s}u.prototype.ObjectElement=B,u.prototype.RefElement=V,u.prototype.MemberElement=L,u.prototype.refract=refract,U.prototype.refract=refract,s.exports={Element:u,NullElement:_,StringElement:w,NumberElement:x,BooleanElement:C,ArrayElement:j,MemberElement:L,ObjectElement:B,LinkElement:$,RefElement:V,refract,ArraySlice:U,ObjectSlice:z,KeyValuePair:Y}},86303:(s,o,i)=>{const u=i(10316);s.exports=class LinkElement extends u{constructor(s,o,i){super(s||[],o,i),this.element="link"}get relation(){return this.attributes.get("relation")}set relation(s){this.attributes.set("relation",s)}get href(){return this.attributes.get("href")}set href(s){this.attributes.set("href",s)}}},14540:(s,o,i)=>{const u=i(10316);s.exports=class RefElement extends u{constructor(s,o,i){super(s||[],o,i),this.element="ref",this.path||(this.path="element")}get path(){return this.attributes.get("path")}set path(s){this.attributes.set("path",s)}}},34035:(s,o,i)=>{const u=i(3110),_=i(86804);o.g$=u,o.KeyValuePair=i(55973),o.G6=_.ArraySlice,o.ot=_.ObjectSlice,o.Hg=_.Element,o.Om=_.StringElement,o.kT=_.NumberElement,o.bd=_.BooleanElement,o.Os=_.NullElement,o.wE=_.ArrayElement,o.Sh=_.ObjectElement,o.Pr=_.MemberElement,o.sI=_.RefElement,o.Ft=_.LinkElement,o.e=_.refract,i(85105),i(75147)},6233:(s,o,i)=>{const u=i(6048),_=i(10316),w=i(92340);class ArrayElement extends _{constructor(s,o,i){super(s||[],o,i),this.element="array"}primitive(){return"array"}get(s){return this.content[s]}getValue(s){const o=this.get(s);if(o)return o.toValue()}getIndex(s){return this.content[s]}set(s,o){return this.content[s]=this.refract(o),this}remove(s){const o=this.content.splice(s,1);return o.length?o[0]:null}map(s,o){return this.content.map(s,o)}flatMap(s,o){return this.map(s,o).reduce(((s,o)=>s.concat(o)),[])}compactMap(s,o){const i=[];return this.forEach((u=>{const _=s.bind(o)(u);_&&i.push(_)})),i}filter(s,o){return new w(this.content.filter(s,o))}reject(s,o){return this.filter(u(s),o)}reduce(s,o){let i,u;void 0!==o?(i=0,u=this.refract(o)):(i=1,u="object"===this.primitive()?this.first.value:this.first);for(let o=i;o{s.bind(o)(i,this.refract(u))}))}shift(){return this.content.shift()}unshift(s){this.content.unshift(this.refract(s))}push(s){return this.content.push(this.refract(s)),this}add(s){this.push(s)}findElements(s,o){const i=o||{},u=!!i.recursive,_=void 0===i.results?[]:i.results;return this.forEach(((o,i,w)=>{u&&void 0!==o.findElements&&o.findElements(s,{results:_,recursive:u}),s(o,i,w)&&_.push(o)})),_}find(s){return new w(this.findElements(s,{recursive:!0}))}findByElement(s){return this.find((o=>o.element===s))}findByClass(s){return this.find((o=>o.classes.includes(s)))}getById(s){return this.find((o=>o.id.toValue()===s)).first}includes(s){return this.content.some((o=>o.equals(s)))}contains(s){return this.includes(s)}empty(){return new this.constructor([])}"fantasy-land/empty"(){return this.empty()}concat(s){return new this.constructor(this.content.concat(s.content))}"fantasy-land/concat"(s){return this.concat(s)}"fantasy-land/map"(s){return new this.constructor(this.map(s))}"fantasy-land/chain"(s){return this.map((o=>s(o)),this).reduce(((s,o)=>s.concat(o)),this.empty())}"fantasy-land/filter"(s){return new this.constructor(this.content.filter(s))}"fantasy-land/reduce"(s,o){return this.content.reduce(s,o)}get length(){return this.content.length}get isEmpty(){return 0===this.content.length}get first(){return this.getIndex(0)}get second(){return this.getIndex(1)}get last(){return this.getIndex(this.length-1)}}ArrayElement.empty=function empty(){return new this},ArrayElement["fantasy-land/empty"]=ArrayElement.empty,"undefined"!=typeof Symbol&&(ArrayElement.prototype[Symbol.iterator]=function symbol(){return this.content[Symbol.iterator]()}),s.exports=ArrayElement},12242:(s,o,i)=>{const u=i(10316);s.exports=class BooleanElement extends u{constructor(s,o,i){super(s,o,i),this.element="boolean"}primitive(){return"boolean"}}},10316:(s,o,i)=>{const u=i(2404),_=i(55973),w=i(92340);class Element{constructor(s,o,i){o&&(this.meta=o),i&&(this.attributes=i),this.content=s}freeze(){Object.isFrozen(this)||(this._meta&&(this.meta.parent=this,this.meta.freeze()),this._attributes&&(this.attributes.parent=this,this.attributes.freeze()),this.children.forEach((s=>{s.parent=this,s.freeze()}),this),this.content&&Array.isArray(this.content)&&Object.freeze(this.content),Object.freeze(this))}primitive(){}clone(){const s=new this.constructor;return s.element=this.element,this.meta.length&&(s._meta=this.meta.clone()),this.attributes.length&&(s._attributes=this.attributes.clone()),this.content?this.content.clone?s.content=this.content.clone():Array.isArray(this.content)?s.content=this.content.map((s=>s.clone())):s.content=this.content:s.content=this.content,s}toValue(){return this.content instanceof Element?this.content.toValue():this.content instanceof _?{key:this.content.key.toValue(),value:this.content.value?this.content.value.toValue():void 0}:this.content&&this.content.map?this.content.map((s=>s.toValue()),this):this.content}toRef(s){if(""===this.id.toValue())throw Error("Cannot create reference to an element that does not contain an ID");const o=new this.RefElement(this.id.toValue());return s&&(o.path=s),o}findRecursive(...s){if(arguments.length>1&&!this.isFrozen)throw new Error("Cannot find recursive with multiple element names without first freezing the element. Call `element.freeze()`");const o=s.pop();let i=new w;const append=(s,o)=>(s.push(o),s),checkElement=(s,i)=>{i.element===o&&s.push(i);const u=i.findRecursive(o);return u&&u.reduce(append,s),i.content instanceof _&&(i.content.key&&checkElement(s,i.content.key),i.content.value&&checkElement(s,i.content.value)),s};return this.content&&(this.content.element&&checkElement(i,this.content),Array.isArray(this.content)&&this.content.reduce(checkElement,i)),s.isEmpty||(i=i.filter((o=>{let i=o.parents.map((s=>s.element));for(const o in s){const u=s[o],_=i.indexOf(u);if(-1===_)return!1;i=i.splice(0,_)}return!0}))),i}set(s){return this.content=s,this}equals(s){return u(this.toValue(),s)}getMetaProperty(s,o){if(!this.meta.hasKey(s)){if(this.isFrozen){const s=this.refract(o);return s.freeze(),s}this.meta.set(s,o)}return this.meta.get(s)}setMetaProperty(s,o){this.meta.set(s,o)}get element(){return this._storedElement||"element"}set element(s){this._storedElement=s}get content(){return this._content}set content(s){if(s instanceof Element)this._content=s;else if(s instanceof w)this.content=s.elements;else if("string"==typeof s||"number"==typeof s||"boolean"==typeof s||"null"===s||null==s)this._content=s;else if(s instanceof _)this._content=s;else if(Array.isArray(s))this._content=s.map(this.refract);else{if("object"!=typeof s)throw new Error("Cannot set content to given value");this._content=Object.keys(s).map((o=>new this.MemberElement(o,s[o])))}}get meta(){if(!this._meta){if(this.isFrozen){const s=new this.ObjectElement;return s.freeze(),s}this._meta=new this.ObjectElement}return this._meta}set meta(s){s instanceof this.ObjectElement?this._meta=s:this.meta.set(s||{})}get attributes(){if(!this._attributes){if(this.isFrozen){const s=new this.ObjectElement;return s.freeze(),s}this._attributes=new this.ObjectElement}return this._attributes}set attributes(s){s instanceof this.ObjectElement?this._attributes=s:this.attributes.set(s||{})}get id(){return this.getMetaProperty("id","")}set id(s){this.setMetaProperty("id",s)}get classes(){return this.getMetaProperty("classes",[])}set classes(s){this.setMetaProperty("classes",s)}get title(){return this.getMetaProperty("title","")}set title(s){this.setMetaProperty("title",s)}get description(){return this.getMetaProperty("description","")}set description(s){this.setMetaProperty("description",s)}get links(){return this.getMetaProperty("links",[])}set links(s){this.setMetaProperty("links",s)}get isFrozen(){return Object.isFrozen(this)}get parents(){let{parent:s}=this;const o=new w;for(;s;)o.push(s),s=s.parent;return o}get children(){if(Array.isArray(this.content))return new w(this.content);if(this.content instanceof _){const s=new w([this.content.key]);return this.content.value&&s.push(this.content.value),s}return this.content instanceof Element?new w([this.content]):new w}get recursiveChildren(){const s=new w;return this.children.forEach((o=>{s.push(o),o.recursiveChildren.forEach((o=>{s.push(o)}))})),s}}s.exports=Element},87726:(s,o,i)=>{const u=i(55973),_=i(10316);s.exports=class MemberElement extends _{constructor(s,o,i,_){super(new u,i,_),this.element="member",this.key=s,this.value=o}get key(){return this.content.key}set key(s){this.content.key=this.refract(s)}get value(){return this.content.value}set value(s){this.content.value=this.refract(s)}}},41067:(s,o,i)=>{const u=i(10316);s.exports=class NullElement extends u{constructor(s,o,i){super(s||null,o,i),this.element="null"}primitive(){return"null"}set(){return new Error("Cannot set the value of null")}}},40239:(s,o,i)=>{const u=i(10316);s.exports=class NumberElement extends u{constructor(s,o,i){super(s,o,i),this.element="number"}primitive(){return"number"}}},61045:(s,o,i)=>{const u=i(6048),_=i(23805),w=i(6233),x=i(87726),C=i(10866);s.exports=class ObjectElement extends w{constructor(s,o,i){super(s||[],o,i),this.element="object"}primitive(){return"object"}toValue(){return this.content.reduce(((s,o)=>(s[o.key.toValue()]=o.value?o.value.toValue():void 0,s)),{})}get(s){const o=this.getMember(s);if(o)return o.value}getMember(s){if(void 0!==s)return this.content.find((o=>o.key.toValue()===s))}remove(s){let o=null;return this.content=this.content.filter((i=>i.key.toValue()!==s||(o=i,!1))),o}getKey(s){const o=this.getMember(s);if(o)return o.key}set(s,o){if(_(s))return Object.keys(s).forEach((o=>{this.set(o,s[o])})),this;const i=s,u=this.getMember(i);return u?u.value=o:this.content.push(new x(i,o)),this}keys(){return this.content.map((s=>s.key.toValue()))}values(){return this.content.map((s=>s.value.toValue()))}hasKey(s){return this.content.some((o=>o.key.equals(s)))}items(){return this.content.map((s=>[s.key.toValue(),s.value.toValue()]))}map(s,o){return this.content.map((i=>s.bind(o)(i.value,i.key,i)))}compactMap(s,o){const i=[];return this.forEach(((u,_,w)=>{const x=s.bind(o)(u,_,w);x&&i.push(x)})),i}filter(s,o){return new C(this.content).filter(s,o)}reject(s,o){return this.filter(u(s),o)}forEach(s,o){return this.content.forEach((i=>s.bind(o)(i.value,i.key,i)))}}},71167:(s,o,i)=>{const u=i(10316);s.exports=class StringElement extends u{constructor(s,o,i){super(s,o,i),this.element="string"}primitive(){return"string"}get length(){return this.content.length}}},75147:(s,o,i)=>{const u=i(85105);s.exports=class JSON06Serialiser extends u{serialise(s){if(!(s instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${s}\` is not an Element instance`);let o;s._attributes&&s.attributes.get("variable")&&(o=s.attributes.get("variable"));const i={element:s.element};s._meta&&s._meta.length>0&&(i.meta=this.serialiseObject(s.meta));const u="enum"===s.element||-1!==s.attributes.keys().indexOf("enumerations");if(u){const o=this.enumSerialiseAttributes(s);o&&(i.attributes=o)}else if(s._attributes&&s._attributes.length>0){let{attributes:u}=s;u.get("metadata")&&(u=u.clone(),u.set("meta",u.get("metadata")),u.remove("metadata")),"member"===s.element&&o&&(u=u.clone(),u.remove("variable")),u.length>0&&(i.attributes=this.serialiseObject(u))}if(u)i.content=this.enumSerialiseContent(s,i);else if(this[`${s.element}SerialiseContent`])i.content=this[`${s.element}SerialiseContent`](s,i);else if(void 0!==s.content){let u;o&&s.content.key?(u=s.content.clone(),u.key.attributes.set("variable",o),u=this.serialiseContent(u)):u=this.serialiseContent(s.content),this.shouldSerialiseContent(s,u)&&(i.content=u)}else this.shouldSerialiseContent(s,s.content)&&s instanceof this.namespace.elements.Array&&(i.content=[]);return i}shouldSerialiseContent(s,o){return"parseResult"===s.element||"httpRequest"===s.element||"httpResponse"===s.element||"category"===s.element||"link"===s.element||void 0!==o&&(!Array.isArray(o)||0!==o.length)}refSerialiseContent(s,o){return delete o.attributes,{href:s.toValue(),path:s.path.toValue()}}sourceMapSerialiseContent(s){return s.toValue()}dataStructureSerialiseContent(s){return[this.serialiseContent(s.content)]}enumSerialiseAttributes(s){const o=s.attributes.clone(),i=o.remove("enumerations")||new this.namespace.elements.Array([]),u=o.get("default");let _=o.get("samples")||new this.namespace.elements.Array([]);if(u&&u.content&&(u.content.attributes&&u.content.attributes.remove("typeAttributes"),o.set("default",new this.namespace.elements.Array([u.content]))),_.forEach((s=>{s.content&&s.content.element&&s.content.attributes.remove("typeAttributes")})),s.content&&0!==i.length&&_.unshift(s.content),_=_.map((s=>s instanceof this.namespace.elements.Array?[s]:new this.namespace.elements.Array([s.content]))),_.length&&o.set("samples",_),o.length>0)return this.serialiseObject(o)}enumSerialiseContent(s){if(s._attributes){const o=s.attributes.get("enumerations");if(o&&o.length>0)return o.content.map((s=>{const o=s.clone();return o.attributes.remove("typeAttributes"),this.serialise(o)}))}if(s.content){const o=s.content.clone();return o.attributes.remove("typeAttributes"),[this.serialise(o)]}return[]}deserialise(s){if("string"==typeof s)return new this.namespace.elements.String(s);if("number"==typeof s)return new this.namespace.elements.Number(s);if("boolean"==typeof s)return new this.namespace.elements.Boolean(s);if(null===s)return new this.namespace.elements.Null;if(Array.isArray(s))return new this.namespace.elements.Array(s.map(this.deserialise,this));const o=this.namespace.getElementClass(s.element),i=new o;i.element!==s.element&&(i.element=s.element),s.meta&&this.deserialiseObject(s.meta,i.meta),s.attributes&&this.deserialiseObject(s.attributes,i.attributes);const u=this.deserialiseContent(s.content);if(void 0===u&&null!==i.content||(i.content=u),"enum"===i.element){i.content&&i.attributes.set("enumerations",i.content);let s=i.attributes.get("samples");if(i.attributes.remove("samples"),s){const u=s;s=new this.namespace.elements.Array,u.forEach((u=>{u.forEach((u=>{const _=new o(u);_.element=i.element,s.push(_)}))}));const _=s.shift();i.content=_?_.content:void 0,i.attributes.set("samples",s)}else i.content=void 0;let u=i.attributes.get("default");if(u&&u.length>0){u=u.get(0);const s=new o(u);s.element=i.element,i.attributes.set("default",s)}}else if("dataStructure"===i.element&&Array.isArray(i.content))[i.content]=i.content;else if("category"===i.element){const s=i.attributes.get("meta");s&&(i.attributes.set("metadata",s),i.attributes.remove("meta"))}else"member"===i.element&&i.key&&i.key._attributes&&i.key._attributes.getValue("variable")&&(i.attributes.set("variable",i.key.attributes.get("variable")),i.key.attributes.remove("variable"));return i}serialiseContent(s){if(s instanceof this.namespace.elements.Element)return this.serialise(s);if(s instanceof this.namespace.KeyValuePair){const o={key:this.serialise(s.key)};return s.value&&(o.value=this.serialise(s.value)),o}return s&&s.map?s.map(this.serialise,this):s}deserialiseContent(s){if(s){if(s.element)return this.deserialise(s);if(s.key){const o=new this.namespace.KeyValuePair(this.deserialise(s.key));return s.value&&(o.value=this.deserialise(s.value)),o}if(s.map)return s.map(this.deserialise,this)}return s}shouldRefract(s){return!!(s._attributes&&s.attributes.keys().length||s._meta&&s.meta.keys().length)||"enum"!==s.element&&(s.element!==s.primitive()||"member"===s.element)}convertKeyToRefract(s,o){return this.shouldRefract(o)?this.serialise(o):"enum"===o.element?this.serialiseEnum(o):"array"===o.element?o.map((o=>this.shouldRefract(o)||"default"===s?this.serialise(o):"array"===o.element||"object"===o.element||"enum"===o.element?o.children.map((s=>this.serialise(s))):o.toValue())):"object"===o.element?(o.content||[]).map(this.serialise,this):o.toValue()}serialiseEnum(s){return s.children.map((s=>this.serialise(s)))}serialiseObject(s){const o={};return s.forEach(((s,i)=>{if(s){const u=i.toValue();o[u]=this.convertKeyToRefract(u,s)}})),o}deserialiseObject(s,o){Object.keys(s).forEach((i=>{o.set(i,this.deserialise(s[i]))}))}}},85105:s=>{s.exports=class JSONSerialiser{constructor(s){this.namespace=s||new this.Namespace}serialise(s){if(!(s instanceof this.namespace.elements.Element))throw new TypeError(`Given element \`${s}\` is not an Element instance`);const o={element:s.element};s._meta&&s._meta.length>0&&(o.meta=this.serialiseObject(s.meta)),s._attributes&&s._attributes.length>0&&(o.attributes=this.serialiseObject(s.attributes));const i=this.serialiseContent(s.content);return void 0!==i&&(o.content=i),o}deserialise(s){if(!s.element)throw new Error("Given value is not an object containing an element name");const o=new(this.namespace.getElementClass(s.element));o.element!==s.element&&(o.element=s.element),s.meta&&this.deserialiseObject(s.meta,o.meta),s.attributes&&this.deserialiseObject(s.attributes,o.attributes);const i=this.deserialiseContent(s.content);return void 0===i&&null!==o.content||(o.content=i),o}serialiseContent(s){if(s instanceof this.namespace.elements.Element)return this.serialise(s);if(s instanceof this.namespace.KeyValuePair){const o={key:this.serialise(s.key)};return s.value&&(o.value=this.serialise(s.value)),o}if(s&&s.map){if(0===s.length)return;return s.map(this.serialise,this)}return s}deserialiseContent(s){if(s){if(s.element)return this.deserialise(s);if(s.key){const o=new this.namespace.KeyValuePair(this.deserialise(s.key));return s.value&&(o.value=this.deserialise(s.value)),o}if(s.map)return s.map(this.deserialise,this)}return s}serialiseObject(s){const o={};if(s.forEach(((s,i)=>{s&&(o[i.toValue()]=this.serialise(s))})),0!==Object.keys(o).length)return o}deserialiseObject(s,o){Object.keys(s).forEach((i=>{o.set(i,this.deserialise(s[i]))}))}}},65606:s=>{var o,i,u=s.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(s){if(o===setTimeout)return setTimeout(s,0);if((o===defaultSetTimout||!o)&&setTimeout)return o=setTimeout,setTimeout(s,0);try{return o(s,0)}catch(i){try{return o.call(null,s,0)}catch(i){return o.call(this,s,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(s){o=defaultSetTimout}try{i="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(s){i=defaultClearTimeout}}();var _,w=[],x=!1,C=-1;function cleanUpNextTick(){x&&_&&(x=!1,_.length?w=_.concat(w):C=-1,w.length&&drainQueue())}function drainQueue(){if(!x){var s=runTimeout(cleanUpNextTick);x=!0;for(var o=w.length;o;){for(_=w,w=[];++C1)for(var i=1;i{"use strict";var u=i(6925);function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction,s.exports=function(){function shim(s,o,i,_,w,x){if(x!==u){var C=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 C.name="Invariant Violation",C}}function getShim(){return shim}shim.isRequired=shim;var s={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return s.PropTypes=s,s}},5556:(s,o,i)=>{s.exports=i(2694)()},6925:s=>{"use strict";s.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},73992:(s,o)=>{"use strict";var i=Object.prototype.hasOwnProperty;function decode(s){try{return decodeURIComponent(s.replace(/\+/g," "))}catch(s){return null}}function encode(s){try{return encodeURIComponent(s)}catch(s){return null}}o.stringify=function querystringify(s,o){o=o||"";var u,_,w=[];for(_ in"string"!=typeof o&&(o="?"),s)if(i.call(s,_)){if((u=s[_])||null!=u&&!isNaN(u)||(u=""),_=encode(_),u=encode(u),null===_||null===u)continue;w.push(_+"="+u)}return w.length?o+w.join("&"):""},o.parse=function querystring(s){for(var o,i=/([^=?#&]+)=?([^&]*)/g,u={};o=i.exec(s);){var _=decode(o[1]),w=decode(o[2]);null===_||null===w||_ in u||(u[_]=w)}return u}},41859:(s,o,i)=>{const u=i(27096),_=i(78004),w=u.types;s.exports=class RandExp{constructor(s,o){if(this._setDefaults(s),s instanceof RegExp)this.ignoreCase=s.ignoreCase,this.multiline=s.multiline,s=s.source;else{if("string"!=typeof s)throw new Error("Expected a regexp or string");this.ignoreCase=o&&-1!==o.indexOf("i"),this.multiline=o&&-1!==o.indexOf("m")}this.tokens=u(s)}_setDefaults(s){this.max=null!=s.max?s.max:null!=RandExp.prototype.max?RandExp.prototype.max:100,this.defaultRange=s.defaultRange?s.defaultRange:this.defaultRange.clone(),s.randInt&&(this.randInt=s.randInt)}gen(){return this._gen(this.tokens,[])}_gen(s,o){var i,u,_,x,C;switch(s.type){case w.ROOT:case w.GROUP:if(s.followedBy||s.notFollowedBy)return"";for(s.remember&&void 0===s.groupNumber&&(s.groupNumber=o.push(null)-1),u="",x=0,C=(i=s.options?this._randSelect(s.options):s.stack).length;x{"use strict";var u=i(65606),_=65536,w=4294967295;var x=i(92861).Buffer,C=i.g.crypto||i.g.msCrypto;C&&C.getRandomValues?s.exports=function randomBytes(s,o){if(s>w)throw new RangeError("requested too many random bytes");var i=x.allocUnsafe(s);if(s>0)if(s>_)for(var j=0;j{"use strict";function _typeof(s){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(s){return typeof s}:function(s){return s&&"function"==typeof Symbol&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},_typeof(s)}Object.defineProperty(o,"__esModule",{value:!0}),o.CopyToClipboard=void 0;var u=_interopRequireDefault(i(96540)),_=_interopRequireDefault(i(17965)),w=["text","onCopy","options","children"];function _interopRequireDefault(s){return s&&s.__esModule?s:{default:s}}function ownKeys(s,o){var i=Object.keys(s);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);o&&(u=u.filter((function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(s){for(var o=1;o=0||(_[i]=s[i]);return _}(s,o);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(s);for(u=0;u=0||Object.prototype.propertyIsEnumerable.call(s,i)&&(_[i]=s[i])}return _}function _defineProperties(s,o){for(var i=0;i{"use strict";var u=i(25264).CopyToClipboard;u.CopyToClipboard=u,s.exports=u},81214:(s,o,i)=>{"use strict";function _typeof(s){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(s){return typeof s}:function(s){return s&&"function"==typeof Symbol&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},_typeof(s)}Object.defineProperty(o,"__esModule",{value:!0}),o.DebounceInput=void 0;var u=_interopRequireDefault(i(96540)),_=_interopRequireDefault(i(20181)),w=["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"];function _interopRequireDefault(s){return s&&s.__esModule?s:{default:s}}function _objectWithoutProperties(s,o){if(null==s)return{};var i,u,_=function _objectWithoutPropertiesLoose(s,o){if(null==s)return{};var i,u,_={},w=Object.keys(s);for(u=0;u=0||(_[i]=s[i]);return _}(s,o);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(s);for(u=0;u=0||Object.prototype.propertyIsEnumerable.call(s,i)&&(_[i]=s[i])}return _}function ownKeys(s,o){var i=Object.keys(s);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);o&&(u=u.filter((function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable}))),i.push.apply(i,u)}return i}function _objectSpread(s){for(var o=1;o=u?i.notify(s):o.length>_.length&&i.notify(_objectSpread(_objectSpread({},s),{},{target:_objectSpread(_objectSpread({},s.target),{},{value:""})}))}))})),_defineProperty(_assertThisInitialized(i),"onKeyDown",(function(s){"Enter"===s.key&&i.forceNotify(s);var o=i.props.onKeyDown;o&&(s.persist(),o(s))})),_defineProperty(_assertThisInitialized(i),"onBlur",(function(s){i.forceNotify(s);var o=i.props.onBlur;o&&(s.persist(),o(s))})),_defineProperty(_assertThisInitialized(i),"createNotifier",(function(s){if(s<0)i.notify=function(){return null};else if(0===s)i.notify=i.doNotify;else{var o=(0,_.default)((function(s){i.isDebouncing=!1,i.doNotify(s)}),s);i.notify=function(s){i.isDebouncing=!0,o(s)},i.flush=function(){return o.flush()},i.cancel=function(){i.isDebouncing=!1,o.cancel()}}})),_defineProperty(_assertThisInitialized(i),"doNotify",(function(){i.props.onChange.apply(void 0,arguments)})),_defineProperty(_assertThisInitialized(i),"forceNotify",(function(s){var o=i.props.debounceTimeout;if(i.isDebouncing||!(o>0)){i.cancel&&i.cancel();var u=i.state.value,_=i.props.minLength;u.length>=_?i.doNotify(s):i.doNotify(_objectSpread(_objectSpread({},s),{},{target:_objectSpread(_objectSpread({},s.target),{},{value:u})}))}})),i.isDebouncing=!1,i.state={value:void 0===s.value||null===s.value?"":s.value};var u=i.props.debounceTimeout;return i.createNotifier(u),i}return function _createClass(s,o,i){return o&&_defineProperties(s.prototype,o),i&&_defineProperties(s,i),Object.defineProperty(s,"prototype",{writable:!1}),s}(DebounceInput,[{key:"componentDidUpdate",value:function componentDidUpdate(s){if(!this.isDebouncing){var o=this.props,i=o.value,u=o.debounceTimeout,_=s.debounceTimeout,w=s.value,x=this.state.value;void 0!==i&&w!==i&&x!==i&&this.setState({value:i}),u!==_&&this.createNotifier(u)}}},{key:"componentWillUnmount",value:function componentWillUnmount(){this.flush&&this.flush()}},{key:"render",value:function render(){var s,o,i=this.props,_=i.element,x=(i.onChange,i.value,i.minLength,i.debounceTimeout,i.forceNotifyByEnter),C=i.forceNotifyOnBlur,j=i.onKeyDown,L=i.onBlur,B=i.inputRef,$=_objectWithoutProperties(i,w),V=this.state.value;s=x?{onKeyDown:this.onKeyDown}:j?{onKeyDown:j}:{},o=C?{onBlur:this.onBlur}:L?{onBlur:L}:{};var U=B?{ref:B}:{};return u.default.createElement(_,_objectSpread(_objectSpread(_objectSpread(_objectSpread({},$),{},{onChange:this.onChange,value:V},s),o),U))}}]),DebounceInput}(u.default.PureComponent);o.DebounceInput=x,_defineProperty(x,"defaultProps",{element:"input",type:"text",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0})},24677:(s,o,i)=>{"use strict";var u=i(81214).DebounceInput;u.DebounceInput=u,s.exports=u},22551:(s,o,i)=>{"use strict";var u=i(96540),_=i(69982);function p(s){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+s,i=1;i