commit 1301a01d6d29a22da84f5bf01a4e895f29efc629 Author: Robert van Diest Date: Tue Mar 24 20:13:07 2026 +0100 Initial commit diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..934ac94 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,17 @@ +{ + "permissions": { + "allow": [ + "Bash(dotnet new:*)", + "Bash(dotnet sln:*)", + "Bash(dotnet add:*)", + "Bash(dotnet build:*)", + "Bash(dotnet tool:*)", + "Bash(dotnet ef:*)", + "Bash(timeout 8 dotnet run)", + "Bash(npm create:*)", + "Bash(npm install:*)", + "Bash(npm run:*)", + "Bash(npx playwright:*)" + ] + } +} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000..5c92524 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,75 @@ +name: E2E Tests + +on: + push: + branches: [main] + pull_request: + +jobs: + e2e: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + # ── Docker ──────────────────────────────────────────────────────────── + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build images + run: docker compose -f cicd/docker/docker-compose.yml build + + - name: Start services + run: docker compose -f cicd/docker/docker-compose.yml up -d + env: + # Falls back to the default in docker-compose.yml if the secret is absent + JWT_KEY: ${{ secrets.JWT_KEY }} + + - name: Wait for frontend to be ready + run: | + echo "Waiting for services to become healthy..." + timeout 120 bash -c \ + 'until curl -sf http://localhost > /dev/null; do echo " still waiting..."; sleep 3; done' + echo "Services are ready." + + # ── Playwright ──────────────────────────────────────────────────────── + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + cache-dependency-path: tests/e2e/package-lock.json + + - name: Install dependencies + working-directory: tests/e2e + run: npm ci + + - name: Install Playwright browsers + working-directory: tests/e2e + run: npx playwright install --with-deps chromium + + - name: Run E2E tests + working-directory: tests/e2e + env: + BASE_URL: http://localhost + CI: 'true' + run: npx playwright test + + # ── Artifacts ───────────────────────────────────────────────────────── + - name: Upload Playwright report + uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: tests/e2e/playwright-report/ + retention-days: 30 + + - name: Dump Docker logs on failure + if: failure() + run: docker compose -f cicd/docker/docker-compose.yml logs + + # ── Cleanup ─────────────────────────────────────────────────────────── + - name: Stop services + if: always() + run: docker compose -f cicd/docker/docker-compose.yml down -v diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..826ee0b --- /dev/null +++ b/.gitignore @@ -0,0 +1,54 @@ +# ------------------------- +# .NET +# ------------------------- +src/backend/**/bin/ +src/backend/**/obj/ +src/backend/**/*.user +src/backend/**/.vs/ + +# SQLite databases +*.db +*.db-shm +*.db-wal + +# ------------------------- +# Node / Frontend +# ------------------------- +src/frontend/node_modules/ +src/frontend/dist/ +src/frontend/.env +src/frontend/.env.* + +# ------------------------- +# Docker +# ------------------------- +cicd/docker/.env + +# ------------------------- +# IDEs +# ------------------------- +.vs/ +.vscode/ +.idea/ +*.suo +*.user + +# ------------------------- +# OS +# ------------------------- +.DS_Store +Thumbs.db + +# ------------------------- +# Playwright +# ------------------------- +tests/e2e/node_modules/ +tests/e2e/playwright-report/ +tests/e2e/test-results/ +tests/e2e/.cache/ + +# ------------------------- +# Logs +# ------------------------- +*.log +logs/ diff --git a/cicd/docker/.env.example b/cicd/docker/.env.example new file mode 100644 index 0000000..ddec482 --- /dev/null +++ b/cicd/docker/.env.example @@ -0,0 +1,12 @@ +# Copy this file to .env and fill in the values before running docker compose + +# Port the app is exposed on (default: 80) +PORT=80 + +# JWT — use a long random string in production +JWT_KEY=randall-super-secret-jwt-key-change-in-production-32chars +JWT_ISSUER=randall-api +JWT_AUDIENCE=randall-app + +# ASP.NET Core environment +ASPNETCORE_ENVIRONMENT=Production diff --git a/cicd/docker/Dockerfile.backend b/cicd/docker/Dockerfile.backend new file mode 100644 index 0000000..56921c9 --- /dev/null +++ b/cicd/docker/Dockerfile.backend @@ -0,0 +1,30 @@ +# Build stage +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +WORKDIR /src + +# Restore — copy only project files first to cache the NuGet layer +COPY src/backend/Randall.slnx src/backend/ +COPY src/backend/src/Randall.Domain/Randall.Domain.csproj src/backend/src/Randall.Domain/ +COPY src/backend/src/Randall.Application/Randall.Application.csproj src/backend/src/Randall.Application/ +COPY src/backend/src/Randall.Infrastructure/Randall.Infrastructure.csproj src/backend/src/Randall.Infrastructure/ +COPY src/backend/src/Randall.Api/Randall.Api.csproj src/backend/src/Randall.Api/ +RUN dotnet restore "src/backend/src/Randall.Api/Randall.Api.csproj" + +# Build — copy source only (no bin/obj/db files) +COPY src/backend/src/ src/backend/src/ +RUN dotnet publish "src/backend/src/Randall.Api/Randall.Api.csproj" \ + -c Release -o /app/publish + +# Runtime stage +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime +WORKDIR /app + +RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/* +RUN mkdir -p /app/data +COPY --from=build /app/publish . + +ENV ASPNETCORE_URLS=http://+:8080 +ENV ConnectionStrings__DefaultConnection="Data Source=/app/data/randall.db" + +EXPOSE 8080 +ENTRYPOINT ["dotnet", "Randall.Api.dll"] diff --git a/cicd/docker/Dockerfile.backend.dockerignore b/cicd/docker/Dockerfile.backend.dockerignore new file mode 100644 index 0000000..18396de --- /dev/null +++ b/cicd/docker/Dockerfile.backend.dockerignore @@ -0,0 +1,18 @@ +# Not needed for backend build +src/frontend/ +cicd/ + +# Build artifacts +src/backend/**/bin/ +src/backend/**/obj/ + +# Local database files +src/backend/**/*.db +src/backend/**/*.db-shm +src/backend/**/*.db-wal + +# IDE and git +.git/ +.vs/ +**/*.user +**/.idea/ diff --git a/cicd/docker/Dockerfile.frontend b/cicd/docker/Dockerfile.frontend new file mode 100644 index 0000000..ceaf299 --- /dev/null +++ b/cicd/docker/Dockerfile.frontend @@ -0,0 +1,24 @@ +# Build stage +FROM node:22-alpine AS build +WORKDIR /app + +# Install dependencies — copy lockfiles first to cache the npm layer +COPY src/frontend/package.json src/frontend/package-lock.json ./ +RUN npm ci + +# Copy source +COPY src/frontend/index.html ./ +COPY src/frontend/vite.config.ts ./ +COPY src/frontend/tsconfig.json src/frontend/tsconfig.app.json src/frontend/tsconfig.node.json ./ +COPY src/frontend/eslint.config.js ./ +COPY src/frontend/src/ ./src/ +COPY src/frontend/public/ ./public/ + +RUN npm run build + +# Serve stage +FROM nginx:alpine AS runtime +COPY --from=build /app/dist /usr/share/nginx/html +COPY cicd/docker/nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 diff --git a/cicd/docker/Dockerfile.frontend.dockerignore b/cicd/docker/Dockerfile.frontend.dockerignore new file mode 100644 index 0000000..64f5666 --- /dev/null +++ b/cicd/docker/Dockerfile.frontend.dockerignore @@ -0,0 +1,16 @@ +# Not needed for frontend build +src/backend/ + +# Build artifacts and dependencies +src/frontend/node_modules/ +src/frontend/dist/ + +# Secrets — never bake these into an image +src/frontend/.env +src/frontend/.env.* + +# IDE and git +.git/ +.vs/ +**/*.user +**/.idea/ diff --git a/cicd/docker/docker-compose.yml b/cicd/docker/docker-compose.yml new file mode 100644 index 0000000..3ff51d0 --- /dev/null +++ b/cicd/docker/docker-compose.yml @@ -0,0 +1,34 @@ +services: + backend: + build: + context: ../.. + dockerfile: cicd/docker/Dockerfile.backend + environment: + - ConnectionStrings__DefaultConnection=Data Source=/app/data/randall.db + - Jwt__Key=${JWT_KEY:-randall-super-secret-jwt-key-change-in-production-32chars} + - Jwt__Issuer=${JWT_ISSUER:-randall-api} + - Jwt__Audience=${JWT_AUDIENCE:-randall-app} + - ASPNETCORE_ENVIRONMENT=${ASPNETCORE_ENVIRONMENT:-Production} + volumes: + - db-data:/app/data + restart: unless-stopped + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/health"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 10s + + frontend: + build: + context: ../.. + dockerfile: cicd/docker/Dockerfile.frontend + ports: + - "${PORT:-80}:80" + depends_on: + backend: + condition: service_healthy + restart: unless-stopped + +volumes: + db-data: diff --git a/cicd/docker/nginx.conf b/cicd/docker/nginx.conf new file mode 100644 index 0000000..f9f8026 --- /dev/null +++ b/cicd/docker/nginx.conf @@ -0,0 +1,21 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # Proxy API calls to the backend + location /api/ { + proxy_pass http://backend:8080; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # SPA fallback — all unmatched routes serve index.html + location / { + try_files $uri $uri/ /index.html; + } +} diff --git a/src/backend/Randall.slnx b/src/backend/Randall.slnx new file mode 100644 index 0000000..5e21be4 --- /dev/null +++ b/src/backend/Randall.slnx @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/backend/src/Randall.Api/Admin/AdminController.cs b/src/backend/src/Randall.Api/Admin/AdminController.cs new file mode 100644 index 0000000..e9b13f0 --- /dev/null +++ b/src/backend/src/Randall.Api/Admin/AdminController.cs @@ -0,0 +1,70 @@ +using System.Security.Claims; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Randall.Application.Admin.ApproveUser; +using Randall.Application.Admin.DeleteUser; +using Randall.Application.Admin.GetAllUsers; +using Randall.Application.Admin.GetPendingUsers; +using Randall.Application.Admin.MakeAdmin; + +namespace Randall.Api.Admin; + +[ApiController] +[Route("api/admin")] +[Authorize] +public class AdminController( + GetAllUsersHandler getAllUsersHandler, + GetPendingUsersHandler getPendingUsersHandler, + ApproveUserHandler approveUserHandler, + DeleteUserHandler deleteUserHandler, + MakeAdminHandler makeAdminHandler) : ControllerBase +{ + private bool IsAdmin => + User.FindFirstValue("isAdmin") == "true"; + + [HttpGet("users")] + public async Task GetAllUsers(CancellationToken ct) + { + if (!IsAdmin) return Forbid(); + var result = await getAllUsersHandler.HandleAsync(ct); + return Ok(result.Value); + } + + [HttpGet("users/pending")] + public async Task GetPendingUsers(CancellationToken ct) + { + if (!IsAdmin) return Forbid(); + var result = await getPendingUsersHandler.HandleAsync(ct); + return Ok(result.Value); + } + + [HttpPost("users/{id}/approve")] + public async Task ApproveUser(Guid id, CancellationToken ct) + { + if (!IsAdmin) return Forbid(); + var result = await approveUserHandler.HandleAsync(new ApproveUserCommand(id), ct); + if (!result.IsSuccess) + return BadRequest(new ProblemDetails { Detail = result.Error }); + return NoContent(); + } + + [HttpPost("users/{id}/make-admin")] + public async Task MakeAdmin(Guid id, CancellationToken ct) + { + if (!IsAdmin) return Forbid(); + var result = await makeAdminHandler.HandleAsync(new MakeAdminCommand(id), ct); + if (!result.IsSuccess) + return BadRequest(new ProblemDetails { Detail = result.Error }); + return NoContent(); + } + + [HttpDelete("users/{id}")] + public async Task DeleteUser(Guid id, CancellationToken ct) + { + if (!IsAdmin) return Forbid(); + var result = await deleteUserHandler.HandleAsync(new DeleteUserCommand(id), ct); + if (!result.IsSuccess) + return BadRequest(new ProblemDetails { Detail = result.Error }); + return NoContent(); + } +} diff --git a/src/backend/src/Randall.Api/Auth/AuthController.cs b/src/backend/src/Randall.Api/Auth/AuthController.cs new file mode 100644 index 0000000..fbd3215 --- /dev/null +++ b/src/backend/src/Randall.Api/Auth/AuthController.cs @@ -0,0 +1,39 @@ +using Microsoft.AspNetCore.Mvc; +using Randall.Application.Auth; +using Randall.Application.Auth.Login; +using Randall.Application.Auth.Register; + +namespace Randall.Api.Auth; + +[ApiController] +[Route("api/auth")] +public class AuthController(RegisterHandler registerHandler, LoginHandler loginHandler) : ControllerBase +{ + [HttpPost("register")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public async Task Register([FromBody] AuthRequest request, CancellationToken ct) + { + var result = await registerHandler.HandleAsync( + new RegisterCommand(request.Email, request.Name ?? string.Empty, request.Password), ct); + + if (!result.IsSuccess) + return BadRequest(new ProblemDetails { Detail = result.Error }); + + return Ok(result.Value); + } + + [HttpPost("login")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public async Task Login([FromBody] AuthRequest request, CancellationToken ct) + { + var result = await loginHandler.HandleAsync( + new LoginCommand(request.Email, request.Password), ct); + + if (!result.IsSuccess) + return BadRequest(new ProblemDetails { Detail = result.Error }); + + return Ok(result.Value); + } +} diff --git a/src/backend/src/Randall.Api/Auth/AuthRequest.cs b/src/backend/src/Randall.Api/Auth/AuthRequest.cs new file mode 100644 index 0000000..4ecdd0f --- /dev/null +++ b/src/backend/src/Randall.Api/Auth/AuthRequest.cs @@ -0,0 +1,3 @@ +namespace Randall.Api.Auth; + +public record AuthRequest(string Email, string Password, string? Name); diff --git a/src/backend/src/Randall.Api/Program.cs b/src/backend/src/Randall.Api/Program.cs new file mode 100644 index 0000000..8e0e4de --- /dev/null +++ b/src/backend/src/Randall.Api/Program.cs @@ -0,0 +1,68 @@ +using System.Text; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.IdentityModel.Tokens; +using Randall.Application; +using Randall.Application.Common; +using Randall.Infrastructure; +using Randall.Infrastructure.Persistence; +using Randall.Infrastructure.Persistence.Seeding; + +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddHealthChecks(); +builder.Services.AddControllers() + .AddJsonOptions(o => + o.JsonSerializerOptions.Converters.Add(new System.Text.Json.Serialization.JsonStringEnumConverter())); +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(options => + { + options.MapInboundClaims = false; + options.TokenValidationParameters = new TokenValidationParameters + { + ValidateIssuer = true, + ValidateAudience = true, + ValidateLifetime = true, + ValidateIssuerSigningKey = true, + ValidIssuer = builder.Configuration["Jwt:Issuer"], + ValidAudience = builder.Configuration["Jwt:Audience"], + IssuerSigningKey = new SymmetricSecurityKey( + Encoding.UTF8.GetBytes(builder.Configuration["Jwt:Key"]!)), + }; + }); + +builder.Services.AddAuthorization(); +builder.Services.AddApplication(); +builder.Services.AddInfrastructure(builder.Configuration); + +builder.Services.AddCors(options => +{ + options.AddDefaultPolicy(policy => + policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); +}); + +var app = builder.Build(); + +using (var scope = app.Services.CreateScope()) +{ + var db = scope.ServiceProvider.GetRequiredService(); + var hasher = scope.ServiceProvider.GetRequiredService(); + await DatabaseSeeder.SeedAsync(db, hasher); +} + +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.MapHealthChecks("/health"); +app.UseCors(); +if (app.Environment.IsDevelopment()) app.UseHttpsRedirection(); +app.UseAuthentication(); +app.UseAuthorization(); +app.MapControllers(); + +app.Run(); diff --git a/src/backend/src/Randall.Api/Properties/launchSettings.json b/src/backend/src/Randall.Api/Properties/launchSettings.json new file mode 100644 index 0000000..ba613e5 --- /dev/null +++ b/src/backend/src/Randall.Api/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://localhost:5180", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:7004;http://localhost:5180", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/backend/src/Randall.Api/Randall.Api.csproj b/src/backend/src/Randall.Api/Randall.Api.csproj new file mode 100644 index 0000000..169ab4d --- /dev/null +++ b/src/backend/src/Randall.Api/Randall.Api.csproj @@ -0,0 +1,24 @@ + + + + net10.0 + enable + enable + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + diff --git a/src/backend/src/Randall.Api/Randall.Api.http b/src/backend/src/Randall.Api/Randall.Api.http new file mode 100644 index 0000000..19f8954 --- /dev/null +++ b/src/backend/src/Randall.Api/Randall.Api.http @@ -0,0 +1,6 @@ +@Randall.Api_HostAddress = http://localhost:5180 + +GET {{Randall.Api_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/src/backend/src/Randall.Api/Reservations/CreateReservationRequest.cs b/src/backend/src/Randall.Api/Reservations/CreateReservationRequest.cs new file mode 100644 index 0000000..9a8fb58 --- /dev/null +++ b/src/backend/src/Randall.Api/Reservations/CreateReservationRequest.cs @@ -0,0 +1,3 @@ +namespace Randall.Api.Reservations; + +public record CreateReservationRequest(Guid WorkplaceId, DateOnly Date); diff --git a/src/backend/src/Randall.Api/Reservations/ReservationsController.cs b/src/backend/src/Randall.Api/Reservations/ReservationsController.cs new file mode 100644 index 0000000..75a9f47 --- /dev/null +++ b/src/backend/src/Randall.Api/Reservations/ReservationsController.cs @@ -0,0 +1,78 @@ +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Randall.Application.Reservations.CancelReservation; +using Randall.Application.Reservations.CreateReservation; +using Randall.Application.Reservations.GetMyReservations; +using Randall.Application.Reservations.GetReservationById; + +namespace Randall.Api.Reservations; + +[ApiController] +[Route("api/reservations")] +[Authorize] +public class ReservationsController( + CreateReservationHandler createHandler, + CancelReservationHandler cancelHandler, + GetMyReservationsHandler getMyHandler, + GetReservationByIdHandler getByIdHandler) : ControllerBase +{ + private string UserEmail => User.FindFirstValue(JwtRegisteredClaimNames.Email)!; + private string UserName => User.FindFirstValue(JwtRegisteredClaimNames.Name)!; + + [HttpPost] + [ProducesResponseType(StatusCodes.Status201Created)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public async Task Create([FromBody] CreateReservationRequest request, CancellationToken ct) + { + var command = new CreateReservationCommand(request.WorkplaceId, UserEmail, UserName, request.Date); + var result = await createHandler.HandleAsync(command, ct); + + if (!result.IsSuccess) + return BadRequest(new ProblemDetails { Detail = result.Error }); + + return CreatedAtAction(nameof(GetById), new { id = result.Value!.Id }, result.Value); + } + + [HttpGet("{id:guid}")] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task GetById(Guid id, CancellationToken ct) + { + var result = await getByIdHandler.HandleAsync(new GetReservationByIdQuery(id), ct); + + if (!result.IsSuccess) + return NotFound(new ProblemDetails { Detail = result.Error }); + + return Ok(result.Value); + } + + [HttpGet("my")] + [ProducesResponseType>(StatusCodes.Status200OK)] + public async Task GetMy(CancellationToken ct) + { + var result = await getMyHandler.HandleAsync(new GetMyReservationsQuery(UserEmail), ct); + return Ok(result.Value); + } + + [HttpDelete("{id:guid}")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task Cancel(Guid id, CancellationToken ct) + { + var command = new CancelReservationCommand(id, UserEmail); + var result = await cancelHandler.HandleAsync(command, ct); + + if (!result.IsSuccess) + { + if (result.Error!.Contains("not found")) + return NotFound(new ProblemDetails { Detail = result.Error }); + + return BadRequest(new ProblemDetails { Detail = result.Error }); + } + + return NoContent(); + } +} diff --git a/src/backend/src/Randall.Api/Workplaces/WorkplacesController.cs b/src/backend/src/Randall.Api/Workplaces/WorkplacesController.cs new file mode 100644 index 0000000..11bc73a --- /dev/null +++ b/src/backend/src/Randall.Api/Workplaces/WorkplacesController.cs @@ -0,0 +1,50 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Randall.Application.Workplaces.GetAllWorkplaces; +using Randall.Application.Workplaces.GetAvailableWorkplaces; +using Randall.Application.Workplaces.GetWorkplaceSchedule; + +namespace Randall.Api.Workplaces; + +[ApiController] +[Route("api/workplaces")] +[Authorize] +public class WorkplacesController( + GetAllWorkplacesHandler getAllHandler, + GetAvailableWorkplacesHandler getAvailableHandler, + GetWorkplaceScheduleHandler getScheduleHandler) : ControllerBase +{ + [HttpGet] + [ProducesResponseType>(StatusCodes.Status200OK)] + public async Task GetAll(CancellationToken ct) + { + var result = await getAllHandler.HandleAsync(ct); + return Ok(result.Value); + } + + [HttpGet("available")] + [ProducesResponseType>(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public async Task GetAvailable([FromQuery] DateOnly date, CancellationToken ct) + { + var result = await getAvailableHandler.HandleAsync(new GetAvailableWorkplacesQuery(date), ct); + + if (!result.IsSuccess) + return BadRequest(new ProblemDetails { Detail = result.Error }); + + return Ok(result.Value); + } + + [HttpGet("schedule")] + [ProducesResponseType>(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public async Task GetSchedule([FromQuery] DateOnly date, CancellationToken ct) + { + var result = await getScheduleHandler.HandleAsync(date, ct); + + if (!result.IsSuccess) + return BadRequest(new ProblemDetails { Detail = result.Error }); + + return Ok(result.Value); + } +} diff --git a/src/backend/src/Randall.Api/appsettings.Development.json b/src/backend/src/Randall.Api/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/src/backend/src/Randall.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/backend/src/Randall.Api/appsettings.json b/src/backend/src/Randall.Api/appsettings.json new file mode 100644 index 0000000..0b2c601 --- /dev/null +++ b/src/backend/src/Randall.Api/appsettings.json @@ -0,0 +1,17 @@ +{ + "ConnectionStrings": { + "DefaultConnection": "Data Source=randall.db" + }, + "Jwt": { + "Key": "randall-super-secret-jwt-key-change-in-production-32chars", + "Issuer": "randall-api", + "Audience": "randall-app" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/src/backend/src/Randall.Application/Admin/ApproveUser/ApproveUserCommand.cs b/src/backend/src/Randall.Application/Admin/ApproveUser/ApproveUserCommand.cs new file mode 100644 index 0000000..a7621da --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/ApproveUser/ApproveUserCommand.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Admin.ApproveUser; + +public record ApproveUserCommand(Guid UserId); diff --git a/src/backend/src/Randall.Application/Admin/ApproveUser/ApproveUserHandler.cs b/src/backend/src/Randall.Application/Admin/ApproveUser/ApproveUserHandler.cs new file mode 100644 index 0000000..6d1b8e4 --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/ApproveUser/ApproveUserHandler.cs @@ -0,0 +1,18 @@ +using Randall.Domain.Common; +using Randall.Domain.Users; + +namespace Randall.Application.Admin.ApproveUser; + +public class ApproveUserHandler(IUserRepository userRepository) +{ + public async Task HandleAsync(ApproveUserCommand command, CancellationToken ct = default) + { + var user = await userRepository.GetByIdAsync(command.UserId, ct); + if (user is null) + return Result.Failure("User not found."); + + user.Approve(); + await userRepository.SaveChangesAsync(ct); + return Result.Success(); + } +} diff --git a/src/backend/src/Randall.Application/Admin/DeleteUser/DeleteUserCommand.cs b/src/backend/src/Randall.Application/Admin/DeleteUser/DeleteUserCommand.cs new file mode 100644 index 0000000..d60c38d --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/DeleteUser/DeleteUserCommand.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Admin.DeleteUser; + +public record DeleteUserCommand(Guid UserId); diff --git a/src/backend/src/Randall.Application/Admin/DeleteUser/DeleteUserHandler.cs b/src/backend/src/Randall.Application/Admin/DeleteUser/DeleteUserHandler.cs new file mode 100644 index 0000000..ccc5859 --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/DeleteUser/DeleteUserHandler.cs @@ -0,0 +1,21 @@ +using Randall.Domain.Common; +using Randall.Domain.Users; + +namespace Randall.Application.Admin.DeleteUser; + +public class DeleteUserHandler(IUserRepository userRepository) +{ + public async Task HandleAsync(DeleteUserCommand command, CancellationToken ct = default) + { + var user = await userRepository.GetByIdAsync(command.UserId, ct); + if (user is null) + return Result.Failure("User not found."); + + if (user.IsAdmin) + return Result.Failure("Admin users cannot be deleted."); + + userRepository.Delete(user); + await userRepository.SaveChangesAsync(ct); + return Result.Success(); + } +} diff --git a/src/backend/src/Randall.Application/Admin/GetAllUsers/AdminUserDto.cs b/src/backend/src/Randall.Application/Admin/GetAllUsers/AdminUserDto.cs new file mode 100644 index 0000000..74730dd --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/GetAllUsers/AdminUserDto.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Admin.GetAllUsers; + +public record AdminUserDto(Guid Id, string Name, string Email, bool IsApproved, bool IsAdmin); diff --git a/src/backend/src/Randall.Application/Admin/GetAllUsers/GetAllUsersHandler.cs b/src/backend/src/Randall.Application/Admin/GetAllUsers/GetAllUsersHandler.cs new file mode 100644 index 0000000..b8c437d --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/GetAllUsers/GetAllUsersHandler.cs @@ -0,0 +1,14 @@ +using Randall.Domain.Common; +using Randall.Domain.Users; + +namespace Randall.Application.Admin.GetAllUsers; + +public class GetAllUsersHandler(IUserRepository userRepository) +{ + public async Task>> HandleAsync(CancellationToken ct = default) + { + var users = await userRepository.GetAllAsync(ct); + var dtos = users.Select(u => new AdminUserDto(u.Id, u.Name, u.Email, u.IsApproved, u.IsAdmin)).ToList(); + return Result.Success(dtos); + } +} diff --git a/src/backend/src/Randall.Application/Admin/GetPendingUsers/GetPendingUsersHandler.cs b/src/backend/src/Randall.Application/Admin/GetPendingUsers/GetPendingUsersHandler.cs new file mode 100644 index 0000000..8ec7425 --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/GetPendingUsers/GetPendingUsersHandler.cs @@ -0,0 +1,14 @@ +using Randall.Domain.Common; +using Randall.Domain.Users; + +namespace Randall.Application.Admin.GetPendingUsers; + +public class GetPendingUsersHandler(IUserRepository userRepository) +{ + public async Task>> HandleAsync(CancellationToken ct = default) + { + var users = await userRepository.GetPendingAsync(ct); + var dtos = users.Select(u => new PendingUserDto(u.Id, u.Name, u.Email)).ToList(); + return Result.Success(dtos); + } +} diff --git a/src/backend/src/Randall.Application/Admin/GetPendingUsers/PendingUserDto.cs b/src/backend/src/Randall.Application/Admin/GetPendingUsers/PendingUserDto.cs new file mode 100644 index 0000000..ffdb643 --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/GetPendingUsers/PendingUserDto.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Admin.GetPendingUsers; + +public record PendingUserDto(Guid Id, string Name, string Email); diff --git a/src/backend/src/Randall.Application/Admin/MakeAdmin/MakeAdminCommand.cs b/src/backend/src/Randall.Application/Admin/MakeAdmin/MakeAdminCommand.cs new file mode 100644 index 0000000..7ec3aed --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/MakeAdmin/MakeAdminCommand.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Admin.MakeAdmin; + +public record MakeAdminCommand(Guid UserId); diff --git a/src/backend/src/Randall.Application/Admin/MakeAdmin/MakeAdminHandler.cs b/src/backend/src/Randall.Application/Admin/MakeAdmin/MakeAdminHandler.cs new file mode 100644 index 0000000..a20eb4e --- /dev/null +++ b/src/backend/src/Randall.Application/Admin/MakeAdmin/MakeAdminHandler.cs @@ -0,0 +1,18 @@ +using Randall.Domain.Common; +using Randall.Domain.Users; + +namespace Randall.Application.Admin.MakeAdmin; + +public class MakeAdminHandler(IUserRepository userRepository) +{ + public async Task HandleAsync(MakeAdminCommand command, CancellationToken ct = default) + { + var user = await userRepository.GetByIdAsync(command.UserId, ct); + if (user is null) + return Result.Failure("User not found."); + + user.MakeAdmin(); + await userRepository.SaveChangesAsync(ct); + return Result.Success(); + } +} diff --git a/src/backend/src/Randall.Application/Auth/AuthResponse.cs b/src/backend/src/Randall.Application/Auth/AuthResponse.cs new file mode 100644 index 0000000..5906f2b --- /dev/null +++ b/src/backend/src/Randall.Application/Auth/AuthResponse.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Auth; + +public record AuthResponse(string Token, string Name, string Email, bool IsAdmin); diff --git a/src/backend/src/Randall.Application/Auth/Login/LoginCommand.cs b/src/backend/src/Randall.Application/Auth/Login/LoginCommand.cs new file mode 100644 index 0000000..ae879de --- /dev/null +++ b/src/backend/src/Randall.Application/Auth/Login/LoginCommand.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Auth.Login; + +public record LoginCommand(string Email, string Password); diff --git a/src/backend/src/Randall.Application/Auth/Login/LoginHandler.cs b/src/backend/src/Randall.Application/Auth/Login/LoginHandler.cs new file mode 100644 index 0000000..936f104 --- /dev/null +++ b/src/backend/src/Randall.Application/Auth/Login/LoginHandler.cs @@ -0,0 +1,24 @@ +using Randall.Application.Common; +using Randall.Domain.Common; +using Randall.Domain.Users; + +namespace Randall.Application.Auth.Login; + +public class LoginHandler( + IUserRepository userRepository, + IPasswordHasher passwordHasher, + IJwtTokenService jwtTokenService) +{ + public async Task> HandleAsync(LoginCommand command, CancellationToken ct = default) + { + var user = await userRepository.GetByEmailAsync(command.Email, ct); + if (user is null || !passwordHasher.Verify(command.Password, user.PasswordHash)) + return Result.Failure("Invalid email or password."); + + if (!user.IsApproved) + return Result.Failure("Your account is pending approval by an administrator."); + + var token = jwtTokenService.GenerateToken(user.Id, user.Email, user.Name, user.IsAdmin); + return Result.Success(new AuthResponse(token, user.Name, user.Email, user.IsAdmin)); + } +} diff --git a/src/backend/src/Randall.Application/Auth/Register/RegisterCommand.cs b/src/backend/src/Randall.Application/Auth/Register/RegisterCommand.cs new file mode 100644 index 0000000..44b1232 --- /dev/null +++ b/src/backend/src/Randall.Application/Auth/Register/RegisterCommand.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Auth.Register; + +public record RegisterCommand(string Email, string Name, string Password); diff --git a/src/backend/src/Randall.Application/Auth/Register/RegisterHandler.cs b/src/backend/src/Randall.Application/Auth/Register/RegisterHandler.cs new file mode 100644 index 0000000..dccb36d --- /dev/null +++ b/src/backend/src/Randall.Application/Auth/Register/RegisterHandler.cs @@ -0,0 +1,26 @@ +using Randall.Application.Common; +using Randall.Domain.Common; +using Randall.Domain.Users; + +namespace Randall.Application.Auth.Register; + +public class RegisterHandler(IUserRepository userRepository, IPasswordHasher passwordHasher) +{ + public async Task> HandleAsync(RegisterCommand command, CancellationToken ct = default) + { + var exists = await userRepository.ExistsByEmailAsync(command.Email, ct); + if (exists) + return Result.Failure("An account with this email already exists."); + + var hash = passwordHasher.Hash(command.Password); + + var result = User.Create(command.Email, command.Name, hash); + if (!result.IsSuccess) + return Result.Failure(result.Error!); + + await userRepository.AddAsync(result.Value!, ct); + await userRepository.SaveChangesAsync(ct); + + return Result.Success(new RegisterResponse("Your account is pending approval by an administrator.")); + } +} diff --git a/src/backend/src/Randall.Application/Auth/Register/RegisterResponse.cs b/src/backend/src/Randall.Application/Auth/Register/RegisterResponse.cs new file mode 100644 index 0000000..9afcfcf --- /dev/null +++ b/src/backend/src/Randall.Application/Auth/Register/RegisterResponse.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Auth.Register; + +public record RegisterResponse(string Message); diff --git a/src/backend/src/Randall.Application/Common/IJwtTokenService.cs b/src/backend/src/Randall.Application/Common/IJwtTokenService.cs new file mode 100644 index 0000000..af55e73 --- /dev/null +++ b/src/backend/src/Randall.Application/Common/IJwtTokenService.cs @@ -0,0 +1,6 @@ +namespace Randall.Application.Common; + +public interface IJwtTokenService +{ + string GenerateToken(Guid userId, string email, string name, bool isAdmin); +} diff --git a/src/backend/src/Randall.Application/Common/IPasswordHasher.cs b/src/backend/src/Randall.Application/Common/IPasswordHasher.cs new file mode 100644 index 0000000..21d34b7 --- /dev/null +++ b/src/backend/src/Randall.Application/Common/IPasswordHasher.cs @@ -0,0 +1,7 @@ +namespace Randall.Application.Common; + +public interface IPasswordHasher +{ + string Hash(string password); + bool Verify(string password, string hash); +} diff --git a/src/backend/src/Randall.Application/DependencyInjection.cs b/src/backend/src/Randall.Application/DependencyInjection.cs new file mode 100644 index 0000000..13921a4 --- /dev/null +++ b/src/backend/src/Randall.Application/DependencyInjection.cs @@ -0,0 +1,41 @@ +using Microsoft.Extensions.DependencyInjection; +using Randall.Application.Admin.ApproveUser; +using Randall.Application.Admin.DeleteUser; +using Randall.Application.Admin.GetAllUsers; +using Randall.Application.Admin.GetPendingUsers; +using Randall.Application.Admin.MakeAdmin; +using Randall.Application.Auth.Login; +using Randall.Application.Auth.Register; +using Randall.Application.Reservations.CancelReservation; +using Randall.Application.Reservations.CreateReservation; +using Randall.Application.Reservations.GetMyReservations; +using Randall.Application.Reservations.GetReservationById; +using Randall.Application.Workplaces.GetAllWorkplaces; +using Randall.Application.Workplaces.GetAvailableWorkplaces; +using Randall.Application.Workplaces.GetWorkplaceSchedule; + +namespace Randall.Application; + +public static class DependencyInjection +{ + public static IServiceCollection AddApplication(this IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + + return services; + } +} diff --git a/src/backend/src/Randall.Application/Randall.Application.csproj b/src/backend/src/Randall.Application/Randall.Application.csproj new file mode 100644 index 0000000..c17bb3e --- /dev/null +++ b/src/backend/src/Randall.Application/Randall.Application.csproj @@ -0,0 +1,17 @@ + + + + + + + + + + + + net10.0 + enable + enable + + + diff --git a/src/backend/src/Randall.Application/Reservations/CancelReservation/CancelReservationCommand.cs b/src/backend/src/Randall.Application/Reservations/CancelReservation/CancelReservationCommand.cs new file mode 100644 index 0000000..04f47be --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/CancelReservation/CancelReservationCommand.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Reservations.CancelReservation; + +public record CancelReservationCommand(Guid ReservationId, string EmployeeEmail); diff --git a/src/backend/src/Randall.Application/Reservations/CancelReservation/CancelReservationHandler.cs b/src/backend/src/Randall.Application/Reservations/CancelReservation/CancelReservationHandler.cs new file mode 100644 index 0000000..c545551 --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/CancelReservation/CancelReservationHandler.cs @@ -0,0 +1,30 @@ +using Randall.Domain.Common; +using Randall.Domain.Reservations; + +namespace Randall.Application.Reservations.CancelReservation; + +public class CancelReservationHandler(IReservationRepository reservationRepository) +{ + public async Task HandleAsync( + CancelReservationCommand command, + CancellationToken ct = default) + { + var reservation = await reservationRepository.GetByIdAsync(command.ReservationId, ct); + if (reservation is null) + return Result.Failure("Reservation not found."); + + if (!string.Equals(reservation.EmployeeEmail, command.EmployeeEmail, StringComparison.OrdinalIgnoreCase)) + return Result.Failure("You are not allowed to cancel this reservation."); + + var today = DateOnly.FromDateTime(DateTime.UtcNow); + if (reservation.Date < today) + return Result.Failure("Cannot cancel a reservation for a past date."); + + var result = reservation.Cancel(); + if (!result.IsSuccess) + return result; + + await reservationRepository.SaveChangesAsync(ct); + return Result.Success(); + } +} diff --git a/src/backend/src/Randall.Application/Reservations/CreateReservation/CreateReservationCommand.cs b/src/backend/src/Randall.Application/Reservations/CreateReservation/CreateReservationCommand.cs new file mode 100644 index 0000000..7067187 --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/CreateReservation/CreateReservationCommand.cs @@ -0,0 +1,7 @@ +namespace Randall.Application.Reservations.CreateReservation; + +public record CreateReservationCommand( + Guid WorkplaceId, + string EmployeeEmail, + string EmployeeName, + DateOnly Date); diff --git a/src/backend/src/Randall.Application/Reservations/CreateReservation/CreateReservationHandler.cs b/src/backend/src/Randall.Application/Reservations/CreateReservation/CreateReservationHandler.cs new file mode 100644 index 0000000..51ddc1e --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/CreateReservation/CreateReservationHandler.cs @@ -0,0 +1,51 @@ +using Randall.Domain.Common; +using Randall.Domain.Reservations; +using Randall.Domain.Workplaces; + +namespace Randall.Application.Reservations.CreateReservation; + +public class CreateReservationHandler( + IWorkplaceRepository workplaceRepository, + IReservationRepository reservationRepository) +{ + public async Task> HandleAsync( + CreateReservationCommand command, + CancellationToken ct = default) + { + var workplace = await workplaceRepository.GetByIdAsync(command.WorkplaceId, ct); + if (workplace is null || !workplace.IsActive) + return Result.Failure("Workplace not found or inactive."); + + var today = DateOnly.FromDateTime(DateTime.UtcNow); + + var alreadyBookedByEmployee = await reservationRepository + .ExistsActiveForEmployeeOnDateAsync(command.EmployeeEmail, command.Date, ct); + if (alreadyBookedByEmployee) + return Result.Failure("You already have a reservation on this date."); + + var workplaceTaken = await reservationRepository + .ExistsActiveForWorkplaceOnDateAsync(command.WorkplaceId, command.Date, ct); + if (workplaceTaken) + return Result.Failure("This workplace is already reserved on the requested date."); + + var result = Reservation.Create( + command.WorkplaceId, + command.EmployeeEmail, + command.EmployeeName, + command.Date, + today); + + if (!result.IsSuccess) + return Result.Failure(result.Error!); + + var reservation = result.Value!; + await reservationRepository.AddAsync(reservation, ct); + await reservationRepository.SaveChangesAsync(ct); + + return Result.Success(new CreatedReservationDto( + reservation.Id, + reservation.WorkplaceId, + reservation.EmployeeName, + reservation.Date)); + } +} diff --git a/src/backend/src/Randall.Application/Reservations/CreateReservation/CreatedReservationDto.cs b/src/backend/src/Randall.Application/Reservations/CreateReservation/CreatedReservationDto.cs new file mode 100644 index 0000000..005c908 --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/CreateReservation/CreatedReservationDto.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Reservations.CreateReservation; + +public record CreatedReservationDto(Guid Id, Guid WorkplaceId, string EmployeeName, DateOnly Date); diff --git a/src/backend/src/Randall.Application/Reservations/GetMyReservations/GetMyReservationsHandler.cs b/src/backend/src/Randall.Application/Reservations/GetMyReservations/GetMyReservationsHandler.cs new file mode 100644 index 0000000..e9d00af --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/GetMyReservations/GetMyReservationsHandler.cs @@ -0,0 +1,33 @@ +using Randall.Domain.Common; +using Randall.Domain.Reservations; +using Randall.Domain.Workplaces; + +namespace Randall.Application.Reservations.GetMyReservations; + +public class GetMyReservationsHandler( + IReservationRepository reservationRepository, + IWorkplaceRepository workplaceRepository) +{ + public async Task>> HandleAsync( + GetMyReservationsQuery query, + CancellationToken ct = default) + { + var reservations = await reservationRepository.GetByEmployeeAsync(query.EmployeeEmail, ct); + + var dtos = new List(); + foreach (var r in reservations.OrderByDescending(r => r.Date)) + { + var workplace = await workplaceRepository.GetByIdAsync(r.WorkplaceId, ct); + dtos.Add(new ReservationDto( + r.Id, + r.WorkplaceId, + workplace?.Name ?? "Unknown", + workplace?.Location ?? "Unknown", + r.Date, + r.Status, + r.CreatedAt)); + } + + return Result.Success>(dtos); + } +} diff --git a/src/backend/src/Randall.Application/Reservations/GetMyReservations/GetMyReservationsQuery.cs b/src/backend/src/Randall.Application/Reservations/GetMyReservations/GetMyReservationsQuery.cs new file mode 100644 index 0000000..60fc5ad --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/GetMyReservations/GetMyReservationsQuery.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Reservations.GetMyReservations; + +public record GetMyReservationsQuery(string EmployeeEmail); diff --git a/src/backend/src/Randall.Application/Reservations/GetMyReservations/ReservationDto.cs b/src/backend/src/Randall.Application/Reservations/GetMyReservations/ReservationDto.cs new file mode 100644 index 0000000..d4312a4 --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/GetMyReservations/ReservationDto.cs @@ -0,0 +1,12 @@ +using Randall.Domain.Reservations; + +namespace Randall.Application.Reservations.GetMyReservations; + +public record ReservationDto( + Guid Id, + Guid WorkplaceId, + string WorkplaceName, + string WorkplaceLocation, + DateOnly Date, + ReservationStatus Status, + DateTime CreatedAt); diff --git a/src/backend/src/Randall.Application/Reservations/GetReservationById/GetReservationByIdHandler.cs b/src/backend/src/Randall.Application/Reservations/GetReservationById/GetReservationByIdHandler.cs new file mode 100644 index 0000000..41b0eb9 --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/GetReservationById/GetReservationByIdHandler.cs @@ -0,0 +1,32 @@ +using Randall.Domain.Common; +using Randall.Domain.Reservations; +using Randall.Domain.Workplaces; + +namespace Randall.Application.Reservations.GetReservationById; + +public class GetReservationByIdHandler( + IReservationRepository reservationRepository, + IWorkplaceRepository workplaceRepository) +{ + public async Task> HandleAsync( + GetReservationByIdQuery query, + CancellationToken ct = default) + { + var reservation = await reservationRepository.GetByIdAsync(query.ReservationId, ct); + if (reservation is null) + return Result.Failure("Reservation not found."); + + var workplace = await workplaceRepository.GetByIdAsync(reservation.WorkplaceId, ct); + + return Result.Success(new ReservationDetailDto( + reservation.Id, + reservation.WorkplaceId, + workplace?.Name ?? "Unknown", + workplace?.Location ?? "Unknown", + reservation.EmployeeName, + reservation.EmployeeEmail, + reservation.Date, + reservation.Status, + reservation.CreatedAt)); + } +} diff --git a/src/backend/src/Randall.Application/Reservations/GetReservationById/GetReservationByIdQuery.cs b/src/backend/src/Randall.Application/Reservations/GetReservationById/GetReservationByIdQuery.cs new file mode 100644 index 0000000..c779ae3 --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/GetReservationById/GetReservationByIdQuery.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Reservations.GetReservationById; + +public record GetReservationByIdQuery(Guid ReservationId); diff --git a/src/backend/src/Randall.Application/Reservations/GetReservationById/ReservationDetailDto.cs b/src/backend/src/Randall.Application/Reservations/GetReservationById/ReservationDetailDto.cs new file mode 100644 index 0000000..211f9f7 --- /dev/null +++ b/src/backend/src/Randall.Application/Reservations/GetReservationById/ReservationDetailDto.cs @@ -0,0 +1,14 @@ +using Randall.Domain.Reservations; + +namespace Randall.Application.Reservations.GetReservationById; + +public record ReservationDetailDto( + Guid Id, + Guid WorkplaceId, + string WorkplaceName, + string WorkplaceLocation, + string EmployeeName, + string EmployeeEmail, + DateOnly Date, + ReservationStatus Status, + DateTime CreatedAt); diff --git a/src/backend/src/Randall.Application/Workplaces/GetAllWorkplaces/GetAllWorkplacesHandler.cs b/src/backend/src/Randall.Application/Workplaces/GetAllWorkplaces/GetAllWorkplacesHandler.cs new file mode 100644 index 0000000..e2811f0 --- /dev/null +++ b/src/backend/src/Randall.Application/Workplaces/GetAllWorkplaces/GetAllWorkplacesHandler.cs @@ -0,0 +1,19 @@ +using Randall.Domain.Common; +using Randall.Domain.Workplaces; + +namespace Randall.Application.Workplaces.GetAllWorkplaces; + +public record WorkplaceDto(Guid Id, string Name, string Location); + +public class GetAllWorkplacesHandler(IWorkplaceRepository workplaceRepository) +{ + public async Task>> HandleAsync(CancellationToken ct = default) + { + var workplaces = await workplaceRepository.GetAllActiveAsync(ct); + var dtos = workplaces + .Select(w => new WorkplaceDto(w.Id, w.Name, w.Location)) + .ToList(); + + return Result.Success>(dtos); + } +} diff --git a/src/backend/src/Randall.Application/Workplaces/GetAvailableWorkplaces/AvailableWorkplaceDto.cs b/src/backend/src/Randall.Application/Workplaces/GetAvailableWorkplaces/AvailableWorkplaceDto.cs new file mode 100644 index 0000000..15fb8e7 --- /dev/null +++ b/src/backend/src/Randall.Application/Workplaces/GetAvailableWorkplaces/AvailableWorkplaceDto.cs @@ -0,0 +1,6 @@ +namespace Randall.Application.Workplaces.GetAvailableWorkplaces; + +public record AvailableWorkplaceDto( + Guid Id, + string Name, + string Location); diff --git a/src/backend/src/Randall.Application/Workplaces/GetAvailableWorkplaces/GetAvailableWorkplacesHandler.cs b/src/backend/src/Randall.Application/Workplaces/GetAvailableWorkplaces/GetAvailableWorkplacesHandler.cs new file mode 100644 index 0000000..e1d7ed0 --- /dev/null +++ b/src/backend/src/Randall.Application/Workplaces/GetAvailableWorkplaces/GetAvailableWorkplacesHandler.cs @@ -0,0 +1,36 @@ +using Randall.Domain.Common; +using Randall.Domain.Reservations; +using Randall.Domain.Workplaces; + +namespace Randall.Application.Workplaces.GetAvailableWorkplaces; + +public class GetAvailableWorkplacesHandler( + IWorkplaceRepository workplaceRepository, + IReservationRepository reservationRepository) +{ + public async Task>> HandleAsync( + GetAvailableWorkplacesQuery query, + CancellationToken ct = default) + { + var today = DateOnly.FromDateTime(DateTime.UtcNow); + + if (query.Date < today) + return Result.Failure>("Date cannot be in the past."); + + if (query.Date > today.AddDays(Reservation.MaxAdvanceDays)) + return Result.Failure>( + $"Date cannot be more than {Reservation.MaxAdvanceDays} days in advance."); + + var workplaces = await workplaceRepository.GetAllActiveAsync(ct); + + var available = new List(); + foreach (var workplace in workplaces) + { + var isTaken = await reservationRepository.ExistsActiveForWorkplaceOnDateAsync(workplace.Id, query.Date, ct); + if (!isTaken) + available.Add(new AvailableWorkplaceDto(workplace.Id, workplace.Name, workplace.Location)); + } + + return Result.Success>(available); + } +} diff --git a/src/backend/src/Randall.Application/Workplaces/GetAvailableWorkplaces/GetAvailableWorkplacesQuery.cs b/src/backend/src/Randall.Application/Workplaces/GetAvailableWorkplaces/GetAvailableWorkplacesQuery.cs new file mode 100644 index 0000000..61e19b1 --- /dev/null +++ b/src/backend/src/Randall.Application/Workplaces/GetAvailableWorkplaces/GetAvailableWorkplacesQuery.cs @@ -0,0 +1,3 @@ +namespace Randall.Application.Workplaces.GetAvailableWorkplaces; + +public record GetAvailableWorkplacesQuery(DateOnly Date); diff --git a/src/backend/src/Randall.Application/Workplaces/GetWorkplaceSchedule/GetWorkplaceScheduleHandler.cs b/src/backend/src/Randall.Application/Workplaces/GetWorkplaceSchedule/GetWorkplaceScheduleHandler.cs new file mode 100644 index 0000000..c81215c --- /dev/null +++ b/src/backend/src/Randall.Application/Workplaces/GetWorkplaceSchedule/GetWorkplaceScheduleHandler.cs @@ -0,0 +1,42 @@ +using Randall.Domain.Common; +using Randall.Domain.Reservations; +using Randall.Domain.Workplaces; + +namespace Randall.Application.Workplaces.GetWorkplaceSchedule; + +public class GetWorkplaceScheduleHandler( + IWorkplaceRepository workplaceRepository, + IReservationRepository reservationRepository) +{ + public async Task>> HandleAsync( + DateOnly date, + CancellationToken ct = default) + { + var today = DateOnly.FromDateTime(DateTime.UtcNow); + + if (date < today) + return Result.Failure>("Date cannot be in the past."); + + if (date > today.AddDays(Reservation.MaxAdvanceDays)) + return Result.Failure>( + $"Date cannot be more than {Reservation.MaxAdvanceDays} days in advance."); + + var workplaces = await workplaceRepository.GetAllActiveAsync(ct); + var reservations = await reservationRepository.GetActiveReservationsForDateAsync(date, ct); + + var reservationByWorkplace = reservations.ToDictionary(r => r.WorkplaceId); + + var schedule = workplaces.Select(w => + { + var hasReservation = reservationByWorkplace.TryGetValue(w.Id, out var reservation); + return new WorkplaceScheduleDto( + w.Id, + w.Name, + w.Location, + IsAvailable: !hasReservation, + ReservedBy: hasReservation ? reservation!.EmployeeName : null); + }).ToList(); + + return Result.Success>(schedule); + } +} diff --git a/src/backend/src/Randall.Application/Workplaces/GetWorkplaceSchedule/WorkplaceScheduleDto.cs b/src/backend/src/Randall.Application/Workplaces/GetWorkplaceSchedule/WorkplaceScheduleDto.cs new file mode 100644 index 0000000..aa93e80 --- /dev/null +++ b/src/backend/src/Randall.Application/Workplaces/GetWorkplaceSchedule/WorkplaceScheduleDto.cs @@ -0,0 +1,8 @@ +namespace Randall.Application.Workplaces.GetWorkplaceSchedule; + +public record WorkplaceScheduleDto( + Guid Id, + string Name, + string Location, + bool IsAvailable, + string? ReservedBy); diff --git a/src/backend/src/Randall.Domain/Common/Entity.cs b/src/backend/src/Randall.Domain/Common/Entity.cs new file mode 100644 index 0000000..33788bd --- /dev/null +++ b/src/backend/src/Randall.Domain/Common/Entity.cs @@ -0,0 +1,9 @@ +namespace Randall.Domain.Common; + +public abstract class Entity +{ + public Guid Id { get; protected set; } + + protected Entity() => Id = Guid.NewGuid(); + protected Entity(Guid id) => Id = id; +} diff --git a/src/backend/src/Randall.Domain/Common/Result.cs b/src/backend/src/Randall.Domain/Common/Result.cs new file mode 100644 index 0000000..f16a741 --- /dev/null +++ b/src/backend/src/Randall.Domain/Common/Result.cs @@ -0,0 +1,33 @@ +namespace Randall.Domain.Common; + +public class Result +{ + public bool IsSuccess { get; } + public string? Error { get; } + + protected Result(bool isSuccess, string? error) + { + IsSuccess = isSuccess; + Error = error; + } + + public static Result Success() => new(true, null); + public static Result Failure(string error) => new(false, error); + + public static Result Success(T value) => Result.Ok(value); + public static Result Failure(string error) => Result.Fail(error); +} + +public class Result : Result +{ + public T? Value { get; } + + private Result(bool isSuccess, T? value, string? error) + : base(isSuccess, error) + { + Value = value; + } + + public static Result Ok(T value) => new(true, value, null); + public static Result Fail(string error) => new(false, default, error); +} diff --git a/src/backend/src/Randall.Domain/Randall.Domain.csproj b/src/backend/src/Randall.Domain/Randall.Domain.csproj new file mode 100644 index 0000000..b760144 --- /dev/null +++ b/src/backend/src/Randall.Domain/Randall.Domain.csproj @@ -0,0 +1,9 @@ + + + + net10.0 + enable + enable + + + diff --git a/src/backend/src/Randall.Domain/Reservations/IReservationRepository.cs b/src/backend/src/Randall.Domain/Reservations/IReservationRepository.cs new file mode 100644 index 0000000..29d4592 --- /dev/null +++ b/src/backend/src/Randall.Domain/Reservations/IReservationRepository.cs @@ -0,0 +1,13 @@ +namespace Randall.Domain.Reservations; + +public interface IReservationRepository +{ + Task GetByIdAsync(Guid id, CancellationToken ct = default); + Task> GetByEmployeeAsync(string employeeEmail, CancellationToken ct = default); + Task> GetByWorkplaceAndDateAsync(Guid workplaceId, DateOnly date, CancellationToken ct = default); + Task> GetActiveReservationsForDateAsync(DateOnly date, CancellationToken ct = default); + Task ExistsActiveForEmployeeOnDateAsync(string employeeEmail, DateOnly date, CancellationToken ct = default); + Task ExistsActiveForWorkplaceOnDateAsync(Guid workplaceId, DateOnly date, CancellationToken ct = default); + Task AddAsync(Reservation reservation, CancellationToken ct = default); + Task SaveChangesAsync(CancellationToken ct = default); +} diff --git a/src/backend/src/Randall.Domain/Reservations/Reservation.cs b/src/backend/src/Randall.Domain/Reservations/Reservation.cs new file mode 100644 index 0000000..421a48d --- /dev/null +++ b/src/backend/src/Randall.Domain/Reservations/Reservation.cs @@ -0,0 +1,58 @@ +using Randall.Domain.Common; + +namespace Randall.Domain.Reservations; + +public class Reservation : Entity +{ + public static readonly int MaxAdvanceDays = 14; + + public Guid WorkplaceId { get; private set; } + public string EmployeeEmail { get; private set; } + public string EmployeeName { get; private set; } + public DateOnly Date { get; private set; } + public ReservationStatus Status { get; private set; } + public DateTime CreatedAt { get; private set; } + + // EF Core constructor + private Reservation() : base() + { + EmployeeEmail = string.Empty; + EmployeeName = string.Empty; + } + + private Reservation(Guid workplaceId, string employeeEmail, string employeeName, DateOnly date) + : base() + { + WorkplaceId = workplaceId; + EmployeeEmail = employeeEmail; + EmployeeName = employeeName; + Date = date; + Status = ReservationStatus.Active; + CreatedAt = DateTime.UtcNow; + } + + public static Result Create( + Guid workplaceId, + string employeeEmail, + string employeeName, + DateOnly date, + DateOnly today) + { + if (date < today) + return Result.Failure("Cannot reserve a workplace in the past."); + + if (date > today.AddDays(MaxAdvanceDays)) + return Result.Failure($"Cannot reserve more than {MaxAdvanceDays} days in advance."); + + return Result.Success(new Reservation(workplaceId, employeeEmail, employeeName, date)); + } + + public Result Cancel() + { + if (Status == ReservationStatus.Cancelled) + return Result.Failure("Reservation is already cancelled."); + + Status = ReservationStatus.Cancelled; + return Result.Success(); + } +} diff --git a/src/backend/src/Randall.Domain/Reservations/ReservationStatus.cs b/src/backend/src/Randall.Domain/Reservations/ReservationStatus.cs new file mode 100644 index 0000000..6889eb2 --- /dev/null +++ b/src/backend/src/Randall.Domain/Reservations/ReservationStatus.cs @@ -0,0 +1,7 @@ +namespace Randall.Domain.Reservations; + +public enum ReservationStatus +{ + Active, + Cancelled +} diff --git a/src/backend/src/Randall.Domain/Users/IUserRepository.cs b/src/backend/src/Randall.Domain/Users/IUserRepository.cs new file mode 100644 index 0000000..7551f0e --- /dev/null +++ b/src/backend/src/Randall.Domain/Users/IUserRepository.cs @@ -0,0 +1,14 @@ +namespace Randall.Domain.Users; + +public interface IUserRepository +{ + Task GetByEmailAsync(string email, CancellationToken ct = default); + Task GetByIdAsync(Guid id, CancellationToken ct = default); + Task ExistsByEmailAsync(string email, CancellationToken ct = default); + Task> GetPendingAsync(CancellationToken ct = default); + Task> GetAllAsync(CancellationToken ct = default); + Task> GetAllNonAdminAsync(CancellationToken ct = default); + Task AddAsync(User user, CancellationToken ct = default); + void Delete(User user); + Task SaveChangesAsync(CancellationToken ct = default); +} diff --git a/src/backend/src/Randall.Domain/Users/User.cs b/src/backend/src/Randall.Domain/Users/User.cs new file mode 100644 index 0000000..abc10ca --- /dev/null +++ b/src/backend/src/Randall.Domain/Users/User.cs @@ -0,0 +1,47 @@ +using Randall.Domain.Common; + +namespace Randall.Domain.Users; + +public class User : Entity +{ + public string Email { get; private set; } + public string Name { get; private set; } + public string PasswordHash { get; private set; } + public bool IsApproved { get; private set; } + public bool IsAdmin { get; private set; } + + private User() : base() + { + Email = string.Empty; + Name = string.Empty; + PasswordHash = string.Empty; + } + + private User(string email, string name, string passwordHash, bool isAdmin) : base() + { + Email = email; + Name = name; + PasswordHash = passwordHash; + IsAdmin = isAdmin; + IsApproved = isAdmin; // admins are auto-approved + } + + public static Result Create(string email, string name, string passwordHash, bool isAdmin = false) + { + if (string.IsNullOrWhiteSpace(email)) + return Result.Failure("Email is required."); + + if (string.IsNullOrWhiteSpace(name)) + return Result.Failure("Name is required."); + + return Result.Success(new User(email.ToLowerInvariant(), name.Trim(), passwordHash, isAdmin)); + } + + public void Approve() => IsApproved = true; + + public void MakeAdmin() + { + IsAdmin = true; + IsApproved = true; + } +} diff --git a/src/backend/src/Randall.Domain/Workplaces/IWorkplaceRepository.cs b/src/backend/src/Randall.Domain/Workplaces/IWorkplaceRepository.cs new file mode 100644 index 0000000..75fe9b4 --- /dev/null +++ b/src/backend/src/Randall.Domain/Workplaces/IWorkplaceRepository.cs @@ -0,0 +1,7 @@ +namespace Randall.Domain.Workplaces; + +public interface IWorkplaceRepository +{ + Task GetByIdAsync(Guid id, CancellationToken ct = default); + Task> GetAllActiveAsync(CancellationToken ct = default); +} diff --git a/src/backend/src/Randall.Domain/Workplaces/Workplace.cs b/src/backend/src/Randall.Domain/Workplaces/Workplace.cs new file mode 100644 index 0000000..fd47377 --- /dev/null +++ b/src/backend/src/Randall.Domain/Workplaces/Workplace.cs @@ -0,0 +1,26 @@ +using Randall.Domain.Common; + +namespace Randall.Domain.Workplaces; + +public class Workplace : Entity +{ + public string Name { get; private set; } + public string Location { get; private set; } + public bool IsActive { get; private set; } + + private Workplace() : base() + { + Name = string.Empty; + Location = string.Empty; + } + + public Workplace(string name, string location) : base() + { + Name = name; + Location = location; + IsActive = true; + } + + public void Deactivate() => IsActive = false; + public void Activate() => IsActive = true; +} diff --git a/src/backend/src/Randall.Infrastructure/DependencyInjection.cs b/src/backend/src/Randall.Infrastructure/DependencyInjection.cs new file mode 100644 index 0000000..f94b823 --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/DependencyInjection.cs @@ -0,0 +1,34 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Randall.Application.Common; +using Randall.Domain.Reservations; +using Randall.Domain.Users; +using Randall.Domain.Workplaces; +using Randall.Infrastructure.Persistence; +using Randall.Infrastructure.Persistence.Reservations; +using Randall.Infrastructure.Persistence.Users; +using Randall.Infrastructure.Persistence.Workplaces; +using Randall.Infrastructure.Security; + +namespace Randall.Infrastructure; + +public static class DependencyInjection +{ + public static IServiceCollection AddInfrastructure( + this IServiceCollection services, + IConfiguration configuration) + { + services.AddDbContext(options => + options.UseSqlite(configuration.GetConnectionString("DefaultConnection"))); + + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + + services.AddSingleton(); + services.AddSingleton(); + + return services; + } +} diff --git a/src/backend/src/Randall.Infrastructure/Migrations/20260321184811_InitialCreate.Designer.cs b/src/backend/src/Randall.Infrastructure/Migrations/20260321184811_InitialCreate.Designer.cs new file mode 100644 index 0000000..974edba --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Migrations/20260321184811_InitialCreate.Designer.cs @@ -0,0 +1,86 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Randall.Infrastructure.Persistence; + +#nullable disable + +namespace Randall.Infrastructure.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20260321184811_InitialCreate")] + partial class InitialCreate + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.5"); + + modelBuilder.Entity("Randall.Domain.Reservations.Reservation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("Date") + .HasColumnType("TEXT"); + + b.Property("EmployeeEmail") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("EmployeeName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("WorkplaceId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeEmail", "Date"); + + b.HasIndex("WorkplaceId", "Date"); + + b.ToTable("Reservations"); + }); + + modelBuilder.Entity("Randall.Domain.Workplaces.Workplace", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("IsActive") + .HasColumnType("INTEGER"); + + b.Property("Location") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Workplaces"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/backend/src/Randall.Infrastructure/Migrations/20260321184811_InitialCreate.cs b/src/backend/src/Randall.Infrastructure/Migrations/20260321184811_InitialCreate.cs new file mode 100644 index 0000000..c9bc16d --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Migrations/20260321184811_InitialCreate.cs @@ -0,0 +1,66 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Randall.Infrastructure.Migrations +{ + /// + public partial class InitialCreate : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Reservations", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + WorkplaceId = table.Column(type: "TEXT", nullable: false), + EmployeeEmail = table.Column(type: "TEXT", maxLength: 200, nullable: false), + EmployeeName = table.Column(type: "TEXT", maxLength: 200, nullable: false), + Date = table.Column(type: "TEXT", nullable: false), + Status = table.Column(type: "INTEGER", nullable: false), + CreatedAt = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Reservations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Workplaces", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + Name = table.Column(type: "TEXT", maxLength: 100, nullable: false), + Location = table.Column(type: "TEXT", maxLength: 200, nullable: false), + IsActive = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Workplaces", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_Reservations_EmployeeEmail_Date", + table: "Reservations", + columns: new[] { "EmployeeEmail", "Date" }); + + migrationBuilder.CreateIndex( + name: "IX_Reservations_WorkplaceId_Date", + table: "Reservations", + columns: new[] { "WorkplaceId", "Date" }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Reservations"); + + migrationBuilder.DropTable( + name: "Workplaces"); + } + } +} diff --git a/src/backend/src/Randall.Infrastructure/Migrations/20260321191704_AddUsers.Designer.cs b/src/backend/src/Randall.Infrastructure/Migrations/20260321191704_AddUsers.Designer.cs new file mode 100644 index 0000000..7c25d59 --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Migrations/20260321191704_AddUsers.Designer.cs @@ -0,0 +1,114 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Randall.Infrastructure.Persistence; + +#nullable disable + +namespace Randall.Infrastructure.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20260321191704_AddUsers")] + partial class AddUsers + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.5"); + + modelBuilder.Entity("Randall.Domain.Reservations.Reservation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("Date") + .HasColumnType("TEXT"); + + b.Property("EmployeeEmail") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("EmployeeName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("WorkplaceId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeEmail", "Date"); + + b.HasIndex("WorkplaceId", "Date"); + + b.ToTable("Reservations"); + }); + + modelBuilder.Entity("Randall.Domain.Users.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("Email") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("Randall.Domain.Workplaces.Workplace", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("IsActive") + .HasColumnType("INTEGER"); + + b.Property("Location") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Workplaces"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/backend/src/Randall.Infrastructure/Migrations/20260321191704_AddUsers.cs b/src/backend/src/Randall.Infrastructure/Migrations/20260321191704_AddUsers.cs new file mode 100644 index 0000000..13a1034 --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Migrations/20260321191704_AddUsers.cs @@ -0,0 +1,42 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Randall.Infrastructure.Migrations +{ + /// + public partial class AddUsers : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(type: "TEXT", nullable: false), + Email = table.Column(type: "TEXT", maxLength: 200, nullable: false), + Name = table.Column(type: "TEXT", maxLength: 200, nullable: false), + PasswordHash = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_Users_Email", + table: "Users", + column: "Email", + unique: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Users"); + } + } +} diff --git a/src/backend/src/Randall.Infrastructure/Migrations/20260323120000_AddUserApproval.Designer.cs b/src/backend/src/Randall.Infrastructure/Migrations/20260323120000_AddUserApproval.Designer.cs new file mode 100644 index 0000000..307dc5e --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Migrations/20260323120000_AddUserApproval.Designer.cs @@ -0,0 +1,120 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Randall.Infrastructure.Persistence; + +#nullable disable + +namespace Randall.Infrastructure.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20260323120000_AddUserApproval")] + partial class AddUserApproval + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.5"); + + modelBuilder.Entity("Randall.Domain.Reservations.Reservation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("Date") + .HasColumnType("TEXT"); + + b.Property("EmployeeEmail") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("EmployeeName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("WorkplaceId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeEmail", "Date"); + + b.HasIndex("WorkplaceId", "Date"); + + b.ToTable("Reservations"); + }); + + modelBuilder.Entity("Randall.Domain.Users.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("IsAdmin") + .HasColumnType("INTEGER"); + + b.Property("IsApproved") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("Email") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("Randall.Domain.Workplaces.Workplace", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("IsActive") + .HasColumnType("INTEGER"); + + b.Property("Location") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Workplaces"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/backend/src/Randall.Infrastructure/Migrations/20260323120000_AddUserApproval.cs b/src/backend/src/Randall.Infrastructure/Migrations/20260323120000_AddUserApproval.cs new file mode 100644 index 0000000..dfffe29 --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Migrations/20260323120000_AddUserApproval.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Randall.Infrastructure.Migrations +{ + /// + public partial class AddUserApproval : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "IsAdmin", + table: "Users", + type: "INTEGER", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "IsApproved", + table: "Users", + type: "INTEGER", + nullable: false, + defaultValue: false); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn(name: "IsAdmin", table: "Users"); + migrationBuilder.DropColumn(name: "IsApproved", table: "Users"); + } + } +} diff --git a/src/backend/src/Randall.Infrastructure/Migrations/AppDbContextModelSnapshot.cs b/src/backend/src/Randall.Infrastructure/Migrations/AppDbContextModelSnapshot.cs new file mode 100644 index 0000000..5efe56b --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Migrations/AppDbContextModelSnapshot.cs @@ -0,0 +1,117 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Randall.Infrastructure.Persistence; + +#nullable disable + +namespace Randall.Infrastructure.Migrations +{ + [DbContext(typeof(AppDbContext))] + partial class AppDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.5"); + + modelBuilder.Entity("Randall.Domain.Reservations.Reservation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("Date") + .HasColumnType("TEXT"); + + b.Property("EmployeeEmail") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("EmployeeName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("WorkplaceId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeEmail", "Date"); + + b.HasIndex("WorkplaceId", "Date"); + + b.ToTable("Reservations"); + }); + + modelBuilder.Entity("Randall.Domain.Users.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("IsAdmin") + .HasColumnType("INTEGER"); + + b.Property("IsApproved") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("Email") + .IsUnique(); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("Randall.Domain.Workplaces.Workplace", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("IsActive") + .HasColumnType("INTEGER"); + + b.Property("Location") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Workplaces"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/backend/src/Randall.Infrastructure/Persistence/AppDbContext.cs b/src/backend/src/Randall.Infrastructure/Persistence/AppDbContext.cs new file mode 100644 index 0000000..3d5c9f0 --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Persistence/AppDbContext.cs @@ -0,0 +1,49 @@ +using Microsoft.EntityFrameworkCore; +using Randall.Domain.Reservations; +using Randall.Domain.Users; +using Randall.Domain.Workplaces; + +namespace Randall.Infrastructure.Persistence; + +public class AppDbContext(DbContextOptions options) : DbContext(options) +{ + public DbSet Workplaces => Set(); + public DbSet Reservations => Set(); + public DbSet Users => Set(); + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.HasKey(w => w.Id); + entity.Property(w => w.Name).IsRequired().HasMaxLength(100); + entity.Property(w => w.Location).IsRequired().HasMaxLength(200); + entity.Property(w => w.IsActive).IsRequired(); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(r => r.Id); + entity.Property(r => r.WorkplaceId).IsRequired(); + entity.Property(r => r.EmployeeEmail).IsRequired().HasMaxLength(200); + entity.Property(r => r.EmployeeName).IsRequired().HasMaxLength(200); + entity.Property(r => r.Date).IsRequired(); + entity.Property(r => r.Status).IsRequired(); + entity.Property(r => r.CreatedAt).IsRequired(); + + entity.HasIndex(r => new { r.WorkplaceId, r.Date }); + entity.HasIndex(r => new { r.EmployeeEmail, r.Date }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(u => u.Id); + entity.Property(u => u.Email).IsRequired().HasMaxLength(200); + entity.Property(u => u.Name).IsRequired().HasMaxLength(200); + entity.Property(u => u.PasswordHash).IsRequired(); + entity.Property(u => u.IsApproved).IsRequired(); + entity.Property(u => u.IsAdmin).IsRequired(); + entity.HasIndex(u => u.Email).IsUnique(); + }); + } +} diff --git a/src/backend/src/Randall.Infrastructure/Persistence/Reservations/ReservationRepository.cs b/src/backend/src/Randall.Infrastructure/Persistence/Reservations/ReservationRepository.cs new file mode 100644 index 0000000..4369d2d --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Persistence/Reservations/ReservationRepository.cs @@ -0,0 +1,49 @@ +using Microsoft.EntityFrameworkCore; +using Randall.Domain.Reservations; + +namespace Randall.Infrastructure.Persistence.Reservations; + +public class ReservationRepository(AppDbContext context) : IReservationRepository +{ + public Task GetByIdAsync(Guid id, CancellationToken ct = default) => + context.Reservations.FirstOrDefaultAsync(r => r.Id == id, ct); + + public async Task> GetByEmployeeAsync(string employeeEmail, CancellationToken ct = default) => + await context.Reservations + .Where(r => r.EmployeeEmail.ToLower() == employeeEmail.ToLower()) + .ToListAsync(ct); + + public async Task> GetByWorkplaceAndDateAsync( + Guid workplaceId, DateOnly date, CancellationToken ct = default) => + await context.Reservations + .Where(r => r.WorkplaceId == workplaceId && r.Date == date) + .ToListAsync(ct); + + public Task ExistsActiveForEmployeeOnDateAsync( + string employeeEmail, DateOnly date, CancellationToken ct = default) => + context.Reservations.AnyAsync( + r => r.EmployeeEmail.ToLower() == employeeEmail.ToLower() + && r.Date == date + && r.Status == ReservationStatus.Active, + ct); + + public Task ExistsActiveForWorkplaceOnDateAsync( + Guid workplaceId, DateOnly date, CancellationToken ct = default) => + context.Reservations.AnyAsync( + r => r.WorkplaceId == workplaceId + && r.Date == date + && r.Status == ReservationStatus.Active, + ct); + + public async Task> GetActiveReservationsForDateAsync( + DateOnly date, CancellationToken ct = default) => + await context.Reservations + .Where(r => r.Date == date && r.Status == ReservationStatus.Active) + .ToListAsync(ct); + + public async Task AddAsync(Reservation reservation, CancellationToken ct = default) => + await context.Reservations.AddAsync(reservation, ct); + + public Task SaveChangesAsync(CancellationToken ct = default) => + context.SaveChangesAsync(ct); +} diff --git a/src/backend/src/Randall.Infrastructure/Persistence/Seeding/DatabaseSeeder.cs b/src/backend/src/Randall.Infrastructure/Persistence/Seeding/DatabaseSeeder.cs new file mode 100644 index 0000000..0c17dde --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Persistence/Seeding/DatabaseSeeder.cs @@ -0,0 +1,50 @@ +using Microsoft.EntityFrameworkCore; +using Randall.Application.Common; +using Randall.Domain.Users; +using Randall.Domain.Workplaces; + +namespace Randall.Infrastructure.Persistence.Seeding; + +public static class DatabaseSeeder +{ + private static readonly (string Name, string Location)[] ExpectedWorkplaces = + [ + ("D13", "Pod A"), ("D14", "Pod A"), ("D15", "Pod A"), ("D16", "Pod A"), + ("D9", "Pod A"), ("D10", "Pod A"), ("D11", "Pod A"), ("D12", "Pod A"), + ("D5", "Pod B"), ("D6", "Pod B"), ("D7", "Pod B"), ("D8", "Pod B"), + ("D1", "Pod B"), ("D2", "Pod B"), ("D3", "Pod B"), ("D4", "Pod B"), + ]; + + private const string AdminEmail = "admin@randall.local"; + private const string AdminPassword = "Admin@123"; + + public static async Task SeedAsync(AppDbContext context, IPasswordHasher passwordHasher) + { + await context.Database.MigrateAsync(); + + // Seed workplaces + var existing = await context.Workplaces.ToListAsync(); + var expectedSet = ExpectedWorkplaces.Select(w => w.Name + w.Location).ToHashSet(); + var existingSet = existing.Select(w => w.Name + w.Location).ToHashSet(); + + if (!expectedSet.SetEquals(existingSet)) + { + context.Workplaces.RemoveRange(existing); + await context.SaveChangesAsync(); + + var workplaces = ExpectedWorkplaces.Select(w => new Workplace(w.Name, w.Location)); + context.Workplaces.AddRange(workplaces); + await context.SaveChangesAsync(); + } + + // Seed admin user + var adminExists = await context.Users.AnyAsync(u => u.Email == AdminEmail); + if (!adminExists) + { + var hash = passwordHasher.Hash(AdminPassword); + var admin = User.Create(AdminEmail, "Admin", hash, isAdmin: true).Value!; + context.Users.Add(admin); + await context.SaveChangesAsync(); + } + } +} diff --git a/src/backend/src/Randall.Infrastructure/Persistence/Users/UserRepository.cs b/src/backend/src/Randall.Infrastructure/Persistence/Users/UserRepository.cs new file mode 100644 index 0000000..de47d8a --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Persistence/Users/UserRepository.cs @@ -0,0 +1,34 @@ +using Microsoft.EntityFrameworkCore; +using Randall.Domain.Users; + +namespace Randall.Infrastructure.Persistence.Users; + +public class UserRepository(AppDbContext context) : IUserRepository +{ + public Task GetByEmailAsync(string email, CancellationToken ct = default) => + context.Users.FirstOrDefaultAsync(u => u.Email == email.ToLowerInvariant(), ct); + + public Task GetByIdAsync(Guid id, CancellationToken ct = default) => + context.Users.FirstOrDefaultAsync(u => u.Id == id, ct); + + public Task ExistsByEmailAsync(string email, CancellationToken ct = default) => + context.Users.AnyAsync(u => u.Email == email.ToLowerInvariant(), ct); + + public Task> GetPendingAsync(CancellationToken ct = default) => + context.Users.Where(u => !u.IsApproved && !u.IsAdmin).ToListAsync(ct); + + public Task> GetAllAsync(CancellationToken ct = default) => + context.Users.OrderBy(u => u.Name).ToListAsync(ct); + + public Task> GetAllNonAdminAsync(CancellationToken ct = default) => + context.Users.Where(u => !u.IsAdmin).OrderBy(u => u.Name).ToListAsync(ct); + + public async Task AddAsync(User user, CancellationToken ct = default) => + await context.Users.AddAsync(user, ct); + + public void Delete(User user) => + context.Users.Remove(user); + + public Task SaveChangesAsync(CancellationToken ct = default) => + context.SaveChangesAsync(ct); +} diff --git a/src/backend/src/Randall.Infrastructure/Persistence/Workplaces/WorkplaceRepository.cs b/src/backend/src/Randall.Infrastructure/Persistence/Workplaces/WorkplaceRepository.cs new file mode 100644 index 0000000..9a69c07 --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Persistence/Workplaces/WorkplaceRepository.cs @@ -0,0 +1,13 @@ +using Microsoft.EntityFrameworkCore; +using Randall.Domain.Workplaces; + +namespace Randall.Infrastructure.Persistence.Workplaces; + +public class WorkplaceRepository(AppDbContext context) : IWorkplaceRepository +{ + public Task GetByIdAsync(Guid id, CancellationToken ct = default) => + context.Workplaces.FirstOrDefaultAsync(w => w.Id == id, ct); + + public async Task> GetAllActiveAsync(CancellationToken ct = default) => + await context.Workplaces.Where(w => w.IsActive).ToListAsync(ct); +} diff --git a/src/backend/src/Randall.Infrastructure/Randall.Infrastructure.csproj b/src/backend/src/Randall.Infrastructure/Randall.Infrastructure.csproj new file mode 100644 index 0000000..78f3361 --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Randall.Infrastructure.csproj @@ -0,0 +1,23 @@ + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + net10.0 + enable + enable + + + diff --git a/src/backend/src/Randall.Infrastructure/Security/JwtTokenService.cs b/src/backend/src/Randall.Infrastructure/Security/JwtTokenService.cs new file mode 100644 index 0000000..b02a756 --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Security/JwtTokenService.cs @@ -0,0 +1,35 @@ +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using System.Text; +using Microsoft.Extensions.Configuration; +using Microsoft.IdentityModel.Tokens; +using Randall.Application.Common; + +namespace Randall.Infrastructure.Security; + +public class JwtTokenService(IConfiguration configuration) : IJwtTokenService +{ + public string GenerateToken(Guid userId, string email, string name, bool isAdmin) + { + var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(configuration["Jwt:Key"]!)); + var credentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); + + var claims = new[] + { + new Claim(JwtRegisteredClaimNames.Sub, userId.ToString()), + new Claim(JwtRegisteredClaimNames.Email, email), + new Claim(JwtRegisteredClaimNames.Name, name), + new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()), + new Claim("isAdmin", isAdmin ? "true" : "false"), + }; + + var token = new JwtSecurityToken( + issuer: configuration["Jwt:Issuer"], + audience: configuration["Jwt:Audience"], + claims: claims, + expires: DateTime.UtcNow.AddDays(7), + signingCredentials: credentials); + + return new JwtSecurityTokenHandler().WriteToken(token); + } +} diff --git a/src/backend/src/Randall.Infrastructure/Security/PasswordHasher.cs b/src/backend/src/Randall.Infrastructure/Security/PasswordHasher.cs new file mode 100644 index 0000000..54f864f --- /dev/null +++ b/src/backend/src/Randall.Infrastructure/Security/PasswordHasher.cs @@ -0,0 +1,29 @@ +using System.Security.Cryptography; +using Randall.Application.Common; + +namespace Randall.Infrastructure.Security; + +public class PasswordHasher : IPasswordHasher +{ + private const int Iterations = 100_000; + private const int HashSize = 32; + private const int SaltSize = 16; + + public string Hash(string password) + { + var salt = RandomNumberGenerator.GetBytes(SaltSize); + var hash = Rfc2898DeriveBytes.Pbkdf2(password, salt, Iterations, HashAlgorithmName.SHA256, HashSize); + return $"{Convert.ToBase64String(salt)}:{Convert.ToBase64String(hash)}"; + } + + public bool Verify(string password, string hashedPassword) + { + var parts = hashedPassword.Split(':'); + if (parts.Length != 2) return false; + + var salt = Convert.FromBase64String(parts[0]); + var storedHash = Convert.FromBase64String(parts[1]); + var hash = Rfc2898DeriveBytes.Pbkdf2(password, salt, Iterations, HashAlgorithmName.SHA256, HashSize); + return CryptographicOperations.FixedTimeEquals(hash, storedHash); + } +} diff --git a/src/frontend/.gitignore b/src/frontend/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/src/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/src/frontend/README.md b/src/frontend/README.md new file mode 100644 index 0000000..7dbf7eb --- /dev/null +++ b/src/frontend/README.md @@ -0,0 +1,73 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) + +## React Compiler + +The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: + +```js +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + + // Remove tseslint.configs.recommended and replace with this + tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + tseslint.configs.stylisticTypeChecked, + + // Other configs... + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` + +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + // Enable lint rules for React + reactX.configs['recommended-typescript'], + // Enable lint rules for React DOM + reactDom.configs.recommended, + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` diff --git a/src/frontend/eslint.config.js b/src/frontend/eslint.config.js new file mode 100644 index 0000000..5e6b472 --- /dev/null +++ b/src/frontend/eslint.config.js @@ -0,0 +1,23 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + tseslint.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + }, +]) diff --git a/src/frontend/index.html b/src/frontend/index.html new file mode 100644 index 0000000..0fca6f0 --- /dev/null +++ b/src/frontend/index.html @@ -0,0 +1,13 @@ + + + + + + + frontend + + +
+ + + diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json new file mode 100644 index 0000000..6546b24 --- /dev/null +++ b/src/frontend/package-lock.json @@ -0,0 +1,3372 @@ +{ + "name": "frontend", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "frontend", + "version": "0.0.0", + "dependencies": { + "react": "^19.2.4", + "react-dom": "^19.2.4", + "react-router-dom": "^7.13.1" + }, + "devDependencies": { + "@eslint/js": "^9.39.4", + "@tailwindcss/vite": "^4.2.2", + "@types/node": "^24.12.0", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "eslint": "^9.39.4", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.5.2", + "globals": "^17.4.0", + "tailwindcss": "^4.2.2", + "typescript": "~5.9.3", + "typescript-eslint": "^8.57.0", + "vite": "^8.0.1" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", + "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", + "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", + "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emnapi/core": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz", + "integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz", + "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz", + "integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.1.tgz", + "integrity": "sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1", + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.120.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.120.0.tgz", + "integrity": "sha512-k1YNu55DuvAip/MGE1FTsIuU3FUCn6v/ujG9V7Nq5Df/kX2CWb13hhwD0lmJGMGqE+bE1MXvv9SZVnMzEXlWcg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.10.tgz", + "integrity": "sha512-jOHxwXhxmFKuXztiu1ORieJeTbx5vrTkcOkkkn2d35726+iwhrY1w/+nYY/AGgF12thg33qC3R1LMBF5tHTZHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.10.tgz", + "integrity": "sha512-gED05Teg/vtTZbIJBc4VNMAxAFDUPkuO/rAIyyxZjTj1a1/s6z5TII/5yMGZ0uLRCifEtwUQn8OlYzuYc0m70w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.10.tgz", + "integrity": "sha512-rI15NcM1mA48lqrIxVkHfAqcyFLcQwyXWThy+BQ5+mkKKPvSO26ir+ZDp36AgYoYVkqvMcdS8zOE6SeBsR9e8A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.10.tgz", + "integrity": "sha512-XZRXHdTa+4ME1MuDVp021+doQ+z6Ei4CCFmNc5/sKbqb8YmkiJdj8QKlV3rCI0AJtAeSB5n0WGPuJWNL9p/L2w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.10.tgz", + "integrity": "sha512-R0SQMRluISSLzFE20sPWYHVmJdDQnRyc/FzSCN72BqQmh2SOZUFG+N3/vBZpR4C6WpEUVYJLrYUXaj43sJsNLA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.10.tgz", + "integrity": "sha512-Y1reMrV/o+cwpduYhJuOE3OMKx32RMYCidf14y+HssARRmhDuWXJ4yVguDg2R/8SyyGNo+auzz64LnPK9Hq6jg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.10.tgz", + "integrity": "sha512-vELN+HNb2IzuzSBUOD4NHmP9yrGwl1DVM29wlQvx1OLSclL0NgVWnVDKl/8tEks79EFek/kebQKnNJkIAA4W2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.10.tgz", + "integrity": "sha512-ZqrufYTgzxbHwpqOjzSsb0UV/aV2TFIY5rP8HdsiPTv/CuAgCRjM6s9cYFwQ4CNH+hf9Y4erHW1GjZuZ7WoI7w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.10.tgz", + "integrity": "sha512-gSlmVS1FZJSRicA6IyjoRoKAFK7IIHBs7xJuHRSmjImqk3mPPWbR7RhbnfH2G6bcmMEllCt2vQ/7u9e6bBnByg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.10.tgz", + "integrity": "sha512-eOCKUpluKgfObT2pHjztnaWEIbUabWzk3qPZ5PuacuPmr4+JtQG4k2vGTY0H15edaTnicgU428XW/IH6AimcQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.10.tgz", + "integrity": "sha512-Xdf2jQbfQowJnLcgYfD/m0Uu0Qj5OdxKallD78/IPPfzaiaI4KRAwZzHcKQ4ig1gtg1SuzC7jovNiM2TzQsBXA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.10.tgz", + "integrity": "sha512-o1hYe8hLi1EY6jgPFyxQgQ1wcycX+qz8eEbVmot2hFkgUzPxy9+kF0u0NIQBeDq+Mko47AkaFFaChcvZa9UX9Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.10.tgz", + "integrity": "sha512-Ugv9o7qYJudqQO5Y5y2N2SOo6S4WiqiNOpuQyoPInnhVzCY+wi/GHltcLHypG9DEUYMB0iTB/huJrpadiAcNcA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.1.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.10.tgz", + "integrity": "sha512-7UODQb4fQUNT/vmgDZBl3XOBAIOutP5R3O/rkxg0aLfEGQ4opbCgU5vOw/scPe4xOqBwL9fw7/RP1vAMZ6QlAQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.10.tgz", + "integrity": "sha512-PYxKHMVHOb5NJuDL53vBUl1VwUjymDcYI6rzpIni0C9+9mTiJedvUxSk7/RPp7OOAm3v+EjgMu9bIy3N6b408w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.7", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.7.tgz", + "integrity": "sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tailwindcss/node": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.2.2.tgz", + "integrity": "sha512-pXS+wJ2gZpVXqFaUEjojq7jzMpTGf8rU6ipJz5ovJV6PUGmlJ+jvIwGrzdHdQ80Sg+wmQxUFuoW1UAAwHNEdFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.19.0", + "jiti": "^2.6.1", + "lightningcss": "1.32.0", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.2.2" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.2.2.tgz", + "integrity": "sha512-qEUA07+E5kehxYp9BVMpq9E8vnJuBHfJEC0vPC5e7iL/hw7HR61aDKoVoKzrG+QKp56vhNZe4qwkRmMC0zDLvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.2.2", + "@tailwindcss/oxide-darwin-arm64": "4.2.2", + "@tailwindcss/oxide-darwin-x64": "4.2.2", + "@tailwindcss/oxide-freebsd-x64": "4.2.2", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.2", + "@tailwindcss/oxide-linux-arm64-gnu": "4.2.2", + "@tailwindcss/oxide-linux-arm64-musl": "4.2.2", + "@tailwindcss/oxide-linux-x64-gnu": "4.2.2", + "@tailwindcss/oxide-linux-x64-musl": "4.2.2", + "@tailwindcss/oxide-wasm32-wasi": "4.2.2", + "@tailwindcss/oxide-win32-arm64-msvc": "4.2.2", + "@tailwindcss/oxide-win32-x64-msvc": "4.2.2" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.2.2.tgz", + "integrity": "sha512-dXGR1n+P3B6748jZO/SvHZq7qBOqqzQ+yFrXpoOWWALWndF9MoSKAT3Q0fYgAzYzGhxNYOoysRvYlpixRBBoDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.2.2.tgz", + "integrity": "sha512-iq9Qjr6knfMpZHj55/37ouZeykwbDqF21gPFtfnhCCKGDcPI/21FKC9XdMO/XyBM7qKORx6UIhGgg6jLl7BZlg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.2.2.tgz", + "integrity": "sha512-BlR+2c3nzc8f2G639LpL89YY4bdcIdUmiOOkv2GQv4/4M0vJlpXEa0JXNHhCHU7VWOKWT/CjqHdTP8aUuDJkuw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.2.2.tgz", + "integrity": "sha512-YUqUgrGMSu2CDO82hzlQ5qSb5xmx3RUrke/QgnoEx7KvmRJHQuZHZmZTLSuuHwFf0DJPybFMXMYf+WJdxHy/nQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.2.2.tgz", + "integrity": "sha512-FPdhvsW6g06T9BWT0qTwiVZYE2WIFo2dY5aCSpjG/S/u1tby+wXoslXS0kl3/KXnULlLr1E3NPRRw0g7t2kgaQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.2.2.tgz", + "integrity": "sha512-4og1V+ftEPXGttOO7eCmW7VICmzzJWgMx+QXAJRAhjrSjumCwWqMfkDrNu1LXEQzNAwz28NCUpucgQPrR4S2yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.2.2.tgz", + "integrity": "sha512-oCfG/mS+/+XRlwNjnsNLVwnMWYH7tn/kYPsNPh+JSOMlnt93mYNCKHYzylRhI51X+TbR+ufNhhKKzm6QkqX8ag==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.2.2.tgz", + "integrity": "sha512-rTAGAkDgqbXHNp/xW0iugLVmX62wOp2PoE39BTCGKjv3Iocf6AFbRP/wZT/kuCxC9QBh9Pu8XPkv/zCZB2mcMg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.2.2.tgz", + "integrity": "sha512-XW3t3qwbIwiSyRCggeO2zxe3KWaEbM0/kW9e8+0XpBgyKU4ATYzcVSMKteZJ1iukJ3HgHBjbg9P5YPRCVUxlnQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.2.2.tgz", + "integrity": "sha512-eKSztKsmEsn1O5lJ4ZAfyn41NfG7vzCg496YiGtMDV86jz1q/irhms5O0VrY6ZwTUkFy/EKG3RfWgxSI3VbZ8Q==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.8.1", + "@emnapi/runtime": "^1.8.1", + "@emnapi/wasi-threads": "^1.1.0", + "@napi-rs/wasm-runtime": "^1.1.1", + "@tybys/wasm-util": "^0.10.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.2.2.tgz", + "integrity": "sha512-qPmaQM4iKu5mxpsrWZMOZRgZv1tOZpUm+zdhhQP0VhJfyGGO3aUKdbh3gDZc/dPLQwW4eSqWGrrcWNBZWUWaXQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.2.2.tgz", + "integrity": "sha512-1T/37VvI7WyH66b+vqHj/cLwnCxt7Qt3WFu5Q8hk65aOvlwAhs7rAp1VkulBJw/N4tMirXjVnylTR72uI0HGcA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.2.2.tgz", + "integrity": "sha512-mEiF5HO1QqCLXoNEfXVA1Tzo+cYsrqV7w9Juj2wdUFyW07JRenqMG225MvPwr3ZD9N1bFQj46X7r33iHxLUW0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.2.2", + "@tailwindcss/oxide": "4.2.2", + "tailwindcss": "4.2.2" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz", + "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.12.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz", + "integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/react": { + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.57.1.tgz", + "integrity": "sha512-Gn3aqnvNl4NGc6x3/Bqk1AOn0thyTU9bqDRhiRnUWezgvr2OnhYCWCgC8zXXRVqBsIL1pSDt7T9nJUe0oM0kDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.57.1", + "@typescript-eslint/type-utils": "8.57.1", + "@typescript-eslint/utils": "8.57.1", + "@typescript-eslint/visitor-keys": "8.57.1", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.57.1", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.57.1.tgz", + "integrity": "sha512-k4eNDan0EIMTT/dUKc/g+rsJ6wcHYhNPdY19VoX/EOtaAG8DLtKCykhrUnuHPYvinn5jhAPgD2Qw9hXBwrahsw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.57.1", + "@typescript-eslint/types": "8.57.1", + "@typescript-eslint/typescript-estree": "8.57.1", + "@typescript-eslint/visitor-keys": "8.57.1", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.57.1.tgz", + "integrity": "sha512-vx1F37BRO1OftsYlmG9xay1TqnjNVlqALymwWVuYTdo18XuKxtBpCj1QlzNIEHlvlB27osvXFWptYiEWsVdYsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.57.1", + "@typescript-eslint/types": "^8.57.1", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.57.1.tgz", + "integrity": "sha512-hs/QcpCwlwT2L5S+3fT6gp0PabyGk4Q0Rv2doJXA0435/OpnSR3VRgvrp8Xdoc3UAYSg9cyUjTeFXZEPg/3OKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.57.1", + "@typescript-eslint/visitor-keys": "8.57.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.57.1.tgz", + "integrity": "sha512-0lgOZB8cl19fHO4eI46YUx2EceQqhgkPSuCGLlGi79L2jwYY1cxeYc1Nae8Aw1xjgW3PKVDLlr3YJ6Bxx8HkWg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.57.1.tgz", + "integrity": "sha512-+Bwwm0ScukFdyoJsh2u6pp4S9ktegF98pYUU0hkphOOqdMB+1sNQhIz8y5E9+4pOioZijrkfNO/HUJVAFFfPKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.57.1", + "@typescript-eslint/typescript-estree": "8.57.1", + "@typescript-eslint/utils": "8.57.1", + "debug": "^4.4.3", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.57.1.tgz", + "integrity": "sha512-S29BOBPJSFUiblEl6RzPPjJt6w25A6XsBqRVDt53tA/tlL8q7ceQNZHTjPeONt/3S7KRI4quk+yP9jK2WjBiPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.57.1.tgz", + "integrity": "sha512-ybe2hS9G6pXpqGtPli9Gx9quNV0TWLOmh58ADlmZe9DguLq0tiAKVjirSbtM1szG6+QH6rVXyU6GTLQbWnMY+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.57.1", + "@typescript-eslint/tsconfig-utils": "8.57.1", + "@typescript-eslint/types": "8.57.1", + "@typescript-eslint/visitor-keys": "8.57.1", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.4.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.57.1.tgz", + "integrity": "sha512-XUNSJ/lEVFttPMMoDVA2r2bwrl8/oPx8cURtczkSEswY5T3AeLmCy+EKWQNdL4u0MmAHOjcWrqJp2cdvgjn8dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.57.1", + "@typescript-eslint/types": "8.57.1", + "@typescript-eslint/typescript-estree": "8.57.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.57.1.tgz", + "integrity": "sha512-YWnmJkXbofiz9KbnbbwuA2rpGkFPLbAIetcCNO6mJ8gdhdZ/v7WDXsoGFAJuM6ikUFKTlSQnjWnVO4ux+UzS6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.57.1", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.1.tgz", + "integrity": "sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-rc.7" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + } + } + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.10", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.10.tgz", + "integrity": "sha512-sUoJ3IMxx4AyRqO4MLeHlnGDkyXRoUG0/AI9fjK+vS72ekpV0yWVY7O0BVjmBcRtkNcsAO2QDZ4tdKKGoI6YaQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001780", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001780.tgz", + "integrity": "sha512-llngX0E7nQci5BPJDqoZSbuZ5Bcs9F5db7EtgfwBerX9XGtkkiO4NwfDDIRzHTTwcYC8vC7bmeUEPGrKlR/TkQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.321", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.321.tgz", + "integrity": "sha512-L2C7Q279W2D/J4PLZLk7sebOILDSWos7bMsMNN06rK482umHUrh/3lM8G7IlHFOYip2oAg5nha1rCMxr/rs6ZQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/enhanced-resolve": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.20.1.tgz", + "integrity": "sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz", + "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react-refresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.5.2.tgz", + "integrity": "sha512-hmgTH57GfzoTFjVN0yBwTggnsVUF2tcqi7RJZHqi9lIezSs4eFyAMktA68YD4r5kNw1mxyY4dmkyoFDb3FIqrA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": "^9 || ^10" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.4.0.tgz", + "integrity": "sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz", + "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.8", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", + "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", + "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz", + "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.4" + } + }, + "node_modules/react-router": { + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.13.1.tgz", + "integrity": "sha512-td+xP4X2/6BJvZoX6xw++A2DdEi++YypA69bJUV5oVvqf6/9/9nNlD70YO1e9d3MyamJEBQFEzk6mbfDYbqrSA==", + "license": "MIT", + "dependencies": { + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/react-router-dom": { + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.13.1.tgz", + "integrity": "sha512-UJnV3Rxc5TgUPJt2KJpo1Jpy0OKQr0AjgbZzBFjaPJcFOb2Y8jA5H3LT8HUJAiRLlWrEXWHbF1Z4SCZaQjWDHw==", + "license": "MIT", + "dependencies": { + "react-router": "7.13.1" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/rolldown": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.10.tgz", + "integrity": "sha512-q7j6vvarRFmKpgJUT8HCAUljkgzEp4LAhPlJUvQhA5LA1SUL36s5QCysMutErzL3EbNOZOkoziSx9iZC4FddKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.120.0", + "@rolldown/pluginutils": "1.0.0-rc.10" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.0-rc.10", + "@rolldown/binding-darwin-arm64": "1.0.0-rc.10", + "@rolldown/binding-darwin-x64": "1.0.0-rc.10", + "@rolldown/binding-freebsd-x64": "1.0.0-rc.10", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.10", + "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.10", + "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.10", + "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.10", + "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.10", + "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.10", + "@rolldown/binding-linux-x64-musl": "1.0.0-rc.10", + "@rolldown/binding-openharmony-arm64": "1.0.0-rc.10", + "@rolldown/binding-wasm32-wasi": "1.0.0-rc.10", + "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.10", + "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.10" + } + }, + "node_modules/rolldown/node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.10.tgz", + "integrity": "sha512-UkVDEFk1w3mveXeKgaTuYfKWtPbvgck1dT8TUG3bnccrH0XtLTuAyfCoks4Q/M5ZGToSVJTIQYCzy2g/atAOeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/set-cookie-parser": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", + "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tailwindcss": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.2.tgz", + "integrity": "sha512-KWBIxs1Xb6NoLdMVqhbhgwZf2PGBpPEiwOqgI4pFIYbNTfBXiKYyWoTsXgBQ9WFg/OlhnvHaY+AEpW7wSmFo2Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.57.1.tgz", + "integrity": "sha512-fLvZWf+cAGw3tqMCYzGIU6yR8K+Y9NT2z23RwOjlNFF2HwSB3KhdEFI5lSBv8tNmFkkBShSjsCjzx1vahZfISA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.57.1", + "@typescript-eslint/parser": "8.57.1", + "@typescript-eslint/typescript-estree": "8.57.1", + "@typescript-eslint/utils": "8.57.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.1.tgz", + "integrity": "sha512-wt+Z2qIhfFt85uiyRt5LPU4oVEJBXj8hZNWKeqFG4gRG/0RaRGJ7njQCwzFVjO+v4+Ipmf5CY7VdmZRAYYBPHw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.8", + "rolldown": "1.0.0-rc.10", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.0", + "esbuild": "^0.27.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} diff --git a/src/frontend/package.json b/src/frontend/package.json new file mode 100644 index 0000000..ea67a30 --- /dev/null +++ b/src/frontend/package.json @@ -0,0 +1,33 @@ +{ + "name": "frontend", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "react": "^19.2.4", + "react-dom": "^19.2.4", + "react-router-dom": "^7.13.1" + }, + "devDependencies": { + "@eslint/js": "^9.39.4", + "@tailwindcss/vite": "^4.2.2", + "@types/node": "^24.12.0", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^6.0.1", + "eslint": "^9.39.4", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.5.2", + "globals": "^17.4.0", + "tailwindcss": "^4.2.2", + "typescript": "~5.9.3", + "typescript-eslint": "^8.57.0", + "vite": "^8.0.1" + } +} diff --git a/src/frontend/public/favicon.svg b/src/frontend/public/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/src/frontend/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/frontend/public/icons.svg b/src/frontend/public/icons.svg new file mode 100644 index 0000000..e952219 --- /dev/null +++ b/src/frontend/public/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/frontend/src/App.css b/src/frontend/src/App.css new file mode 100644 index 0000000..f90339d --- /dev/null +++ b/src/frontend/src/App.css @@ -0,0 +1,184 @@ +.counter { + font-size: 16px; + padding: 5px 10px; + border-radius: 5px; + color: var(--accent); + background: var(--accent-bg); + border: 2px solid transparent; + transition: border-color 0.3s; + margin-bottom: 24px; + + &:hover { + border-color: var(--accent-border); + } + &:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; + } +} + +.hero { + position: relative; + + .base, + .framework, + .vite { + inset-inline: 0; + margin: 0 auto; + } + + .base { + width: 170px; + position: relative; + z-index: 0; + } + + .framework, + .vite { + position: absolute; + } + + .framework { + z-index: 1; + top: 34px; + height: 28px; + transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) + scale(1.4); + } + + .vite { + z-index: 0; + top: 107px; + height: 26px; + width: auto; + transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) + scale(0.8); + } +} + +#center { + display: flex; + flex-direction: column; + gap: 25px; + place-content: center; + place-items: center; + flex-grow: 1; + + @media (max-width: 1024px) { + padding: 32px 20px 24px; + gap: 18px; + } +} + +#next-steps { + display: flex; + border-top: 1px solid var(--border); + text-align: left; + + & > div { + flex: 1 1 0; + padding: 32px; + @media (max-width: 1024px) { + padding: 24px 20px; + } + } + + .icon { + margin-bottom: 16px; + width: 22px; + height: 22px; + } + + @media (max-width: 1024px) { + flex-direction: column; + text-align: center; + } +} + +#docs { + border-right: 1px solid var(--border); + + @media (max-width: 1024px) { + border-right: none; + border-bottom: 1px solid var(--border); + } +} + +#next-steps ul { + list-style: none; + padding: 0; + display: flex; + gap: 8px; + margin: 32px 0 0; + + .logo { + height: 18px; + } + + a { + color: var(--text-h); + font-size: 16px; + border-radius: 6px; + background: var(--social-bg); + display: flex; + padding: 6px 12px; + align-items: center; + gap: 8px; + text-decoration: none; + transition: box-shadow 0.3s; + + &:hover { + box-shadow: var(--shadow); + } + .button-icon { + height: 18px; + width: 18px; + } + } + + @media (max-width: 1024px) { + margin-top: 20px; + flex-wrap: wrap; + justify-content: center; + + li { + flex: 1 1 calc(50% - 8px); + } + + a { + width: 100%; + justify-content: center; + box-sizing: border-box; + } + } +} + +#spacer { + height: 88px; + border-top: 1px solid var(--border); + @media (max-width: 1024px) { + height: 48px; + } +} + +.ticks { + position: relative; + width: 100%; + + &::before, + &::after { + content: ''; + position: absolute; + top: -4.5px; + border: 5px solid transparent; + } + + &::before { + left: 0; + border-left-color: var(--border); + } + &::after { + right: 0; + border-right-color: var(--border); + } +} diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx new file mode 100644 index 0000000..f57043b --- /dev/null +++ b/src/frontend/src/App.tsx @@ -0,0 +1,48 @@ +import { useState } from 'react'; +import { Navigate, Route, Routes } from 'react-router-dom'; +import type { AuthResponse } from './api/types'; +import { AuthPage } from './pages/AuthPage'; +import { AdminPage } from './pages/AdminPage'; +import { PlannerPage } from './pages/PlannerPage'; + +function getStoredAuth(): AuthResponse | null { + const token = localStorage.getItem('token'); + const name = localStorage.getItem('userName'); + const email = localStorage.getItem('userEmail'); + const isAdmin = localStorage.getItem('isAdmin') === 'true'; + if (token && name && email) return { token, name, email, isAdmin }; + return null; +} + +export default function App() { + const [auth, setAuth] = useState(getStoredAuth); + + function handleAuth(authData: AuthResponse) { + localStorage.setItem('token', authData.token); + localStorage.setItem('userName', authData.name); + localStorage.setItem('userEmail', authData.email); + localStorage.setItem('isAdmin', String(authData.isAdmin)); + setAuth(authData); + } + + function handleLogout() { + localStorage.removeItem('token'); + localStorage.removeItem('userName'); + localStorage.removeItem('userEmail'); + localStorage.removeItem('isAdmin'); + setAuth(null); + } + + if (!auth) return ; + + return ( + + } /> + : } + /> + } /> + + ); +} diff --git a/src/frontend/src/api/client.ts b/src/frontend/src/api/client.ts new file mode 100644 index 0000000..17e3504 --- /dev/null +++ b/src/frontend/src/api/client.ts @@ -0,0 +1,116 @@ +import type { AdminUser, AuthResponse, CreateReservationRequest, PendingUser, RegisterPendingResponse, Reservation, WorkplaceScheduleItem } from './types'; + +const BASE = '/api'; + +function getToken(): string | null { + return localStorage.getItem('token'); +} + +function authHeaders(): HeadersInit { + const token = getToken(); + return token ? { Authorization: `Bearer ${token}` } : {}; +} + +async function handleResponse(res: Response): Promise { + if (!res.ok) { + const body = await res.json().catch(() => ({})); + throw new Error(body?.detail ?? `Request failed: ${res.status}`); + } + return res.json() as Promise; +} + +export const api = { + async login(email: string, password: string): Promise { + const res = await fetch(`${BASE}/auth/login`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ email, password }), + }); + return handleResponse(res); + }, + + async register(email: string, name: string, password: string): Promise { + const res = await fetch(`${BASE}/auth/register`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ email, name, password }), + }); + return handleResponse(res); + }, + + getAdminUsers(): Promise { + return fetch(`${BASE}/admin/users`, { + headers: authHeaders(), + }).then(handleResponse); + }, + + getPendingUsers(): Promise { + return fetch(`${BASE}/admin/users/pending`, { + headers: authHeaders(), + }).then(handleResponse); + }, + + async makeAdmin(id: string): Promise { + const res = await fetch(`${BASE}/admin/users/${id}/make-admin`, { + method: 'POST', + headers: authHeaders(), + }); + if (!res.ok) { + const body = await res.json().catch(() => ({})); + throw new Error(body?.detail ?? `Request failed: ${res.status}`); + } + }, + + async approveUser(id: string): Promise { + const res = await fetch(`${BASE}/admin/users/${id}/approve`, { + method: 'POST', + headers: authHeaders(), + }); + if (!res.ok) { + const body = await res.json().catch(() => ({})); + throw new Error(body?.detail ?? `Request failed: ${res.status}`); + } + }, + + async deleteUser(id: string): Promise { + const res = await fetch(`${BASE}/admin/users/${id}`, { + method: 'DELETE', + headers: authHeaders(), + }); + if (!res.ok) { + const body = await res.json().catch(() => ({})); + throw new Error(body?.detail ?? `Request failed: ${res.status}`); + } + }, + + getWorkplaceSchedule(date: string): Promise { + return fetch(`${BASE}/workplaces/schedule?date=${date}`, { + headers: authHeaders(), + }).then(handleResponse); + }, + + createReservation(data: CreateReservationRequest): Promise<{ id: string }> { + return fetch(`${BASE}/reservations`, { + method: 'POST', + headers: { 'Content-Type': 'application/json', ...authHeaders() }, + body: JSON.stringify(data), + }).then(handleResponse<{ id: string }>); + }, + + getMyReservations(): Promise { + return fetch(`${BASE}/reservations/my`, { + headers: authHeaders(), + }).then(handleResponse); + }, + + async cancelReservation(id: string): Promise { + const res = await fetch(`${BASE}/reservations/${id}`, { + method: 'DELETE', + headers: authHeaders(), + }); + if (!res.ok) { + const body = await res.json().catch(() => ({})); + throw new Error(body?.detail ?? `Request failed: ${res.status}`); + } + }, +}; diff --git a/src/frontend/src/api/types.ts b/src/frontend/src/api/types.ts new file mode 100644 index 0000000..c5f9414 --- /dev/null +++ b/src/frontend/src/api/types.ts @@ -0,0 +1,61 @@ +export interface Workplace { + id: string; + name: string; + location: string; +} + +export interface AvailableWorkplace { + id: string; + name: string; + location: string; +} + +export interface Reservation { + id: string; + workplaceId: string; + workplaceName: string; + workplaceLocation: string; + employeeName: string; + employeeEmail: string; + date: string; + status: 'Active' | 'Cancelled'; + createdAt: string; +} + +export interface WorkplaceScheduleItem { + id: string; + name: string; + location: string; + isAvailable: boolean; + reservedBy: string | null; +} + +export interface CreateReservationRequest { + workplaceId: string; + date: string; +} + +export interface AuthResponse { + token: string; + name: string; + email: string; + isAdmin: boolean; +} + +export interface RegisterPendingResponse { + message: string; +} + +export interface PendingUser { + id: string; + name: string; + email: string; +} + +export interface AdminUser { + id: string; + name: string; + email: string; + isApproved: boolean; + isAdmin: boolean; +} diff --git a/src/frontend/src/assets/hero.png b/src/frontend/src/assets/hero.png new file mode 100644 index 0000000..cc51a3d Binary files /dev/null and b/src/frontend/src/assets/hero.png differ diff --git a/src/frontend/src/assets/react.svg b/src/frontend/src/assets/react.svg new file mode 100644 index 0000000..6c87de9 --- /dev/null +++ b/src/frontend/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/frontend/src/assets/vite.svg b/src/frontend/src/assets/vite.svg new file mode 100644 index 0000000..5101b67 --- /dev/null +++ b/src/frontend/src/assets/vite.svg @@ -0,0 +1 @@ +Vite diff --git a/src/frontend/src/components/CancelModal.tsx b/src/frontend/src/components/CancelModal.tsx new file mode 100644 index 0000000..c7f6267 --- /dev/null +++ b/src/frontend/src/components/CancelModal.tsx @@ -0,0 +1,58 @@ +import { useState } from 'react'; + +interface CancelModalProps { + deskName: string; + date: string; + onConfirm: () => Promise; + onClose: () => void; +} + +export function CancelModal({ deskName, date, onConfirm, onClose }: CancelModalProps) { + const [loading, setLoading] = useState(false); + const [error, setError] = useState(''); + + async function handleConfirm() { + setLoading(true); + setError(''); + try { + await onConfirm(); + } catch (err) { + setError(err instanceof Error ? err.message : 'Something went wrong'); + } finally { + setLoading(false); + } + } + + return ( +
+
e.stopPropagation()} + > +

Cancel reservation

+

+ Cancel your booking for {deskName} on{' '} + {date}? +

+ + {error &&

{error}

} + +
+ + +
+
+
+ ); +} diff --git a/src/frontend/src/components/Desk.tsx b/src/frontend/src/components/Desk.tsx new file mode 100644 index 0000000..6482dbe --- /dev/null +++ b/src/frontend/src/components/Desk.tsx @@ -0,0 +1,72 @@ +interface DeskProps { + name: string; + available: boolean; + reserved: boolean; // reserved by the current user + reservedBy?: string; // name of whoever reserved it (when taken by someone else) + rotate?: 'cw' | 'ccw'; + onClick: () => void; +} + +export function Desk({ name, available, reserved, reservedBy, rotate, onClick }: DeskProps) { + let bgColor: string; + let borderColor: string; + let textColor: string; + let deskColor: string; + let cursor: string; + let title: string; + + if (reserved) { + bgColor = 'bg-blue-50'; + borderColor = 'border-blue-400'; + textColor = 'text-blue-700'; + deskColor = '#93c5fd'; + cursor = 'cursor-pointer hover:bg-blue-100'; + title = 'Your reservation — click to cancel'; + } else if (available) { + bgColor = 'bg-emerald-50'; + borderColor = 'border-emerald-400'; + textColor = 'text-emerald-700'; + deskColor = '#6ee7b7'; + cursor = 'cursor-pointer hover:bg-emerald-100 hover:scale-105'; + title = `Reserve ${name}`; + } else { + bgColor = 'bg-slate-50'; + borderColor = 'border-slate-300'; + textColor = 'text-slate-500'; + deskColor = '#cbd5e1'; + cursor = 'cursor-default'; + title = reservedBy ? `Reserved by ${reservedBy}` : `${name} is taken`; + } + + // Truncate long names to fit the tile + const displayName = reservedBy && reservedBy.length > 7 + ? reservedBy.slice(0, 6) + '…' + : reservedBy; + + return ( + + ); +} diff --git a/src/frontend/src/components/DeskPod.tsx b/src/frontend/src/components/DeskPod.tsx new file mode 100644 index 0000000..f6c7bc8 --- /dev/null +++ b/src/frontend/src/components/DeskPod.tsx @@ -0,0 +1,58 @@ +import { Desk } from './Desk'; + +interface ScheduleItem { + id: string; + name: string; + location: string; + isAvailable: boolean; + reservedBy: string | null; +} + +interface DeskPodProps { + desks: ScheduleItem[]; + myReservedIds: Set; + onDeskClick: (desk: ScheduleItem) => void; +} + +export function DeskPod({ desks, myReservedIds, onDeskClick }: DeskPodProps) { + const left = [...desks.slice(0, 4)].reverse(); + const right = [...desks.slice(4, 8)].reverse(); + + return ( +
+
+
+
+ {left.map((desk) => ( + onDeskClick(desk)} + /> + ))} +
+ +
+ +
+ {right.map((desk) => ( + onDeskClick(desk)} + /> + ))} +
+
+
+
+ ); +} diff --git a/src/frontend/src/components/MyReservations.tsx b/src/frontend/src/components/MyReservations.tsx new file mode 100644 index 0000000..5661add --- /dev/null +++ b/src/frontend/src/components/MyReservations.tsx @@ -0,0 +1,40 @@ +import type { Reservation } from '../api/types'; + +interface MyReservationsProps { + reservations: Reservation[]; + onCancel: (reservation: Reservation) => void; +} + +export function MyReservations({ reservations, onCancel }: MyReservationsProps) { + const upcoming = reservations + .filter((r) => r.status === 'Active') + .sort((a, b) => a.date.localeCompare(b.date)); + + if (upcoming.length === 0) { + return ( +

No upcoming reservations.

+ ); + } + + return ( +
    + {upcoming.map((r) => ( +
  • +
    + {r.workplaceName} +
    {r.date}
    +
    + +
  • + ))} +
+ ); +} diff --git a/src/frontend/src/components/ReservationModal.tsx b/src/frontend/src/components/ReservationModal.tsx new file mode 100644 index 0000000..ef1dfe8 --- /dev/null +++ b/src/frontend/src/components/ReservationModal.tsx @@ -0,0 +1,57 @@ +import { useState } from 'react'; + +interface ReservationModalProps { + deskName: string; + date: string; + onConfirm: () => Promise; + onClose: () => void; +} + +export function ReservationModal({ deskName, date, onConfirm, onClose }: ReservationModalProps) { + const [error, setError] = useState(''); + const [loading, setLoading] = useState(false); + + async function handleConfirm() { + setError(''); + setLoading(true); + try { + await onConfirm(); + } catch (err) { + setError(err instanceof Error ? err.message : 'Something went wrong'); + } finally { + setLoading(false); + } + } + + return ( +
+
e.stopPropagation()} + > +

Reserve desk

+

+ {deskName} — {date} +

+ + {error &&

{error}

} + +
+ + +
+
+
+ ); +} diff --git a/src/frontend/src/index.css b/src/frontend/src/index.css new file mode 100644 index 0000000..55a54fa --- /dev/null +++ b/src/frontend/src/index.css @@ -0,0 +1,12 @@ +@import "tailwindcss"; + +*, *::before, *::after { + box-sizing: border-box; +} + +body { + margin: 0; + font-family: system-ui, 'Segoe UI', Roboto, sans-serif; + background-color: #f8fafc; + color: #0f172a; +} diff --git a/src/frontend/src/main.tsx b/src/frontend/src/main.tsx new file mode 100644 index 0000000..ade9d64 --- /dev/null +++ b/src/frontend/src/main.tsx @@ -0,0 +1,13 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import { BrowserRouter } from 'react-router-dom' +import './index.css' +import App from './App.tsx' + +createRoot(document.getElementById('root')!).render( + + + + + , +) diff --git a/src/frontend/src/pages/AdminPage.tsx b/src/frontend/src/pages/AdminPage.tsx new file mode 100644 index 0000000..4e14c8c --- /dev/null +++ b/src/frontend/src/pages/AdminPage.tsx @@ -0,0 +1,212 @@ +import { useEffect, useState } from 'react'; +import { useNavigate } from 'react-router-dom'; +import { api } from '../api/client'; +import type { AdminUser } from '../api/types'; + +export function AdminPage() { + const navigate = useNavigate(); + const [users, setUsers] = useState([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(''); + const [approvingId, setApprovingId] = useState(null); + const [makingAdminId, setMakingAdminId] = useState(null); + const [deletingId, setDeletingId] = useState(null); + const [confirmAdminId, setConfirmAdminId] = useState(null); + const [confirmDeleteId, setConfirmDeleteId] = useState(null); + + async function load() { + setLoading(true); + setError(''); + try { + setUsers(await api.getAdminUsers()); + } catch (err) { + setError(err instanceof Error ? err.message : 'Failed to load users'); + } finally { + setLoading(false); + } + } + + useEffect(() => { load(); }, []); + + async function handleApprove(id: string) { + setApprovingId(id); + try { + await api.approveUser(id); + setUsers((prev) => prev.map((u) => u.id === id ? { ...u, isApproved: true } : u)); + } catch (err) { + setError(err instanceof Error ? err.message : 'Failed to approve user'); + } finally { + setApprovingId(null); + } + } + + async function handleMakeAdmin(id: string) { + setMakingAdminId(id); + try { + await api.makeAdmin(id); + setUsers((prev) => prev.filter((u) => u.id !== id)); + setConfirmAdminId(null); + } catch (err) { + setError(err instanceof Error ? err.message : 'Failed to make user admin'); + } finally { + setMakingAdminId(null); + } + } + + async function handleDelete(id: string) { + setDeletingId(id); + try { + await api.deleteUser(id); + setUsers((prev) => prev.filter((u) => u.id !== id)); + setConfirmDeleteId(null); + } catch (err) { + setError(err instanceof Error ? err.message : 'Failed to delete user'); + } finally { + setDeletingId(null); + } + } + + const pending = users.filter((u) => !u.isApproved); + const approved = users.filter((u) => u.isApproved); + + function UserRow({ user }: { user: AdminUser }) { + const busy = approvingId === user.id || makingAdminId === user.id || deletingId === user.id; + + return ( +
  • +
    +
    +

    {user.name}

    + {user.isAdmin && ( + + Admin + + )} +
    +

    {user.email}

    +
    +
    + {!user.isApproved && ( + + )} + + {!user.isAdmin && confirmAdminId === user.id ? ( + <> + Make admin? + + + + ) : ( + !user.isAdmin && ( + + ) + )} + + {confirmDeleteId === user.id ? ( + <> + Sure? + + + + ) : ( + + )} +
    +
  • + ); + } + + return ( +
    +
    +
    +
    +

    Admin Portal

    +

    Manage user accounts

    +
    + +
    +
    + +
    + {loading &&

    Loading…

    } + {error &&

    {error}

    } + + {!loading && ( + <> +
    +

    + Pending approval +

    + {pending.length === 0 ? ( +

    No pending accounts.

    + ) : ( +
      + {pending.map((u) => )} +
    + )} +
    + +
    +

    + Approved accounts +

    + {approved.length === 0 ? ( +

    No approved accounts yet.

    + ) : ( +
      + {approved.map((u) => )} +
    + )} +
    + + )} +
    +
    + ); +} diff --git a/src/frontend/src/pages/AuthPage.tsx b/src/frontend/src/pages/AuthPage.tsx new file mode 100644 index 0000000..493422b --- /dev/null +++ b/src/frontend/src/pages/AuthPage.tsx @@ -0,0 +1,135 @@ +import { useState } from 'react'; +import { api } from '../api/client'; +import type { AuthResponse } from '../api/types'; + +interface AuthPageProps { + onAuth: (auth: AuthResponse) => void; +} + +export function AuthPage({ onAuth }: AuthPageProps) { + const [mode, setMode] = useState<'login' | 'register' | 'pending'>('login'); + const [email, setEmail] = useState(''); + const [name, setName] = useState(''); + const [password, setPassword] = useState(''); + const [error, setError] = useState(''); + const [loading, setLoading] = useState(false); + + async function handleSubmit(e: { preventDefault: () => void }) { + e.preventDefault(); + setError(''); + setLoading(true); + try { + if (mode === 'login') { + const auth = await api.login(email, password); + onAuth(auth); + } else { + await api.register(email, name, password); + setMode('pending'); + } + } catch (err) { + setError(err instanceof Error ? err.message : 'Something went wrong'); + } finally { + setLoading(false); + } + } + + return ( +
    +
    +
    +

    Office Planner

    +

    Reserve your workspace

    +
    + + {mode === 'pending' && ( +
    +
    +

    Account pending approval

    +

    + Your account has been created. An administrator will review and approve it shortly. +

    + +
    + )} + + {mode !== 'pending' &&
    +
    + + +
    + +
    + {mode === 'register' && ( +
    + + setName(e.target.value)} + placeholder="Jane Smith" + className="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-emerald-400" + /> +
    + )} + +
    + + setEmail(e.target.value)} + placeholder="jane@company.com" + className="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-emerald-400" + /> +
    + +
    + + setPassword(e.target.value)} + placeholder="••••••••" + className="w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-emerald-400" + /> +
    + + {error && ( +

    {error}

    + )} + + +
    +
    } +
    +
    + ); +} diff --git a/src/frontend/src/pages/PlannerPage.tsx b/src/frontend/src/pages/PlannerPage.tsx new file mode 100644 index 0000000..b7f65ef --- /dev/null +++ b/src/frontend/src/pages/PlannerPage.tsx @@ -0,0 +1,202 @@ +import { useEffect, useState, useCallback } from 'react'; +import { useNavigate } from 'react-router-dom'; +import { api } from '../api/client'; +import type { AuthResponse, Reservation, WorkplaceScheduleItem } from '../api/types'; +import { DeskPod } from '../components/DeskPod'; +import { ReservationModal } from '../components/ReservationModal'; +import { CancelModal } from '../components/CancelModal'; +import { MyReservations } from '../components/MyReservations'; + +function toIsoDate(date: Date): string { + const m = String(date.getMonth() + 1).padStart(2, '0'); + const d = String(date.getDate()).padStart(2, '0'); + return `${date.getFullYear()}-${m}-${d}`; +} + +function offsetDate(isoDate: string, days: number): string { + const [y, m, d] = isoDate.split('-').map(Number); + return toIsoDate(new Date(y, m - 1, d + days)); +} + +function formatDisplayDate(isoDate: string): string { + const [y, m, d] = isoDate.split('-').map(Number); + return new Date(y, m - 1, d).toLocaleDateString('en-GB', { + weekday: 'short', day: 'numeric', month: 'short', year: 'numeric', + }); +} + +interface PlannerPageProps { + auth: AuthResponse; + onLogout: () => void; +} + +export function PlannerPage({ auth, onLogout }: PlannerPageProps) { + const navigate = useNavigate(); + + const today = toIsoDate(new Date()); + const maxDate = toIsoDate(new Date(Date.now() + 14 * 24 * 60 * 60 * 1000)); + + const [selectedDate, setSelectedDate] = useState(today); + const [schedule, setSchedule] = useState([]); + const [myReservations, setMyReservations] = useState([]); + const [loadingFloor, setLoadingFloor] = useState(false); + const [floorError, setFloorError] = useState(''); + const [reserveTarget, setReserveTarget] = useState(null); + const [cancelTarget, setCancelTarget] = useState(null); + + const loadSchedule = useCallback(async (date: string) => { + setLoadingFloor(true); + setFloorError(''); + try { + setSchedule(await api.getWorkplaceSchedule(date)); + } catch (err) { + setFloorError(err instanceof Error ? err.message : 'Failed to load floor plan'); + } finally { + setLoadingFloor(false); + } + }, []); + + useEffect(() => { loadSchedule(selectedDate); }, [selectedDate, loadSchedule]); + useEffect(() => { api.getMyReservations().then(setMyReservations).catch(() => {}); }, []); + + const myReservedIdsOnDate = new Set( + myReservations + .filter((r) => r.status === 'Active' && r.date === selectedDate) + .map((r) => r.workplaceId), + ); + + function handleDeskClick(desk: WorkplaceScheduleItem) { + if (myReservedIdsOnDate.has(desk.id)) { + const res = myReservations.find( + (r) => r.workplaceId === desk.id && r.date === selectedDate && r.status === 'Active', + ); + if (res) setCancelTarget(res); + } else if (desk.isAvailable) { + setReserveTarget(desk); + } + } + + async function handleReserve() { + if (!reserveTarget) return; + await api.createReservation({ workplaceId: reserveTarget.id, date: selectedDate }); + setReserveTarget(null); + await Promise.all([loadSchedule(selectedDate), api.getMyReservations().then(setMyReservations)]); + } + + async function handleCancel() { + if (!cancelTarget) return; + await api.cancelReservation(cancelTarget.id); + setCancelTarget(null); + await Promise.all([loadSchedule(selectedDate), api.getMyReservations().then(setMyReservations)]); + } + + const podA = schedule.filter((w) => w.location === 'Pod A'); + const podB = schedule.filter((w) => w.location === 'Pod B'); + + return ( +
    +
    +
    +
    +

    Office Planner

    +

    Reserve your workspace up to 2 weeks ahead

    +
    +
    + {auth.name} + {auth.isAdmin && ( + + )} + +
    +
    +
    + +
    +
    + + + setSelectedDate(e.target.value)} + className="border border-slate-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-emerald-400 bg-white" + /> + + {formatDisplayDate(selectedDate)} +
    + +
    + + + Available — click to reserve + + + + Your reservation — click to cancel + + + + Taken — hover to see who + +
    + +
    + {loadingFloor &&

    Loading floor plan…

    } + {floorError &&

    {floorError}

    } + {!loadingFloor && !floorError && ( +
    + + +
    + )} +
    + +
    +

    My reservations

    + +
    +
    + + {reserveTarget && ( + setReserveTarget(null)} + /> + )} + {cancelTarget && ( + setCancelTarget(null)} + /> + )} +
    + ); +} diff --git a/src/frontend/tsconfig.app.json b/src/frontend/tsconfig.app.json new file mode 100644 index 0000000..af516fc --- /dev/null +++ b/src/frontend/tsconfig.app.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2023", + "useDefineForClassFields": true, + "lib": ["ES2023", "DOM", "DOM.Iterable"], + "module": "ESNext", + "types": ["vite/client"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src"] +} diff --git a/src/frontend/tsconfig.json b/src/frontend/tsconfig.json new file mode 100644 index 0000000..1ffef60 --- /dev/null +++ b/src/frontend/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/src/frontend/tsconfig.node.json b/src/frontend/tsconfig.node.json new file mode 100644 index 0000000..8a67f62 --- /dev/null +++ b/src/frontend/tsconfig.node.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2023", + "lib": ["ES2023"], + "module": "ESNext", + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/src/frontend/vite.config.ts b/src/frontend/vite.config.ts new file mode 100644 index 0000000..d3a9caf --- /dev/null +++ b/src/frontend/vite.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import tailwindcss from '@tailwindcss/vite' + +export default defineConfig({ + plugins: [react(), tailwindcss()], + server: { + proxy: { + '/api': 'http://localhost:5180', + }, + }, +}) diff --git a/tests/e2e/package-lock.json b/tests/e2e/package-lock.json new file mode 100644 index 0000000..9c815d2 --- /dev/null +++ b/tests/e2e/package-lock.json @@ -0,0 +1,96 @@ +{ + "name": "randall-e2e", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "randall-e2e", + "version": "1.0.0", + "devDependencies": { + "@playwright/test": "^1.49.0", + "@types/node": "^22.0.0" + } + }, + "node_modules/@playwright/test": { + "version": "1.58.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.58.2.tgz", + "integrity": "sha512-akea+6bHYBBfA9uQqSYmlJXn61cTa+jbO87xVLCWbTqbWadRVmhxlXATaOjOgcBaWU4ePo0wB41KMFv3o35IXA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.58.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@types/node": { + "version": "22.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.15.tgz", + "integrity": "sha512-F0R/h2+dsy5wJAUe3tAU6oqa2qbWY5TpNfL/RGmo1y38hiyO1w3x2jPtt76wmuaJI4DQnOBu21cNXQ2STIUUWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/playwright": { + "version": "1.58.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.2.tgz", + "integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.58.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.58.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.2.tgz", + "integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/tests/e2e/package.json b/tests/e2e/package.json new file mode 100644 index 0000000..6d26244 --- /dev/null +++ b/tests/e2e/package.json @@ -0,0 +1,15 @@ +{ + "name": "randall-e2e", + "version": "1.0.0", + "private": true, + "scripts": { + "test": "playwright test", + "test:headed": "playwright test --headed", + "test:ui": "playwright test --ui", + "report": "playwright show-report" + }, + "devDependencies": { + "@playwright/test": "^1.49.0", + "@types/node": "^22.0.0" + } +} diff --git a/tests/e2e/playwright.config.ts b/tests/e2e/playwright.config.ts new file mode 100644 index 0000000..2ace249 --- /dev/null +++ b/tests/e2e/playwright.config.ts @@ -0,0 +1,21 @@ +import { defineConfig, devices } from '@playwright/test'; + +export default defineConfig({ + testDir: './tests', + fullyParallel: false, + workers: 1, // tests share database state — never run in parallel + retries: 0, + reporter: [['list'], ['html', { open: 'never' }]], + use: { + baseURL: process.env.BASE_URL ?? 'http://localhost', + trace: 'on-first-retry', + screenshot: 'only-on-failure', + headless: !!process.env.CI, + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}); diff --git a/tests/e2e/tests/admin.spec.ts b/tests/e2e/tests/admin.spec.ts new file mode 100644 index 0000000..11b47f3 --- /dev/null +++ b/tests/e2e/tests/admin.spec.ts @@ -0,0 +1,46 @@ +import { test, expect } from '@playwright/test'; +import { loginAsAdmin } from './helpers'; + +test.describe('Admin portal', () => { + test.beforeEach(async ({ page }) => { + await loginAsAdmin(page); + }); + + test('admin user sees the Admin portal button in the header', async ({ page }) => { + await expect(page.getByRole('button', { name: 'Admin portal' })).toBeVisible(); + }); + + test('navigates to the admin portal', async ({ page }) => { + await page.getByRole('button', { name: 'Admin portal' }).click(); + await page.waitForURL('/admin'); + + await expect(page.getByRole('heading', { name: 'Admin Portal' })).toBeVisible(); + await expect(page.getByText('Manage user accounts')).toBeVisible(); + }); + + test('admin portal lists the admin account under Approved accounts', async ({ page }) => { + await page.goto('/admin'); + + await expect(page.getByText('Approved accounts')).toBeVisible(); + // Target the name paragraph inside the admin's list item + const adminRow = page.locator('li').filter({ hasText: 'admin@randall.local' }); + await expect(adminRow.getByRole('paragraph').filter({ hasText: /^Admin$/ })).toBeVisible(); + }); + + test('admin account has the Admin badge and no Make admin button', async ({ page }) => { + await page.goto('/admin'); + + const adminRow = page.locator('li').filter({ hasText: 'admin@randall.local' }); + // The badge is a with class bg-amber-100 + await expect(adminRow.locator('span').filter({ hasText: /^Admin$/ })).toBeVisible(); + await expect(adminRow.getByRole('button', { name: 'Make admin' })).not.toBeVisible(); + }); + + test('Back to planner link returns to the planner', async ({ page }) => { + await page.goto('/admin'); + await page.getByRole('button', { name: '← Back to planner' }).click(); + + await page.waitForURL('/'); + await expect(page.getByText('Reserve your workspace up to 2 weeks ahead')).toBeVisible(); + }); +}); diff --git a/tests/e2e/tests/auth.spec.ts b/tests/e2e/tests/auth.spec.ts new file mode 100644 index 0000000..f2392bc --- /dev/null +++ b/tests/e2e/tests/auth.spec.ts @@ -0,0 +1,63 @@ +import { test, expect } from '@playwright/test'; +import { ADMIN_EMAIL, ADMIN_PASSWORD } from './helpers'; + +test.describe('Authentication', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/'); + }); + + test('shows the sign-in form on initial load', async ({ page }) => { + await expect(page.getByRole('heading', { name: 'Office Planner' })).toBeVisible(); + await expect(page.getByPlaceholder('jane@company.com')).toBeVisible(); + await expect(page.getByPlaceholder('••••••••')).toBeVisible(); + await expect(page.locator('button[type="submit"]')).toHaveText('Sign in'); + }); + + test('signs in with valid credentials and reaches the planner', async ({ page }) => { + await page.getByPlaceholder('jane@company.com').fill(ADMIN_EMAIL); + await page.getByPlaceholder('••••••••').fill(ADMIN_PASSWORD); + await page.locator('button[type="submit"]').click(); + + await expect(page.getByText('Reserve your workspace up to 2 weeks ahead')).toBeVisible(); + }); + + test('shows an error for an unknown email', async ({ page }) => { + await page.getByPlaceholder('jane@company.com').fill('nobody@example.com'); + await page.getByPlaceholder('••••••••').fill('anything'); + await page.locator('button[type="submit"]').click(); + + await expect(page.getByText(/invalid email or password/i)).toBeVisible(); + }); + + test('shows an error for a wrong password', async ({ page }) => { + await page.getByPlaceholder('jane@company.com').fill(ADMIN_EMAIL); + await page.getByPlaceholder('••••••••').fill('wrongpassword'); + await page.locator('button[type="submit"]').click(); + + await expect(page.getByText(/invalid email or password/i)).toBeVisible(); + }); + + test('registers a new account and shows pending approval message', async ({ page }) => { + // Switch to register mode + await page.locator('button').filter({ hasText: 'Create account' }).first().click(); + + await page.getByPlaceholder('Jane Smith').fill('Test User'); + await page.getByPlaceholder('jane@company.com').fill(`testuser+${Date.now()}@example.com`); + await page.getByPlaceholder('••••••••').fill('Test@1234'); + await page.locator('button[type="submit"]').click(); + + await expect(page.getByText('Account pending approval')).toBeVisible(); + await expect(page.getByText(/administrator will review/i)).toBeVisible(); + }); + + test('signs out and returns to the sign-in form', async ({ page }) => { + await page.getByPlaceholder('jane@company.com').fill(ADMIN_EMAIL); + await page.getByPlaceholder('••••••••').fill(ADMIN_PASSWORD); + await page.locator('button[type="submit"]').click(); + await page.waitForURL('/'); + + await page.getByRole('button', { name: 'Sign out' }).click(); + + await expect(page.locator('button[type="submit"]')).toHaveText('Sign in'); + }); +}); diff --git a/tests/e2e/tests/helpers.ts b/tests/e2e/tests/helpers.ts new file mode 100644 index 0000000..7bed4d7 --- /dev/null +++ b/tests/e2e/tests/helpers.ts @@ -0,0 +1,25 @@ +import { type Page } from '@playwright/test'; + +export const ADMIN_EMAIL = 'admin@randall.local'; +export const ADMIN_PASSWORD = 'Admin@123'; +export const ADMIN_NAME = 'Admin'; + +export async function loginAs(page: Page, email: string, password: string) { + await page.goto('/'); + await page.getByPlaceholder('jane@company.com').fill(email); + await page.getByPlaceholder('••••••••').fill(password); + await page.locator('button[type="submit"]').click(); + await page.waitForURL('/'); + await page.getByText('Reserve your workspace up to 2 weeks ahead').waitFor(); +} + +export async function loginAsAdmin(page: Page) { + await loginAs(page, ADMIN_EMAIL, ADMIN_PASSWORD); +} + +/** Returns today's date offset by `days` in yyyy-MM-dd format */ +export function offsetDate(days: number): string { + const d = new Date(); + d.setDate(d.getDate() + days); + return d.toISOString().split('T')[0]; +} diff --git a/tests/e2e/tests/planner.spec.ts b/tests/e2e/tests/planner.spec.ts new file mode 100644 index 0000000..2438aa7 --- /dev/null +++ b/tests/e2e/tests/planner.spec.ts @@ -0,0 +1,100 @@ +import { test, expect } from '@playwright/test'; +import { loginAsAdmin, offsetDate } from './helpers'; + +test.describe('Planner', () => { + test.beforeEach(async ({ page }) => { + await loginAsAdmin(page); + }); + + test('displays both pods with 8 desks each', async ({ page }) => { + // Wait for floor plan to load — at least one free desk must be visible + await expect(page.getByRole('button', { name: 'D1 Free' })).toBeVisible(); + + // All 16 desk buttons contain a desk label (D1–D16) in their text content + const allDesks = page.getByRole('button').filter({ hasText: /D\d+/ }); + await expect(allDesks).toHaveCount(16); + }); + + test('date picker is constrained to today and 14 days ahead', async ({ page }) => { + const input = page.locator('input[type="date"]'); + const today = offsetDate(0); + const max = offsetDate(14); + + await expect(input).toHaveAttribute('min', today); + await expect(input).toHaveAttribute('max', max); + }); + + test('previous-day button is disabled when on today', async ({ page }) => { + await expect(page.getByRole('button', { name: '←' })).toBeDisabled(); + }); + + test('next-day button is disabled when on the maximum date', async ({ page }) => { + const input = page.locator('input[type="date"]'); + await input.fill(offsetDate(14)); + await input.dispatchEvent('change'); + + await expect(page.getByRole('button', { name: '→' })).toBeDisabled(); + }); + + test('reserves a desk and shows it as Mine', async ({ page }) => { + const targetDate = offsetDate(7); + const input = page.locator('input[type="date"]'); + await input.fill(targetDate); + await input.dispatchEvent('change'); + + await page.getByRole('button', { name: 'D1 Free' }).click(); + await expect(page.getByRole('heading', { name: 'Reserve desk' })).toBeVisible(); + await page.getByRole('button', { name: 'Confirm' }).click(); + + await expect(page.getByRole('button', { name: /^D1\s+Mine/ })).toBeVisible(); + + // Clean up + await page.getByRole('button', { name: /^D1\s+Mine/ }).click(); + await page.getByRole('button', { name: 'Cancel reservation' }).click(); + }); + + test('reserved desk appears in My reservations', async ({ page }) => { + const targetDate = offsetDate(8); + const input = page.locator('input[type="date"]'); + await input.fill(targetDate); + await input.dispatchEvent('change'); + + await page.getByRole('button', { name: 'D2 Free' }).click(); + await page.getByRole('button', { name: 'Confirm' }).click(); + + await expect(page.getByRole('heading', { name: 'My reservations' })).toBeVisible(); + await expect(page.locator('section').filter({ hasText: 'My reservations' }).getByText('D2')).toBeVisible(); + + // Clean up + await page.getByRole('button', { name: /^D2\s+Mine/ }).click(); + await page.getByRole('button', { name: 'Cancel reservation' }).click(); + }); + + test('cancels a reservation and desk returns to Free', async ({ page }) => { + const targetDate = offsetDate(9); + const input = page.locator('input[type="date"]'); + await input.fill(targetDate); + await input.dispatchEvent('change'); + + // Reserve + await page.getByRole('button', { name: 'D3 Free' }).click(); + await page.getByRole('button', { name: 'Confirm' }).click(); + await expect(page.getByRole('button', { name: /^D3\s+Mine/ })).toBeVisible(); + + // Cancel + await page.getByRole('button', { name: /^D3\s+Mine/ }).click(); + await expect(page.getByRole('heading', { name: 'Cancel reservation' })).toBeVisible(); + await page.getByRole('button', { name: 'Cancel reservation' }).click(); + + await expect(page.getByRole('button', { name: 'D3 Free' })).toBeVisible(); + }); + + test('dismisses the reservation modal when clicking Cancel', async ({ page }) => { + await page.getByRole('button', { name: 'D4 Free' }).click(); + await expect(page.getByRole('heading', { name: 'Reserve desk' })).toBeVisible(); + + // Scope to the modal overlay to avoid matching Cancel buttons in My reservations + await page.locator('.fixed.inset-0').getByRole('button', { name: 'Cancel' }).click(); + await expect(page.getByRole('heading', { name: 'Reserve desk' })).not.toBeVisible(); + }); +}); diff --git a/tests/e2e/tsconfig.json b/tests/e2e/tsconfig.json new file mode 100644 index 0000000..4777694 --- /dev/null +++ b/tests/e2e/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "commonjs", + "moduleResolution": "node", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "baseUrl": ".", + "paths": { + "@/*": ["./*"] + } + }, + "include": ["**/*.ts"] +}