commit 3467dbcf03a9b11634cc4eb711b3fa12bd5f01bf Author: DJP Date: Mon Feb 23 20:20:58 2026 -0500 Initial commit — OliVAS visual attention analysis platform Full-stack application for predicting where humans look in images using DeepGaze saliency models. Includes heatmap overlays, gaze sequence prediction, hotspot detection, AOI analysis, rule-based insights, optional Claude AI design analysis, and professional PDF report generation. Co-Authored-By: Claude Opus 4.6 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..ee273ba --- /dev/null +++ b/.env.example @@ -0,0 +1,15 @@ +# Database +DATABASE_URL=postgresql+asyncpg://olivas:olivas@localhost:5453/olivas + +# Storage +UPLOAD_DIR=./data/uploads + +# ML Model +DEVICE=auto # auto | cpu | cuda + +# CORS +CORS_ORIGINS=http://localhost:1577 + +# Server +BACKEND_HOST=0.0.0.0 +BACKEND_PORT=8000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5767390 --- /dev/null +++ b/.gitignore @@ -0,0 +1,47 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.venv/ +*.egg-info/ +dist/ +build/ +*.egg + +# Node +node_modules/ +dist/ +.cache/ + +# Environment +.env +.env.local +.env.*.local + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Data +backend/data/ +backend/uploads/ +*.npy + +# Docker +docker-compose.override.yml + +# Testing +.coverage +htmlcov/ +.pytest_cache/ + +# Build artifacts +*.log diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..e4fba21 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b0d7c38 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 OLIVER + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4b07ef9 --- /dev/null +++ b/Makefile @@ -0,0 +1,58 @@ +.PHONY: setup setup-backend setup-frontend dev dev-backend dev-frontend db-up db-migrate test clean + +# ─── Setup ─────────────────────────────────────────────────────────── +setup: setup-backend setup-frontend + +setup-backend: + cd backend && python3.12 -m venv .venv + cd backend && .venv/bin/pip install --upgrade pip + cd backend && .venv/bin/pip install -e ".[dev]" + cd backend && .venv/bin/pip install "deepgaze-pytorch @ git+https://github.com/matthias-k/DeepGaze.git" + +setup-frontend: + cd frontend && npm install + +# ─── Database ──────────────────────────────────────────────────────── +db-up: + docker compose up -d postgres + +db-migrate: + cd backend && .venv/bin/alembic upgrade head + +db-revision: + cd backend && .venv/bin/alembic revision --autogenerate -m "$(msg)" + +# ─── Development ───────────────────────────────────────────────────── +dev: db-up dev-backend dev-frontend + +dev-backend: + cd backend && .venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload + +dev-frontend: + cd frontend && npm run dev + +# ─── Docker ────────────────────────────────────────────────────────── +docker-up: + docker compose up --build + +docker-down: + docker compose down + +# ─── Testing ───────────────────────────────────────────────────────── +test: + cd backend && .venv/bin/pytest -v + +test-backend: + cd backend && .venv/bin/pytest -v + +# ─── Utilities ─────────────────────────────────────────────────────── +lint: + cd backend && .venv/bin/ruff check app/ tests/ + +lint-fix: + cd backend && .venv/bin/ruff check --fix app/ tests/ + +clean: + find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true + find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true + rm -rf backend/.venv frontend/node_modules diff --git a/README.md b/README.md new file mode 100644 index 0000000..29651d7 --- /dev/null +++ b/README.md @@ -0,0 +1,215 @@ +# OliVAS — Open-Source Visual Attention Software + +**OliVAS** (OLIVER Visual Attention Suite) is an open-source web application that predicts where humans will look in an image during the first 3-5 seconds of viewing. Built for creative teams, designers, and marketers at OLIVER, it provides saliency heatmaps, gaze sequence predictions, hotspot analysis, and actionable design insights — all without needing physical eye-tracking hardware. + +## Features + +- **Saliency Heatmap** — Interactive heatmap overlay showing predicted attention intensity with adjustable opacity and colormap (Jet, Viridis, Inferno, etc.) +- **Gaze Sequence Prediction** — Numbered fixation points showing the predicted order viewers will scan the image +- **Hotspot Detection** — Top 5 attention regions ranked by intensity with bounding boxes +- **Attention Score** — Overall 0-100 concentration score measuring how focused or diffuse the predicted attention is +- **Areas of Interest (AOI)** — Draw rectangles over design elements to measure attention %, area %, and attention density +- **Rule-Based Insights** — Automatic analysis of attention concentration, focal dominance, gaze entry point, spatial balance, edge risk, and drop-off +- **AI Design Analysis** — Optional Claude Sonnet 4.6-powered insights that reference specific visual elements in your design with actionable recommendations +- **PDF Reports** — Professional downloadable reports with Montserrat typography, all visualizations, metrics, and insights (both rule-based and AI) +- **Multi-Model Support** — Choose between DeepGaze I, DeepGaze IIE (recommended), and DeepGaze III +- **Project Organization** — Group analyses into projects for easy management +- **Comparison View** — Side-by-side comparison of two analyses with metrics + +## Tech Stack + +| Layer | Technology | +|-------|-----------| +| **Frontend** | React 18, TypeScript, Vite, Tailwind CSS, Zustand, React Router | +| **Backend** | FastAPI, Python 3.12, SQLAlchemy (async), Pydantic v2 | +| **Database** | PostgreSQL 16 | +| **ML Models** | DeepGaze I / IIE / III via [deepgaze_pytorch](https://github.com/matthias-k/DeepGaze) | +| **AI Insights** | Anthropic Claude Sonnet 4.6 (optional) | +| **PDF Generation** | ReportLab with Montserrat font | +| **Deployment** | Docker Compose | + +## Prerequisites + +- Python 3.12+ +- Node.js 18+ +- Docker & Docker Compose (for PostgreSQL) +- Git + +## Quick Start + +### 1. Clone the repository + +```bash +git clone git@bitbucket.org:zlalani/olivas.git +cd olivas +``` + +### 2. Start PostgreSQL + +```bash +docker compose up -d postgres +``` + +This starts PostgreSQL on port **5453** with database `olivas`. + +### 3. Set up the backend + +```bash +cd backend +python3.12 -m venv .venv +.venv/bin/pip install --upgrade pip +.venv/bin/pip install -e ".[dev]" +.venv/bin/pip install "deepgaze-pytorch @ git+https://github.com/matthias-k/DeepGaze.git" +``` + +### 4. Configure environment (optional) + +Create `backend/.env` for optional settings: + +```env +# Required for AI Design Analysis feature (optional) +ANTHROPIC_API_KEY=sk-ant-your-key-here + +# Defaults (change if needed) +DATABASE_URL=postgresql+asyncpg://olivas:olivas@localhost:5453/olivas +DEVICE=auto +CORS_ORIGINS=http://localhost:1577 +``` + +### 5. Start the backend + +```bash +cd backend +.venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload +``` + +The backend will load all DeepGaze models on startup (this may take 30-60 seconds on first run as model weights are downloaded). + +### 6. Set up and start the frontend + +```bash +cd frontend +npm install +npm run dev +``` + +### 7. Open the app + +Navigate to **http://localhost:1577** in your browser. + +## Using the Makefile + +For convenience, the project includes a Makefile: + +```bash +make setup # Install all backend + frontend dependencies +make dev-backend # Start backend with hot reload +make dev-frontend # Start frontend dev server +make db-up # Start PostgreSQL container +make test # Run backend tests +make lint # Run ruff linter +make lint-fix # Auto-fix linting issues +make clean # Remove caches and virtual environments +``` + +## Docker Compose (Full Stack) + +To run everything in Docker: + +```bash +docker compose up --build +``` + +This starts PostgreSQL, the backend API, and the frontend. Access the app at **http://localhost:1577**. + +## Project Structure + +``` +olivas/ +├── backend/ +│ ├── app/ +│ │ ├── api/endpoints/ # FastAPI route handlers +│ │ ├── db/ # Database session & connection +│ │ ├── models/ # SQLAlchemy ORM models +│ │ ├── schemas/ # Pydantic request/response schemas +│ │ ├── services/ +│ │ │ ├── saliency/ # DeepGaze model manager & inference +│ │ │ ├── ai_insights.py # Claude AI integration +│ │ │ ├── insights.py # Rule-based insights engine +│ │ │ ├── report_generator.py # PDF report generation +│ │ │ ├── heatmap.py # Heatmap overlay generation +│ │ │ ├── gaze_sequence.py # Gaze sequence extraction +│ │ │ ├── image_processing.py # Image resize & upscale +│ │ │ └── storage.py # File storage abstraction +│ │ ├── config.py # App settings (env vars) +│ │ └── main.py # FastAPI app entry point +│ └── pyproject.toml +├── frontend/ +│ ├── src/ +│ │ ├── api/ # Axios API client & endpoints +│ │ ├── components/ +│ │ │ ├── analysis/ # Heatmap, gaze, hotspots, insights +│ │ │ ├── aoi/ # Area of Interest canvas & results +│ │ │ ├── common/ # Button, Card, LoadingSpinner +│ │ │ └── layout/ # Header, Sidebar, AppLayout +│ │ ├── hooks/ # React Query hooks +│ │ ├── pages/ # Dashboard, NewAnalysis, AnalysisView, Help, About +│ │ ├── stores/ # Zustand state management +│ │ └── types/ # TypeScript interfaces +│ └── package.json +├── docker-compose.yml # Production Docker setup +├── docker-compose.dev.yml # Development Docker overrides +├── Makefile # Development shortcuts +└── LICENSE # MIT License +``` + +## Saliency Models + +OliVAS uses the [DeepGaze](https://github.com/matthias-k/DeepGaze) family of saliency prediction models: + +| Model | Architecture | Best For | Reference | +|-------|-------------|----------|-----------| +| **DeepGaze IIE** (recommended) | ResNet + DenseNet ensemble | Best accuracy on benchmarks | [Linardos et al., ICCV 2021](https://arxiv.org/abs/2105.12441) | +| **DeepGaze III** | Transformer-based | Complex layouts with many elements | [Kummerer et al., J. Vision 2022](https://doi.org/10.1167/jov.22.5.7) | +| **DeepGaze I** | AlexNet features | Quick preliminary analysis | [Kummerer et al., ICLR 2015](https://arxiv.org/abs/1411.1045) | + +These models are trained on thousands of real eye-tracking experiments and are among the top-performing models on the [MIT/Tubingen Saliency Benchmark](https://saliency.tuebingen.ai/). + +## AI Design Analysis + +When an Anthropic API key is configured, OliVAS can send the original image and heatmap overlay to **Claude Sonnet 4.6** for context-aware design analysis. The AI references specific visual elements in your design and provides actionable recommendations. + +- Cost per analysis is tracked and displayed (typically $0.01-0.05 per image) +- AI insights are saved to the database and included in PDF reports +- This feature is entirely optional — rule-based insights always work without an API key + +## API Endpoints + +| Method | Endpoint | Description | +|--------|---------|-------------| +| `POST` | `/api/projects` | Create a new project | +| `GET` | `/api/projects` | List all projects | +| `POST` | `/api/projects/{id}/analyses` | Upload image and start analysis | +| `GET` | `/api/analyses/{id}` | Get analysis details + insights | +| `GET` | `/api/analyses/{id}/status` | Poll analysis status | +| `GET` | `/api/analyses/{id}/images/{type}` | Get analysis images | +| `POST` | `/api/analyses/{id}/ai-insights` | Generate AI insights (on-demand) | +| `GET` | `/api/analyses/{id}/report` | Download PDF report | +| `POST` | `/api/analyses/{id}/aois` | Create Areas of Interest | +| `DELETE` | `/api/analyses/{id}` | Delete an analysis | + +## Academic References + +- Kummerer, M., Theis, L., & Bethge, M. (2015). "Deep Gaze I: Boosting Saliency Prediction with Feature Maps Trained on ImageNet." *ICLR 2015*. [arXiv:1411.1045](https://arxiv.org/abs/1411.1045) +- Kummerer, M., Wallis, T.S.A., & Bethge, M. (2016). "DeepGaze II: Reading fixations from deep features trained on object recognition." [arXiv:1610.01563](https://arxiv.org/abs/1610.01563) +- Linardos, A., Kummerer, M., Press, O., & Bethge, M. (2021). "DeepGaze IIE: Calibrated prediction in and out-of-domain for state-of-the-art saliency modeling." *ICCV 2021*. [arXiv:2105.12441](https://arxiv.org/abs/2105.12441) +- Kummerer, M., Bethge, M., & Wallis, T.S.A. (2022). "DeepGaze III: Modeling free-viewing human scanpaths with deep learning." *Journal of Vision*, 22(5):7. [DOI:10.1167/jov.22.5.7](https://doi.org/10.1167/jov.22.5.7) +- Itti, L., Koch, C., & Niebur, E. (1998). "A Model of Saliency-Based Visual Attention for Rapid Scene Analysis." *IEEE TPAMI*, 20(11), 1254-1259. [DOI:10.1109/34.730558](https://doi.org/10.1109/34.730558) + +## License + +MIT License. See [LICENSE](LICENSE) for details. + +--- + +Built with care by **OLIVER** creative teams. diff --git a/backend/=0.40 b/backend/=0.40 new file mode 100644 index 0000000..c8c6c93 --- /dev/null +++ b/backend/=0.40 @@ -0,0 +1 @@ +(eval):1: command not found: pip diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..7c8ce02 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.12-slim + +WORKDIR /app + +RUN apt-get update && apt-get install -y --no-install-recommends \ + libgl1-mesa-glx libglib2.0-0 curl git && \ + rm -rf /var/lib/apt/lists/* + +COPY pyproject.toml . +RUN pip install --no-cache-dir -e . && \ + pip install --no-cache-dir "deepgaze-pytorch @ git+https://github.com/matthias-k/DeepGaze.git" + +COPY . . + +RUN mkdir -p data/uploads + +EXPOSE 8000 +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/backend/alembic.ini b/backend/alembic.ini new file mode 100644 index 0000000..0eec43b --- /dev/null +++ b/backend/alembic.ini @@ -0,0 +1,36 @@ +[alembic] +script_location = app/db/migrations +sqlalchemy.url = postgresql+asyncpg://olivas:olivas@localhost:5453/olivas + +[loggers] +keys = root,sqlalchemy,alembic + +[handlers] +keys = console + +[formatters] +keys = generic + +[logger_root] +level = WARN +handlers = console + +[logger_sqlalchemy] +level = WARN +handlers = +qualname = sqlalchemy.engine + +[logger_alembic] +level = INFO +handlers = +qualname = alembic + +[handler_console] +class = StreamHandler +args = (sys.stderr,) +level = NOTSET +formatter = generic + +[formatter_generic] +format = %(levelname)-5.5s [%(name)s] %(message)s +datefmt = %H:%M:%S diff --git a/backend/app/__init__.py b/backend/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/api/__init__.py b/backend/app/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/api/endpoints/__init__.py b/backend/app/api/endpoints/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/api/endpoints/analysis.py b/backend/app/api/endpoints/analysis.py new file mode 100644 index 0000000..452a7ac --- /dev/null +++ b/backend/app/api/endpoints/analysis.py @@ -0,0 +1,452 @@ +import io + +from fastapi import APIRouter, BackgroundTasks, Depends, Header, HTTPException, UploadFile, Form +from fastapi.responses import StreamingResponse +from PIL import Image +from sqlalchemy import select +from sqlalchemy.ext.asyncio import AsyncSession + +from app.db.session import get_db +from app.dependencies import get_user_id +from app.models.analysis import Analysis +from app.models.project import Project +from app.schemas.analysis import AnalysisDetail, AnalysisStatus, AnalysisSummary +from app.services.storage import storage + +router = APIRouter(tags=["analysis"]) + +ALLOWED_FORMATS = {"JPEG", "PNG", "TIFF", "WEBP", "BMP"} +MAX_FILE_SIZE = 50 * 1024 * 1024 # 50MB + + +@router.post("/projects/{project_id}/analyses", response_model=AnalysisStatus, status_code=202) +async def create_analysis( + project_id: str, + file: UploadFile, + background_tasks: BackgroundTasks, + name: str | None = Form(None), + model: str = Form("deepgaze_iie"), + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + + # Verify project belongs to user + stmt = select(Project).where(Project.id == project_id, Project.user_id == user_id) + result = await db.execute(stmt) + project = result.scalar_one_or_none() + if not project: + raise HTTPException(status_code=404, detail="Project not found") + + # Read and validate image + image_data = await file.read() + if len(image_data) > MAX_FILE_SIZE: + raise HTTPException(status_code=413, detail="File too large (max 50MB)") + + try: + image = Image.open(io.BytesIO(image_data)) + image.verify() + image = Image.open(io.BytesIO(image_data)) # re-open after verify + except Exception: + raise HTTPException(status_code=400, detail="Invalid image file") + + if image.format not in ALLOWED_FORMATS: + raise HTTPException( + status_code=400, + detail=f"Unsupported format: {image.format}. Allowed: {', '.join(ALLOWED_FORMATS)}", + ) + + # Create analysis record + analysis = Analysis( + project_id=project_id, + user_id=user_id, + name=name or file.filename or "Untitled", + model_used=model, + status="pending", + original_filename=file.filename or "upload", + image_width=image.width, + image_height=image.height, + file_format=image.format or "PNG", + storage_path=str(storage.base_dir), + ) + db.add(analysis) + await db.flush() + await db.refresh(analysis) + + # Save original image + await storage.save_bytes(image_data, analysis.id, "original.png") + + # Save thumbnail + thumb = image.copy() + thumb.thumbnail((400, 400)) + thumb_buffer = io.BytesIO() + thumb.save(thumb_buffer, format="PNG") + await storage.save_bytes(thumb_buffer.getvalue(), analysis.id, "thumbnail.png") + + analysis_id = analysis.id + + # Commit now so the background thread can see the record + await db.commit() + + # Queue background processing (sync function runs in threadpool) + background_tasks.add_task(run_analysis_pipeline, analysis_id, image_data, model) + + return AnalysisStatus(id=analysis_id, status="pending") + + +def run_analysis_pipeline(analysis_id: str, image_data: bytes, model_name: str): + """Background task: full saliency analysis pipeline. Runs sync in threadpool.""" + import asyncio + import logging + import numpy as np + from app.services.saliency.model_manager import model_manager + from app.services.image_processing import prepare_for_inference, upscale_saliency + from app.services.heatmap import generate_heatmap_overlay, generate_standalone_heatmap + from app.services.gaze_sequence import extract_gaze_sequence + + logger = logging.getLogger("olivas.pipeline") + + # Use sync DB connection for background thread + from sqlalchemy import create_engine + from sqlalchemy.orm import Session + from app.config import settings + + sync_url = settings.DATABASE_URL.replace("+asyncpg", "").replace("postgresql://", "postgresql+psycopg2://") + # Use psycopg2 if available, otherwise fallback + try: + sync_engine = create_engine(settings.DATABASE_URL.replace("+asyncpg", "+psycopg2")) + except Exception: + sync_engine = create_engine(settings.DATABASE_URL.replace("+asyncpg", "")) + + try: + with Session(sync_engine) as db: + analysis = db.get(Analysis, analysis_id) + analysis.status = "processing" + db.commit() + + logger.info(f"Starting analysis {analysis_id}") + image = Image.open(io.BytesIO(image_data)).convert("RGB") + + # 1. Resize for inference + resized, scale = prepare_for_inference(image) + logger.info(f"Image resized: {image.size} -> {resized.size}") + + # 2. Run saliency model + logger.info(f"Running {model_name} inference...") + saliency = model_manager.predict(resized, model_name) + logger.info("Inference complete") + + # 3. Upscale to original dimensions + saliency_full = upscale_saliency(saliency, image.height, image.width) + + # 4. Save raw saliency as .npy + np.save(str(storage.get_path(analysis_id, "saliency_raw.npy")), saliency_full) + + # 5. Save saliency as grayscale PNG + saliency_uint8 = (saliency_full * 255).astype(np.uint8) + saliency_img = Image.fromarray(saliency_uint8, mode="L") + buf = io.BytesIO() + saliency_img.save(buf, format="PNG") + with open(storage.get_path(analysis_id, "saliency_gray.png"), "wb") as f: + f.write(buf.getvalue()) + + # 6. Generate heatmap overlay + heatmap_overlay = generate_heatmap_overlay(image, saliency_full) + buf = io.BytesIO() + heatmap_overlay.save(buf, format="PNG") + with open(storage.get_path(analysis_id, "heatmap_overlay.png"), "wb") as f: + f.write(buf.getvalue()) + + # 7. Generate standalone heatmap + heatmap_standalone = generate_standalone_heatmap(saliency_full) + buf = io.BytesIO() + heatmap_standalone.save(buf, format="PNG") + with open(storage.get_path(analysis_id, "heatmap_standalone.png"), "wb") as f: + f.write(buf.getvalue()) + + # 8. Extract gaze sequence + gaze_seq = extract_gaze_sequence(saliency_full, num_fixations=5) + + # 9. Compute overall attention score + # Normalize saliency to a proper probability distribution + sal_sum = saliency_full.sum() + if sal_sum > 0: + prob_dist = saliency_full / sal_sum + prob_dist = prob_dist[prob_dist > 0] # remove zeros for log + entropy = -np.sum(prob_dist * np.log2(prob_dist)) + max_entropy = np.log2(saliency_full.size) + concentration = (1 - entropy / max_entropy) * 100 + overall_score = round(float(np.clip(concentration, 0, 100)), 1) + else: + overall_score = 0.0 + + # 10. Extract hotspots + hotspots = _extract_hotspots(saliency_full, num_hotspots=5) + + # 11. Generate gaze sequence image + gaze_img = _draw_gaze_sequence(image, gaze_seq) + buf = io.BytesIO() + gaze_img.save(buf, format="PNG") + with open(storage.get_path(analysis_id, "gaze_sequence.png"), "wb") as f: + f.write(buf.getvalue()) + + # Update DB + analysis.status = "completed" + analysis.gaze_sequence = gaze_seq + analysis.hotspots = hotspots + analysis.overall_score = overall_score + db.commit() + logger.info(f"Analysis {analysis_id} completed (score={overall_score})") + + except Exception as e: + logger.error(f"Analysis {analysis_id} failed: {e}", exc_info=True) + try: + with Session(sync_engine) as db: + analysis = db.get(Analysis, analysis_id) + if analysis: + analysis.status = "failed" + db.commit() + except Exception: + pass + + +def _extract_hotspots(saliency, num_hotspots=5): + import numpy as np + from scipy.ndimage import gaussian_filter + + sal = saliency.copy() + h, w = sal.shape + hotspots = [] + radius = int(max(h, w) * 0.08) + + for i in range(num_hotspots): + smoothed = gaussian_filter(sal, sigma=max(h, w) * 0.015) + peak_idx = np.unravel_index(np.argmax(smoothed), smoothed.shape) + y, x = int(peak_idx[0]), int(peak_idx[1]) + intensity = float(saliency[y, x]) + + # Bounding box around hotspot + x1 = max(0, x - radius) + y1 = max(0, y - radius) + x2 = min(w, x + radius) + y2 = min(h, y + radius) + + hotspots.append({ + "rank": i + 1, + "center_x": x, + "center_y": y, + "x": x1, + "y": y1, + "width": x2 - x1, + "height": y2 - y1, + "intensity": round(intensity, 4), + }) + + # Inhibition of return + yy, xx = np.ogrid[:h, :w] + mask = (xx - x) ** 2 + (yy - y) ** 2 <= radius ** 2 + sal[mask] = 0.0 + + return hotspots + + +def _draw_gaze_sequence(image, gaze_seq): + from PIL import ImageDraw, ImageFont + + img = image.copy() + draw = ImageDraw.Draw(img) + + font = ImageFont.load_default(size=24) + + colors = ["#FF4444", "#FF8800", "#FFCC00", "#44CC44", "#4488FF"] + + for i, point in enumerate(gaze_seq): + x, y = point["x"], point["y"] + color = colors[i % len(colors)] + r = 25 + + # Draw circle + draw.ellipse([x - r, y - r, x + r, y + r], outline=color, width=3) + draw.text((x - 6, y - 12), str(point["rank"]), fill=color, font=font) + + # Draw line to next point + if i < len(gaze_seq) - 1: + nx, ny = gaze_seq[i + 1]["x"], gaze_seq[i + 1]["y"] + draw.line([x, y, nx, ny], fill=color, width=2) + + return img + + +@router.get("/analyses/ai-insights-available") +async def check_ai_insights_available(): + """Check if AI insights are available (API key configured).""" + from app.services.ai_insights import is_available + return {"available": is_available()} + + +@router.get("/analyses/{analysis_id}", response_model=AnalysisDetail) +async def get_analysis( + analysis_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = select(Analysis).where(Analysis.id == analysis_id, Analysis.user_id == user_id) + result = await db.execute(stmt) + analysis = result.scalar_one_or_none() + if not analysis: + raise HTTPException(status_code=404, detail="Analysis not found") + + # Generate insights for completed analyses + insights = None + if analysis.status == "completed": + from app.services.insights import generate_insights + insights = generate_insights(analysis) + + return AnalysisDetail( + id=analysis.id, + name=analysis.name, + model_used=analysis.model_used, + status=analysis.status, + original_filename=analysis.original_filename, + image_width=analysis.image_width, + image_height=analysis.image_height, + file_format=analysis.file_format, + overall_score=analysis.overall_score, + created_at=analysis.created_at, + gaze_sequence=analysis.gaze_sequence, + hotspots=analysis.hotspots, + insights=insights, + ai_insights=analysis.ai_insights, + ai_cost_usd=analysis.ai_cost_usd, + ) + + +@router.get("/analyses/{analysis_id}/status", response_model=AnalysisStatus) +async def get_analysis_status( + analysis_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = select(Analysis).where(Analysis.id == analysis_id, Analysis.user_id == user_id) + result = await db.execute(stmt) + analysis = result.scalar_one_or_none() + if not analysis: + raise HTTPException(status_code=404, detail="Analysis not found") + return AnalysisStatus(id=analysis.id, status=analysis.status) + + +@router.get("/analyses/{analysis_id}/images/{image_type}") +async def get_analysis_image( + analysis_id: str, + image_type: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = select(Analysis).where(Analysis.id == analysis_id, Analysis.user_id == user_id) + result = await db.execute(stmt) + analysis = result.scalar_one_or_none() + if not analysis: + raise HTTPException(status_code=404, detail="Analysis not found") + + file_map = { + "original": "original.png", + "thumbnail": "thumbnail.png", + "heatmap": "heatmap_overlay.png", + "heatmap-standalone": "heatmap_standalone.png", + "saliency-raw": "saliency_gray.png", + "gaze-sequence": "gaze_sequence.png", + } + + filename = file_map.get(image_type) + if not filename: + raise HTTPException(status_code=400, detail=f"Unknown image type: {image_type}") + + if not storage.exists(analysis_id, filename): + raise HTTPException(status_code=404, detail=f"Image not yet available") + + data = await storage.load_bytes(analysis_id, filename) + return StreamingResponse(io.BytesIO(data), media_type="image/png") + + +@router.post("/analyses/{analysis_id}/ai-insights") +async def generate_ai_insights_endpoint( + analysis_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + """Generate AI-powered insights for a completed analysis using Claude.""" + from app.services.ai_insights import generate_ai_insights, is_available + + if not is_available(): + raise HTTPException(status_code=503, detail="AI insights not configured (missing API key)") + + user_id = get_user_id(x_user_id) + stmt = select(Analysis).where(Analysis.id == analysis_id, Analysis.user_id == user_id) + result = await db.execute(stmt) + analysis = result.scalar_one_or_none() + if not analysis: + raise HTTPException(status_code=404, detail="Analysis not found") + + if analysis.status != "completed": + raise HTTPException(status_code=400, detail="Analysis is not yet completed") + + # Load images + try: + original_bytes = await storage.load_bytes(analysis_id, "original.png") + heatmap_bytes = await storage.load_bytes(analysis_id, "heatmap_overlay.png") + except FileNotFoundError: + raise HTTPException(status_code=404, detail="Analysis images not found") + + metadata = { + "overall_score": analysis.overall_score, + "hotspots": analysis.hotspots or [], + "gaze_sequence": analysis.gaze_sequence or [], + "image_width": analysis.image_width, + "image_height": analysis.image_height, + } + + try: + result = generate_ai_insights(metadata, original_bytes, heatmap_bytes) + + # Save to DB + analysis.ai_insights = result["insights"] + analysis.ai_cost_usd = result["cost_usd"] + await db.flush() + + # Invalidate cached PDF so next download includes AI insights + if storage.exists(analysis_id, "report.pdf"): + import os + try: + os.remove(storage.get_path(analysis_id, "report.pdf")) + except OSError: + pass + + return { + "insights": result["insights"], + "cost_usd": result["cost_usd"], + "input_tokens": result["input_tokens"], + "output_tokens": result["output_tokens"], + } + except RuntimeError as e: + raise HTTPException(status_code=502, detail=str(e)) + + +@router.delete("/analyses/{analysis_id}", status_code=204) +async def delete_analysis( + analysis_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = select(Analysis).where(Analysis.id == analysis_id, Analysis.user_id == user_id) + result = await db.execute(stmt) + analysis = result.scalar_one_or_none() + if not analysis: + raise HTTPException(status_code=404, detail="Analysis not found") + + await storage.delete_analysis(analysis_id) + await db.delete(analysis) + await db.commit() diff --git a/backend/app/api/endpoints/aoi.py b/backend/app/api/endpoints/aoi.py new file mode 100644 index 0000000..a7b598a --- /dev/null +++ b/backend/app/api/endpoints/aoi.py @@ -0,0 +1,105 @@ +import numpy as np +from fastapi import APIRouter, Depends, Header, HTTPException +from sqlalchemy import select +from sqlalchemy.ext.asyncio import AsyncSession + +from app.db.session import get_db +from app.dependencies import get_user_id +from app.models.analysis import Analysis +from app.models.aoi import AOI +from app.schemas.aoi import AOICreate, AOIResult, AOIUpdate +from app.services.aoi_analysis import compute_aoi_attention +from app.services.storage import storage + +router = APIRouter(tags=["aoi"]) + + +@router.post("/analyses/{analysis_id}/aois", response_model=list[AOIResult], status_code=201) +async def create_aois( + analysis_id: str, + body: AOICreate, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = select(Analysis).where(Analysis.id == analysis_id, Analysis.user_id == user_id) + result = await db.execute(stmt) + analysis = result.scalar_one_or_none() + if not analysis: + raise HTTPException(status_code=404, detail="Analysis not found") + + if analysis.status != "completed": + raise HTTPException(status_code=400, detail="Analysis not yet completed") + + # Load saliency map + npy_path = storage.get_path(analysis_id, "saliency_raw.npy") + if not npy_path.exists(): + raise HTTPException(status_code=400, detail="Saliency data not available") + + saliency = np.load(str(npy_path)) + + regions = [r.model_dump() for r in body.regions] + attention_results = compute_aoi_attention(saliency, regions) + + aoi_records = [] + for region, att in zip(body.regions, attention_results): + aoi = AOI( + analysis_id=analysis_id, + label=region.label, + x=region.x, + y=region.y, + width=region.width, + height=region.height, + attention_pct=att["attention_pct"], + area_pct=att["area_pct"], + attention_density=att["attention_density"], + ) + db.add(aoi) + aoi_records.append(aoi) + + await db.flush() + for aoi in aoi_records: + await db.refresh(aoi) + + return [AOIResult.model_validate(aoi) for aoi in aoi_records] + + +@router.get("/analyses/{analysis_id}/aois", response_model=list[AOIResult]) +async def list_aois( + analysis_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = select(Analysis).where(Analysis.id == analysis_id, Analysis.user_id == user_id) + result = await db.execute(stmt) + analysis = result.scalar_one_or_none() + if not analysis: + raise HTTPException(status_code=404, detail="Analysis not found") + + aoi_stmt = select(AOI).where(AOI.analysis_id == analysis_id) + aoi_result = await db.execute(aoi_stmt) + aois = aoi_result.scalars().all() + return [AOIResult.model_validate(aoi) for aoi in aois] + + +@router.delete("/analyses/{analysis_id}/aois/{aoi_id}", status_code=204) +async def delete_aoi( + analysis_id: str, + aoi_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + # Verify analysis ownership + stmt = select(Analysis).where(Analysis.id == analysis_id, Analysis.user_id == user_id) + result = await db.execute(stmt) + if not result.scalar_one_or_none(): + raise HTTPException(status_code=404, detail="Analysis not found") + + aoi_stmt = select(AOI).where(AOI.id == aoi_id, AOI.analysis_id == analysis_id) + aoi_result = await db.execute(aoi_stmt) + aoi = aoi_result.scalar_one_or_none() + if not aoi: + raise HTTPException(status_code=404, detail="AOI not found") + await db.delete(aoi) diff --git a/backend/app/api/endpoints/comparison.py b/backend/app/api/endpoints/comparison.py new file mode 100644 index 0000000..94be9ef --- /dev/null +++ b/backend/app/api/endpoints/comparison.py @@ -0,0 +1,145 @@ +from fastapi import APIRouter, Depends, Header, HTTPException +from sqlalchemy import select +from sqlalchemy.ext.asyncio import AsyncSession + +from app.db.session import get_db +from app.dependencies import get_user_id +from app.models.analysis import Analysis +from app.models.comparison import Comparison +from app.models.project import Project + +router = APIRouter(tags=["comparison"]) + + +class ComparisonCreate: + pass + + +from pydantic import BaseModel + + +class ComparisonCreateBody(BaseModel): + name: str + analysis_ids: list[str] + + +class ComparisonResponse(BaseModel): + id: str + name: str + analyses: list[dict] + comparison_data: dict | None = None + + model_config = {"from_attributes": True} + + +@router.post( + "/projects/{project_id}/comparisons", response_model=ComparisonResponse, status_code=201 +) +async def create_comparison( + project_id: str, + body: ComparisonCreateBody, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + + # Verify project + stmt = select(Project).where(Project.id == project_id, Project.user_id == user_id) + result = await db.execute(stmt) + if not result.scalar_one_or_none(): + raise HTTPException(status_code=404, detail="Project not found") + + if len(body.analysis_ids) < 2: + raise HTTPException(status_code=400, detail="Need at least 2 analyses to compare") + + # Fetch analyses + analyses_stmt = select(Analysis).where( + Analysis.id.in_(body.analysis_ids), + Analysis.user_id == user_id, + Analysis.status == "completed", + ) + analyses_result = await db.execute(analyses_stmt) + analyses = analyses_result.scalars().all() + + if len(analyses) != len(body.analysis_ids): + raise HTTPException( + status_code=400, detail="Some analyses not found or not completed" + ) + + # Build comparison data + analyses_data = [] + winner_id = None + max_score = -1 + + for a in analyses: + data = { + "analysis_id": a.id, + "name": a.name, + "overall_score": a.overall_score, + "top_fixation": a.gaze_sequence[0] if a.gaze_sequence else None, + } + analyses_data.append(data) + if a.overall_score and a.overall_score > max_score: + max_score = a.overall_score + winner_id = a.id + + comparison_data = { + "winner": winner_id, + "score_delta": round(max_score - min(a.overall_score or 0 for a in analyses), 1), + } + + comparison = Comparison( + project_id=project_id, + user_id=user_id, + name=body.name, + analysis_ids=body.analysis_ids, + comparison_data=comparison_data, + ) + db.add(comparison) + await db.flush() + await db.refresh(comparison) + + return ComparisonResponse( + id=comparison.id, + name=comparison.name, + analyses=analyses_data, + comparison_data=comparison_data, + ) + + +@router.get("/comparisons/{comparison_id}", response_model=ComparisonResponse) +async def get_comparison( + comparison_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = select(Comparison).where( + Comparison.id == comparison_id, Comparison.user_id == user_id + ) + result = await db.execute(stmt) + comparison = result.scalar_one_or_none() + if not comparison: + raise HTTPException(status_code=404, detail="Comparison not found") + + # Fetch the analyses for display + analyses_stmt = select(Analysis).where(Analysis.id.in_(comparison.analysis_ids)) + analyses_result = await db.execute(analyses_stmt) + analyses = analyses_result.scalars().all() + + analyses_data = [ + { + "analysis_id": a.id, + "name": a.name, + "overall_score": a.overall_score, + "top_fixation": a.gaze_sequence[0] if a.gaze_sequence else None, + } + for a in analyses + ] + + return ComparisonResponse( + id=comparison.id, + name=comparison.name, + analyses=analyses_data, + comparison_data=comparison.comparison_data, + ) diff --git a/backend/app/api/endpoints/health.py b/backend/app/api/endpoints/health.py new file mode 100644 index 0000000..81956e8 --- /dev/null +++ b/backend/app/api/endpoints/health.py @@ -0,0 +1,14 @@ +from fastapi import APIRouter + +router = APIRouter() + + +@router.get("/health") +async def health_check(): + from app.services.saliency.model_manager import model_manager + + loaded = list(model_manager.models.keys()) if model_manager.models else [] + return { + "status": "ok", + "models_loaded": loaded, + } diff --git a/backend/app/api/endpoints/projects.py b/backend/app/api/endpoints/projects.py new file mode 100644 index 0000000..a4fc915 --- /dev/null +++ b/backend/app/api/endpoints/projects.py @@ -0,0 +1,141 @@ +from fastapi import APIRouter, Depends, Header, HTTPException +from sqlalchemy import func, select +from sqlalchemy.ext.asyncio import AsyncSession +from sqlalchemy.orm import selectinload + +from app.db.session import get_db +from app.dependencies import get_user_id +from app.models.analysis import Analysis +from app.models.project import Project +from app.schemas.project import ProjectCreate, ProjectDetail, ProjectSummary, ProjectUpdate + +router = APIRouter(prefix="/projects", tags=["projects"]) + + +@router.post("", response_model=ProjectSummary, status_code=201) +async def create_project( + body: ProjectCreate, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + project = Project(user_id=user_id, name=body.name, description=body.description) + db.add(project) + await db.flush() + await db.refresh(project) + return ProjectSummary( + id=project.id, + name=project.name, + description=project.description, + analysis_count=0, + created_at=project.created_at, + updated_at=project.updated_at, + ) + + +@router.get("", response_model=list[ProjectSummary]) +async def list_projects( + page: int = 1, + per_page: int = 20, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + offset = (page - 1) * per_page + + stmt = ( + select( + Project, + func.count(Analysis.id).label("analysis_count"), + ) + .outerjoin(Analysis) + .where(Project.user_id == user_id) + .group_by(Project.id) + .order_by(Project.updated_at.desc()) + .offset(offset) + .limit(per_page) + ) + result = await db.execute(stmt) + rows = result.all() + + return [ + ProjectSummary( + id=p.id, + name=p.name, + description=p.description, + analysis_count=count, + created_at=p.created_at, + updated_at=p.updated_at, + ) + for p, count in rows + ] + + +@router.get("/{project_id}", response_model=ProjectDetail) +async def get_project( + project_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = ( + select(Project) + .options(selectinload(Project.analyses)) + .where(Project.id == project_id, Project.user_id == user_id) + ) + result = await db.execute(stmt) + project = result.scalar_one_or_none() + if not project: + raise HTTPException(status_code=404, detail="Project not found") + return project + + +@router.put("/{project_id}", response_model=ProjectSummary) +async def update_project( + project_id: str, + body: ProjectUpdate, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = select(Project).where(Project.id == project_id, Project.user_id == user_id) + result = await db.execute(stmt) + project = result.scalar_one_or_none() + if not project: + raise HTTPException(status_code=404, detail="Project not found") + + if body.name is not None: + project.name = body.name + if body.description is not None: + project.description = body.description + + await db.flush() + await db.refresh(project) + + count_stmt = select(func.count(Analysis.id)).where(Analysis.project_id == project_id) + count_result = await db.execute(count_stmt) + analysis_count = count_result.scalar() or 0 + + return ProjectSummary( + id=project.id, + name=project.name, + description=project.description, + analysis_count=analysis_count, + created_at=project.created_at, + updated_at=project.updated_at, + ) + + +@router.delete("/{project_id}", status_code=204) +async def delete_project( + project_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = select(Project).where(Project.id == project_id, Project.user_id == user_id) + result = await db.execute(stmt) + project = result.scalar_one_or_none() + if not project: + raise HTTPException(status_code=404, detail="Project not found") + await db.delete(project) diff --git a/backend/app/api/endpoints/reports.py b/backend/app/api/endpoints/reports.py new file mode 100644 index 0000000..ecf8b10 --- /dev/null +++ b/backend/app/api/endpoints/reports.py @@ -0,0 +1,89 @@ +import io +import logging + +from fastapi import APIRouter, Depends, Header, HTTPException +from fastapi.responses import StreamingResponse +from sqlalchemy import select +from sqlalchemy.ext.asyncio import AsyncSession +from sqlalchemy.orm import selectinload + +from app.db.session import get_db +from app.dependencies import get_user_id +from app.models.analysis import Analysis +from app.services.storage import storage + +router = APIRouter(tags=["reports"]) +logger = logging.getLogger("olivas.reports") + + +@router.get("/analyses/{analysis_id}/report") +async def download_report( + analysis_id: str, + db: AsyncSession = Depends(get_db), + x_user_id: str | None = Header(None), +): + user_id = get_user_id(x_user_id) + stmt = ( + select(Analysis) + .options(selectinload(Analysis.aois)) + .where(Analysis.id == analysis_id, Analysis.user_id == user_id) + ) + result = await db.execute(stmt) + analysis = result.scalar_one_or_none() + if not analysis: + raise HTTPException(status_code=404, detail="Analysis not found") + + if analysis.status != "completed": + raise HTTPException(status_code=400, detail="Analysis not yet completed") + + # Check if PDF already cached + if storage.exists(analysis_id, "report.pdf"): + data = await storage.load_bytes(analysis_id, "report.pdf") + else: + from app.services.report_generator import generate_report + + # Load images for the report + try: + original_data = await storage.load_bytes(analysis_id, "original.png") + except FileNotFoundError: + raise HTTPException(status_code=404, detail="Original image not found") + + try: + heatmap_data = await storage.load_bytes(analysis_id, "heatmap_overlay.png") + except FileNotFoundError: + raise HTTPException(status_code=404, detail="Heatmap image not yet generated") + + try: + gaze_data = await storage.load_bytes(analysis_id, "gaze_sequence.png") + except FileNotFoundError: + raise HTTPException(status_code=404, detail="Gaze sequence image not yet generated") + + # Generate rule-based insights + from app.services.insights import generate_insights + rule_insights = generate_insights(analysis) if analysis.status == "completed" else [] + + try: + data = generate_report( + analysis=analysis, + original_image=original_data, + heatmap_image=heatmap_data, + gaze_image=gaze_data, + aois=list(analysis.aois), + rule_insights=rule_insights, + ai_insights=analysis.ai_insights, + ai_cost_usd=analysis.ai_cost_usd, + ) + except Exception as e: + logger.error(f"Report generation failed for {analysis_id}: {e}", exc_info=True) + raise HTTPException(status_code=500, detail=f"Report generation failed: {str(e)}") + + await storage.save_bytes(data, analysis_id, "report.pdf") + + safe_name = analysis.name.replace(" ", "_").replace("/", "_") + return StreamingResponse( + io.BytesIO(data), + media_type="application/pdf", + headers={ + "Content-Disposition": f'attachment; filename="olivas-report-{safe_name}.pdf"' + }, + ) diff --git a/backend/app/api/router.py b/backend/app/api/router.py new file mode 100644 index 0000000..4d4c6b9 --- /dev/null +++ b/backend/app/api/router.py @@ -0,0 +1,12 @@ +from fastapi import APIRouter + +from app.api.endpoints import analysis, aoi, comparison, health, projects, reports + +api_router = APIRouter(prefix="/api") + +api_router.include_router(health.router) +api_router.include_router(projects.router) +api_router.include_router(analysis.router) +api_router.include_router(aoi.router) +api_router.include_router(comparison.router) +api_router.include_router(reports.router) diff --git a/backend/app/config.py b/backend/app/config.py new file mode 100644 index 0000000..9253d23 --- /dev/null +++ b/backend/app/config.py @@ -0,0 +1,30 @@ +from pydantic_settings import BaseSettings + + +class Settings(BaseSettings): + DATABASE_URL: str = "postgresql+asyncpg://olivas:olivas@localhost:5453/olivas" + UPLOAD_DIR: str = "./data/uploads" + DEVICE: str = "auto" # auto | cpu | cuda + ANTHROPIC_API_KEY: str = "" + CORS_ORIGINS: str = "http://localhost:1577" + BACKEND_HOST: str = "0.0.0.0" + BACKEND_PORT: int = 8000 + + @property + def device(self) -> str: + if self.DEVICE == "auto": + try: + import torch + return "cuda" if torch.cuda.is_available() else "cpu" + except ImportError: + return "cpu" + return self.DEVICE + + @property + def cors_origins_list(self) -> list[str]: + return [o.strip() for o in self.CORS_ORIGINS.split(",")] + + model_config = {"env_file": ".env", "env_file_encoding": "utf-8"} + + +settings = Settings() diff --git a/backend/app/core/__init__.py b/backend/app/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/core/exceptions.py b/backend/app/core/exceptions.py new file mode 100644 index 0000000..08de9b4 --- /dev/null +++ b/backend/app/core/exceptions.py @@ -0,0 +1,18 @@ +class OliVASError(Exception): + pass + + +class AnalysisNotFoundError(OliVASError): + pass + + +class ProjectNotFoundError(OliVASError): + pass + + +class ModelNotLoadedError(OliVASError): + pass + + +class ImageProcessingError(OliVASError): + pass diff --git a/backend/app/db/__init__.py b/backend/app/db/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/db/migrations/env.py b/backend/app/db/migrations/env.py new file mode 100644 index 0000000..67b81d8 --- /dev/null +++ b/backend/app/db/migrations/env.py @@ -0,0 +1,57 @@ +import asyncio +from logging.config import fileConfig + +from alembic import context +from sqlalchemy import pool +from sqlalchemy.ext.asyncio import async_engine_from_config + +from app.models.base import Base +from app.models.project import Project # noqa: F401 +from app.models.analysis import Analysis # noqa: F401 +from app.models.aoi import AOI # noqa: F401 +from app.models.comparison import Comparison # noqa: F401 + +config = context.config +if config.config_file_name is not None: + fileConfig(config.config_file_name) + +target_metadata = Base.metadata + + +def run_migrations_offline() -> None: + url = config.get_main_option("sqlalchemy.url") + context.configure( + url=url, + target_metadata=target_metadata, + literal_binds=True, + dialect_opts={"paramstyle": "named"}, + ) + with context.begin_transaction(): + context.run_migrations() + + +def do_run_migrations(connection): + context.configure(connection=connection, target_metadata=target_metadata) + with context.begin_transaction(): + context.run_migrations() + + +async def run_async_migrations() -> None: + connectable = async_engine_from_config( + config.get_section(config.config_ini_section, {}), + prefix="sqlalchemy.", + poolclass=pool.NullPool, + ) + async with connectable.connect() as connection: + await connection.run_sync(do_run_migrations) + await connectable.dispose() + + +def run_migrations_online() -> None: + asyncio.run(run_async_migrations()) + + +if context.is_offline_mode(): + run_migrations_offline() +else: + run_migrations_online() diff --git a/backend/app/db/migrations/script.py.mako b/backend/app/db/migrations/script.py.mako new file mode 100644 index 0000000..fbc4b07 --- /dev/null +++ b/backend/app/db/migrations/script.py.mako @@ -0,0 +1,26 @@ +"""${message} + +Revision ID: ${up_revision} +Revises: ${down_revision | comma,n} +Create Date: ${create_date} + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +${imports if imports else ""} + +# revision identifiers, used by Alembic. +revision: str = ${repr(up_revision)} +down_revision: Union[str, None] = ${repr(down_revision)} +branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)} +depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)} + + +def upgrade() -> None: + ${upgrades if upgrades else "pass"} + + +def downgrade() -> None: + ${downgrades if downgrades else "pass"} diff --git a/backend/app/db/migrations/versions/2f6f70f606a1_initial_schema.py b/backend/app/db/migrations/versions/2f6f70f606a1_initial_schema.py new file mode 100644 index 0000000..b00af67 --- /dev/null +++ b/backend/app/db/migrations/versions/2f6f70f606a1_initial_schema.py @@ -0,0 +1,97 @@ +"""initial schema + +Revision ID: 2f6f70f606a1 +Revises: +Create Date: 2026-02-23 14:18:44.382856 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision: str = '2f6f70f606a1' +down_revision: Union[str, None] = None +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('projects', + sa.Column('id', sa.String(length=36), nullable=False), + sa.Column('user_id', sa.String(length=36), nullable=False), + sa.Column('name', sa.String(length=255), nullable=False), + sa.Column('description', sa.Text(), nullable=True), + sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False), + sa.Column('updated_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_projects_user_id'), 'projects', ['user_id'], unique=False) + op.create_table('analyses', + sa.Column('id', sa.String(length=36), nullable=False), + sa.Column('project_id', sa.String(length=36), nullable=False), + sa.Column('user_id', sa.String(length=36), nullable=False), + sa.Column('name', sa.String(length=255), nullable=False), + sa.Column('model_used', sa.String(length=50), nullable=False), + sa.Column('status', sa.String(length=20), nullable=False), + sa.Column('original_filename', sa.String(length=255), nullable=False), + sa.Column('image_width', sa.Integer(), nullable=False), + sa.Column('image_height', sa.Integer(), nullable=False), + sa.Column('file_format', sa.String(length=10), nullable=False), + sa.Column('storage_path', sa.String(length=512), nullable=False), + sa.Column('gaze_sequence', sa.JSON(), nullable=True), + sa.Column('hotspots', sa.JSON(), nullable=True), + sa.Column('overall_score', sa.Float(), nullable=True), + sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False), + sa.ForeignKeyConstraint(['project_id'], ['projects.id'], ), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_analyses_project_id'), 'analyses', ['project_id'], unique=False) + op.create_index(op.f('ix_analyses_user_id'), 'analyses', ['user_id'], unique=False) + op.create_table('comparisons', + sa.Column('id', sa.String(length=36), nullable=False), + sa.Column('project_id', sa.String(length=36), nullable=False), + sa.Column('user_id', sa.String(length=36), nullable=False), + sa.Column('name', sa.String(length=255), nullable=False), + sa.Column('analysis_ids', sa.JSON(), nullable=False), + sa.Column('comparison_data', sa.JSON(), nullable=True), + sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False), + sa.ForeignKeyConstraint(['project_id'], ['projects.id'], ), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_comparisons_project_id'), 'comparisons', ['project_id'], unique=False) + op.create_index(op.f('ix_comparisons_user_id'), 'comparisons', ['user_id'], unique=False) + op.create_table('aois', + sa.Column('id', sa.String(length=36), nullable=False), + sa.Column('analysis_id', sa.String(length=36), nullable=False), + sa.Column('label', sa.String(length=100), nullable=False), + sa.Column('x', sa.Integer(), nullable=False), + sa.Column('y', sa.Integer(), nullable=False), + sa.Column('width', sa.Integer(), nullable=False), + sa.Column('height', sa.Integer(), nullable=False), + sa.Column('attention_pct', sa.Float(), nullable=True), + sa.Column('area_pct', sa.Float(), nullable=True), + sa.Column('attention_density', sa.Float(), nullable=True), + sa.ForeignKeyConstraint(['analysis_id'], ['analyses.id'], ), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_aois_analysis_id'), 'aois', ['analysis_id'], unique=False) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index(op.f('ix_aois_analysis_id'), table_name='aois') + op.drop_table('aois') + op.drop_index(op.f('ix_comparisons_user_id'), table_name='comparisons') + op.drop_index(op.f('ix_comparisons_project_id'), table_name='comparisons') + op.drop_table('comparisons') + op.drop_index(op.f('ix_analyses_user_id'), table_name='analyses') + op.drop_index(op.f('ix_analyses_project_id'), table_name='analyses') + op.drop_table('analyses') + op.drop_index(op.f('ix_projects_user_id'), table_name='projects') + op.drop_table('projects') + # ### end Alembic commands ### diff --git a/backend/app/db/session.py b/backend/app/db/session.py new file mode 100644 index 0000000..7aa48af --- /dev/null +++ b/backend/app/db/session.py @@ -0,0 +1,16 @@ +from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine + +from app.config import settings + +engine = create_async_engine(settings.DATABASE_URL, echo=False) +async_session_factory = async_sessionmaker(engine, class_=AsyncSession, expire_on_commit=False) + + +async def get_db() -> AsyncSession: + async with async_session_factory() as session: + try: + yield session + await session.commit() + except Exception: + await session.rollback() + raise diff --git a/backend/app/dependencies.py b/backend/app/dependencies.py new file mode 100644 index 0000000..b4b00ce --- /dev/null +++ b/backend/app/dependencies.py @@ -0,0 +1,12 @@ +from sqlalchemy.ext.asyncio import AsyncSession + +from app.db.session import get_db + +# User ID header — placeholder for SSO integration. +# When SSO is added, this will extract user_id from the JWT/session token. +USER_ID_HEADER = "X-User-Id" +DEFAULT_USER_ID = "default" + + +def get_user_id(x_user_id: str | None = None) -> str: + return x_user_id or DEFAULT_USER_ID diff --git a/backend/app/main.py b/backend/app/main.py new file mode 100644 index 0000000..b197d9e --- /dev/null +++ b/backend/app/main.py @@ -0,0 +1,47 @@ +import logging +from contextlib import asynccontextmanager + +from fastapi import FastAPI +from fastapi.middleware.cors import CORSMiddleware + +from app.api.router import api_router +from app.config import settings + +logger = logging.getLogger("olivas") + + +@asynccontextmanager +async def lifespan(app: FastAPI): + # Startup: load ML models + logger.info(f"Starting OliVAS backend (device={settings.device})") + from app.services.saliency.model_manager import model_manager + + try: + model_manager.load_models(device=settings.device) + logger.info(f"Models loaded: {list(model_manager.models.keys())}") + except Exception as e: + logger.warning(f"Failed to load ML models: {e}. Analysis will fail until models load.") + + yield + + # Shutdown + model_manager.cleanup() + logger.info("OliVAS backend shut down") + + +app = FastAPI( + title="OliVAS", + description="Open-Source Visual Attention Software by OLIVER", + version="0.1.0", + lifespan=lifespan, +) + +app.add_middleware( + CORSMiddleware, + allow_origins=settings.cors_origins_list, + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + +app.include_router(api_router) diff --git a/backend/app/models/__init__.py b/backend/app/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/models/analysis.py b/backend/app/models/analysis.py new file mode 100644 index 0000000..0c133aa --- /dev/null +++ b/backend/app/models/analysis.py @@ -0,0 +1,39 @@ +import uuid +from datetime import datetime + +from sqlalchemy import Float, ForeignKey, Integer, JSON, String, func +from sqlalchemy.orm import Mapped, mapped_column, relationship + +from app.models.base import Base + + +class Analysis(Base): + __tablename__ = "analyses" + + id: Mapped[str] = mapped_column( + String(36), primary_key=True, default=lambda: str(uuid.uuid4()) + ) + project_id: Mapped[str] = mapped_column(ForeignKey("projects.id"), index=True) + user_id: Mapped[str] = mapped_column(String(36), index=True) + name: Mapped[str] = mapped_column(String(255)) + model_used: Mapped[str] = mapped_column(String(50), default="deepgaze_iie") + status: Mapped[str] = mapped_column(String(20), default="pending") + + original_filename: Mapped[str] = mapped_column(String(255)) + image_width: Mapped[int] = mapped_column(Integer) + image_height: Mapped[int] = mapped_column(Integer) + file_format: Mapped[str] = mapped_column(String(10)) + storage_path: Mapped[str] = mapped_column(String(512)) + + gaze_sequence: Mapped[dict | None] = mapped_column(JSON, nullable=True) + hotspots: Mapped[dict | None] = mapped_column(JSON, nullable=True) + overall_score: Mapped[float | None] = mapped_column(Float, nullable=True) + ai_insights: Mapped[dict | None] = mapped_column(JSON, nullable=True) + ai_cost_usd: Mapped[float | None] = mapped_column(Float, nullable=True) + + created_at: Mapped[datetime] = mapped_column(server_default=func.now()) + + project: Mapped["Project"] = relationship(back_populates="analyses") # noqa: F821 + aois: Mapped[list["AOI"]] = relationship( # noqa: F821 + back_populates="analysis", cascade="all, delete-orphan" + ) diff --git a/backend/app/models/aoi.py b/backend/app/models/aoi.py new file mode 100644 index 0000000..9b20fa9 --- /dev/null +++ b/backend/app/models/aoi.py @@ -0,0 +1,26 @@ +import uuid + +from sqlalchemy import Float, ForeignKey, Integer, String +from sqlalchemy.orm import Mapped, mapped_column, relationship + +from app.models.base import Base + + +class AOI(Base): + __tablename__ = "aois" + + id: Mapped[str] = mapped_column( + String(36), primary_key=True, default=lambda: str(uuid.uuid4()) + ) + analysis_id: Mapped[str] = mapped_column(ForeignKey("analyses.id"), index=True) + label: Mapped[str] = mapped_column(String(100)) + x: Mapped[int] = mapped_column(Integer) + y: Mapped[int] = mapped_column(Integer) + width: Mapped[int] = mapped_column(Integer) + height: Mapped[int] = mapped_column(Integer) + + attention_pct: Mapped[float | None] = mapped_column(Float, nullable=True) + area_pct: Mapped[float | None] = mapped_column(Float, nullable=True) + attention_density: Mapped[float | None] = mapped_column(Float, nullable=True) + + analysis: Mapped["Analysis"] = relationship(back_populates="aois") # noqa: F821 diff --git a/backend/app/models/base.py b/backend/app/models/base.py new file mode 100644 index 0000000..fa2b68a --- /dev/null +++ b/backend/app/models/base.py @@ -0,0 +1,5 @@ +from sqlalchemy.orm import DeclarativeBase + + +class Base(DeclarativeBase): + pass diff --git a/backend/app/models/comparison.py b/backend/app/models/comparison.py new file mode 100644 index 0000000..941d8bb --- /dev/null +++ b/backend/app/models/comparison.py @@ -0,0 +1,23 @@ +import uuid +from datetime import datetime + +from sqlalchemy import ForeignKey, JSON, String, func +from sqlalchemy.orm import Mapped, mapped_column, relationship + +from app.models.base import Base + + +class Comparison(Base): + __tablename__ = "comparisons" + + id: Mapped[str] = mapped_column( + String(36), primary_key=True, default=lambda: str(uuid.uuid4()) + ) + project_id: Mapped[str] = mapped_column(ForeignKey("projects.id"), index=True) + user_id: Mapped[str] = mapped_column(String(36), index=True) + name: Mapped[str] = mapped_column(String(255)) + analysis_ids: Mapped[dict] = mapped_column(JSON) + comparison_data: Mapped[dict | None] = mapped_column(JSON, nullable=True) + created_at: Mapped[datetime] = mapped_column(server_default=func.now()) + + project: Mapped["Project"] = relationship(back_populates="comparisons") # noqa: F821 diff --git a/backend/app/models/project.py b/backend/app/models/project.py new file mode 100644 index 0000000..0be18ed --- /dev/null +++ b/backend/app/models/project.py @@ -0,0 +1,27 @@ +import uuid +from datetime import datetime + +from sqlalchemy import String, Text, func +from sqlalchemy.orm import Mapped, mapped_column, relationship + +from app.models.base import Base + + +class Project(Base): + __tablename__ = "projects" + + id: Mapped[str] = mapped_column( + String(36), primary_key=True, default=lambda: str(uuid.uuid4()) + ) + user_id: Mapped[str] = mapped_column(String(36), index=True) + name: Mapped[str] = mapped_column(String(255)) + description: Mapped[str | None] = mapped_column(Text, nullable=True) + created_at: Mapped[datetime] = mapped_column(server_default=func.now()) + updated_at: Mapped[datetime] = mapped_column(server_default=func.now(), onupdate=func.now()) + + analyses: Mapped[list["Analysis"]] = relationship( # noqa: F821 + back_populates="project", cascade="all, delete-orphan" + ) + comparisons: Mapped[list["Comparison"]] = relationship( # noqa: F821 + back_populates="project", cascade="all, delete-orphan" + ) diff --git a/backend/app/schemas/__init__.py b/backend/app/schemas/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/schemas/analysis.py b/backend/app/schemas/analysis.py new file mode 100644 index 0000000..330c64f --- /dev/null +++ b/backend/app/schemas/analysis.py @@ -0,0 +1,52 @@ +from datetime import datetime + +from pydantic import BaseModel + + +class AnalysisSummary(BaseModel): + id: str + name: str + model_used: str + status: str + original_filename: str + image_width: int + image_height: int + overall_score: float | None = None + created_at: datetime + + model_config = {"from_attributes": True} + + +class GazePoint(BaseModel): + rank: int + x: int + y: int + x_pct: float + y_pct: float + probability: float + + +class Insight(BaseModel): + type: str # "info" | "success" | "warning" + title: str + description: str + + +class AnalysisDetail(AnalysisSummary): + file_format: str + gaze_sequence: list[GazePoint] | None = None + hotspots: list[dict] | None = None + insights: list[Insight] | None = None + ai_insights: list[Insight] | None = None + ai_cost_usd: float | None = None + aoi_count: int = 0 + + +class AnalysisCreate(BaseModel): + name: str | None = None + model: str = "deepgaze_iie" + + +class AnalysisStatus(BaseModel): + id: str + status: str diff --git a/backend/app/schemas/aoi.py b/backend/app/schemas/aoi.py new file mode 100644 index 0000000..8b03302 --- /dev/null +++ b/backend/app/schemas/aoi.py @@ -0,0 +1,35 @@ +from pydantic import BaseModel + + +class AOIRegion(BaseModel): + label: str + x: int + y: int + width: int + height: int + + +class AOICreate(BaseModel): + regions: list[AOIRegion] + + +class AOIResult(BaseModel): + id: str + label: str + x: int + y: int + width: int + height: int + attention_pct: float | None = None + area_pct: float | None = None + attention_density: float | None = None + + model_config = {"from_attributes": True} + + +class AOIUpdate(BaseModel): + label: str | None = None + x: int | None = None + y: int | None = None + width: int | None = None + height: int | None = None diff --git a/backend/app/schemas/project.py b/backend/app/schemas/project.py new file mode 100644 index 0000000..2bf73b5 --- /dev/null +++ b/backend/app/schemas/project.py @@ -0,0 +1,35 @@ +from datetime import datetime + +from pydantic import BaseModel + + +class ProjectCreate(BaseModel): + name: str + description: str | None = None + + +class ProjectUpdate(BaseModel): + name: str | None = None + description: str | None = None + + +class ProjectSummary(BaseModel): + id: str + name: str + description: str | None + analysis_count: int = 0 + created_at: datetime + updated_at: datetime + + model_config = {"from_attributes": True} + + +class ProjectDetail(ProjectSummary): + analyses: list["AnalysisSummary"] = [] + + model_config = {"from_attributes": True} + + +from app.schemas.analysis import AnalysisSummary # noqa: E402 + +ProjectDetail.model_rebuild() diff --git a/backend/app/schemas/report.py b/backend/app/schemas/report.py new file mode 100644 index 0000000..237c8f8 --- /dev/null +++ b/backend/app/schemas/report.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class ReportRequest(BaseModel): + include_aois: bool = True + include_gaze_sequence: bool = True + include_hotspots: bool = True diff --git a/backend/app/services/__init__.py b/backend/app/services/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/services/ai_insights.py b/backend/app/services/ai_insights.py new file mode 100644 index 0000000..315c3c3 --- /dev/null +++ b/backend/app/services/ai_insights.py @@ -0,0 +1,158 @@ +"""Claude-powered AI insights for saliency analysis.""" + +import base64 +import json +import logging + +import anthropic + +from app.config import settings + +logger = logging.getLogger("olivas.ai_insights") + +# Sonnet 4.6 pricing per million tokens +INPUT_COST_PER_M = 3.00 +OUTPUT_COST_PER_M = 15.00 + + +def is_available() -> bool: + """Check if AI insights are available (API key configured).""" + return bool(settings.ANTHROPIC_API_KEY) + + +def generate_ai_insights( + analysis_metadata: dict, + original_image_bytes: bytes, + heatmap_image_bytes: bytes, +) -> dict: + """ + Send the original image, heatmap overlay, and analysis metrics to Claude + and return actionable design insights with cost tracking. + + Returns: + dict with keys: insights (list[dict]), cost_usd (float), input_tokens (int), output_tokens (int) + """ + if not is_available(): + raise RuntimeError("ANTHROPIC_API_KEY is not configured") + + client = anthropic.Anthropic(api_key=settings.ANTHROPIC_API_KEY) + + original_b64 = base64.standard_b64encode(original_image_bytes).decode("utf-8") + heatmap_b64 = base64.standard_b64encode(heatmap_image_bytes).decode("utf-8") + + score = analysis_metadata.get("overall_score", 0) + hotspots = analysis_metadata.get("hotspots", []) + gaze_sequence = analysis_metadata.get("gaze_sequence", []) + width = analysis_metadata.get("image_width", 0) + height = analysis_metadata.get("image_height", 0) + + metrics_text = f"""Analysis Metrics: +- Image dimensions: {width} x {height} pixels +- Overall Attention Score: {score}/100 (higher = more concentrated attention) +- Number of hotspots detected: {len(hotspots)} +- Top hotspot location: ({hotspots[0]['center_x']}, {hotspots[0]['center_y']}) with intensity {hotspots[0]['intensity']:.4f} +- First gaze fixation point: ({gaze_sequence[0]['x']}, {gaze_sequence[0]['y']}) — this is where viewers look first +""" if hotspots and gaze_sequence else f"""Analysis Metrics: +- Image dimensions: {width} x {height} pixels +- Overall Attention Score: {score}/100 +""" + + prompt = f"""You are a visual attention and design expert analyzing an image using saliency prediction data. You have been given: +1. The original image +2. A heatmap overlay showing predicted visual attention (warm colors = high attention, cool colors = low attention) +3. Numerical metrics from the analysis + +{metrics_text} + +Based on the original image, the heatmap overlay, and the metrics, provide exactly 4 actionable design insights. Each insight should be specific to THIS image — reference actual visual elements you can see (logos, text, products, faces, backgrounds, etc.). + +For each insight, provide: +- "type": one of "success" (something working well), "info" (neutral observation or suggestion), or "warning" (potential issue) +- "title": a short heading (5-10 words) +- "description": 1-2 sentences of specific, actionable advice + +Respond with ONLY a JSON array of 4 insight objects. No other text, no markdown formatting, just the JSON array. + +Example format: +[ + {{"type": "success", "title": "Strong focal point on product", "description": "The product image captures the highest predicted attention, which aligns well with the likely design goal. The bright contrast against the background naturally draws the eye."}}, + {{"type": "warning", "title": "CTA button may be overlooked", "description": "The call-to-action button in the lower right receives minimal predicted attention. Consider increasing its size, contrast, or moving it closer to the primary focal area."}} +]""" + + try: + message = client.messages.create( + model="claude-sonnet-4-6", + max_tokens=1024, + messages=[ + { + "role": "user", + "content": [ + { + "type": "image", + "source": { + "type": "base64", + "media_type": "image/png", + "data": original_b64, + }, + }, + { + "type": "image", + "source": { + "type": "base64", + "media_type": "image/png", + "data": heatmap_b64, + }, + }, + { + "type": "text", + "text": prompt, + }, + ], + } + ], + ) + + # Extract token usage and compute cost + input_tokens = message.usage.input_tokens + output_tokens = message.usage.output_tokens + cost_usd = round( + (input_tokens / 1_000_000) * INPUT_COST_PER_M + + (output_tokens / 1_000_000) * OUTPUT_COST_PER_M, + 6, + ) + + response_text = message.content[0].text.strip() + + # Handle potential markdown code block wrapping + if response_text.startswith("```"): + response_text = response_text.split("\n", 1)[1] + if response_text.endswith("```"): + response_text = response_text[:-3].strip() + + insights = json.loads(response_text) + + # Validate structure + validated = [] + for item in insights[:5]: # cap at 5 + if isinstance(item, dict) and "type" in item and "title" in item and "description" in item: + if item["type"] not in ("success", "info", "warning"): + item["type"] = "info" + validated.append({ + "type": item["type"], + "title": str(item["title"]), + "description": str(item["description"]), + }) + + return { + "insights": validated, + "cost_usd": cost_usd, + "input_tokens": input_tokens, + "output_tokens": output_tokens, + } + + except anthropic.APIError as e: + logger.error(f"Anthropic API error: {e}") + raise RuntimeError(f"AI analysis failed: {e.message}") + except json.JSONDecodeError as e: + logger.error(f"Failed to parse AI response: {e}") + raise RuntimeError("AI returned an unexpected response format") diff --git a/backend/app/services/aoi_analysis.py b/backend/app/services/aoi_analysis.py new file mode 100644 index 0000000..4e62abd --- /dev/null +++ b/backend/app/services/aoi_analysis.py @@ -0,0 +1,47 @@ +import numpy as np + + +def compute_aoi_attention( + saliency: np.ndarray, + regions: list[dict], +) -> list[dict]: + """ + Compute attention metrics for user-defined regions. + + Returns list of dicts with attention_pct, area_pct, attention_density. + """ + h, w = saliency.shape + total_saliency = saliency.sum() + total_area = h * w + + if total_saliency == 0: + return [ + {"attention_pct": 0.0, "area_pct": 0.0, "attention_density": 0.0} + for _ in regions + ] + + results = [] + for region in regions: + rx, ry = region["x"], region["y"] + rw, rh = region["width"], region["height"] + + # Clamp to image bounds + x1 = max(0, rx) + y1 = max(0, ry) + x2 = min(w, rx + rw) + y2 = min(h, ry + rh) + + region_saliency = saliency[y1:y2, x1:x2].sum() + region_area = (x2 - x1) * (y2 - y1) + + attention_pct = (region_saliency / total_saliency) * 100 + area_pct = (region_area / total_area) * 100 + density = attention_pct / max(area_pct, 0.01) + + results.append({ + "attention_pct": round(float(attention_pct), 2), + "area_pct": round(float(area_pct), 2), + "attention_density": round(float(density), 2), + }) + + return results diff --git a/backend/app/services/fonts/Montserrat-Bold.ttf b/backend/app/services/fonts/Montserrat-Bold.ttf new file mode 100644 index 0000000..a3dbde5 Binary files /dev/null and b/backend/app/services/fonts/Montserrat-Bold.ttf differ diff --git a/backend/app/services/fonts/Montserrat-Regular.ttf b/backend/app/services/fonts/Montserrat-Regular.ttf new file mode 100644 index 0000000..3ef210a Binary files /dev/null and b/backend/app/services/fonts/Montserrat-Regular.ttf differ diff --git a/backend/app/services/fonts/Montserrat-SemiBold.ttf b/backend/app/services/fonts/Montserrat-SemiBold.ttf new file mode 100644 index 0000000..e36320f Binary files /dev/null and b/backend/app/services/fonts/Montserrat-SemiBold.ttf differ diff --git a/backend/app/services/gaze_sequence.py b/backend/app/services/gaze_sequence.py new file mode 100644 index 0000000..e3f3780 --- /dev/null +++ b/backend/app/services/gaze_sequence.py @@ -0,0 +1,42 @@ +import numpy as np +from scipy.ndimage import gaussian_filter + + +def extract_gaze_sequence( + saliency: np.ndarray, + num_fixations: int = 5, + inhibition_radius_fraction: float = 0.1, +) -> list[dict]: + """ + Extract predicted fixation sequence using iterative peak finding + with inhibition-of-return. + """ + sal = saliency.copy().astype(np.float64) + h, w = sal.shape + inhibition_radius = int(max(h, w) * inhibition_radius_fraction) + fixations = [] + + for rank in range(1, num_fixations + 1): + smoothed = gaussian_filter(sal, sigma=max(h, w) * 0.01) + if smoothed.max() < 1e-10: + break + + peak_idx = np.unravel_index(np.argmax(smoothed), smoothed.shape) + y, x = int(peak_idx[0]), int(peak_idx[1]) + prob = float(saliency[y, x]) + + fixations.append({ + "rank": rank, + "x": x, + "y": y, + "x_pct": round(x / w * 100, 1), + "y_pct": round(y / h * 100, 1), + "probability": round(prob, 4), + }) + + # Inhibition of return + yy, xx = np.ogrid[:h, :w] + mask = (xx - x) ** 2 + (yy - y) ** 2 <= inhibition_radius ** 2 + sal[mask] = 0.0 + + return fixations diff --git a/backend/app/services/heatmap.py b/backend/app/services/heatmap.py new file mode 100644 index 0000000..f8da9e0 --- /dev/null +++ b/backend/app/services/heatmap.py @@ -0,0 +1,26 @@ +import matplotlib +matplotlib.use("Agg") +import matplotlib.cm as cm +import numpy as np +from PIL import Image + + +def generate_heatmap_overlay( + original: Image.Image, + saliency: np.ndarray, + colormap: str = "jet", + alpha: float = 0.5, +) -> Image.Image: + """Generate heatmap blended over original image.""" + cmap = matplotlib.colormaps.get_cmap(colormap) + heatmap_rgba = cmap(saliency) + heatmap_rgb = (heatmap_rgba[:, :, :3] * 255).astype(np.uint8) + heatmap_img = Image.fromarray(heatmap_rgb).resize(original.size, Image.LANCZOS) + return Image.blend(original.convert("RGB"), heatmap_img, alpha) + + +def generate_standalone_heatmap(saliency: np.ndarray, colormap: str = "jet") -> Image.Image: + """Generate a pure heatmap image.""" + cmap = matplotlib.colormaps.get_cmap(colormap) + heatmap_rgba = cmap(saliency) + return Image.fromarray((heatmap_rgba[:, :, :3] * 255).astype(np.uint8)) diff --git a/backend/app/services/image_processing.py b/backend/app/services/image_processing.py new file mode 100644 index 0000000..ef9978f --- /dev/null +++ b/backend/app/services/image_processing.py @@ -0,0 +1,24 @@ +import numpy as np +from PIL import Image +from scipy.ndimage import zoom + +MAX_INFERENCE_SIZE = 1024 + + +def prepare_for_inference(image: Image.Image) -> tuple[Image.Image, float]: + """Resize for model input. Returns (resized_image, scale_factor).""" + w, h = image.size + scale = MAX_INFERENCE_SIZE / max(w, h) + if scale < 1.0: + new_size = (int(w * scale), int(h * scale)) + return image.resize(new_size, Image.LANCZOS), scale + return image, 1.0 + + +def upscale_saliency(saliency: np.ndarray, target_h: int, target_w: int) -> np.ndarray: + """Upscale saliency map to original image dimensions.""" + if saliency.shape == (target_h, target_w): + return saliency + h_scale = target_h / saliency.shape[0] + w_scale = target_w / saliency.shape[1] + return zoom(saliency, (h_scale, w_scale), order=1) diff --git a/backend/app/services/insights.py b/backend/app/services/insights.py new file mode 100644 index 0000000..f619cd2 --- /dev/null +++ b/backend/app/services/insights.py @@ -0,0 +1,200 @@ +"""Rule-based insights engine for visual attention analysis. + +Generates actionable text insights from analysis metrics — +no AI needed, just conditional logic on the computed data. +""" + + +def generate_insights(analysis) -> list[dict]: + """Generate insights from a completed analysis. + + Args: + analysis: Analysis ORM object with overall_score, hotspots, gaze_sequence, + image_width, image_height. + + Returns: + List of dicts with keys: type (info|success|warning), title, description. + """ + insights = [] + + score = analysis.overall_score + hotspots = analysis.hotspots or [] + gaze_seq = analysis.gaze_sequence or [] + w = analysis.image_width + h = analysis.image_height + + if score is None or not hotspots: + return insights + + # 1. Attention Concentration + if score >= 60: + insights.append({ + "type": "success", + "title": "Strong focal point", + "description": ( + f"Attention is highly concentrated (score {score:.0f}/100). " + "Most viewers will fixate on the same areas — your design has a clear visual hierarchy." + ), + }) + elif score >= 30: + insights.append({ + "type": "info", + "title": "Moderate attention spread", + "description": ( + f"Attention is moderately distributed (score {score:.0f}/100). " + "Viewers will notice several areas. Consider whether your primary message " + "is prominent enough to stand out." + ), + }) + else: + insights.append({ + "type": "warning", + "title": "Diffuse attention", + "description": ( + f"Attention is widely spread (score {score:.0f}/100). " + "No single element dominates — viewers may struggle to find your key message. " + "Consider increasing contrast, size, or whitespace around your hero element." + ), + }) + + # 2. Dominant Focal Point + if len(hotspots) >= 2: + top = hotspots[0]["intensity"] + second = hotspots[1]["intensity"] + if top > 0 and second > 0: + ratio = top / second + if ratio >= 3: + insights.append({ + "type": "success", + "title": "Clear dominant element", + "description": ( + f"The top hotspot is {ratio:.1f}x stronger than the second — " + "your design has one unmistakable focal point. This is ideal for " + "ads with a single hero product or CTA." + ), + }) + elif ratio >= 1.5: + insights.append({ + "type": "info", + "title": "Moderate focal dominance", + "description": ( + f"The top hotspot is {ratio:.1f}x stronger than the second. " + "There's a primary focus but competing elements may split attention." + ), + }) + else: + insights.append({ + "type": "warning", + "title": "Competing focal points", + "description": ( + "The top two hotspots have similar intensity — viewers' eyes will " + "bounce between them. If one element is your priority, consider " + "making it larger, brighter, or more isolated." + ), + }) + + # 3. Gaze Entry Point + if gaze_seq: + first = gaze_seq[0] + x_pct = first.get("x_pct", first["x"] / w * 100 if w else 50) + y_pct = first.get("y_pct", first["y"] / h * 100 if h else 50) + + if y_pct < 33: + v_zone = "top" + elif y_pct < 66: + v_zone = "middle" + else: + v_zone = "bottom" + + if x_pct < 33: + h_zone = "left" + elif x_pct < 66: + h_zone = "center" + else: + h_zone = "right" + + position = f"{v_zone}-{h_zone}" + + insights.append({ + "type": "info", + "title": f"First fixation: {position}", + "description": ( + f"Viewers are predicted to look at the {position} area first " + f"({x_pct:.0f}% from left, {y_pct:.0f}% from top). " + "Place your most important message or brand element here for maximum impact." + ), + }) + + # 4. Spatial Balance + if len(hotspots) >= 3: + quadrants = {"TL": 0, "TR": 0, "BL": 0, "BR": 0} + for hs in hotspots: + cx = hs.get("center_x", hs["x"]) + cy = hs.get("center_y", hs["y"]) + q_h = "L" if cx < w / 2 else "R" + q_v = "T" if cy < h / 2 else "B" + quadrants[q_v + q_h] += 1 + + max_q = max(quadrants.values()) + max_q_name = { + "TL": "top-left", "TR": "top-right", + "BL": "bottom-left", "BR": "bottom-right", + } + dominant = [k for k, v in quadrants.items() if v == max_q] + + if max_q >= 3: + zone = max_q_name[dominant[0]] + insights.append({ + "type": "warning", + "title": f"Attention clusters in {zone}", + "description": ( + f"{max_q} of {len(hotspots)} hotspots fall in the {zone} quadrant. " + "The opposite areas of your design may go largely unnoticed. " + "Consider rebalancing if key information is in the neglected zones." + ), + }) + + # 5. Edge Risk + edge_threshold = 0.10 # 10% from edge + edge_hotspots = [] + for hs in hotspots[:3]: # check top 3 + cx = hs.get("center_x", hs["x"]) + cy = hs.get("center_y", hs["y"]) + near_edge = ( + cx < w * edge_threshold + or cx > w * (1 - edge_threshold) + or cy < h * edge_threshold + or cy > h * (1 - edge_threshold) + ) + if near_edge: + edge_hotspots.append(hs["rank"]) + + if edge_hotspots: + ranks = ", ".join(f"#{r}" for r in edge_hotspots) + insights.append({ + "type": "warning", + "title": "Key attention near edge", + "description": ( + f"Hotspot {ranks} {'is' if len(edge_hotspots) == 1 else 'are'} close to the " + "image edge. When printed or cropped, this attention area may be partially cut off. " + "Consider adding safe margins around critical content." + ), + }) + + # 6. Attention Drop-off + if len(hotspots) >= 3: + intensities = [hs["intensity"] for hs in hotspots[:5]] + if intensities[0] > 0: + dropoff = intensities[-1] / intensities[0] + if dropoff < 0.2: + insights.append({ + "type": "info", + "title": "Steep attention drop-off", + "description": ( + f"Attention drops sharply from hotspot #1 ({intensities[0]:.0%}) to " + f"#{len(intensities)} ({intensities[-1]:.0%}). This means the design " + "has a very strong primary focus but secondary elements get little attention." + ), + }) + + return insights diff --git a/backend/app/services/report_generator.py b/backend/app/services/report_generator.py new file mode 100644 index 0000000..ef2e02d --- /dev/null +++ b/backend/app/services/report_generator.py @@ -0,0 +1,439 @@ +import io +import os +from datetime import datetime + +from PIL import Image as PILImage +from reportlab.lib import colors +from reportlab.lib.pagesizes import A4 +from reportlab.lib.styles import ParagraphStyle +from reportlab.lib.units import inch, mm +from reportlab.pdfbase import pdfmetrics +from reportlab.pdfbase.ttfonts import TTFont +from reportlab.platypus import ( + Image, + PageBreak, + Paragraph, + SimpleDocTemplate, + Spacer, + Table, + TableStyle, +) + +# ─── Colors ────────────────────────────────────────── +NAVY = colors.HexColor("#1a1a2e") +GOLD = colors.HexColor("#ffc407") +GOLD_LIGHT = colors.HexColor("#fff8e0") +LIGHT_GRAY = colors.HexColor("#f5f5f5") +MEDIUM_GRAY = colors.HexColor("#666666") +DARK_TEXT = colors.HexColor("#333333") +WHITE = colors.white +GREEN = colors.HexColor("#16a34a") +BLUE = colors.HexColor("#2563eb") +AMBER = colors.HexColor("#d97706") +PURPLE = colors.HexColor("#7c3aed") + +# ─── Register Montserrat fonts ────────────────────── +FONT_DIR = os.path.join(os.path.dirname(__file__), "fonts") + +pdfmetrics.registerFont(TTFont("Montserrat", os.path.join(FONT_DIR, "Montserrat-Regular.ttf"))) +pdfmetrics.registerFont(TTFont("Montserrat-Bold", os.path.join(FONT_DIR, "Montserrat-Bold.ttf"))) +pdfmetrics.registerFont(TTFont("Montserrat-SemiBold", os.path.join(FONT_DIR, "Montserrat-SemiBold.ttf"))) + +pdfmetrics.registerFontFamily( + "Montserrat", + normal="Montserrat", + bold="Montserrat-Bold", +) + + +def _bytes_to_image(data: bytes) -> io.BytesIO: + buf = io.BytesIO(data) + buf.seek(0) + return buf + + +def _make_styles(): + title = ParagraphStyle( + "Title", + fontName="Montserrat-Bold", + fontSize=32, + textColor=NAVY, + spaceAfter=6, + leading=38, + ) + subtitle = ParagraphStyle( + "Subtitle", + fontName="Montserrat", + fontSize=14, + textColor=GOLD, + spaceAfter=20, + leading=18, + ) + heading = ParagraphStyle( + "Heading", + fontName="Montserrat-Bold", + fontSize=18, + textColor=NAVY, + spaceBefore=12, + spaceAfter=8, + leading=22, + ) + subheading = ParagraphStyle( + "Subheading", + fontName="Montserrat-SemiBold", + fontSize=13, + textColor=NAVY, + spaceBefore=8, + spaceAfter=4, + leading=16, + ) + body = ParagraphStyle( + "Body", + fontName="Montserrat", + fontSize=10, + textColor=DARK_TEXT, + spaceAfter=6, + leading=14, + ) + body_small = ParagraphStyle( + "BodySmall", + fontName="Montserrat", + fontSize=9, + textColor=MEDIUM_GRAY, + spaceAfter=4, + leading=12, + ) + meta_label = ParagraphStyle( + "MetaLabel", + fontName="Montserrat-SemiBold", + fontSize=10, + textColor=MEDIUM_GRAY, + spaceAfter=2, + ) + meta_value = ParagraphStyle( + "MetaValue", + fontName="Montserrat-Bold", + fontSize=14, + textColor=NAVY, + spaceAfter=8, + ) + footer = ParagraphStyle( + "Footer", + fontName="Montserrat", + fontSize=8, + textColor=MEDIUM_GRAY, + alignment=1, # center + ) + return { + "title": title, + "subtitle": subtitle, + "heading": heading, + "subheading": subheading, + "body": body, + "body_small": body_small, + "meta_label": meta_label, + "meta_value": meta_value, + "footer": footer, + } + + +def _insight_type_label(t: str) -> tuple[str, colors.Color]: + return { + "success": ("STRENGTH", GREEN), + "warning": ("ATTENTION", AMBER), + "info": ("INSIGHT", BLUE), + }.get(t, ("INSIGHT", BLUE)) + + +def _build_insight_table(insights: list[dict], styles: dict, is_ai: bool = False) -> list: + """Build styled insight rows as ReportLab elements.""" + elements = [] + for insight in insights: + label_text, label_color = _insight_type_label(insight["type"]) + accent = PURPLE if is_ai else label_color + + # Build a mini table for each insight card + badge = f'{label_text}' + title = f'{insight["title"]}' + desc = f'{insight["description"]}' + + content = Paragraph(f"{badge}
{title}
{desc}", styles["body"]) + + t = Table( + [[content]], + colWidths=[170 * mm], + ) + t.setStyle(TableStyle([ + ("BACKGROUND", (0, 0), (-1, -1), GOLD_LIGHT if is_ai else LIGHT_GRAY), + ("LEFTPADDING", (0, 0), (-1, -1), 10), + ("RIGHTPADDING", (0, 0), (-1, -1), 10), + ("TOPPADDING", (0, 0), (-1, -1), 8), + ("BOTTOMPADDING", (0, 0), (-1, -1), 8), + ("ROUNDEDCORNERS", [4, 4, 4, 4]), + ("LINEBEFOREDECORCOLOR", (0, 0), (0, -1), accent), + # Left accent border + ("LINEBEFORE", (0, 0), (0, -1), 3, accent), + ])) + elements.append(t) + elements.append(Spacer(1, 4)) + + return elements + + +def generate_report( + analysis, + original_image: bytes, + heatmap_image: bytes, + gaze_image: bytes, + aois: list, + rule_insights: list[dict] | None = None, + ai_insights: list[dict] | None = None, + ai_cost_usd: float | None = None, +) -> bytes: + """Generate a professional PDF report for an analysis.""" + buffer = io.BytesIO() + doc = SimpleDocTemplate( + buffer, + pagesize=A4, + topMargin=20 * mm, + bottomMargin=20 * mm, + leftMargin=15 * mm, + rightMargin=15 * mm, + ) + + styles = _make_styles() + elements = [] + + # ─── Cover Page ────────────────────────────────────────── + elements.append(Spacer(1, 50)) + elements.append(Paragraph("OliVAS", styles["title"])) + elements.append(Paragraph("Visual Attention Analysis Report", styles["subtitle"])) + elements.append(Spacer(1, 8)) + + # Gold divider line + divider = Table([[""]], colWidths=[60 * mm], rowHeights=[2]) + divider.setStyle(TableStyle([ + ("BACKGROUND", (0, 0), (-1, -1), GOLD), + ("LEFTPADDING", (0, 0), (-1, -1), 0), + ("RIGHTPADDING", (0, 0), (-1, -1), 0), + ("TOPPADDING", (0, 0), (-1, -1), 0), + ("BOTTOMPADDING", (0, 0), (-1, -1), 0), + ])) + elements.append(divider) + elements.append(Spacer(1, 20)) + + # Metadata grid + meta_data = [ + ["ANALYSIS", "MODEL", "DATE", "IMAGE SIZE"], + [ + analysis.name, + analysis.model_used.replace("_", " ").title(), + datetime.now().strftime("%B %d, %Y"), + f"{analysis.image_width} x {analysis.image_height}", + ], + ] + meta_table = Table(meta_data, colWidths=[45 * mm] * 4) + meta_table.setStyle(TableStyle([ + ("FONTNAME", (0, 0), (-1, 0), "Montserrat-SemiBold"), + ("FONTSIZE", (0, 0), (-1, 0), 8), + ("TEXTCOLOR", (0, 0), (-1, 0), MEDIUM_GRAY), + ("FONTNAME", (0, 1), (-1, 1), "Montserrat-Bold"), + ("FONTSIZE", (0, 1), (-1, 1), 11), + ("TEXTCOLOR", (0, 1), (-1, 1), NAVY), + ("TOPPADDING", (0, 0), (-1, -1), 4), + ("BOTTOMPADDING", (0, 0), (-1, -1), 4), + ("VALIGN", (0, 0), (-1, -1), "TOP"), + ])) + elements.append(meta_table) + elements.append(Spacer(1, 10)) + + # Score badge + if analysis.overall_score is not None: + score = analysis.overall_score + score_color = GREEN if score >= 60 else (AMBER if score >= 30 else colors.HexColor("#ef4444")) + score_text = f'ATTENTION SCORE
{score:.0f} / 100' + elements.append(Paragraph(score_text, styles["body"])) + elements.append(Spacer(1, 10)) + + # Thumbnail on cover + max_width = 160 * mm + img = PILImage.open(io.BytesIO(original_image)) + aspect = img.width / img.height + img_width = min(max_width, 130 * mm) + img_height = img_width / aspect + if img_height > 90 * mm: + img_height = 90 * mm + img_width = img_height * aspect + elements.append(Image(_bytes_to_image(original_image), width=img_width, height=img_height)) + + elements.append(PageBreak()) + + # ─── Heatmap Page ──────────────────────────────────────── + elements.append(Paragraph("Attention Heatmap", styles["heading"])) + elements.append( + Paragraph( + "Areas highlighted in warm colors (red/yellow) indicate high predicted " + "attention during the first 3-5 seconds of viewing. Cool colors (blue) " + "indicate lower attention probability.", + styles["body"], + ) + ) + elements.append(Spacer(1, 8)) + elements.append(Image(_bytes_to_image(heatmap_image), width=img_width, height=img_height)) + + elements.append(PageBreak()) + + # ─── Gaze Sequence Page ────────────────────────────────── + elements.append(Paragraph("Predicted Gaze Sequence", styles["heading"])) + elements.append( + Paragraph( + "Numbered points show the predicted order in which viewers will " + "fixate on different areas of the design. Point #1 is where the eye " + "lands first.", + styles["body"], + ) + ) + elements.append(Spacer(1, 8)) + elements.append(Image(_bytes_to_image(gaze_image), width=img_width, height=img_height)) + + if analysis.gaze_sequence: + elements.append(Spacer(1, 10)) + elements.append(Paragraph("Fixation Details", styles["subheading"])) + table_data = [["#", "Position", "From Left", "From Top", "Probability"]] + for point in analysis.gaze_sequence: + table_data.append([ + str(point["rank"]), + f"({point['x']}, {point['y']})", + f"{point['x_pct']:.1f}%", + f"{point['y_pct']:.1f}%", + f"{point['probability']:.1%}", + ]) + t = Table(table_data, colWidths=[25, 80, 60, 60, 70]) + t.setStyle(TableStyle([ + ("BACKGROUND", (0, 0), (-1, 0), NAVY), + ("TEXTCOLOR", (0, 0), (-1, 0), WHITE), + ("FONTNAME", (0, 0), (-1, 0), "Montserrat-SemiBold"), + ("FONTNAME", (0, 1), (-1, -1), "Montserrat"), + ("FONTSIZE", (0, 0), (-1, -1), 9), + ("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#dddddd")), + ("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, LIGHT_GRAY]), + ("ALIGN", (0, 0), (-1, -1), "CENTER"), + ("TOPPADDING", (0, 0), (-1, -1), 5), + ("BOTTOMPADDING", (0, 0), (-1, -1), 5), + ])) + elements.append(t) + + # ─── Hotspots Page ─────────────────────────────────────── + if analysis.hotspots: + elements.append(PageBreak()) + elements.append(Paragraph("Attention Hotspots", styles["heading"])) + elements.append( + Paragraph( + "The top regions ranked by predicted attention intensity. Higher rank " + "means more predicted visual attention.", + styles["body"], + ) + ) + elements.append(Spacer(1, 8)) + + hs_data = [["Rank", "Position (x, y)", "Intensity"]] + for hs in analysis.hotspots: + cx = hs.get("center_x", hs["x"]) + cy = hs.get("center_y", hs["y"]) + hs_data.append([ + f"#{hs['rank']}", + f"({cx}, {cy})", + f"{hs['intensity']:.2%}", + ]) + t = Table(hs_data, colWidths=[50, 120, 80]) + t.setStyle(TableStyle([ + ("BACKGROUND", (0, 0), (-1, 0), NAVY), + ("TEXTCOLOR", (0, 0), (-1, 0), WHITE), + ("FONTNAME", (0, 0), (-1, 0), "Montserrat-SemiBold"), + ("FONTNAME", (0, 1), (-1, -1), "Montserrat"), + ("FONTSIZE", (0, 0), (-1, -1), 9), + ("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#dddddd")), + ("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, LIGHT_GRAY]), + ("ALIGN", (0, 0), (-1, -1), "CENTER"), + ("TOPPADDING", (0, 0), (-1, -1), 5), + ("BOTTOMPADDING", (0, 0), (-1, -1), 5), + ])) + elements.append(t) + + # ─── Insights Page ─────────────────────────────────────── + has_rule = rule_insights and len(rule_insights) > 0 + has_ai = ai_insights and len(ai_insights) > 0 + + if has_rule or has_ai: + elements.append(PageBreak()) + elements.append(Paragraph("Analysis Insights", styles["heading"])) + + if has_rule: + elements.append(Paragraph("Rule-Based Insights", styles["subheading"])) + elements.append( + Paragraph( + "Automatically generated observations based on the attention metrics.", + styles["body_small"], + ) + ) + elements.append(Spacer(1, 6)) + elements.extend(_build_insight_table(rule_insights, styles, is_ai=False)) + elements.append(Spacer(1, 12)) + + if has_ai: + elements.append(Paragraph("AI Design Analysis", styles["subheading"])) + ai_note = "Generated by Claude Sonnet 4.6 — context-aware design recommendations." + if ai_cost_usd is not None: + ai_note += f" (Cost: ${ai_cost_usd:.4f})" + elements.append(Paragraph(ai_note, styles["body_small"])) + elements.append(Spacer(1, 6)) + elements.extend(_build_insight_table(ai_insights, styles, is_ai=True)) + + # ─── AOI Page (if any) ─────────────────────────────────── + if aois: + elements.append(PageBreak()) + elements.append(Paragraph("Areas of Interest", styles["heading"])) + elements.append( + Paragraph( + "User-defined regions analyzed for predicted attention capture. " + "Density > 1.0 means the region captures more attention than its " + "size would suggest.", + styles["body"], + ) + ) + elements.append(Spacer(1, 8)) + + aoi_data = [["Region", "Attention %", "Area %", "Density"]] + for aoi in aois: + aoi_data.append([ + aoi.label, + f"{aoi.attention_pct:.1f}%", + f"{aoi.area_pct:.1f}%", + f"{aoi.attention_density:.2f}x", + ]) + t = Table(aoi_data, colWidths=[100, 70, 70, 70]) + t.setStyle(TableStyle([ + ("BACKGROUND", (0, 0), (-1, 0), NAVY), + ("TEXTCOLOR", (0, 0), (-1, 0), WHITE), + ("FONTNAME", (0, 0), (-1, 0), "Montserrat-SemiBold"), + ("FONTNAME", (0, 1), (-1, -1), "Montserrat"), + ("FONTSIZE", (0, 0), (-1, -1), 9), + ("GRID", (0, 0), (-1, -1), 0.5, colors.HexColor("#dddddd")), + ("ROWBACKGROUNDS", (0, 1), (-1, -1), [WHITE, LIGHT_GRAY]), + ("ALIGN", (1, 0), (-1, -1), "CENTER"), + ("TOPPADDING", (0, 0), (-1, -1), 5), + ("BOTTOMPADDING", (0, 0), (-1, -1), 5), + ])) + elements.append(t) + + # ─── Footer ────────────────────────────────────────────── + elements.append(Spacer(1, 30)) + elements.append( + Paragraph( + "Generated by OliVAS — Open-Source Visual Attention Software by OLIVER", + styles["footer"], + ) + ) + + doc.build(elements) + return buffer.getvalue() diff --git a/backend/app/services/saliency/__init__.py b/backend/app/services/saliency/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/services/saliency/base.py b/backend/app/services/saliency/base.py new file mode 100644 index 0000000..238e23b --- /dev/null +++ b/backend/app/services/saliency/base.py @@ -0,0 +1,19 @@ +from abc import ABC, abstractmethod + +import numpy as np +from PIL import Image + + +class BaseSaliencyModel(ABC): + @abstractmethod + def load(self) -> None: + ... + + @abstractmethod + def predict(self, image: Image.Image) -> np.ndarray: + """Returns 2D array (H, W) with values in [0, 1].""" + ... + + @abstractmethod + def get_name(self) -> str: + ... diff --git a/backend/app/services/saliency/deepgaze.py b/backend/app/services/saliency/deepgaze.py new file mode 100644 index 0000000..c9c03cd --- /dev/null +++ b/backend/app/services/saliency/deepgaze.py @@ -0,0 +1,93 @@ +import logging + +import numpy as np +import torch +from PIL import Image +from scipy.ndimage import zoom as scipy_zoom +from scipy.special import logsumexp + +from app.services.saliency.base import BaseSaliencyModel + +logger = logging.getLogger("olivas.deepgaze") + +# Map variant keys to deepgaze_pytorch classes +VARIANT_MAP = { + "I": ("DeepGazeI", "DeepGaze I"), + "IIE": ("DeepGazeIIE", "DeepGaze IIE"), + "III": ("DeepGazeIII", "DeepGaze III"), +} + + +class DeepGazeModel(BaseSaliencyModel): + """Unified wrapper for all DeepGaze model variants (I, IIE, III).""" + + def __init__(self, variant: str = "IIE", device: str = "cpu"): + if variant not in VARIANT_MAP: + raise ValueError(f"Unknown DeepGaze variant: {variant}. Choose from {list(VARIANT_MAP.keys())}") + self.variant = variant + self.class_name, self.display_name = VARIANT_MAP[variant] + self.device = torch.device(device) + self.model = None + self.centerbias_template = None + + def load(self) -> None: + import deepgaze_pytorch + + logger.info(f"Loading {self.display_name} on {self.device}...") + model_cls = getattr(deepgaze_pytorch, self.class_name) + self.model = model_cls(pretrained=True).to(self.device) + self.model.eval() + + self._create_default_centerbias() + logger.info(f"{self.display_name} loaded successfully") + + def _create_default_centerbias(self): + """Create a generic center bias prior (Gaussian centered).""" + size = 1024 + x = np.linspace(-1, 1, size) + y = np.linspace(-1, 1, size) + xx, yy = np.meshgrid(x, y) + self.centerbias_template = -0.5 * (xx**2 + yy**2) / 0.5**2 + + def predict(self, image: Image.Image) -> np.ndarray: + img_np = np.array(image.convert("RGB")) + h, w = img_np.shape[:2] + + # Prepare image tensor [1, C, H, W] + image_tensor = ( + torch.tensor([img_np.transpose(2, 0, 1)]) + .float() + .to(self.device) + ) + + # Prepare centerbias + cb = scipy_zoom( + self.centerbias_template, + (h / self.centerbias_template.shape[0], w / self.centerbias_template.shape[1]), + order=0, + ) + cb -= logsumexp(cb) + centerbias_tensor = ( + torch.tensor([cb]).float().to(self.device) + ) + + with torch.no_grad(): + log_density = self.model(image_tensor, centerbias_tensor) + + saliency = torch.exp(log_density).cpu().numpy().squeeze() + + # Normalize to [0, 1] + sal_min, sal_max = saliency.min(), saliency.max() + if sal_max - sal_min > 1e-10: + saliency = (saliency - sal_min) / (sal_max - sal_min) + else: + saliency = np.zeros_like(saliency) + + return saliency + + def get_name(self) -> str: + return self.display_name + + +# Backwards-compatible alias +DeepGazeIIEModel = lambda device="cpu": DeepGazeModel(variant="IIE", device=device) diff --git a/backend/app/services/saliency/model_manager.py b/backend/app/services/saliency/model_manager.py new file mode 100644 index 0000000..3e38b10 --- /dev/null +++ b/backend/app/services/saliency/model_manager.py @@ -0,0 +1,55 @@ +import logging + +import numpy as np +from PIL import Image + +from app.services.saliency.base import BaseSaliencyModel + +logger = logging.getLogger("olivas.model_manager") + + +class ModelManager: + def __init__(self): + self.models: dict[str, BaseSaliencyModel] = {} + self.default_model = "deepgaze_iie" + + def load_models(self, device: str = "cpu") -> None: + from app.services.saliency.deepgaze import DeepGazeModel + + variants = [ + ("deepgaze_i", "I"), + ("deepgaze_iie", "IIE"), + ("deepgaze_iii", "III"), + ] + + for key, variant in variants: + try: + model = DeepGazeModel(variant=variant, device=device) + model.load() + self.models[key] = model + logger.info(f"Loaded {model.get_name()}") + except Exception as e: + logger.warning(f"Failed to load DeepGaze {variant}: {e}") + + def predict(self, image: Image.Image, model_name: str | None = None) -> np.ndarray: + name = model_name or self.default_model + if name not in self.models: + raise RuntimeError(f"Model '{name}' not loaded. Available: {list(self.models.keys())}") + return self.models[name].predict(image) + + def list_models(self) -> list[dict]: + return [ + {"id": key, "name": model.get_name()} for key, model in self.models.items() + ] + + def cleanup(self): + self.models.clear() + try: + import torch + if torch.cuda.is_available(): + torch.cuda.empty_cache() + except ImportError: + pass + + +model_manager = ModelManager() diff --git a/backend/app/services/storage.py b/backend/app/services/storage.py new file mode 100644 index 0000000..b650568 --- /dev/null +++ b/backend/app/services/storage.py @@ -0,0 +1,44 @@ +import os +from pathlib import Path + +import aiofiles + +from app.config import settings + + +class LocalStorage: + def __init__(self): + self.base_dir = Path(settings.UPLOAD_DIR) + self.base_dir.mkdir(parents=True, exist_ok=True) + + def analysis_dir(self, analysis_id: str) -> Path: + path = self.base_dir / analysis_id + path.mkdir(parents=True, exist_ok=True) + return path + + async def save_bytes(self, data: bytes, analysis_id: str, filename: str) -> str: + dir_path = self.analysis_dir(analysis_id) + file_path = dir_path / filename + async with aiofiles.open(file_path, "wb") as f: + await f.write(data) + return str(file_path) + + async def load_bytes(self, analysis_id: str, filename: str) -> bytes: + file_path = self.analysis_dir(analysis_id) / filename + async with aiofiles.open(file_path, "rb") as f: + return await f.read() + + def get_path(self, analysis_id: str, filename: str) -> Path: + return self.analysis_dir(analysis_id) / filename + + def exists(self, analysis_id: str, filename: str) -> bool: + return (self.analysis_dir(analysis_id) / filename).exists() + + async def delete_analysis(self, analysis_id: str) -> None: + import shutil + dir_path = self.base_dir / analysis_id + if dir_path.exists(): + shutil.rmtree(dir_path) + + +storage = LocalStorage() diff --git a/backend/pyproject.toml b/backend/pyproject.toml new file mode 100644 index 0000000..92ffe7c --- /dev/null +++ b/backend/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "olivas-backend" +version = "0.1.0" +description = "OliVAS - Open-Source Visual Attention Software backend" +requires-python = ">=3.12" +dependencies = [ + "fastapi>=0.115.0", + "uvicorn[standard]>=0.30.0", + "python-multipart>=0.0.9", + "sqlalchemy[asyncio]>=2.0", + "alembic>=1.13", + "asyncpg>=0.29", + "pydantic>=2.0", + "pydantic-settings>=2.0", + "pillow>=10.0", + "numpy>=1.26", + "torch>=2.1", + "torchvision>=0.16", + "scipy>=1.11", + "matplotlib>=3.8", + "scikit-image>=0.22", + "reportlab>=4.0", + "aiofiles>=23.0", + "anthropic>=0.40", +] + +[project.optional-dependencies] +dev = [ + "pytest>=8.0", + "pytest-asyncio>=0.23", + "httpx>=0.27", + "ruff>=0.4", +] + +[build-system] +requires = ["setuptools>=68.0"] +build-backend = "setuptools.build_meta" + +[tool.ruff] +line-length = 100 +target-version = "py312" + +[tool.pytest.ini_options] +asyncio_mode = "auto" +testpaths = ["tests"] diff --git a/backend/tests/__init__.py b/backend/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py new file mode 100644 index 0000000..57f7ece --- /dev/null +++ b/backend/tests/conftest.py @@ -0,0 +1,51 @@ +import asyncio + +import pytest +import pytest_asyncio +from httpx import ASGITransport, AsyncClient +from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine + +from app.main import app +from app.models.base import Base +from app.db.session import get_db + + +# Use SQLite for tests +TEST_DATABASE_URL = "sqlite+aiosqlite:///./test.db" + + +@pytest.fixture(scope="session") +def event_loop(): + loop = asyncio.new_event_loop() + yield loop + loop.close() + + +@pytest_asyncio.fixture +async def db_engine(): + engine = create_async_engine(TEST_DATABASE_URL, echo=False) + async with engine.begin() as conn: + await conn.run_sync(Base.metadata.create_all) + yield engine + async with engine.begin() as conn: + await conn.run_sync(Base.metadata.drop_all) + await engine.dispose() + + +@pytest_asyncio.fixture +async def db_session(db_engine): + session_factory = async_sessionmaker(db_engine, class_=AsyncSession, expire_on_commit=False) + async with session_factory() as session: + yield session + + +@pytest_asyncio.fixture +async def client(db_session): + async def override_get_db(): + yield db_session + + app.dependency_overrides[get_db] = override_get_db + transport = ASGITransport(app=app) + async with AsyncClient(transport=transport, base_url="http://test") as ac: + yield ac + app.dependency_overrides.clear() diff --git a/backend/tests/test_analysis.py b/backend/tests/test_analysis.py new file mode 100644 index 0000000..305c4c2 --- /dev/null +++ b/backend/tests/test_analysis.py @@ -0,0 +1,94 @@ +import numpy as np +import pytest + +from app.services.gaze_sequence import extract_gaze_sequence +from app.services.aoi_analysis import compute_aoi_attention +from app.services.heatmap import generate_heatmap_overlay, generate_standalone_heatmap +from app.services.image_processing import prepare_for_inference, upscale_saliency +from PIL import Image + + +class TestGazeSequence: + def test_extracts_correct_number_of_fixations(self): + saliency = np.random.rand(100, 100) + result = extract_gaze_sequence(saliency, num_fixations=5) + assert len(result) == 5 + + def test_fixations_are_ranked(self): + saliency = np.random.rand(100, 100) + result = extract_gaze_sequence(saliency, num_fixations=3) + ranks = [p["rank"] for p in result] + assert ranks == [1, 2, 3] + + def test_first_fixation_is_at_peak(self): + saliency = np.zeros((100, 100)) + saliency[50, 75] = 1.0 # Set a clear peak + result = extract_gaze_sequence(saliency, num_fixations=1) + assert result[0]["x"] == 75 + assert result[0]["y"] == 50 + + def test_coordinates_have_percentages(self): + saliency = np.random.rand(200, 300) + result = extract_gaze_sequence(saliency, num_fixations=1) + assert 0 <= result[0]["x_pct"] <= 100 + assert 0 <= result[0]["y_pct"] <= 100 + + +class TestAOIAnalysis: + def test_full_image_aoi_gets_100_percent(self): + saliency = np.ones((100, 100)) + regions = [{"x": 0, "y": 0, "width": 100, "height": 100}] + result = compute_aoi_attention(saliency, regions) + assert abs(result[0]["attention_pct"] - 100.0) < 0.1 + + def test_half_image_aoi(self): + saliency = np.ones((100, 100)) + regions = [{"x": 0, "y": 0, "width": 50, "height": 100}] + result = compute_aoi_attention(saliency, regions) + assert abs(result[0]["attention_pct"] - 50.0) < 1.0 + + def test_density_calculation(self): + saliency = np.zeros((100, 100)) + saliency[0:10, 0:10] = 1.0 # High saliency in small region + regions = [{"x": 0, "y": 0, "width": 10, "height": 10}] + result = compute_aoi_attention(saliency, regions) + assert result[0]["attention_density"] > 1.0 + + def test_zero_saliency(self): + saliency = np.zeros((100, 100)) + regions = [{"x": 0, "y": 0, "width": 50, "height": 50}] + result = compute_aoi_attention(saliency, regions) + assert result[0]["attention_pct"] == 0.0 + + +class TestHeatmap: + def test_generates_overlay(self): + img = Image.new("RGB", (100, 100), color="white") + saliency = np.random.rand(100, 100) + result = generate_heatmap_overlay(img, saliency) + assert result.size == (100, 100) + assert result.mode == "RGB" + + def test_generates_standalone(self): + saliency = np.random.rand(100, 100) + result = generate_standalone_heatmap(saliency) + assert result.size == (100, 100) + + +class TestImageProcessing: + def test_resize_large_image(self): + img = Image.new("RGB", (2000, 1000)) + resized, scale = prepare_for_inference(img) + assert max(resized.size) <= 1024 + assert scale < 1.0 + + def test_no_resize_small_image(self): + img = Image.new("RGB", (500, 300)) + resized, scale = prepare_for_inference(img) + assert resized.size == (500, 300) + assert scale == 1.0 + + def test_upscale_saliency(self): + saliency = np.random.rand(50, 50) + result = upscale_saliency(saliency, 200, 300) + assert result.shape == (200, 300) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..963cf3b --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,16 @@ +services: + backend: + build: + context: ./backend + command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload + volumes: + - ./backend:/app + - uploads:/app/data/uploads + + frontend: + build: + context: ./frontend + command: npm run dev -- --host 0.0.0.0 + volumes: + - ./frontend:/app + - /app/node_modules diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4e0954c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,42 @@ +services: + postgres: + image: postgres:16-alpine + ports: + - "5453:5432" + environment: + POSTGRES_USER: olivas + POSTGRES_PASSWORD: olivas + POSTGRES_DB: olivas + volumes: + - pgdata:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U olivas"] + interval: 5s + timeout: 5s + retries: 5 + + backend: + build: ./backend + ports: + - "8000:8000" + environment: + DATABASE_URL: postgresql+asyncpg://olivas:olivas@postgres:5432/olivas + UPLOAD_DIR: /app/data/uploads + DEVICE: auto + CORS_ORIGINS: http://localhost:1577 + volumes: + - uploads:/app/data/uploads + depends_on: + postgres: + condition: service_healthy + + frontend: + build: ./frontend + ports: + - "1577:1577" + depends_on: + - backend + +volumes: + pgdata: + uploads: diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/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/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..b6252c7 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,13 @@ +FROM node:20-alpine AS build + +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci +COPY . . +RUN npm run build + +FROM nginx:alpine +COPY --from=build /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 1577 +CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000..d2e7761 --- /dev/null +++ b/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 [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## 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/frontend/eslint.config.js b/frontend/eslint.config.js new file mode 100644 index 0000000..5e6b472 --- /dev/null +++ b/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/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..0772292 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,16 @@ + + + + + + + + + + OliVAS + + +
+ + + diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..670a2ef --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,18 @@ +server { + listen 1577; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + location /api { + proxy_pass http://backend:8000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + client_max_body_size 50M; + } + + location / { + try_files $uri $uri/ /index.html; + } +} diff --git a/frontend/package-lock.json b/frontend/package-lock.json new file mode 100644 index 0000000..2502453 --- /dev/null +++ b/frontend/package-lock.json @@ -0,0 +1,4364 @@ +{ + "name": "frontend", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "frontend", + "version": "0.0.0", + "dependencies": { + "@tailwindcss/vite": "^4.2.1", + "@tanstack/react-query": "^5.90.21", + "axios": "^1.13.5", + "konva": "^10.2.0", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "react-dropzone": "^15.0.0", + "react-konva": "^19.2.2", + "react-router-dom": "^7.13.1", + "tailwindcss": "^4.2.1", + "zustand": "^5.0.11" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@types/node": "^24.10.1", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "typescript": "~5.9.3", + "typescript-eslint": "^8.48.0", + "vite": "^7.3.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", + "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-plugin-utils": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", + "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.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.28.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz", + "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz", + "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.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/@esbuild/aix-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", + "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", + "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", + "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", + "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", + "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", + "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", + "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", + "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", + "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", + "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", + "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", + "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", + "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", + "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", + "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", + "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", + "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", + "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", + "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", + "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", + "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", + "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", + "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", + "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", + "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", + "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "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.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "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.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", + "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "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.2", + "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.3", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.3.tgz", + "integrity": "sha512-1B1VkCq6FuUNlQvlBYb+1jDu/gV297TIs/OeiaSR9l1H27SVW55ONE1e1Vp16NqP683+xEGzxYtv4XCiDPaQiw==", + "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==", + "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==", + "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==", + "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==", + "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==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", + "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.59.0.tgz", + "integrity": "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.59.0.tgz", + "integrity": "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.59.0.tgz", + "integrity": "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz", + "integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.59.0.tgz", + "integrity": "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.59.0.tgz", + "integrity": "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.59.0.tgz", + "integrity": "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.59.0.tgz", + "integrity": "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.59.0.tgz", + "integrity": "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.59.0.tgz", + "integrity": "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.59.0.tgz", + "integrity": "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.59.0.tgz", + "integrity": "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.59.0.tgz", + "integrity": "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.59.0.tgz", + "integrity": "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.59.0.tgz", + "integrity": "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.59.0.tgz", + "integrity": "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.59.0.tgz", + "integrity": "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz", + "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.59.0.tgz", + "integrity": "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.59.0.tgz", + "integrity": "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.59.0.tgz", + "integrity": "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.59.0.tgz", + "integrity": "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.59.0.tgz", + "integrity": "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.59.0.tgz", + "integrity": "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.59.0.tgz", + "integrity": "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@tailwindcss/node": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.2.1.tgz", + "integrity": "sha512-jlx6sLk4EOwO6hHe1oCGm1Q4AN/s0rSrTTPBGPM0/RQ6Uylwq17FuU8IeJJKEjtc6K6O07zsvP+gDO6MMWo7pg==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.19.0", + "jiti": "^2.6.1", + "lightningcss": "1.31.1", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.2.1" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.2.1.tgz", + "integrity": "sha512-yv9jeEFWnjKCI6/T3Oq50yQEOqmpmpfzG1hcZsAOaXFQPfzWprWrlHSdGPEF3WQTi8zu8ohC9Mh9J470nT5pUw==", + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.2.1", + "@tailwindcss/oxide-darwin-arm64": "4.2.1", + "@tailwindcss/oxide-darwin-x64": "4.2.1", + "@tailwindcss/oxide-freebsd-x64": "4.2.1", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.1", + "@tailwindcss/oxide-linux-arm64-gnu": "4.2.1", + "@tailwindcss/oxide-linux-arm64-musl": "4.2.1", + "@tailwindcss/oxide-linux-x64-gnu": "4.2.1", + "@tailwindcss/oxide-linux-x64-musl": "4.2.1", + "@tailwindcss/oxide-wasm32-wasi": "4.2.1", + "@tailwindcss/oxide-win32-arm64-msvc": "4.2.1", + "@tailwindcss/oxide-win32-x64-msvc": "4.2.1" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.2.1.tgz", + "integrity": "sha512-eZ7G1Zm5EC8OOKaesIKuw77jw++QJ2lL9N+dDpdQiAB/c/B2wDh0QPFHbkBVrXnwNugvrbJFk1gK2SsVjwWReg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.2.1.tgz", + "integrity": "sha512-q/LHkOstoJ7pI1J0q6djesLzRvQSIfEto148ppAd+BVQK0JYjQIFSK3JgYZJa+Yzi0DDa52ZsQx2rqytBnf8Hw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.2.1.tgz", + "integrity": "sha512-/f/ozlaXGY6QLbpvd/kFTro2l18f7dHKpB+ieXz+Cijl4Mt9AI2rTrpq7V+t04nK+j9XBQHnSMdeQRhbGyt6fw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.2.1.tgz", + "integrity": "sha512-5e/AkgYJT/cpbkys/OU2Ei2jdETCLlifwm7ogMC7/hksI2fC3iiq6OcXwjibcIjPung0kRtR3TxEITkqgn0TcA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.2.1.tgz", + "integrity": "sha512-Uny1EcVTTmerCKt/1ZuKTkb0x8ZaiuYucg2/kImO5A5Y/kBz41/+j0gxUZl+hTF3xkWpDmHX+TaWhOtba2Fyuw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.2.1.tgz", + "integrity": "sha512-CTrwomI+c7n6aSSQlsPL0roRiNMDQ/YzMD9EjcR+H4f0I1SQ8QqIuPnsVp7QgMkC1Qi8rtkekLkOFjo7OlEFRQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.2.1.tgz", + "integrity": "sha512-WZA0CHRL/SP1TRbA5mp9htsppSEkWuQ4KsSUumYQnyl8ZdT39ntwqmz4IUHGN6p4XdSlYfJwM4rRzZLShHsGAQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.2.1.tgz", + "integrity": "sha512-qMFzxI2YlBOLW5PhblzuSWlWfwLHaneBE0xHzLrBgNtqN6mWfs+qYbhryGSXQjFYB1Dzf5w+LN5qbUTPhW7Y5g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.2.1.tgz", + "integrity": "sha512-5r1X2FKnCMUPlXTWRYpHdPYUY6a1Ar/t7P24OuiEdEOmms5lyqjDRvVY1yy9Rmioh+AunQ0rWiOTPE8F9A3v5g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.2.1.tgz", + "integrity": "sha512-MGFB5cVPvshR85MTJkEvqDUnuNoysrsRxd6vnk1Lf2tbiqNlXpHYZqkqOQalydienEWOHHFyyuTSYRsLfxFJ2Q==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "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.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.2.1.tgz", + "integrity": "sha512-YlUEHRHBGnCMh4Nj4GnqQyBtsshUPdiNroZj8VPkvTZSoHsilRCwXcVKnG9kyi0ZFAS/3u+qKHBdDc81SADTRA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.2.1.tgz", + "integrity": "sha512-rbO34G5sMWWyrN/idLeVxAZgAKWrn5LiR3/I90Q9MkA67s6T1oB0xtTe+0heoBvHSpbU9Mk7i6uwJnpo4u21XQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.2.1.tgz", + "integrity": "sha512-TBf2sJjYeb28jD2U/OhwdW0bbOsxkWPwQ7SrqGf9sVcoYwZj7rkXljroBO9wKBut9XnmQLXanuDUeqQK0lGg/w==", + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.2.1", + "@tailwindcss/oxide": "4.2.1", + "tailwindcss": "4.2.1" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7" + } + }, + "node_modules/@tanstack/query-core": { + "version": "5.90.20", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.20.tgz", + "integrity": "sha512-OMD2HLpNouXEfZJWcKeVKUgQ5n+n3A2JFmBaScpNDUqSrQSjiveC7dKMe53uJUg1nDG16ttFPz2xfilz6i2uVg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "5.90.21", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.21.tgz", + "integrity": "sha512-0Lu6y5t+tvlTJMTO7oh5NSpJfpg/5D41LlThfepTixPYkJ0sE2Jj0m0f6yYqujBwIXlId87e234+MxG3D3g7kg==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.90.20" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^18 || ^19" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "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==", + "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.10.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.13.tgz", + "integrity": "sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==", + "devOptional": true, + "license": "MIT", + "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==", + "license": "MIT", + "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/@types/react-reconciler": { + "version": "0.32.3", + "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.32.3.tgz", + "integrity": "sha512-cMi5ZrLG7UtbL7LTK6hq9w/EZIRk4Mf1Z5qHoI+qBh7/WkYkFXQ7gOto2yfUvPzF5ERMAhaXS5eTQ2SAnHjLzA==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*" + } + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.1.tgz", + "integrity": "sha512-Jz9ZztpB37dNC+HU2HI28Bs9QXpzCz+y/twHOwhyrIRdbuVDxSytJNDl6z/aAKlaRIwC7y8wJdkBv7FxYGgi0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.56.1", + "@typescript-eslint/type-utils": "8.56.1", + "@typescript-eslint/utils": "8.56.1", + "@typescript-eslint/visitor-keys": "8.56.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.56.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.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.56.1.tgz", + "integrity": "sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.56.1", + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/typescript-estree": "8.56.1", + "@typescript-eslint/visitor-keys": "8.56.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.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.1.tgz", + "integrity": "sha512-TAdqQTzHNNvlVFfR+hu2PDJrURiwKsUvxFn1M0h95BB8ah5jejas08jUWG4dBA68jDMI988IvtfdAI53JzEHOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.56.1", + "@typescript-eslint/types": "^8.56.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.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.1.tgz", + "integrity": "sha512-YAi4VDKcIZp0O4tz/haYKhmIDZFEUPOreKbfdAN3SzUDMcPhJ8QI99xQXqX+HoUVq8cs85eRKnD+rne2UAnj2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/visitor-keys": "8.56.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.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.1.tgz", + "integrity": "sha512-qOtCYzKEeyr3aR9f28mPJqBty7+DBqsdd63eO0yyDwc6vgThj2UjWfJIcsFeSucYydqcuudMOprZ+x1SpF3ZuQ==", + "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.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.56.1.tgz", + "integrity": "sha512-yB/7dxi7MgTtGhZdaHCemf7PuwrHMenHjmzgUW1aJpO+bBU43OycnM3Wn+DdvDO/8zzA9HlhaJ0AUGuvri4oGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/typescript-estree": "8.56.1", + "@typescript-eslint/utils": "8.56.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.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.1.tgz", + "integrity": "sha512-dbMkdIUkIkchgGDIv7KLUpa0Mda4IYjo4IAMJUZ+3xNoUXxMsk9YtKpTHSChRS85o+H9ftm51gsK1dZReY9CVw==", + "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.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.1.tgz", + "integrity": "sha512-qzUL1qgalIvKWAf9C1HpvBjif+Vm6rcT5wZd4VoMb9+Km3iS3Cv9DY6dMRMDtPnwRAFyAi7YXJpTIEXLvdfPxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.56.1", + "@typescript-eslint/tsconfig-utils": "8.56.1", + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/visitor-keys": "8.56.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.3", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz", + "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==", + "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.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.2.tgz", + "integrity": "sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==", + "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.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.1.tgz", + "integrity": "sha512-HPAVNIME3tABJ61siYlHzSWCGtOoeP2RTIaHXFMPqjrQKCGB9OgUVdiNgH7TJS2JNIQ5qQ4RsAUDuGaGme/KOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.56.1", + "@typescript-eslint/types": "8.56.1", + "@typescript-eslint/typescript-estree": "8.56.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.56.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.1.tgz", + "integrity": "sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.56.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": "5.1.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz", + "integrity": "sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.29.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-rc.3", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.18.0" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "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", + "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/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/attr-accept": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/attr-accept/-/attr-accept-2.2.5.tgz", + "integrity": "sha512-0bDNnY/u6pPwHDMoF0FieU354oBi0a8rD9FcsLwzcGWbc8KS8KPIi7y+s13OlVY+gMWc/9xEMUgNE6Qm8ZllYQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/axios": { + "version": "1.13.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.5.tgz", + "integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", + "proxy-from-env": "^1.1.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.0", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz", + "integrity": "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==", + "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", + "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/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "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.30001774", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001774.tgz", + "integrity": "sha512-DDdwPGz99nmIEv216hKSgLD+D4ikHQHjBC/seF98N9CPqRX4M5mSxT9eTV6oyisnJcuzxtZy4n17yKKQYmYQOA==", + "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/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "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==", + "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/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "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==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.302", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.302.tgz", + "integrity": "sha512-sM6HAN2LyK82IyPBpznDRqlTQAtuSaO+ShzFiWTvoMJLHyZ+Y39r8VMfHzwbU8MVBzQ4Wdn85+wlZl2TLGIlwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/enhanced-resolve": { + "version": "5.19.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz", + "integrity": "sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", + "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.3", + "@esbuild/android-arm": "0.27.3", + "@esbuild/android-arm64": "0.27.3", + "@esbuild/android-x64": "0.27.3", + "@esbuild/darwin-arm64": "0.27.3", + "@esbuild/darwin-x64": "0.27.3", + "@esbuild/freebsd-arm64": "0.27.3", + "@esbuild/freebsd-x64": "0.27.3", + "@esbuild/linux-arm": "0.27.3", + "@esbuild/linux-arm64": "0.27.3", + "@esbuild/linux-ia32": "0.27.3", + "@esbuild/linux-loong64": "0.27.3", + "@esbuild/linux-mips64el": "0.27.3", + "@esbuild/linux-ppc64": "0.27.3", + "@esbuild/linux-riscv64": "0.27.3", + "@esbuild/linux-s390x": "0.27.3", + "@esbuild/linux-x64": "0.27.3", + "@esbuild/netbsd-arm64": "0.27.3", + "@esbuild/netbsd-x64": "0.27.3", + "@esbuild/openbsd-arm64": "0.27.3", + "@esbuild/openbsd-x64": "0.27.3", + "@esbuild/openharmony-arm64": "0.27.3", + "@esbuild/sunos-x64": "0.27.3", + "@esbuild/win32-arm64": "0.27.3", + "@esbuild/win32-ia32": "0.27.3", + "@esbuild/win32-x64": "0.27.3" + } + }, + "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.3", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.3.tgz", + "integrity": "sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.39.3", + "@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.12.4", + "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.2", + "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.4.26", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.26.tgz", + "integrity": "sha512-1RETEylht2O6FM/MvgnyvT+8K21wLqDNg4qD51Zj3guhjt433XbnnkVttHMyaVyAFD03QSV4LPS5iE3VQmO7XQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=8.40" + } + }, + "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==", + "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/file-selector": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/file-selector/-/file-selector-2.1.2.tgz", + "integrity": "sha512-QgXo+mXTe8ljeqUFaX3QVHc5osSItJ/Km+xpocx0aSqWGMSCf6qYs/VnzZgS864Pjn5iceMRFigeAV7AfTlaig==", + "license": "MIT", + "dependencies": { + "tslib": "^2.7.0" + }, + "engines": { + "node": ">= 12" + } + }, + "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.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "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": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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==", + "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/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "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/its-fine": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/its-fine/-/its-fine-2.0.0.tgz", + "integrity": "sha512-KLViCmWx94zOvpLwSlsx6yOCeMhZYaxrJV87Po5k/FoZzcPSahvK5qJ7fYhS61sZi5ikmh2S3Hz55A2l3U69ng==", + "license": "MIT", + "dependencies": { + "@types/react-reconciler": "^0.28.9" + }, + "peerDependencies": { + "react": "^19.0.0" + } + }, + "node_modules/its-fine/node_modules/@types/react-reconciler": { + "version": "0.28.9", + "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.28.9.tgz", + "integrity": "sha512-HHM3nxyUZ3zAylX8ZEyrDNd2XZOnQ0D5XfunJF5FLQnZbHHYq4UWvW1QfelQNXv1ICNkwYhfxjwfnqivYB6bFg==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*" + } + }, + "node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "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==", + "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/konva": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/konva/-/konva-10.2.0.tgz", + "integrity": "sha512-JBoz0Xjbf49UPxCZegZ4WseqOzJ+C4AUDOtJ9eBve5RS5Fcq/u8TdBD5fDl/uPFInpC3a9uycm0sRyZpF4hheg==", + "funding": [ + { + "type": "patreon", + "url": "https://www.patreon.com/lavrton" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/konva" + }, + { + "type": "github", + "url": "https://github.com/sponsors/lavrton" + } + ], + "license": "MIT" + }, + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.31.1.tgz", + "integrity": "sha512-l51N2r93WmGUye3WuFoN5k10zyvrVs0qfKBhyC5ogUQ6Ew6JUSswh78mbSO+IU3nTWsyOArqPCcShdQSadghBQ==", + "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.31.1", + "lightningcss-darwin-arm64": "1.31.1", + "lightningcss-darwin-x64": "1.31.1", + "lightningcss-freebsd-x64": "1.31.1", + "lightningcss-linux-arm-gnueabihf": "1.31.1", + "lightningcss-linux-arm64-gnu": "1.31.1", + "lightningcss-linux-arm64-musl": "1.31.1", + "lightningcss-linux-x64-gnu": "1.31.1", + "lightningcss-linux-x64-musl": "1.31.1", + "lightningcss-win32-arm64-msvc": "1.31.1", + "lightningcss-win32-x64-msvc": "1.31.1" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.31.1.tgz", + "integrity": "sha512-HXJF3x8w9nQ4jbXRiNppBCqeZPIAfUo8zE/kOEGbW5NZvGc/K7nMxbhIr+YlFlHW5mpbg/YFPdbnCh1wAXCKFg==", + "cpu": [ + "arm64" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.31.1.tgz", + "integrity": "sha512-02uTEqf3vIfNMq3h/z2cJfcOXnQ0GRwQrkmPafhueLb2h7mqEidiCzkE4gBMEH65abHRiQvhdcQ+aP0D0g67sg==", + "cpu": [ + "arm64" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.31.1.tgz", + "integrity": "sha512-1ObhyoCY+tGxtsz1lSx5NXCj3nirk0Y0kB/g8B8DT+sSx4G9djitg9ejFnjb3gJNWo7qXH4DIy2SUHvpoFwfTA==", + "cpu": [ + "x64" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.31.1.tgz", + "integrity": "sha512-1RINmQKAItO6ISxYgPwszQE1BrsVU5aB45ho6O42mu96UiZBxEXsuQ7cJW4zs4CEodPUioj/QrXW1r9pLUM74A==", + "cpu": [ + "x64" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.31.1.tgz", + "integrity": "sha512-OOCm2//MZJ87CdDK62rZIu+aw9gBv4azMJuA8/KB74wmfS3lnC4yoPHm0uXZ/dvNNHmnZnB8XLAZzObeG0nS1g==", + "cpu": [ + "arm" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.31.1.tgz", + "integrity": "sha512-WKyLWztD71rTnou4xAD5kQT+982wvca7E6QoLpoawZ1gP9JM0GJj4Tp5jMUh9B3AitHbRZ2/H3W5xQmdEOUlLg==", + "cpu": [ + "arm64" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.31.1.tgz", + "integrity": "sha512-mVZ7Pg2zIbe3XlNbZJdjs86YViQFoJSpc41CbVmKBPiGmC4YrfeOyz65ms2qpAobVd7WQsbW4PdsSJEMymyIMg==", + "cpu": [ + "arm64" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.31.1.tgz", + "integrity": "sha512-xGlFWRMl+0KvUhgySdIaReQdB4FNudfUTARn7q0hh/V67PVGCs3ADFjw+6++kG1RNd0zdGRlEKa+T13/tQjPMA==", + "cpu": [ + "x64" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.31.1.tgz", + "integrity": "sha512-eowF8PrKHw9LpoZii5tdZwnBcYDxRw2rRCyvAXLi34iyeYfqCQNA9rmUM0ce62NlPhCvof1+9ivRaTY6pSKDaA==", + "cpu": [ + "x64" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.31.1.tgz", + "integrity": "sha512-aJReEbSEQzx1uBlQizAOBSjcmr9dCdL3XuC/6HLXAxmtErsj2ICo5yYggg1qOODQMtnjNQv2UHb9NpOuFtYe4w==", + "cpu": [ + "arm64" + ], + "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.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.31.1.tgz", + "integrity": "sha512-I9aiFrbd7oYHwlnQDqr1Roz+fTz61oDDJX7n9tYF9FJymH1cIN1DtKw3iYt6b8WZgEjoNwVSncwF4wx/ZedMhw==", + "cpu": [ + "x64" + ], + "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/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "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==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.3.tgz", + "integrity": "sha512-M2GCs7Vk83NxkUyQV1bkABc4yxgz9kILhHImZiBPAZ9ybuvCb0/H7lEl5XvIg3g+9d4eNotkZA5IWwYl0tibaA==", + "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==", + "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.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "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==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "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/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "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", + "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", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.4" + } + }, + "node_modules/react-dropzone": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/react-dropzone/-/react-dropzone-15.0.0.tgz", + "integrity": "sha512-lGjYV/EoqEjEWPnmiSvH4v5IoIAwQM2W4Z1C0Q/Pw2xD0eVzKPS359BQTUMum+1fa0kH2nrKjuavmTPOGhpLPg==", + "license": "MIT", + "dependencies": { + "attr-accept": "^2.2.4", + "file-selector": "^2.1.0", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">= 10.13" + }, + "peerDependencies": { + "react": ">= 16.8 || 18.0.0" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/react-konva": { + "version": "19.2.2", + "resolved": "https://registry.npmjs.org/react-konva/-/react-konva-19.2.2.tgz", + "integrity": "sha512-fgIevJSiZ6mYxouR0XLq7oKgQkfHHySHyNpyc1f/3in0xXq8BV7M7Y82obyoBPOAj35TBUPuZ568qZcelYm3ag==", + "funding": [ + { + "type": "patreon", + "url": "https://www.patreon.com/lavrton" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/konva" + }, + { + "type": "github", + "url": "https://github.com/sponsors/lavrton" + } + ], + "license": "MIT", + "dependencies": { + "@types/react-reconciler": "^0.32.3", + "its-fine": "^2.0.0", + "react-reconciler": "0.33.0", + "scheduler": "0.27.0" + }, + "peerDependencies": { + "konva": "^8.0.1 || ^7.2.5 || ^9.0.0 || ^10.0.0", + "react": "^19.2.0", + "react-dom": "^19.2.0" + } + }, + "node_modules/react-reconciler": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.33.0.tgz", + "integrity": "sha512-KetWRytFv1epdpJc3J4G75I4WrplZE5jOL7Yq0p34+OVOKF4Se7WrdIdVC45XsSSmUTlht2FM/fM1FZb1mfQeA==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "react": "^19.2.0" + } + }, + "node_modules/react-refresh": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz", + "integrity": "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "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/rollup": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz", + "integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==", + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.59.0", + "@rollup/rollup-android-arm64": "4.59.0", + "@rollup/rollup-darwin-arm64": "4.59.0", + "@rollup/rollup-darwin-x64": "4.59.0", + "@rollup/rollup-freebsd-arm64": "4.59.0", + "@rollup/rollup-freebsd-x64": "4.59.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", + "@rollup/rollup-linux-arm-musleabihf": "4.59.0", + "@rollup/rollup-linux-arm64-gnu": "4.59.0", + "@rollup/rollup-linux-arm64-musl": "4.59.0", + "@rollup/rollup-linux-loong64-gnu": "4.59.0", + "@rollup/rollup-linux-loong64-musl": "4.59.0", + "@rollup/rollup-linux-ppc64-gnu": "4.59.0", + "@rollup/rollup-linux-ppc64-musl": "4.59.0", + "@rollup/rollup-linux-riscv64-gnu": "4.59.0", + "@rollup/rollup-linux-riscv64-musl": "4.59.0", + "@rollup/rollup-linux-s390x-gnu": "4.59.0", + "@rollup/rollup-linux-x64-gnu": "4.59.0", + "@rollup/rollup-linux-x64-musl": "4.59.0", + "@rollup/rollup-openbsd-x64": "4.59.0", + "@rollup/rollup-openharmony-arm64": "4.59.0", + "@rollup/rollup-win32-arm64-msvc": "4.59.0", + "@rollup/rollup-win32-ia32-msvc": "4.59.0", + "@rollup/rollup-win32-x64-gnu": "4.59.0", + "@rollup/rollup-win32-x64-msvc": "4.59.0", + "fsevents": "~2.3.2" + } + }, + "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==", + "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.1", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.1.tgz", + "integrity": "sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw==", + "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==", + "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==", + "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.4.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz", + "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==", + "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==", + "license": "0BSD" + }, + "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", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.56.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.56.1.tgz", + "integrity": "sha512-U4lM6pjmBX7J5wk4szltF7I1cGBHXZopnAXCMXb3+fZ3B/0Z3hq3wS/CCUB2NZBNAExK92mCU2tEohWuwVMsDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.56.1", + "@typescript-eslint/parser": "8.56.1", + "@typescript-eslint/typescript-estree": "8.56.1", + "@typescript-eslint/utils": "8.56.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==", + "devOptional": 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": "7.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", + "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "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", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.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 + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "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", + "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" + } + }, + "node_modules/zustand": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.11.tgz", + "integrity": "sha512-fdZY+dk7zn/vbWNCYmzZULHRrss0jx5pPFiOuMZ/5HJN6Yv3u+1Wswy/4MpZEkEGhtNH+pwxZB8OKgUBPzYAGg==", + "license": "MIT", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=18.0.0", + "immer": ">=9.0.6", + "react": ">=18.0.0", + "use-sync-external-store": ">=1.2.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "immer": { + "optional": true + }, + "react": { + "optional": true + }, + "use-sync-external-store": { + "optional": true + } + } + } + } +} diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..1683c85 --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,39 @@ +{ + "name": "frontend", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@tailwindcss/vite": "^4.2.1", + "@tanstack/react-query": "^5.90.21", + "axios": "^1.13.5", + "konva": "^10.2.0", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "react-dropzone": "^15.0.0", + "react-konva": "^19.2.2", + "react-router-dom": "^7.13.1", + "tailwindcss": "^4.2.1", + "zustand": "^5.0.11" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@types/node": "^24.10.1", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "typescript": "~5.9.3", + "typescript-eslint": "^8.48.0", + "vite": "^7.3.1" + } +} diff --git a/frontend/public/vite.svg b/frontend/public/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/frontend/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx new file mode 100644 index 0000000..e9e3108 --- /dev/null +++ b/frontend/src/App.tsx @@ -0,0 +1,27 @@ +import { Routes, Route } from "react-router-dom"; +import AppLayout from "./components/layout/AppLayout"; +import Dashboard from "./pages/Dashboard"; +import ProjectDetail from "./pages/ProjectDetail"; +import NewAnalysis from "./pages/NewAnalysis"; +import AnalysisView from "./pages/AnalysisView"; +import ComparisonView from "./pages/ComparisonView"; +import Help from "./pages/Help"; +import About from "./pages/About"; + +function App() { + return ( + + }> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + + ); +} + +export default App; diff --git a/frontend/src/api/analysis.ts b/frontend/src/api/analysis.ts new file mode 100644 index 0000000..0d13aab --- /dev/null +++ b/frontend/src/api/analysis.ts @@ -0,0 +1,83 @@ +import client from "./client"; +import type { AnalysisDetail, AnalysisStatus, AOIRegion, AOIResult, Insight } from "../types/analysis"; + +export async function createAnalysis( + projectId: string, + file: File, + name?: string, + model?: string, +): Promise { + const formData = new FormData(); + formData.append("file", file); + if (name) formData.append("name", name); + if (model) formData.append("model", model); + + const { data } = await client.post(`/projects/${projectId}/analyses`, formData, { + headers: { "Content-Type": "multipart/form-data" }, + }); + return data; +} + +export async function getAnalysis(id: string): Promise { + const { data } = await client.get(`/analyses/${id}`); + return data; +} + +export async function getAnalysisStatus(id: string): Promise { + const { data } = await client.get(`/analyses/${id}/status`); + return data; +} + +export async function deleteAnalysis(id: string): Promise { + await client.delete(`/analyses/${id}`); +} + +export function getAnalysisImageUrl( + id: string, + type: "original" | "saliency-raw" | "heatmap" | "heatmap-standalone" | "gaze-sequence" | "thumbnail", +): string { + return `/api/analyses/${id}/images/${type}`; +} + +export async function createAOIs( + analysisId: string, + regions: AOIRegion[], +): Promise { + const { data } = await client.post(`/analyses/${analysisId}/aois`, { + regions, + }); + return data; +} + +export async function getAOIs(analysisId: string): Promise { + const { data } = await client.get(`/analyses/${analysisId}/aois`); + return data; +} + +export async function checkAIInsightsAvailable(): Promise { + try { + const { data } = await client.get("/analyses/ai-insights-available"); + return data.available; + } catch { + return false; + } +} + +export interface AIInsightsResponse { + insights: Insight[]; + cost_usd: number; + input_tokens: number; + output_tokens: number; +} + +export async function generateAIInsights(analysisId: string): Promise { + const { data } = await client.post(`/analyses/${analysisId}/ai-insights`); + return data; +} + +export async function deleteAOI( + analysisId: string, + aoiId: string, +): Promise { + await client.delete(`/analyses/${analysisId}/aois/${aoiId}`); +} diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts new file mode 100644 index 0000000..902346c --- /dev/null +++ b/frontend/src/api/client.ts @@ -0,0 +1,25 @@ +import axios from "axios"; + +const client = axios.create({ + baseURL: "/api", + headers: { + "Content-Type": "application/json", + }, +}); + +client.interceptors.request.use((config) => { + config.headers["X-User-Id"] = "default"; + return config; +}); + +client.interceptors.response.use( + (response) => response, + (error) => { + const message = + error.response?.data?.detail || error.message || "An error occurred"; + console.error("[API Error]", message); + return Promise.reject(error); + }, +); + +export default client; diff --git a/frontend/src/api/projects.ts b/frontend/src/api/projects.ts new file mode 100644 index 0000000..50fea3c --- /dev/null +++ b/frontend/src/api/projects.ts @@ -0,0 +1,37 @@ +import client from "./client"; +import type { Project, ProjectDetail, ProjectCreate } from "../types/project"; + +export async function createProject( + name: string, + description?: string, +): Promise { + const { data } = await client.post("/projects", { name, description }); + return data; +} + +export async function listProjects( + page: number = 1, + perPage: number = 20, +): Promise { + const { data } = await client.get("/projects", { + params: { page, per_page: perPage }, + }); + return data; +} + +export async function getProject(id: string): Promise { + const { data } = await client.get(`/projects/${id}`); + return data; +} + +export async function updateProject( + id: string, + updates: Partial, +): Promise { + const { data } = await client.put(`/projects/${id}`, updates); + return data; +} + +export async function deleteProject(id: string): Promise { + await client.delete(`/projects/${id}`); +} diff --git a/frontend/src/api/reports.ts b/frontend/src/api/reports.ts new file mode 100644 index 0000000..b00ee99 --- /dev/null +++ b/frontend/src/api/reports.ts @@ -0,0 +1,23 @@ +import client from "./client"; + +export async function downloadReport(analysisId: string): Promise { + const response = await client.get(`/analyses/${analysisId}/report`, { + responseType: "blob", + }); + + const blob = new Blob([response.data], { type: "application/pdf" }); + const url = window.URL.createObjectURL(blob); + const link = document.createElement("a"); + link.href = url; + + const disposition = response.headers["content-disposition"]; + const filename = disposition + ? disposition.split("filename=")[1]?.replace(/"/g, "") + : `analysis-${analysisId}-report.pdf`; + + link.download = filename; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(url); +} diff --git a/frontend/src/assets/react.svg b/frontend/src/assets/react.svg new file mode 100644 index 0000000..6c87de9 --- /dev/null +++ b/frontend/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/components/analysis/GazeSequence.tsx b/frontend/src/components/analysis/GazeSequence.tsx new file mode 100644 index 0000000..1e6e9eb --- /dev/null +++ b/frontend/src/components/analysis/GazeSequence.tsx @@ -0,0 +1,95 @@ +import type { GazePoint } from "../../types/analysis"; +import { useAnalysisStore } from "../../stores/analysisStore"; +import Card from "../common/Card"; + +interface GazeSequenceProps { + imageUrl: string; + gazePoints: GazePoint[]; +} + +export default function GazeSequence({ + imageUrl, + gazePoints, +}: GazeSequenceProps) { + const zoom = useAnalysisStore((s) => s.zoom); + + return ( +
+
+ Gaze sequence visualization +
+ + {gazePoints.length > 0 && ( + +

+ Predicted Gaze Sequence +

+
+ + + + + + + + + + + {gazePoints.map((point) => ( + + + + + + + ))} + +
+ Order + + X + + Y + + Intensity +
+ + {point.rank} + + + {Math.round(point.x)} + + {Math.round(point.y)} + +
+
+
+
+ + {(point.intensity * 100).toFixed(0)}% + +
+
+
+
+ )} +
+ ); +} diff --git a/frontend/src/components/analysis/HeatmapControls.tsx b/frontend/src/components/analysis/HeatmapControls.tsx new file mode 100644 index 0000000..27bd560 --- /dev/null +++ b/frontend/src/components/analysis/HeatmapControls.tsx @@ -0,0 +1,68 @@ +import { useAnalysisStore } from "../../stores/analysisStore"; +import Card from "../common/Card"; + +const colormaps = ["jet", "viridis", "inferno", "magma", "plasma"]; + +export default function HeatmapControls() { + const { opacity, colormap, visible } = useAnalysisStore( + (s) => s.heatmapSettings, + ); + const setOpacity = useAnalysisStore((s) => s.setHeatmapOpacity); + const setColormap = useAnalysisStore((s) => s.setHeatmapColormap); + const setVisible = useAnalysisStore((s) => s.setHeatmapVisible); + + return ( + +

+ Heatmap Controls +

+ +
+ + +
+ +
+ + setOpacity(Number(e.target.value) / 100)} + className="w-full accent-[#ffc407]" + disabled={!visible} + /> +
+ +
+ + +
+
+ ); +} diff --git a/frontend/src/components/analysis/HeatmapOverlay.tsx b/frontend/src/components/analysis/HeatmapOverlay.tsx new file mode 100644 index 0000000..1546fe6 --- /dev/null +++ b/frontend/src/components/analysis/HeatmapOverlay.tsx @@ -0,0 +1,185 @@ +import { useEffect, useRef, useState } from "react"; +import { useAnalysisStore } from "../../stores/analysisStore"; + +type ColormapName = "jet" | "viridis" | "inferno" | "magma" | "plasma"; + +function interpolateColor( + stops: [number, number, number, number][], + t: number, +): [number, number, number, number] { + const n = stops.length - 1; + const idx = Math.min(Math.floor(t * n), n - 1); + const frac = t * n - idx; + const a = stops[idx]; + const b = stops[idx + 1]; + return [ + Math.round(a[0] + (b[0] - a[0]) * frac), + Math.round(a[1] + (b[1] - a[1]) * frac), + Math.round(a[2] + (b[2] - a[2]) * frac), + Math.round(a[3] + (b[3] - a[3]) * frac), + ]; +} + +const colormapStops: Record = { + jet: [ + [0, 0, 131, 255], + [0, 60, 170, 255], + [5, 255, 255, 255], + [255, 255, 0, 255], + [250, 0, 0, 255], + [128, 0, 0, 255], + ], + viridis: [ + [68, 1, 84, 255], + [59, 82, 139, 255], + [33, 145, 140, 255], + [94, 201, 98, 255], + [253, 231, 37, 255], + ], + inferno: [ + [0, 0, 4, 255], + [40, 11, 84, 255], + [101, 21, 110, 255], + [186, 55, 42, 255], + [252, 163, 4, 255], + [252, 255, 164, 255], + ], + magma: [ + [0, 0, 4, 255], + [28, 16, 68, 255], + [79, 18, 123, 255], + [182, 54, 121, 255], + [251, 136, 97, 255], + [252, 253, 191, 255], + ], + plasma: [ + [13, 8, 135, 255], + [84, 2, 163, 255], + [139, 10, 165, 255], + [185, 50, 137, 255], + [219, 92, 104, 255], + [244, 136, 73, 255], + [240, 249, 33, 255], + ], +}; + +function buildColormapLUT(name: ColormapName): Uint8ClampedArray { + const stops = colormapStops[name]; + const lut = new Uint8ClampedArray(256 * 4); + for (let i = 0; i < 256; i++) { + const t = i / 255; + const [r, g, b, a] = interpolateColor(stops, t); + lut[i * 4] = r; + lut[i * 4 + 1] = g; + lut[i * 4 + 2] = b; + lut[i * 4 + 3] = a; + } + return lut; +} + +interface HeatmapOverlayProps { + originalUrl: string; + saliencyUrl: string; +} + +export default function HeatmapOverlay({ + originalUrl, + saliencyUrl, +}: HeatmapOverlayProps) { + const canvasRef = useRef(null); + const containerRef = useRef(null); + const { opacity, colormap, visible } = useAnalysisStore( + (s) => s.heatmapSettings, + ); + const zoom = useAnalysisStore((s) => s.zoom); + const [originalImg, setOriginalImg] = useState(null); + const [saliencyImg, setSaliencyImg] = useState(null); + const [canvasSize, setCanvasSize] = useState({ width: 800, height: 600 }); + + useEffect(() => { + const img = new Image(); + img.onload = () => setOriginalImg(img); + img.onerror = (e) => console.error("Failed to load original image:", originalUrl, e); + img.src = originalUrl; + }, [originalUrl]); + + useEffect(() => { + const img = new Image(); + img.onload = () => setSaliencyImg(img); + img.onerror = (e) => console.error("Failed to load saliency image:", saliencyUrl, e); + img.src = saliencyUrl; + }, [saliencyUrl]); + + useEffect(() => { + if (!originalImg) return; + const container = containerRef.current; + if (!container) return; + + const maxWidth = container.clientWidth; + const baseScale = Math.min(1, maxWidth / originalImg.naturalWidth); + const scale = baseScale * zoom; + setCanvasSize({ + width: Math.round(originalImg.naturalWidth * scale), + height: Math.round(originalImg.naturalHeight * scale), + }); + }, [originalImg, zoom]); + + useEffect(() => { + const canvas = canvasRef.current; + if (!canvas || !originalImg) return; + const ctx = canvas.getContext("2d"); + if (!ctx) return; + + canvas.width = canvasSize.width; + canvas.height = canvasSize.height; + + ctx.drawImage(originalImg, 0, 0, canvasSize.width, canvasSize.height); + + if (visible && saliencyImg) { + const offscreen = document.createElement("canvas"); + offscreen.width = canvasSize.width; + offscreen.height = canvasSize.height; + const offCtx = offscreen.getContext("2d")!; + offCtx.drawImage(saliencyImg, 0, 0, canvasSize.width, canvasSize.height); + const saliencyData = offCtx.getImageData( + 0, + 0, + canvasSize.width, + canvasSize.height, + ); + + // Find the max gray value to normalize the alpha range + const lut = buildColormapLUT(colormap as ColormapName); + const pixels = saliencyData.data; + let maxGray = 0; + for (let i = 0; i < pixels.length; i += 4) { + if (pixels[i] > maxGray) maxGray = pixels[i]; + } + const scale = maxGray > 0 ? 255 / maxGray : 1; + for (let i = 0; i < pixels.length; i += 4) { + const gray = pixels[i]; + // Normalize gray to full 0-255 range for better visibility + const normalized = Math.min(255, Math.round(gray * scale)); + pixels[i] = lut[normalized * 4]; + pixels[i + 1] = lut[normalized * 4 + 1]; + pixels[i + 2] = lut[normalized * 4 + 2]; + // Use sqrt for a gentler falloff so mid-range values are more visible + pixels[i + 3] = Math.round(255 * opacity * Math.sqrt(normalized / 255)); + } + + offCtx.putImageData(saliencyData, 0, 0); + ctx.drawImage(offscreen, 0, 0); + } + }, [originalImg, saliencyImg, canvasSize, opacity, colormap, visible]); + + return ( +
+ +
+ ); +} diff --git a/frontend/src/components/analysis/HotspotList.tsx b/frontend/src/components/analysis/HotspotList.tsx new file mode 100644 index 0000000..1450de4 --- /dev/null +++ b/frontend/src/components/analysis/HotspotList.tsx @@ -0,0 +1,61 @@ +import type { Hotspot } from "../../types/analysis"; +import Card from "../common/Card"; + +interface HotspotListProps { + hotspots: Hotspot[]; +} + +export default function HotspotList({ hotspots }: HotspotListProps) { + const top5 = hotspots.slice(0, 5); + const maxIntensity = top5.length > 0 ? top5[0].intensity : 1; + + return ( + +

+ Top Attention Hotspots +

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

No hotspots detected.

+ ) : ( +
+ {top5.map((hotspot) => { + const barWidth = (hotspot.intensity / maxIntensity) * 100; + return ( +
+
+
+ + {hotspot.rank} + + + {hotspot.label || `Region ${hotspot.rank}`} + +
+ + ({Math.round(hotspot.center_x ?? hotspot.x)}, {Math.round(hotspot.center_y ?? hotspot.y)}) + +
+
+
+
+

+ {(hotspot.intensity * 100).toFixed(1)}% intensity +

+
+ ); + })} +
+ )} + + ); +} diff --git a/frontend/src/components/analysis/InsightsPanel.tsx b/frontend/src/components/analysis/InsightsPanel.tsx new file mode 100644 index 0000000..5238ebe --- /dev/null +++ b/frontend/src/components/analysis/InsightsPanel.tsx @@ -0,0 +1,99 @@ +import type { Insight } from "../../types/analysis"; +import Card from "../common/Card"; + +const iconMap = { + success: ( + + + + ), + info: ( + + + + ), + warning: ( + + + + ), +}; + +const borderColorMap = { + success: "border-l-green-500", + info: "border-l-blue-500", + warning: "border-l-amber-500", +}; + +function InsightCard({ insight, isAI }: { insight: Insight; isAI?: boolean }) { + const bgClass = isAI ? "bg-purple-50/60" : "bg-gray-50"; + return ( +
+ {iconMap[insight.type]} +
+

{insight.title}

+

{insight.description}

+
+
+ ); +} + +interface InsightsPanelProps { + insights: Insight[]; + aiInsights?: Insight[]; + aiCostUsd?: number | null; +} + +export default function InsightsPanel({ insights, aiInsights, aiCostUsd }: InsightsPanelProps) { + const hasInsights = insights && insights.length > 0; + const hasAI = aiInsights && aiInsights.length > 0; + + if (!hasInsights && !hasAI) return null; + + return ( +
+ {hasInsights && ( + +

+ Analysis Insights +

+
+ {insights.map((insight, i) => ( + + ))} +
+
+ )} + + {hasAI && ( + +
+

+ AI Design Analysis +

+ + AI + +
+
+ {aiInsights!.map((insight, i) => ( + + ))} +
+
+

+ Powered by Claude Sonnet 4.6. AI insights are supplementary and should be validated against your design objectives. +

+ {aiCostUsd != null && ( + + Cost: ${aiCostUsd.toFixed(4)} + + )} +
+
+ )} +
+ ); +} diff --git a/frontend/src/components/aoi/AOICanvas.tsx b/frontend/src/components/aoi/AOICanvas.tsx new file mode 100644 index 0000000..bf566dc --- /dev/null +++ b/frontend/src/components/aoi/AOICanvas.tsx @@ -0,0 +1,334 @@ +import { useEffect, useRef, useState, useCallback } from "react"; +import { Stage, Layer, Image as KonvaImage, Rect, Transformer, Text, Group } from "react-konva"; +import type Konva from "konva"; +import { useAnalysisStore } from "../../stores/analysisStore"; +import type { AOIRectangle } from "../../types/aoi"; +import type { AOIRegion } from "../../types/analysis"; +import { createAOIs } from "../../api/analysis"; +import Button from "../common/Button"; +import Card from "../common/Card"; + +const AOI_COLORS = ["#ef4444", "#3b82f6", "#f59e0b", "#8b5cf6", "#ec4899", "#ffc407", "#f97316"]; + +interface AOICanvasProps { + analysisId: string; + imageUrl: string; +} + +export default function AOICanvas({ analysisId, imageUrl }: AOICanvasProps) { + const containerRef = useRef(null); + const transformerRef = useRef(null); + const [image, setImage] = useState(null); + const [stageSize, setStageSize] = useState({ width: 800, height: 600 }); + const [scale, setScale] = useState(1); + const [isDrawing, setIsDrawing] = useState(false); + const [drawMode, setDrawMode] = useState(false); + const [drawStart, setDrawStart] = useState({ x: 0, y: 0 }); + const [tempRect, setTempRect] = useState<{ x: number; y: number; width: number; height: number } | null>(null); + const [selectedId, setSelectedId] = useState(null); + const [loading, setLoading] = useState(false); + const [editingLabel, setEditingLabel] = useState(null); + + const regions = useAnalysisStore((s) => s.aoiRegions); + const setRegions = useAnalysisStore((s) => s.setAoiRegions); + const addRegion = useAnalysisStore((s) => s.addAoiRegion); + const updateRegion = useAnalysisStore((s) => s.updateAoiRegion); + const removeRegion = useAnalysisStore((s) => s.removeAoiRegion); + const setAoiResults = useAnalysisStore((s) => s.setAoiResults); + + useEffect(() => { + const img = new window.Image(); + img.crossOrigin = "anonymous"; + img.onload = () => { + setImage(img); + if (containerRef.current) { + const maxWidth = containerRef.current.clientWidth; + const s = Math.min(1, maxWidth / img.naturalWidth); + setScale(s); + setStageSize({ + width: Math.round(img.naturalWidth * s), + height: Math.round(img.naturalHeight * s), + }); + } + }; + img.src = imageUrl; + }, [imageUrl]); + + const handleMouseDown = useCallback( + (e: Konva.KonvaEventObject) => { + if (!drawMode) return; + const stage = e.target.getStage(); + if (!stage) return; + const pos = stage.getPointerPosition(); + if (!pos) return; + setIsDrawing(true); + setDrawStart({ x: pos.x, y: pos.y }); + setTempRect({ x: pos.x, y: pos.y, width: 0, height: 0 }); + }, + [drawMode], + ); + + const handleMouseMove = useCallback( + (e: Konva.KonvaEventObject) => { + if (!isDrawing) return; + const stage = e.target.getStage(); + if (!stage) return; + const pos = stage.getPointerPosition(); + if (!pos) return; + setTempRect({ + x: Math.min(drawStart.x, pos.x), + y: Math.min(drawStart.y, pos.y), + width: Math.abs(pos.x - drawStart.x), + height: Math.abs(pos.y - drawStart.y), + }); + }, + [isDrawing, drawStart], + ); + + const handleMouseUp = useCallback(() => { + if (!isDrawing || !tempRect) return; + setIsDrawing(false); + if (tempRect.width > 10 && tempRect.height > 10) { + const newRegion: AOIRectangle = { + id: `aoi-${Date.now()}`, + label: `Region ${regions.length + 1}`, + x: tempRect.x / scale, + y: tempRect.y / scale, + width: tempRect.width / scale, + height: tempRect.height / scale, + color: AOI_COLORS[regions.length % AOI_COLORS.length], + }; + addRegion(newRegion); + } + setTempRect(null); + setDrawMode(false); + }, [isDrawing, tempRect, regions.length, scale, addRegion]); + + const handleDragEnd = useCallback( + (id: string, e: Konva.KonvaEventObject) => { + updateRegion(id, { + x: e.target.x() / scale, + y: e.target.y() / scale, + }); + }, + [scale, updateRegion], + ); + + const handleTransformEnd = useCallback( + (id: string, e: Konva.KonvaEventObject) => { + const node = e.target; + const scaleX = node.scaleX(); + const scaleY = node.scaleY(); + node.scaleX(1); + node.scaleY(1); + updateRegion(id, { + x: node.x() / scale, + y: node.y() / scale, + width: (node.width() * scaleX) / scale, + height: (node.height() * scaleY) / scale, + }); + }, + [scale, updateRegion], + ); + + useEffect(() => { + if (!transformerRef.current) return; + const stage = transformerRef.current.getStage(); + if (!stage || !selectedId) { + transformerRef.current.nodes([]); + return; + } + const node = stage.findOne(`#${selectedId}`); + if (node) { + transformerRef.current.nodes([node]); + } else { + transformerRef.current.nodes([]); + } + transformerRef.current.getLayer()?.batchDraw(); + }, [selectedId]); + + const handleAnalyze = async () => { + if (regions.length === 0) return; + setLoading(true); + try { + const apiRegions: AOIRegion[] = regions.map((r) => ({ + label: r.label, + x: r.x, + y: r.y, + width: r.width, + height: r.height, + })); + const results = await createAOIs(analysisId, apiRegions); + setAoiResults(results); + } catch (err) { + console.error("AOI analysis failed:", err); + } finally { + setLoading(false); + } + }; + + const handleLabelChange = (id: string, label: string) => { + updateRegion(id, { label }); + setEditingLabel(null); + }; + + return ( +
+
+ + + {regions.length > 0 && ( + + )} + {drawMode && ( + + Click and drag on the image to draw a region + + )} +
+ +
+ {image && ( + { + if (e.target === e.target.getStage()) { + setSelectedId(null); + } + }} + > + + + {regions.map((region) => ( + + setSelectedId(region.id)} + onDragEnd={(e) => handleDragEnd(region.id, e)} + onTransformEnd={(e) => handleTransformEnd(region.id, e)} + /> + + + ))} + {tempRect && ( + + )} + { + if (newBox.width < 10 || newBox.height < 10) return oldBox; + return newBox; + }} + /> + + + )} +
+ + {regions.length > 0 && ( + +

+ Defined Regions +

+
+ {regions.map((r) => ( +
+ + {editingLabel === r.id ? ( + handleLabelChange(r.id, e.target.value)} + onKeyDown={(e) => { + if (e.key === "Enter") { + handleLabelChange(r.id, e.currentTarget.value); + } + }} + className="border border-gray-300 rounded px-2 py-0.5 text-sm flex-1" + /> + ) : ( + setEditingLabel(r.id)} + > + {r.label} + + )} + + {Math.round(r.width)}x{Math.round(r.height)} + + +
+ ))} +
+
+ )} +
+ ); +} diff --git a/frontend/src/components/aoi/AOIResults.tsx b/frontend/src/components/aoi/AOIResults.tsx new file mode 100644 index 0000000..9cadb81 --- /dev/null +++ b/frontend/src/components/aoi/AOIResults.tsx @@ -0,0 +1,91 @@ +import type { AOIResult } from "../../types/analysis"; +import Card from "../common/Card"; + +interface AOIResultsProps { + results: AOIResult[]; +} + +export default function AOIResults({ results }: AOIResultsProps) { + if (results.length === 0) return null; + + return ( + +

+ AOI Analysis Results +

+
+ + + + + + + + + + + {results.map((result, idx) => { + const densityColor = + result.density >= 1 ? "#ffc407" : "#ef4444"; + return ( + + + + + + + ); + })} + +
+ Region + + Attention % + + Area % + + Density +
+ {result.label} + +
+
+
+
+ + {result.attention_percent.toFixed(1)}% + +
+
+ {result.area_percent.toFixed(1)}% + + = 1 + ? "#ffc40720" + : "#ef444420", + }} + > + {result.density.toFixed(2)}x + +
+
+

+ Density = Attention% / Area%. Values above 1.0 indicate the region + attracts more attention than its size would suggest. +

+
+ ); +} diff --git a/frontend/src/components/common/Button.tsx b/frontend/src/components/common/Button.tsx new file mode 100644 index 0000000..f906e6b --- /dev/null +++ b/frontend/src/components/common/Button.tsx @@ -0,0 +1,64 @@ +import type { ButtonHTMLAttributes, ReactNode } from "react"; + +type Variant = "primary" | "secondary" | "danger"; + +interface ButtonProps extends ButtonHTMLAttributes { + variant?: Variant; + children: ReactNode; + loading?: boolean; +} + +const variantClasses: Record = { + primary: "text-gray-900", + secondary: + "bg-transparent border-2 border-gray-300 text-gray-700 hover:bg-gray-50", + danger: "bg-red-500 text-white hover:bg-red-600", +}; + +const variantStyles: Record = { + primary: { backgroundColor: "#ffc407" }, + secondary: {}, + danger: {}, +}; + +export default function Button({ + variant = "primary", + children, + loading = false, + className = "", + disabled, + style, + ...props +}: ButtonProps) { + return ( + + ); +} diff --git a/frontend/src/components/common/Card.tsx b/frontend/src/components/common/Card.tsx new file mode 100644 index 0000000..8c0edbc --- /dev/null +++ b/frontend/src/components/common/Card.tsx @@ -0,0 +1,23 @@ +import type { ReactNode } from "react"; + +interface CardProps { + children: ReactNode; + className?: string; + padding?: boolean; +} + +export default function Card({ + children, + className = "", + padding = true, +}: CardProps) { + return ( +
+ {children} +
+ ); +} diff --git a/frontend/src/components/common/LoadingSpinner.tsx b/frontend/src/components/common/LoadingSpinner.tsx new file mode 100644 index 0000000..bb6e5b5 --- /dev/null +++ b/frontend/src/components/common/LoadingSpinner.tsx @@ -0,0 +1,40 @@ +interface LoadingSpinnerProps { + size?: "sm" | "md" | "lg"; + message?: string; +} + +const sizeClasses = { + sm: "w-5 h-5", + md: "w-8 h-8", + lg: "w-12 h-12", +}; + +export default function LoadingSpinner({ + size = "md", + message, +}: LoadingSpinnerProps) { + return ( +
+ + + + + {message &&

{message}

} +
+ ); +} diff --git a/frontend/src/components/layout/AppLayout.tsx b/frontend/src/components/layout/AppLayout.tsx new file mode 100644 index 0000000..3eaf5ca --- /dev/null +++ b/frontend/src/components/layout/AppLayout.tsx @@ -0,0 +1,24 @@ +import { Outlet } from "react-router-dom"; +import Header from "./Header"; +import Sidebar from "./Sidebar"; +import { useUIStore } from "../../stores/uiStore"; + +export default function AppLayout() { + const sidebarOpen = useUIStore((s) => s.sidebarOpen); + + return ( +
+
+ +
+
+ +
+
+
+ ); +} diff --git a/frontend/src/components/layout/Header.tsx b/frontend/src/components/layout/Header.tsx new file mode 100644 index 0000000..813f3e2 --- /dev/null +++ b/frontend/src/components/layout/Header.tsx @@ -0,0 +1,77 @@ +import { Link } from "react-router-dom"; +import { useUIStore } from "../../stores/uiStore"; + +export default function Header() { + const toggleSidebar = useUIStore((s) => s.toggleSidebar); + + return ( +
+
+ + + + OliVAS + + + Visual Attention Suite + + +
+ + +
+ ); +} diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx new file mode 100644 index 0000000..b59fb70 --- /dev/null +++ b/frontend/src/components/layout/Sidebar.tsx @@ -0,0 +1,80 @@ +import { NavLink } from "react-router-dom"; +import { useUIStore } from "../../stores/uiStore"; + +const navItems = [ + { + to: "/", + label: "Dashboard", + icon: ( + + + + ), + }, + { + to: "/analyze", + label: "New Analysis", + icon: ( + + + + ), + }, + { + to: "/help", + label: "Help", + icon: ( + + + + ), + }, + { + to: "/about", + label: "About", + icon: ( + + + + ), + }, +]; + +export default function Sidebar() { + const sidebarOpen = useUIStore((s) => s.sidebarOpen); + + return ( + + ); +} diff --git a/frontend/src/components/upload/DropZone.tsx b/frontend/src/components/upload/DropZone.tsx new file mode 100644 index 0000000..2e72b63 --- /dev/null +++ b/frontend/src/components/upload/DropZone.tsx @@ -0,0 +1,96 @@ +import { useCallback, useState } from "react"; +import { useDropzone } from "react-dropzone"; + +interface DropZoneProps { + onFileSelected: (file: File) => void; + disabled?: boolean; +} + +export default function DropZone({ onFileSelected, disabled }: DropZoneProps) { + const [preview, setPreview] = useState(null); + const [selectedFile, setSelectedFile] = useState(null); + + const onDrop = useCallback( + (acceptedFiles: File[]) => { + const file = acceptedFiles[0]; + if (!file) return; + setSelectedFile(file); + setPreview(URL.createObjectURL(file)); + onFileSelected(file); + }, + [onFileSelected], + ); + + const { getRootProps, getInputProps, isDragActive } = useDropzone({ + onDrop, + accept: { + "image/jpeg": [".jpg", ".jpeg"], + "image/png": [".png"], + "image/tiff": [".tiff", ".tif"], + "image/webp": [".webp"], + }, + maxFiles: 1, + disabled, + }); + + return ( +
+
+ + {preview ? ( +
+ Preview +
+

{selectedFile?.name}

+

+ {selectedFile + ? `${(selectedFile.size / 1024 / 1024).toFixed(2)} MB` + : ""} +

+
+

+ Drop a new image to replace +

+
+ ) : ( +
+ + + +
+

+ {isDragActive + ? "Drop your image here" + : "Drag and drop an image, or click to browse"} +

+

+ JPEG, PNG, TIFF, or WebP +

+
+
+ )} +
+
+ ); +} diff --git a/frontend/src/components/upload/UploadPreview.tsx b/frontend/src/components/upload/UploadPreview.tsx new file mode 100644 index 0000000..d4b28ba --- /dev/null +++ b/frontend/src/components/upload/UploadPreview.tsx @@ -0,0 +1,51 @@ +import { useEffect, useState } from "react"; +import Card from "../common/Card"; + +interface UploadPreviewProps { + file: File; +} + +export default function UploadPreview({ file }: UploadPreviewProps) { + const [dimensions, setDimensions] = useState<{ + width: number; + height: number; + } | null>(null); + const [previewUrl, setPreviewUrl] = useState(""); + + useEffect(() => { + const url = URL.createObjectURL(file); + setPreviewUrl(url); + + const img = new Image(); + img.onload = () => { + setDimensions({ width: img.naturalWidth, height: img.naturalHeight }); + }; + img.src = url; + + return () => URL.revokeObjectURL(url); + }, [file]); + + const sizeMB = (file.size / 1024 / 1024).toFixed(2); + + return ( + + {previewUrl && ( + Preview + )} +
+

{file.name}

+

{sizeMB} MB

+ {dimensions && ( +

+ {dimensions.width} x {dimensions.height} px +

+ )} +

{file.type}

+
+
+ ); +} diff --git a/frontend/src/globals.css b/frontend/src/globals.css new file mode 100644 index 0000000..74631d8 --- /dev/null +++ b/frontend/src/globals.css @@ -0,0 +1,13 @@ +@import "tailwindcss"; + +body { + font-family: + "Montserrat", + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + Roboto, + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} diff --git a/frontend/src/hooks/useAnalysis.ts b/frontend/src/hooks/useAnalysis.ts new file mode 100644 index 0000000..87425c9 --- /dev/null +++ b/frontend/src/hooks/useAnalysis.ts @@ -0,0 +1,27 @@ +import { useQuery } from "@tanstack/react-query"; +import { getAnalysis, getAnalysisStatus } from "../api/analysis"; +import type { AnalysisDetail, AnalysisStatus } from "../types/analysis"; + +export function useAnalysis(analysisId: string | undefined) { + return useQuery({ + queryKey: ["analysis", analysisId], + queryFn: () => getAnalysis(analysisId!), + enabled: !!analysisId, + }); +} + +export function useAnalysisStatus( + analysisId: string | undefined, + enabled: boolean = true, +) { + return useQuery({ + queryKey: ["analysisStatus", analysisId], + queryFn: () => getAnalysisStatus(analysisId!), + enabled: !!analysisId && enabled, + refetchInterval: (query) => { + const status = query.state.data?.status; + if (status === "completed" || status === "failed") return false; + return 2000; + }, + }); +} diff --git a/frontend/src/hooks/useProjects.ts b/frontend/src/hooks/useProjects.ts new file mode 100644 index 0000000..40940b2 --- /dev/null +++ b/frontend/src/hooks/useProjects.ts @@ -0,0 +1,63 @@ +import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; +import { + listProjects, + getProject, + createProject, + updateProject, + deleteProject, +} from "../api/projects"; +import type { Project, ProjectDetail, ProjectCreate } from "../types/project"; + +export function useProjects(page: number = 1, perPage: number = 20) { + return useQuery({ + queryKey: ["projects", page, perPage], + queryFn: () => listProjects(page, perPage), + }); +} + +export function useProject(projectId: string | undefined) { + return useQuery({ + queryKey: ["project", projectId], + queryFn: () => getProject(projectId!), + enabled: !!projectId, + }); +} + +export function useCreateProject() { + const queryClient = useQueryClient(); + + return useMutation({ + mutationFn: ({ name, description }: ProjectCreate) => + createProject(name, description), + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ["projects"] }); + }, + }); +} + +export function useUpdateProject() { + const queryClient = useQueryClient(); + + return useMutation({ + mutationFn: ({ + id, + ...updates + }: Partial & { id: string }) => + updateProject(id, updates), + onSuccess: (_, variables) => { + queryClient.invalidateQueries({ queryKey: ["projects"] }); + queryClient.invalidateQueries({ queryKey: ["project", variables.id] }); + }, + }); +} + +export function useDeleteProject() { + const queryClient = useQueryClient(); + + return useMutation({ + mutationFn: (id: string) => deleteProject(id), + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ["projects"] }); + }, + }); +} diff --git a/frontend/src/hooks/useUpload.ts b/frontend/src/hooks/useUpload.ts new file mode 100644 index 0000000..0d2c06e --- /dev/null +++ b/frontend/src/hooks/useUpload.ts @@ -0,0 +1,48 @@ +import { useState, useCallback } from "react"; +import { useMutation } from "@tanstack/react-query"; +import { createAnalysis } from "../api/analysis"; +import type { AnalysisDetail } from "../types/analysis"; + +interface UseUploadOptions { + onSuccess?: (analysis: AnalysisDetail) => void; + onError?: (error: Error) => void; +} + +export function useUpload(options?: UseUploadOptions) { + const [progress, setProgress] = useState(0); + + const mutation = useMutation< + AnalysisDetail, + Error, + { projectId: string; file: File; name?: string; model?: string } + >({ + mutationFn: async ({ projectId, file, name, model }) => { + setProgress(10); + const result = await createAnalysis(projectId, file, name, model); + setProgress(100); + return result; + }, + onSuccess: (data) => { + options?.onSuccess?.(data); + }, + onError: (error) => { + setProgress(0); + options?.onError?.(error); + }, + }); + + const reset = useCallback(() => { + setProgress(0); + mutation.reset(); + }, [mutation]); + + return { + upload: mutation.mutate, + uploadAsync: mutation.mutateAsync, + isUploading: mutation.isPending, + progress, + error: mutation.error, + data: mutation.data, + reset, + }; +} diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx new file mode 100644 index 0000000..a601f65 --- /dev/null +++ b/frontend/src/main.tsx @@ -0,0 +1,26 @@ +import { StrictMode } from "react"; +import { createRoot } from "react-dom/client"; +import { BrowserRouter } from "react-router-dom"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import App from "./App"; +import "./globals.css"; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: 1, + refetchOnWindowFocus: false, + staleTime: 30_000, + }, + }, +}); + +createRoot(document.getElementById("root")!).render( + + + + + + + , +); diff --git a/frontend/src/pages/About.tsx b/frontend/src/pages/About.tsx new file mode 100644 index 0000000..1feeda9 --- /dev/null +++ b/frontend/src/pages/About.tsx @@ -0,0 +1,468 @@ +import { useState } from "react"; +import Card from "../components/common/Card"; + +function Section({ + title, + children, +}: { + title: string; + children: React.ReactNode; +}) { + return ( + +

+ {title} +

+
+ {children} +
+
+ ); +} + +function Expandable({ + label, + children, +}: { + label: string; + children: React.ReactNode; +}) { + const [open, setOpen] = useState(false); + return ( +
+ + {open && ( +
+ {children} +
+ )} +
+ ); +} + +function Citation({ + authors, + year, + title, + venue, + url, +}: { + authors: string; + year: string; + title: string; + venue: string; + url: string; +}) { + return ( +

+ {authors} ({year}).{" "} + + “{title}” + + . {venue}. +

+ ); +} + +export default function About() { + return ( +
+ {/* Hero */} +
+

+ The Science Behind Oli + VAS +

+

+ How we predict where people look — and why you can trust the results +

+
+ + {/* Layman's explanation */} +
+

+ When you look at an image — an ad, a product package, a web page — your + eyes don't scan everything equally. In the first 3–5 seconds, your gaze + is drawn to specific areas: faces, high-contrast text, bright colours, + and unusual shapes. This is called visual saliency. +

+

+ OliVAS uses deep neural networks to predict this + behaviour. These networks were trained on data from thousands of{" "} + real eye-tracking experiments, where researchers recorded + exactly where people looked when shown different images. The models + learned the patterns that drive human attention — and can now predict + them for any new image you upload. +

+

+ The result is a heatmap showing where viewers are most + likely to look, a gaze sequence predicting the order of + fixations, and attention metrics that quantify how + effectively your design captures attention. +

+
+ + {/* The Models */} +
+

+ OliVAS uses the DeepGaze family of models, developed at + the University of Tübingen by Matthias Kümmerer, Matthias Bethge, and + colleagues. These are consistently among the{" "} + top-ranked models on the{" "} + + MIT/Tübingen Saliency Benchmark + + , the standard evaluation platform for saliency prediction. +

+ + {/* DeepGaze IIE */} +
+
+

DeepGaze IIE

+ + Recommended + +
+

+ Our recommended model for most use cases. It combines features from + two powerful image recognition networks (ResNet and DenseNet) to + predict where people look. It is calibrated — meaning + its confidence scores closely match actual fixation probabilities, even + on images very different from its training data. +

+ +

+ DeepGaze IIE uses an ensemble of ResNet-50 and DenseNet-201 features + with a readout network and learned center bias prior. It was the + first model to demonstrate strong out-of-domain generalisation across + different saliency datasets. It achieves state-of-the-art performance + on the MIT/Tübingen benchmark with an Information Gain (IG) score + that significantly outperforms previous models. +

+ +
+
+ + {/* DeepGaze III */} +
+

DeepGaze III

+

+ The latest model in the family, designed to predict not just{" "} + where people look but the sequence of fixations + over time. It uses a transformer-based architecture that can capture + long-range dependencies in an image — useful for complex layouts with + many elements. +

+ +

+ DeepGaze III models scanpaths (sequences of fixations) rather than + just static saliency maps. It uses a deep neural network with a + fixation selection mechanism that accounts for the temporal dynamics + of visual exploration. Published in the Journal of Vision, the + leading peer-reviewed journal for vision science. +

+ +
+
+ + {/* DeepGaze I */} +
+

DeepGaze I

+

+ The original DeepGaze model that pioneered using deep learning features + for saliency prediction. It demonstrated that features learned for + object recognition (on ImageNet) naturally encode information about + where humans look. Faster than the newer variants but less accurate on + complex designs. +

+ +

+ DeepGaze I uses features from AlexNet (trained on ImageNet) with a + linear readout to predict fixation density. It was the first model to + show that deep features trained for object classification transfer + well to saliency prediction, significantly outperforming + hand-engineered feature models. +

+ +
+
+
+ + {/* Validation */} +
+

+ How do we know these predictions are accurate? The models are evaluated + against real human eye-tracking data. In eye-tracking + studies, participants view images while a camera tracks their exact gaze + position at high speed (typically 250–1000 times per second). This + produces ground truth "fixation maps" showing where humans actually + looked. +

+

+ The{" "} + + MIT/Tübingen Saliency Benchmark + {" "} + is the standard platform for comparing saliency models. It uses hidden + test sets so models cannot be tuned to the evaluation data. DeepGaze + models consistently rank among the top performers. +

+

+ Key evaluation datasets include: +

+
    +
  • + MIT1003 — 1,003 natural images with eye-tracking data + from 15 viewers each ( + + Judd et al., 2009 + + ) +
  • +
  • + CAT2000 — 4,000 images across 20 categories with + fixation data from 24 observers ( + + Borji & Itti, 2015 + + ) +
  • +
+ + +

+ Models are evaluated on multiple metrics: AUC (Area Under the ROC + Curve), Information Gain (IG), Normalized Scanpath Saliency (NSS), + and KL Divergence. These measure different aspects of prediction + quality — from binary "is this a fixated location" to fine-grained + probability calibration. +

+

+ DeepGaze IIE achieves some of the highest Information Gain scores on + the MIT benchmark, meaning its predicted probability distributions + closely match actual human fixation patterns. +

+
+
+ + {/* Foundational Research */} +
+

+ The scientific study of visual attention goes back decades. In 1998, + Laurent Itti, Christof Koch, and Ernst Niebur published a landmark + computational model of visual attention based on neuroscience principles + — centre-surround contrast in colour, intensity, and orientation. This + model established the field of computational saliency prediction. +

+

+ Since then, the field has evolved from hand-crafted feature models to + deep learning approaches. DeepGaze I (2015) was a pivotal moment, + showing that neural networks trained for object recognition naturally + learn to predict human attention. Each subsequent version has improved + accuracy and generalisation. +

+ + + + +
+ + {/* Important caveats */} +
+

+ While saliency models are powerful tools, they have important + limitations to keep in mind: +

+
    +
  • + First-glance only — Predictions model the first 3–5 + seconds of free viewing. They do not predict reading behaviour, + task-driven search, or extended engagement. +
  • +
  • + Bottom-up attention — Models predict attention driven + by visual features (contrast, faces, objects). They do not account for + top-down factors like user intent, cultural context, or brand + recognition. +
  • +
  • + Aggregated viewers — Predictions represent an + average across many viewers. Individual variation can be substantial. +
  • +
  • + Static images only — Models are trained on and + predict for static images, not video or interactive content. +
  • +
+

+ For best results, use OliVAS as one input in your design review process + alongside user testing, A/B testing, and domain expertise. +

+
+ + {/* Full References */} +
+
+ + + + + + + + +
+
+

+ Open-source implementation:{" "} + + github.com/matthias-k/DeepGaze + {" "} + | Benchmark:{" "} + + saliency.tuebingen.ai + +

+
+
+ +
+ OliVAS — Open-Source Visual Attention Software by OLIVER +
+
+ ); +} diff --git a/frontend/src/pages/AnalysisView.tsx b/frontend/src/pages/AnalysisView.tsx new file mode 100644 index 0000000..be1cea2 --- /dev/null +++ b/frontend/src/pages/AnalysisView.tsx @@ -0,0 +1,274 @@ +import { useEffect, useState } from "react"; +import { useParams } from "react-router-dom"; +import { useAnalysis } from "../hooks/useAnalysis"; +import { useAnalysisStore, type AnalysisTab } from "../stores/analysisStore"; +import { getAnalysisImageUrl, checkAIInsightsAvailable, generateAIInsights } from "../api/analysis"; +import type { Insight } from "../types/analysis"; + +function ZoomableImage({ src, alt }: { src: string; alt: string }) { + const zoom = useAnalysisStore((s) => s.zoom); + return ( +
+ {alt} +
+ ); +} + +function ZoomControls() { + const zoom = useAnalysisStore((s) => s.zoom); + const setZoom = useAnalysisStore((s) => s.setZoom); + return ( +
+ + {Math.round(zoom * 100)}% + + {zoom !== 1 && ( + + )} +
+ ); +} +import { downloadReport } from "../api/reports"; +import HeatmapOverlay from "../components/analysis/HeatmapOverlay"; +import HeatmapControls from "../components/analysis/HeatmapControls"; +import GazeSequence from "../components/analysis/GazeSequence"; +import HotspotList from "../components/analysis/HotspotList"; +import InsightsPanel from "../components/analysis/InsightsPanel"; +import AOICanvas from "../components/aoi/AOICanvas"; +import AOIResults from "../components/aoi/AOIResults"; +import Card from "../components/common/Card"; +import Button from "../components/common/Button"; +import LoadingSpinner from "../components/common/LoadingSpinner"; + +const tabs: { key: AnalysisTab; label: string }[] = [ + { key: "heatmap", label: "Heatmap" }, + { key: "gaze", label: "Gaze Sequence" }, + { key: "hotspots", label: "Hotspots" }, + { key: "aoi", label: "AOI Analysis" }, +]; + +export default function AnalysisView() { + const { analysisId } = useParams<{ analysisId: string }>(); + const { data: analysis, isLoading, error } = useAnalysis(analysisId); + const activeTab = useAnalysisStore((s) => s.activeTab); + const setActiveTab = useAnalysisStore((s) => s.setActiveTab); + const setCurrentAnalysis = useAnalysisStore((s) => s.setCurrentAnalysis); + const aoiResults = useAnalysisStore((s) => s.aoiResults); + const reset = useAnalysisStore((s) => s.reset); + + const [aiAvailable, setAiAvailable] = useState(false); + const [aiInsights, setAiInsights] = useState([]); + const [aiCostUsd, setAiCostUsd] = useState(null); + const [aiLoading, setAiLoading] = useState(false); + const [aiError, setAiError] = useState(null); + + useEffect(() => { + checkAIInsightsAvailable().then(setAiAvailable); + }, []); + + // Load saved AI insights from DB when analysis loads + useEffect(() => { + if (analysis?.ai_insights && analysis.ai_insights.length > 0) { + setAiInsights(analysis.ai_insights); + setAiCostUsd(analysis.ai_cost_usd ?? null); + } + }, [analysis]); + + const handleGenerateAI = async () => { + if (!analysisId) return; + setAiLoading(true); + setAiError(null); + try { + const result = await generateAIInsights(analysisId); + setAiInsights(result.insights); + setAiCostUsd(result.cost_usd); + } catch (err: any) { + setAiError(err?.response?.data?.detail || "AI analysis failed"); + } finally { + setAiLoading(false); + } + }; + + useEffect(() => { + if (analysis) { + setCurrentAnalysis(analysis); + } + return () => { + reset(); + }; + }, [analysis, setCurrentAnalysis, reset]); + + const handleDownloadPdf = async () => { + if (!analysisId) return; + try { + await downloadReport(analysisId); + } catch (err) { + console.error("Failed to download report:", err); + } + }; + + if (isLoading) { + return ; + } + + if (error || !analysis) { + return ( +
+

+ Failed to load analysis. It may not exist or is still processing. +

+ +
+ ); + } + + const originalUrl = getAnalysisImageUrl(analysis.id, "original"); + const saliencyUrl = getAnalysisImageUrl(analysis.id, "saliency-raw"); + const gazeUrl = getAnalysisImageUrl(analysis.id, "gaze-sequence"); + + return ( +
+ {/* Header */} +
+
+

+ {analysis.name} +

+
+ Model: {analysis.model_used || analysis.model} + + {new Date(analysis.created_at).toLocaleDateString()} + + {analysis.overall_score !== undefined && ( + + Score: {analysis.overall_score.toFixed(1)} + + )} +
+
+
+ {aiAvailable && analysis.status === "completed" && aiInsights.length === 0 && ( + + )} + +
+
+ + {/* Tabs + Zoom */} +
+
+
+ {tabs.map((tab) => ( + + ))} +
+ +
+
+ + {/* Insights */} + {((analysis.insights && analysis.insights.length > 0) || aiInsights.length > 0) && ( + + )} + {aiError && ( +
+ {aiError} +
+ )} + + {/* Tab content */} + {activeTab === "heatmap" && ( +
+
+ + + +
+
+ +
+
+ )} + + {activeTab === "gaze" && ( + ({ + rank: p.rank, + x: p.x, + y: p.y, + intensity: p.probability ?? p.intensity ?? 0, + })) + } + /> + )} + + {activeTab === "hotspots" && ( +
+ + + + +
+ )} + + {activeTab === "aoi" && ( +
+ + +
+ )} +
+ ); +} diff --git a/frontend/src/pages/ComparisonView.tsx b/frontend/src/pages/ComparisonView.tsx new file mode 100644 index 0000000..e19de9e --- /dev/null +++ b/frontend/src/pages/ComparisonView.tsx @@ -0,0 +1,175 @@ +import { useEffect, useState } from "react"; +import { useParams, useNavigate } from "react-router-dom"; +import { useProject } from "../hooks/useProjects"; +import { getAnalysisImageUrl } from "../api/analysis"; +import Card from "../components/common/Card"; +import Button from "../components/common/Button"; +import LoadingSpinner from "../components/common/LoadingSpinner"; + +export default function ComparisonView() { + const { comparisonId } = useParams<{ comparisonId: string }>(); + const navigate = useNavigate(); + const { data: project, isLoading } = useProject(comparisonId); + const [selectedIds, setSelectedIds] = useState([]); + + const analyses = (project?.analyses || []).filter( + (a) => a.status === "completed", + ); + + useEffect(() => { + if (analyses.length >= 2 && selectedIds.length === 0) { + setSelectedIds(analyses.slice(0, 2).map((a) => a.id)); + } + }, [analyses, selectedIds.length]); + + const toggleSelection = (id: string) => { + setSelectedIds((prev) => + prev.includes(id) ? prev.filter((i) => i !== id) : [...prev, id], + ); + }; + + if (isLoading) { + return ; + } + + if (!project) { + return ( +
+

Project not found.

+ +
+ ); + } + + const selected = analyses.filter((a) => selectedIds.includes(a.id)); + + return ( +
+
+

+ Compare Analyses +

+

+ {project.name} -- Side-by-side heatmap comparison +

+
+ + {/* Selection */} + +

+ Select analyses to compare: +

+
+ {analyses.map((a) => ( + + ))} +
+
+ + {/* Side-by-side view */} + {selected.length >= 2 ? ( +
+ {selected.map((analysis) => ( + +
+

+ {analysis.name} +

+

{analysis.model}

+
+
+ {`Heatmap: +
+
+ ))} +
+ ) : ( + +

+ Select at least 2 completed analyses to compare. +

+
+ )} + + {/* Comparison table */} + {selected.length >= 2 && ( + +

+ Comparison Metrics +

+
+ + + + + {selected.map((a) => ( + + ))} + + + + + + {selected.map((a) => ( + + ))} + + + + {selected.map((a) => ( + + ))} + + + + {selected.map((a) => ( + + ))} + + +
+ Metric + + {a.name} +
Model + {a.model} +
Status + + {a.status} + +
Date + {new Date(a.created_at).toLocaleDateString()} +
+
+
+ )} +
+ ); +} diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx new file mode 100644 index 0000000..65d1f9e --- /dev/null +++ b/frontend/src/pages/Dashboard.tsx @@ -0,0 +1,174 @@ +import { useState } from "react"; +import { Link } from "react-router-dom"; +import { useProjects, useCreateProject } from "../hooks/useProjects"; +import Card from "../components/common/Card"; +import Button from "../components/common/Button"; +import LoadingSpinner from "../components/common/LoadingSpinner"; + +export default function Dashboard() { + const { data, isLoading, error } = useProjects(); + const createProject = useCreateProject(); + const [showCreateModal, setShowCreateModal] = useState(false); + const [newName, setNewName] = useState(""); + const [newDescription, setNewDescription] = useState(""); + + const handleCreate = async () => { + if (!newName.trim()) return; + await createProject.mutateAsync({ + name: newName.trim(), + description: newDescription.trim() || undefined, + }); + setNewName(""); + setNewDescription(""); + setShowCreateModal(false); + }; + + if (isLoading) return ; + + if (error) { + return ( +
+

Failed to load projects. Please try again.

+
+ ); + } + + const projects = data || []; + + return ( +
+
+
+

+ Dashboard +

+

+ Manage your visual attention analysis projects +

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

+ No projects yet +

+

+ Create a project to start analyzing visual attention in your + creative assets. +

+ +
+ ) : ( +
+ {projects.map((project) => ( + + +
+

+ {project.name} +

+ + {project.analysis_count} analyses + +
+ {project.description && ( +

+ {project.description} +

+ )} +

+ Updated{" "} + {new Date(project.updated_at).toLocaleDateString()} +

+
+ + ))} +
+ )} + + {showCreateModal && ( +
+ +

+ Create New Project +

+
+
+ + setNewName(e.target.value)} + placeholder="e.g., Q1 Campaign Creatives" + className="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-[#ffc407] focus:border-transparent" + autoFocus + onKeyDown={(e) => e.key === "Enter" && handleCreate()} + /> +
+
+ +