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 @@
+#
+
+[](http://badge.fury.io/js/swagger-ui)
+[](https://jenkins.swagger.io/view/OSS%20-%20JavaScript/job/oss-swagger-ui-master/)
+[](https://jenkins.swagger.io/job/oss-swagger-ui-security-audit/lastBuild/console)
+
+
+
+
+
+
+
+## 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){_+=""+tag(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=""+s[0].slice(1);return-1!==s.input.indexOf(i,o)})(s,{after:i})||o.ignoreMatch()):o.ignoreMatch()}},L={$pattern:o,keyword:i,literal:u,built_in:_},B="[0-9](_?[0-9])*",$=`\\.(${B})`,V="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",U={className:"number",variants:[{begin:`(\\b(${V})((${$})|\\.)?|(${$}))[eE][+-]?(${B})\\b`},{begin:`\\b(${V})\\b((${$})\\b|\\.)?|(${$})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},z={className:"subst",begin:"\\$\\{",end:"\\}",keywords:L,contains:[]},Y={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,z],subLanguage:"xml"}},Z={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[s.BACKSLASH_ESCAPE,z],subLanguage:"css"}},ee={className:"string",begin:"`",end:"`",contains:[s.BACKSLASH_ESCAPE,z]},ie={className:"comment",variants:[s.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:w+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),s.C_BLOCK_COMMENT_MODE,s.C_LINE_COMMENT_MODE]},ae=[s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,Y,Z,ee,U,s.REGEXP_MODE];z.contains=ae.concat({begin:/\{/,end:/\}/,keywords:L,contains:["self"].concat(ae)});const ce=[].concat(ie,z.contains),le=ce.concat([{begin:/\(/,end:/\)/,keywords:L,contains:["self"].concat(ce)}]),pe={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:L,contains:le};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:L,exports:{PARAMS_CONTAINS:le},illegal:/#(?![$_A-z])/,contains:[s.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,Y,Z,ee,ie,U,{begin:concat(/[{,\n]\s*/,lookahead(concat(/(((\/\/.*$)|(\/\*(\*[^/]|[^*])*\*\/))\s*)*/,w+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:w+lookahead("\\s*:"),relevance:0}]},{begin:"("+s.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[ie,s.REGEXP_MODE,{className:"function",begin:"(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+s.UNDERSCORE_IDENT_RE+")\\s*=>",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]+;|[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:/,relevance:0,contains:[{className:"attr",begin:/[A-Za-z0-9._:-]+/,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};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:/