commit 5fb9c7a145ef91999ac18db8a1ec820592fc91f9 Author: Jorem Juárez Date: Sat Jun 13 19:31:27 2026 -0600 Initial build: Menú inteligente platform Multi-tenant digital menu platform (Collina Systems): public QR menu with glassmorphism + 3D macro flip cards, mobile-first editor with draft/publish versioning (5-version history + restore), AI consultant & translation (Claude Haiku), realtime orders via SSE, configurable palette, QR generation, superadmin panel, and Docker/Coolify infra. diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6df1ebb --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +node_modules +.next +.git +.env +.env*.local +data +*.md +Dockerfile +docker-compose.yml +.dockerignore diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..5b45801 --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +DATABASE_URL=postgresql://menu:${DB_PASSWORD}@db:5432/menu +DB_PASSWORD= +JWT_SECRET= +ANTHROPIC_API_KEY= +SUPERADMIN_USER= +SUPERADMIN_PASSWORD= +APP_BASE_URL=https://smartmenu.collinasystems.com.mx +UPLOAD_DIR=/data/uploads diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cd34072 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +/node_modules +/.next +/out +/build +.DS_Store +*.pem +.env +.env*.local +/data +next-env.d.ts +.vercel +*.tsbuildinfo diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6f4bc72 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +# --- deps --- +FROM node:20-alpine AS deps +RUN apk add --no-cache libc6-compat openssl +WORKDIR /app +COPY package.json package-lock.json* ./ +RUN npm ci + +# --- builder --- +FROM node:20-alpine AS builder +RUN apk add --no-cache libc6-compat openssl +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +RUN npx prisma generate +RUN npm run build + +# --- runner --- +FROM node:20-alpine AS runner +RUN apk add --no-cache libc6-compat openssl +WORKDIR /app +ENV NODE_ENV=production +ENV PORT=3000 + +# Standalone output bundles only what's needed to run. +COPY --from=builder /app/public ./public +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static + +# Prisma needs the schema + engine + CLI to run migrate deploy at startup. +COPY --from=builder /app/prisma ./prisma +COPY --from=builder /app/node_modules/.bin/prisma ./node_modules/.bin/prisma +COPY --from=builder /app/node_modules/prisma ./node_modules/prisma +COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma +COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma + +COPY docker-entrypoint.sh ./docker-entrypoint.sh +RUN chmod +x docker-entrypoint.sh + +EXPOSE 3000 +VOLUME ["/data"] +CMD ["./docker-entrypoint.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..a8b40ea --- /dev/null +++ b/README.md @@ -0,0 +1,116 @@ +# Menú inteligente — Collina Systems + +Plataforma multi-tenant de menús digitales para restaurantes. Cada restaurante tiene su +menú público (vía QR), un editor protegido mobile-first y un tablero de órdenes en tiempo +real, con consultor IA y soporte bilingüe (ES/EN). + +Estética: glassmorphism claro/transparente con animaciones high-end (flip 3D de macros, +entradas escalonadas, micro-interacciones). + +## Stack + +- Next.js 14 (App Router) + TypeScript +- PostgreSQL + Prisma +- next-intl (ES/EN, switch por cookie sin cambiar URL) +- Claude Haiku (`claude-haiku-4-5`) para traducción y consultor IA +- SSE para órdenes en tiempo real +- Almacenamiento en volumen local (`/data/uploads`) +- Tailwind CSS +- JWT + link secreto para auth del editor +- Docker + docker-compose (listo para Coolify) + +## Rutas + +| Ruta | Descripción | Auth | +| --- | --- | --- | +| `/{slug}` | Menú público (QR) | — | +| `/{slug}/editor?k={secret}` | Editor | link secreto + login | +| `/{slug}/editor/login` | Login del editor | — | +| `/admin` | Panel maestro Collina | superadmin (env) | + +## Desarrollo local + +```bash +cp .env.example .env # completa los valores +# DATABASE_URL apuntando a tu Postgres local, JWT_SECRET, ANTHROPIC_API_KEY, +# SUPERADMIN_USER / SUPERADMIN_PASSWORD, APP_BASE_URL=http://localhost:3000 + +npm install +npx prisma migrate deploy # o `npm run prisma:migrate` para desarrollo +npm run db:seed # crea el restaurante demo (opcional) +npm run dev +``` + +El seed imprime el link de editor con su secreto y las credenciales `admin / demo1234`. + +## Versionado (concepto clave) + +- Las tablas `Section` y `Product` son el **borrador vivo** que el restaurante edita. +- El menú público **nunca** lee el borrador: lee el `snapshot` JSON de la `MenuVersion` + apuntada por `Restaurant.publishedVersionId`. +- "Guardar y publicar" pide un nombre de versión, crea un `MenuVersion` con el snapshot + completo del borrador y actualiza `publishedVersionId`. +- Se conservan máximo **5 versiones** por restaurante; al publicar la 6ª se elimina la más + vieja (nunca la publicada). Cada versión del historial se puede **restaurar** al borrador. + +## Código de color de macros (estándar fijo) + +Universal en todos los restaurantes — definido en `src/lib/macros.ts` y `tailwind.config.ts`. +La paleta del restaurante (fondos, acentos, tabs) sí es configurable; la de macros no. + +| Macro | Color | +| --- | --- | +| Proteína | `#C2410C` | +| Carbohidratos | `#B45309` | +| Azúcares | `#BE185D` | +| Grasas | `#CA8A04` | +| Fibra | `#15803D` | +| Calorías | `#1D4ED8` | + +## Despliegue con Coolify / Docker + +`docker-compose.yml` define `app` (Next.js standalone) y `db` (Postgres 16) con volúmenes +`menu_data` (uploads) y `menu_db`. El contenedor corre `prisma migrate deploy` al arrancar +(ver `docker-entrypoint.sh`). + +Variables de entorno (`.env`): + +```env +DATABASE_URL=postgresql://menu:${DB_PASSWORD}@db:5432/menu +DB_PASSWORD= +JWT_SECRET= +ANTHROPIC_API_KEY= +SUPERADMIN_USER= +SUPERADMIN_PASSWORD= +APP_BASE_URL=https://smartmenu.collinasystems.com.mx +UPLOAD_DIR=/data/uploads +``` + +```bash +docker compose up -d --build +``` + +En Coolify: apuntar al repo, montar el volumen persistente en `/data`, fijar las variables +de entorno y el dominio `smartmenu.collinasystems.com.mx`. + +## Endpoints + +Públicos: `GET /api/{slug}/menu`, `POST /api/{slug}/order`, `POST /api/{slug}/call-waiter`, +`POST /api/{slug}/ai-consult`, `GET /api/{slug}/orders/stream` (SSE). + +Editor (JWT): `POST /api/{slug}/auth/login`, CRUD `sections`/`products`, +`POST /api/{slug}/publish`, `GET /api/{slug}/versions`, +`POST /api/{slug}/versions/{id}/restore`, `POST /api/{slug}/translate`, +`POST /api/{slug}/upload`, `PATCH /api/{slug}/orders/{id}`, `PATCH /api/{slug}/palette`, +`PATCH /api/{slug}/settings`, `GET /api/{slug}/qr`. + +Superadmin: `POST /api/admin/login`, `GET|POST /api/admin/restaurants`, +`PATCH /api/admin/restaurants/{id}`. + +## Notas + +- i18n de interfaz en `messages/{es,en}.json`; agregar un idioma = añadir un JSON nuevo. +- Contenido dinámico (nombres/descripciones) se guarda como `{ es, en }`; el botón + "Traducir con IA" llena el idioma faltante y marca `translationStatus.en` como `auto` + hasta que el restaurante lo edita (`reviewed`). +- Sentence case en toda la UI. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..ebc2d86 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +version: '3.8' + +services: + app: + build: . + restart: unless-stopped + volumes: + - menu_data:/data + env_file: [.env] + ports: + - '3000:3000' + depends_on: + db: + condition: service_healthy + + db: + image: postgres:16-alpine + restart: unless-stopped + volumes: + - menu_db:/var/lib/postgresql/data + environment: + POSTGRES_DB: menu + POSTGRES_USER: menu + POSTGRES_PASSWORD: ${DB_PASSWORD} + healthcheck: + test: ['CMD-SHELL', 'pg_isready -U menu -d menu'] + interval: 5s + timeout: 5s + retries: 10 + +volumes: + menu_data: + menu_db: diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..48bd329 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +# Apply pending migrations against the database, then start the server. +echo "Running prisma migrate deploy…" +./node_modules/.bin/prisma migrate deploy + +# Ensure the upload directory exists in the mounted volume. +mkdir -p "${UPLOAD_DIR:-/data/uploads}" + +echo "Starting Next.js…" +exec node server.js diff --git a/messages/en.json b/messages/en.json new file mode 100644 index 0000000..f8bfe06 --- /dev/null +++ b/messages/en.json @@ -0,0 +1,106 @@ +{ + "common": { + "appName": "Smart menu", + "save": "Save", + "cancel": "Cancel", + "delete": "Delete", + "edit": "Edit", + "add": "Add", + "close": "Close", + "loading": "Loading…", + "back": "Back", + "confirm": "Confirm", + "restore": "Restore", + "language": "Language" + }, + "menu": { + "askAi": "Ask the AI", + "actions": "Actions", + "placeOrder": "Place order", + "callWaiter": "Call the waiter", + "viewFull": "View full menu", + "tableNumber": "Table number", + "send": "Send", + "addToOrder": "Add to order", + "yourOrder": "Your order", + "empty": "No dishes in this section yet.", + "waiterCalled": "The waiter is on the way", + "orderSent": "Your order was sent", + "macroLegend": "Macro color code", + "tapToFlip": "Tap to see macros" + }, + "macros": { + "protein": "Protein", + "carbs": "Carbs", + "sugar": "Sugars", + "fat": "Fats", + "fiber": "Fiber", + "kcal": "Calories" + }, + "ai": { + "title": "Menu consultant", + "placeholder": "What do you recommend if I'm diabetic?", + "thinking": "Thinking…", + "intro": "Tell me what you're after and I'll recommend dishes from the menu." + }, + "editor": { + "catalog": "Catalog", + "palette": "Palette", + "orders": "Orders", + "qr": "QR", + "publishedVersion": "Published version", + "noVersion": "You haven't published a version yet", + "addDish": "Add dish", + "newSection": "New section", + "viewMenu": "View menu", + "saveAndPublish": "Save and publish", + "versionNamePlaceholder": "Updated menu June 2026", + "versionNameLabel": "Version name", + "publishSuccess": "Done! Your menu «{name}» is now live", + "history": "Version history", + "historyHint": "You can see your last 5 versions", + "translateAi": "Translate with AI", + "autoTranslation": "Auto translation", + "reviewedTranslation": "Reviewed", + "complete": "Complete", + "missingInfo": "Missing info", + "active": "Active", + "inactive": "Inactive", + "name": "Name", + "description": "Description", + "price": "Price", + "section": "Section", + "allergens": "Allergens", + "dietTags": "Diet tags", + "media": "Photos and videos", + "uploadMedia": "Upload photo or video", + "ordersDisabled": "Order taking is disabled", + "enableOrders": "Enable order taking", + "completeOrder": "Complete order", + "table": "Table", + "downloadQr": "Download QR", + "publicLink": "Public link", + "copyLink": "Copy link", + "copied": "Copied", + "paletteHint": "This does not affect the macro color code" + }, + "auth": { + "login": "Log in", + "username": "Username", + "password": "Password", + "invalid": "Wrong username or password", + "invalidLink": "Invalid access link" + }, + "admin": { + "title": "Collina master panel", + "newRestaurant": "New restaurant", + "restaurants": "Restaurants", + "name": "Name", + "slug": "Slug", + "create": "Create restaurant", + "editorLink": "Editor link", + "publicLink": "Public link", + "credentials": "Initial credentials", + "active": "Active" + } +} diff --git a/messages/es.json b/messages/es.json new file mode 100644 index 0000000..1bca1c4 --- /dev/null +++ b/messages/es.json @@ -0,0 +1,106 @@ +{ + "common": { + "appName": "Menú inteligente", + "save": "Guardar", + "cancel": "Cancelar", + "delete": "Eliminar", + "edit": "Editar", + "add": "Agregar", + "close": "Cerrar", + "loading": "Cargando…", + "back": "Volver", + "confirm": "Confirmar", + "restore": "Restaurar", + "language": "Idioma" + }, + "menu": { + "askAi": "Pregúntale a la IA", + "actions": "Acciones", + "placeOrder": "Realizar orden", + "callWaiter": "Llamar al mesero", + "viewFull": "Ver el menú completo", + "tableNumber": "Número de mesa", + "send": "Enviar", + "addToOrder": "Agregar al pedido", + "yourOrder": "Tu pedido", + "empty": "Aún no hay platillos en esta sección.", + "waiterCalled": "El mesero va en camino", + "orderSent": "Tu orden fue enviada", + "macroLegend": "Código de color de macros", + "tapToFlip": "Toca para ver macros" + }, + "macros": { + "protein": "Proteína", + "carbs": "Carbohidratos", + "sugar": "Azúcares", + "fat": "Grasas", + "fiber": "Fibra", + "kcal": "Calorías" + }, + "ai": { + "title": "Consultor del menú", + "placeholder": "¿Qué me recomiendas si soy diabético?", + "thinking": "Pensando…", + "intro": "Cuéntame qué buscas y te recomiendo platillos del menú." + }, + "editor": { + "catalog": "Catálogo", + "palette": "Paleta", + "orders": "Órdenes", + "qr": "QR", + "publishedVersion": "Versión publicada", + "noVersion": "Aún no has publicado una versión", + "addDish": "Agregar platillo", + "newSection": "Nueva sección", + "viewMenu": "Ver menú", + "saveAndPublish": "Guardar y publicar", + "versionNamePlaceholder": "Carta actualizada junio 2026", + "versionNameLabel": "Nombre de la versión", + "publishSuccess": "¡Listo! Tu menú «{name}» ya está en vivo", + "history": "Historial de versiones", + "historyHint": "Puedes ver tus últimas 5 versiones", + "translateAi": "Traducir con IA", + "autoTranslation": "Traducción automática", + "reviewedTranslation": "Revisada", + "complete": "Completo", + "missingInfo": "Falta info", + "active": "Activo", + "inactive": "Inactivo", + "name": "Nombre", + "description": "Descripción", + "price": "Precio", + "section": "Sección", + "allergens": "Alérgenos", + "dietTags": "Tags de dieta", + "media": "Fotos y videos", + "uploadMedia": "Subir foto o video", + "ordersDisabled": "La toma de órdenes está desactivada", + "enableOrders": "Habilitar toma de órdenes", + "completeOrder": "Completar orden", + "table": "Mesa", + "downloadQr": "Descargar QR", + "publicLink": "Link público", + "copyLink": "Copiar link", + "copied": "Copiado", + "paletteHint": "Esto no afecta el código de color de macros" + }, + "auth": { + "login": "Iniciar sesión", + "username": "Usuario", + "password": "Contraseña", + "invalid": "Usuario o contraseña incorrectos", + "invalidLink": "Link de acceso inválido" + }, + "admin": { + "title": "Panel maestro Collina", + "newRestaurant": "Nuevo restaurante", + "restaurants": "Restaurantes", + "name": "Nombre", + "slug": "Slug", + "create": "Crear restaurante", + "editorLink": "Link de editor", + "publicLink": "Link público", + "credentials": "Credenciales iniciales", + "active": "Activo" + } +} diff --git a/next.config.mjs b/next.config.mjs new file mode 100644 index 0000000..091aace --- /dev/null +++ b/next.config.mjs @@ -0,0 +1,13 @@ +import createNextIntlPlugin from 'next-intl/plugin'; + +const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts'); + +/** @type {import('next').NextConfig} */ +const nextConfig = { + output: 'standalone', + experimental: { + // Body size limit for media uploads handled per-route. + }, +}; + +export default withNextIntl(nextConfig); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..322f0fd --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2752 @@ +{ + "name": "smartmenu-collina", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "smartmenu-collina", + "version": "0.1.0", + "dependencies": { + "@anthropic-ai/sdk": "^0.65.0", + "@prisma/client": "^5.22.0", + "bcryptjs": "^2.4.3", + "clsx": "^2.1.1", + "jose": "^5.9.6", + "next": "14.2.21", + "next-intl": "^3.26.3", + "qrcode": "^1.5.4", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@types/bcryptjs": "^2.4.6", + "@types/node": "^20.17.10", + "@types/qrcode": "^1.5.5", + "@types/react": "^18.3.18", + "@types/react-dom": "^18.3.5", + "autoprefixer": "^10.4.20", + "postcss": "^8.4.49", + "prisma": "^5.22.0", + "tailwindcss": "^3.4.17", + "tsx": "^4.19.2", + "typescript": "^5.7.2" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@anthropic-ai/sdk": { + "version": "0.65.0", + "resolved": "https://registry.npmjs.org/@anthropic-ai/sdk/-/sdk-0.65.0.tgz", + "integrity": "sha512-zIdPOcrCVEI8t3Di40nH4z9EoeyGZfXbYSvWdDLsB/KkaSYMnEgC7gmcgWu83g2NTn1ZTpbMvpdttWDGGIk6zw==", + "license": "MIT", + "dependencies": { + "json-schema-to-ts": "^3.1.1" + }, + "bin": { + "anthropic-ai-sdk": "bin/cli" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + } + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", + "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", + "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", + "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", + "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", + "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", + "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", + "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", + "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", + "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", + "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", + "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", + "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", + "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", + "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", + "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", + "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", + "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", + "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", + "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", + "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", + "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", + "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", + "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", + "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", + "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", + "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@formatjs/ecma402-abstract": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.3.6.tgz", + "integrity": "sha512-HJnTFeRM2kVFVr5gr5kH1XP6K0JcJtE7Lzvtr3FS/so5f1kpsqqqxy5JF+FRaO6H2qmcMfAUIox7AJteieRtVw==", + "license": "MIT", + "dependencies": { + "@formatjs/fast-memoize": "2.2.7", + "@formatjs/intl-localematcher": "0.6.2", + "decimal.js": "^10.4.3", + "tslib": "^2.8.0" + } + }, + "node_modules/@formatjs/ecma402-abstract/node_modules/@formatjs/intl-localematcher": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.6.2.tgz", + "integrity": "sha512-XOMO2Hupl0wdd172Y06h6kLpBz6Dv+J4okPLl4LPtzbr8f66WbIoy4ev98EBuZ6ZK4h5ydTN6XneT4QVpD7cdA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@formatjs/fast-memoize": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.7.tgz", + "integrity": "sha512-Yabmi9nSvyOMrlSeGGWDiH7rf3a7sIwplbvo/dlz9WCIjzIQAfy1RMf4S0X3yG724n5Ghu2GmEl5NJIV6O9sZQ==", + "license": "MIT", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@formatjs/icu-messageformat-parser": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.11.4.tgz", + "integrity": "sha512-7kR78cRrPNB4fjGFZg3Rmj5aah8rQj9KPzuLsmcSn4ipLXQvC04keycTI1F7kJYDwIXtT2+7IDEto842CfZBtw==", + "license": "MIT", + "dependencies": { + "@formatjs/ecma402-abstract": "2.3.6", + "@formatjs/icu-skeleton-parser": "1.8.16", + "tslib": "^2.8.0" + } + }, + "node_modules/@formatjs/icu-skeleton-parser": { + "version": "1.8.16", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.16.tgz", + "integrity": "sha512-H13E9Xl+PxBd8D5/6TVUluSpxGNvFSlN/b3coUp0e0JpuWXXnQDiavIpY3NnvSp4xhEMoXyyBvVfdFX8jglOHQ==", + "license": "MIT", + "dependencies": { + "@formatjs/ecma402-abstract": "2.3.6", + "tslib": "^2.8.0" + } + }, + "node_modules/@formatjs/intl-localematcher": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.10.tgz", + "integrity": "sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q==", + "license": "MIT", + "dependencies": { + "tslib": "2" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@next/env": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.21.tgz", + "integrity": "sha512-lXcwcJd5oR01tggjWJ6SrNNYFGuOOMB9c251wUNkjCpkoXOPkDeF/15c3mnVlBqrW4JJXb2kVxDFhC4GduJt2A==", + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.21.tgz", + "integrity": "sha512-HwEjcKsXtvszXz5q5Z7wCtrHeTTDSTgAbocz45PHMUjU3fBYInfvhR+ZhavDRUYLonm53aHZbB09QtJVJj8T7g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.21.tgz", + "integrity": "sha512-TSAA2ROgNzm4FhKbTbyJOBrsREOMVdDIltZ6aZiKvCi/v0UwFmwigBGeqXDA97TFMpR3LNNpw52CbVelkoQBxA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.21.tgz", + "integrity": "sha512-0Dqjn0pEUz3JG+AImpnMMW/m8hRtl1GQCNbO66V1yp6RswSTiKmnHf3pTX6xMdJYSemf3O4Q9ykiL0jymu0TuA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.21.tgz", + "integrity": "sha512-Ggfw5qnMXldscVntwnjfaQs5GbBbjioV4B4loP+bjqNEb42fzZlAaK+ldL0jm2CTJga9LynBMhekNfV8W4+HBw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.21.tgz", + "integrity": "sha512-uokj0lubN1WoSa5KKdThVPRffGyiWlm/vCc/cMkWOQHw69Qt0X1o3b2PyLLx8ANqlefILZh1EdfLRz9gVpG6tg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.21.tgz", + "integrity": "sha512-iAEBPzWNbciah4+0yI4s7Pce6BIoxTQ0AGCkxn/UBuzJFkYyJt71MadYQkjPqCQCJAFQ26sYh7MOKdU+VQFgPg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.21.tgz", + "integrity": "sha512-plykgB3vL2hB4Z32W3ktsfqyuyGAPxqwiyrAi2Mr8LlEUhNn9VgkiAl5hODSBpzIfWweX3er1f5uNpGDygfQVQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.21.tgz", + "integrity": "sha512-w5bacz4Vxqrh06BjWgua3Yf7EMDb8iMcVhNrNx8KnJXt8t+Uu0Zg4JHLDL/T7DkTCEEfKXO/Er1fcfWxn2xfPA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.21.tgz", + "integrity": "sha512-sT6+llIkzpsexGYZq8cjjthRyRGe5cJVhqh12FmlbxHqna6zsDDK8UNaV7g41T6atFHCJUPeLb3uyAwrBwy0NA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@prisma/client": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.22.0.tgz", + "integrity": "sha512-M0SVXfyHnQREBKxCgyo7sffrKttwE6R8PMq330MIUF0pTwjUhLbW84pFDlf06B27XyCR++VtjugEnIHdr07SVA==", + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": ">=16.13" + }, + "peerDependencies": { + "prisma": "*" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + } + } + }, + "node_modules/@prisma/debug": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz", + "integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/engines": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.22.0.tgz", + "integrity": "sha512-UNjfslWhAt06kVL3CjkuYpHAWSO6L4kDCVPegV6itt7nD1kSJavd3vhgAEhjglLJJKEdJ7oIqDJ+yHk6qO8gPA==", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "5.22.0", + "@prisma/engines-version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", + "@prisma/fetch-engine": "5.22.0", + "@prisma/get-platform": "5.22.0" + } + }, + "node_modules/@prisma/engines-version": { + "version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2.tgz", + "integrity": "sha512-2PTmxFR2yHW/eB3uqWtcgRcgAbG1rwG9ZriSvQw+nnb7c4uCr3RAcGMb6/zfE88SKlC1Nj2ziUvc96Z379mHgQ==", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/fetch-engine": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.22.0.tgz", + "integrity": "sha512-bkrD/Mc2fSvkQBV5EpoFcZ87AvOgDxbG99488a5cexp5Ccny+UM6MAe/UFkUC0wLYD9+9befNOqGiIJhhq+HbA==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "5.22.0", + "@prisma/engines-version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", + "@prisma/get-platform": "5.22.0" + } + }, + "node_modules/@prisma/get-platform": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.22.0.tgz", + "integrity": "sha512-pHhpQdr1UPFpt+zFfnPazhulaZYCUqeIcPpJViYoq9R+D/yw4fjE+CtnsnKzPYm0ddUbeXUzjGVGIRVgPDCk4Q==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "5.22.0" + } + }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "license": "Apache-2.0" + }, + "node_modules/@swc/helpers": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", + "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", + "license": "Apache-2.0", + "dependencies": { + "@swc/counter": "^0.1.3", + "tslib": "^2.4.0" + } + }, + "node_modules/@types/bcryptjs": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.6.tgz", + "integrity": "sha512-9xlo6R2qDs5uixm0bcIqCeMCE6HiQsIyel9KQySStiyqNl2tnj2mP3DX1Nf56MD6KMenNNlBBsy3LJ7gUEQPXQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/qrcode": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.6.tgz", + "integrity": "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/react": { + "version": "18.3.31", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.31.tgz", + "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "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==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true, + "license": "MIT" + }, + "node_modules/autoprefixer": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.5.0.tgz", + "integrity": "sha512-FMhOoZV4+qR6aTUALKX2rEqGG+oyATvwBt9IIzVR5rMa2HRWPkxf+P+PAJLD1I/H5/II+HuZcBJYEFBpq39ong==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.28.2", + "caniuse-lite": "^1.0.30001787", + "fraction.js": "^5.3.4", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.37", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.37.tgz", + "integrity": "sha512-girxaJ7WZssDOFhzCGZTDKoTa1gk6A1TbflaYTpykLJ4UU9Fz9kx1aREM8JCuoVHbL8X8T/mJg7w2oYSq72Oig==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==", + "license": "MIT" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", + "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", + "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.10.12", + "caniuse-lite": "^1.0.30001782", + "electron-to-chromium": "^1.5.328", + "node-releases": "^2.0.36", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001799", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001799.tgz", + "integrity": "sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==", + "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/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "license": "MIT" + }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "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==", + "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==", + "license": "MIT" + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "license": "MIT" + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==", + "license": "MIT" + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.372", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.372.tgz", + "integrity": "sha512-M3yhbAlilnwqC8D21t28UCDGHyitShTmmLRU/H+b74P6Ski16Nb9HONYEaVpMj/pwC7BEo5B95FpjODLCWbtfA==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", + "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.1", + "@esbuild/android-arm": "0.28.1", + "@esbuild/android-arm64": "0.28.1", + "@esbuild/android-x64": "0.28.1", + "@esbuild/darwin-arm64": "0.28.1", + "@esbuild/darwin-x64": "0.28.1", + "@esbuild/freebsd-arm64": "0.28.1", + "@esbuild/freebsd-x64": "0.28.1", + "@esbuild/linux-arm": "0.28.1", + "@esbuild/linux-arm64": "0.28.1", + "@esbuild/linux-ia32": "0.28.1", + "@esbuild/linux-loong64": "0.28.1", + "@esbuild/linux-mips64el": "0.28.1", + "@esbuild/linux-ppc64": "0.28.1", + "@esbuild/linux-riscv64": "0.28.1", + "@esbuild/linux-s390x": "0.28.1", + "@esbuild/linux-x64": "0.28.1", + "@esbuild/netbsd-arm64": "0.28.1", + "@esbuild/netbsd-x64": "0.28.1", + "@esbuild/openbsd-arm64": "0.28.1", + "@esbuild/openbsd-x64": "0.28.1", + "@esbuild/openharmony-arm64": "0.28.1", + "@esbuild/sunos-x64": "0.28.1", + "@esbuild/win32-arm64": "0.28.1", + "@esbuild/win32-ia32": "0.28.1", + "@esbuild/win32-x64": "0.28.1" + } + }, + "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/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "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/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/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/intl-messageformat": { + "version": "10.7.18", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.7.18.tgz", + "integrity": "sha512-m3Ofv/X/tV8Y3tHXLohcuVuhWKo7BBq62cqY15etqmLxg2DZ34AGGgQDeR+SCta2+zICb1NX83af0GJmbQ1++g==", + "license": "BSD-3-Clause", + "dependencies": { + "@formatjs/ecma402-abstract": "2.3.6", + "@formatjs/fast-memoize": "2.2.7", + "@formatjs/icu-messageformat-parser": "2.11.4", + "tslib": "^2.8.0" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "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/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/jose": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.10.0.tgz", + "integrity": "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "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/json-schema-to-ts": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/json-schema-to-ts/-/json-schema-to-ts-3.1.1.tgz", + "integrity": "sha512-+DWg8jCJG2TEnpy7kOm/7/AxaYoaRbjVB4LFZLySZlWn8exGs3A4OLJR966cVvU26N7X9TWxl+Jsw7dzAqKT6g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "ts-algebra": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "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/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "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/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/next": { + "version": "14.2.21", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.21.tgz", + "integrity": "sha512-rZmLwucLHr3/zfDMYbJXbw0ZeoBpirxkXuvsJbk7UPorvPYZhP7vq7aHbKnU7dQNCYIimRrbB2pp3xmf+wsYUg==", + "deprecated": "This version has a security vulnerability. Please upgrade to a patched version. See https://nextjs.org/blog/security-update-2025-12-11 for more details.", + "license": "MIT", + "dependencies": { + "@next/env": "14.2.21", + "@swc/helpers": "0.5.5", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=18.17.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "14.2.21", + "@next/swc-darwin-x64": "14.2.21", + "@next/swc-linux-arm64-gnu": "14.2.21", + "@next/swc-linux-arm64-musl": "14.2.21", + "@next/swc-linux-x64-gnu": "14.2.21", + "@next/swc-linux-x64-musl": "14.2.21", + "@next/swc-win32-arm64-msvc": "14.2.21", + "@next/swc-win32-ia32-msvc": "14.2.21", + "@next/swc-win32-x64-msvc": "14.2.21" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/next-intl": { + "version": "3.26.5", + "resolved": "https://registry.npmjs.org/next-intl/-/next-intl-3.26.5.tgz", + "integrity": "sha512-EQlCIfY0jOhRldiFxwSXG+ImwkQtDEfQeSOEQp6ieAGSLWGlgjdb/Ck/O7wMfC430ZHGeUKVKax8KGusTPKCgg==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/amannn" + } + ], + "license": "MIT", + "dependencies": { + "@formatjs/intl-localematcher": "^0.5.4", + "negotiator": "^1.0.0", + "use-intl": "^3.26.5" + }, + "peerDependencies": { + "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0" + } + }, + "node_modules/next/node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "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.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/node-releases": { + "version": "2.0.47", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.47.tgz", + "integrity": "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "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==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "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": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/postcss": { + "version": "8.5.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", + "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz", + "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.4.tgz", + "integrity": "sha512-bIoJLOmjCO1S9XdY/DcnR5hJxvrDir1PbGChrzXG3vw0/FOliy/fA3dmdhQ441kah4gKv+TwckGzex6wNS5cnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/prisma": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.22.0.tgz", + "integrity": "sha512-vtpjW3XuYCSnMsNVBjLMNkTj6OZbudcPPTPYHqX0CJfpcdWciI1dM8uHETwmDxxiqEwCIE6WvXucWUetJgfu/A==", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/engines": "5.22.0" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=16.13" + }, + "optionalDependencies": { + "fsevents": "2.3.3" + } + }, + "node_modules/qrcode": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz", + "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", + "license": "MIT", + "dependencies": { + "dijkstrajs": "^1.0.1", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "license": "ISC" + }, + "node_modules/resolve": { + "version": "1.22.12", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", + "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "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/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/styled-jsx": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", + "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.19", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz", + "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.6.0", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.7", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-algebra": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-algebra/-/ts-algebra-2.0.0.tgz", + "integrity": "sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw==", + "license": "MIT" + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, + "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/tsx": { + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.22.4.tgz", + "integrity": "sha512-X8EX+XV4QR5xCsrgxaED954zTDfY8KqlDtskKEL0cHhyS/P8b4IFOvGDQpsC9Q1XnLq915wEfwwY/zzskCtmhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "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/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "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/use-intl": { + "version": "3.26.5", + "resolved": "https://registry.npmjs.org/use-intl/-/use-intl-3.26.5.tgz", + "integrity": "sha512-OdsJnC/znPvHCHLQH/duvQNXnP1w0hPfS+tkSi3mAbfjYBGh4JnyfdwkQBfIVf7t8gs9eSX/CntxUMvtKdG2MQ==", + "license": "MIT", + "dependencies": { + "@formatjs/fast-memoize": "^2.2.0", + "intl-messageformat": "^10.5.14" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..aa4053c --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "smartmenu-collina", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "prisma generate && next build", + "start": "next start", + "lint": "next lint", + "prisma:generate": "prisma generate", + "prisma:migrate": "prisma migrate dev", + "prisma:deploy": "prisma migrate deploy", + "db:seed": "tsx prisma/seed.ts" + }, + "prisma": { + "seed": "tsx prisma/seed.ts" + }, + "dependencies": { + "@anthropic-ai/sdk": "^0.65.0", + "@prisma/client": "^5.22.0", + "bcryptjs": "^2.4.3", + "clsx": "^2.1.1", + "jose": "^5.9.6", + "next": "14.2.21", + "next-intl": "^3.26.3", + "qrcode": "^1.5.4", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@types/bcryptjs": "^2.4.6", + "@types/node": "^20.17.10", + "@types/qrcode": "^1.5.5", + "@types/react": "^18.3.18", + "@types/react-dom": "^18.3.5", + "autoprefixer": "^10.4.20", + "postcss": "^8.4.49", + "prisma": "^5.22.0", + "tailwindcss": "^3.4.17", + "tsx": "^4.19.2", + "typescript": "^5.7.2" + } +} diff --git a/postcss.config.mjs b/postcss.config.mjs new file mode 100644 index 0000000..a982c64 --- /dev/null +++ b/postcss.config.mjs @@ -0,0 +1,8 @@ +const config = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; + +export default config; diff --git a/prisma/migrations/0001_init/migration.sql b/prisma/migrations/0001_init/migration.sql new file mode 100644 index 0000000..e67f22c --- /dev/null +++ b/prisma/migrations/0001_init/migration.sql @@ -0,0 +1,113 @@ +-- CreateTable +CREATE TABLE "Restaurant" ( + "id" TEXT NOT NULL, + "slug" TEXT NOT NULL, + "name" TEXT NOT NULL, + "editorSecret" TEXT NOT NULL, + "username" TEXT NOT NULL, + "hashedPassword" TEXT NOT NULL, + "palette" JSONB NOT NULL DEFAULT '{}', + "ordersEnabled" BOOLEAN NOT NULL DEFAULT false, + "defaultLocale" TEXT NOT NULL DEFAULT 'es', + "active" BOOLEAN NOT NULL DEFAULT true, + "publishedVersionId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Restaurant_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "MenuVersion" ( + "id" TEXT NOT NULL, + "restaurantId" TEXT NOT NULL, + "versionName" TEXT NOT NULL, + "snapshot" JSONB NOT NULL, + "publishedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "createdBy" TEXT, + + CONSTRAINT "MenuVersion_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Section" ( + "id" TEXT NOT NULL, + "restaurantId" TEXT NOT NULL, + "name" JSONB NOT NULL, + "order" INTEGER NOT NULL DEFAULT 0, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Section_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Product" ( + "id" TEXT NOT NULL, + "sectionId" TEXT NOT NULL, + "restaurantId" TEXT NOT NULL, + "name" JSONB NOT NULL, + "description" JSONB NOT NULL DEFAULT '{}', + "price" DECIMAL(10,2) NOT NULL DEFAULT 0, + "order" INTEGER NOT NULL DEFAULT 0, + "isActive" BOOLEAN NOT NULL DEFAULT true, + "allergens" TEXT[] DEFAULT ARRAY[]::TEXT[], + "dietTags" TEXT[] DEFAULT ARRAY[]::TEXT[], + "macros" JSONB NOT NULL DEFAULT '{}', + "media" JSONB NOT NULL DEFAULT '[]', + "translationStatus" JSONB NOT NULL DEFAULT '{}', + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Product_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Order" ( + "id" TEXT NOT NULL, + "restaurantId" TEXT NOT NULL, + "tableNumber" INTEGER NOT NULL, + "items" JSONB NOT NULL, + "status" TEXT NOT NULL DEFAULT 'active', + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "completedAt" TIMESTAMP(3), + + CONSTRAINT "Order_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Restaurant_slug_key" ON "Restaurant"("slug"); + +-- CreateIndex +CREATE UNIQUE INDEX "Restaurant_publishedVersionId_key" ON "Restaurant"("publishedVersionId"); + +-- CreateIndex +CREATE INDEX "MenuVersion_restaurantId_idx" ON "MenuVersion"("restaurantId"); + +-- CreateIndex +CREATE INDEX "Section_restaurantId_idx" ON "Section"("restaurantId"); + +-- CreateIndex +CREATE INDEX "Product_restaurantId_idx" ON "Product"("restaurantId"); + +-- CreateIndex +CREATE INDEX "Product_sectionId_idx" ON "Product"("sectionId"); + +-- CreateIndex +CREATE INDEX "Order_restaurantId_status_idx" ON "Order"("restaurantId", "status"); + +-- AddForeignKey +ALTER TABLE "Restaurant" ADD CONSTRAINT "Restaurant_publishedVersionId_fkey" FOREIGN KEY ("publishedVersionId") REFERENCES "MenuVersion"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "MenuVersion" ADD CONSTRAINT "MenuVersion_restaurantId_fkey" FOREIGN KEY ("restaurantId") REFERENCES "Restaurant"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Section" ADD CONSTRAINT "Section_restaurantId_fkey" FOREIGN KEY ("restaurantId") REFERENCES "Restaurant"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Product" ADD CONSTRAINT "Product_sectionId_fkey" FOREIGN KEY ("sectionId") REFERENCES "Section"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Product" ADD CONSTRAINT "Product_restaurantId_fkey" FOREIGN KEY ("restaurantId") REFERENCES "Restaurant"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Order" ADD CONSTRAINT "Order_restaurantId_fkey" FOREIGN KEY ("restaurantId") REFERENCES "Restaurant"("id") ON DELETE CASCADE ON UPDATE CASCADE; + diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml new file mode 100644 index 0000000..99e4f20 --- /dev/null +++ b/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (i.e. Git) +provider = "postgresql" diff --git a/prisma/schema.prisma b/prisma/schema.prisma new file mode 100644 index 0000000..311231e --- /dev/null +++ b/prisma/schema.prisma @@ -0,0 +1,96 @@ +generator client { + provider = "prisma-client-js" +} + +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +model Restaurant { + id String @id @default(cuid()) + slug String @unique + name String + editorSecret String + username String + hashedPassword String + palette Json @default("{}") + ordersEnabled Boolean @default(false) + defaultLocale String @default("es") + active Boolean @default(true) + publishedVersionId String? @unique + createdAt DateTime @default(now()) + + publishedVersion MenuVersion? @relation("PublishedVersion", fields: [publishedVersionId], references: [id]) + versions MenuVersion[] @relation("RestaurantVersions") + sections Section[] + products Product[] + orders Order[] +} + +// Versioning system: a published snapshot of the whole menu. +model MenuVersion { + id String @id @default(cuid()) + restaurantId String + versionName String + snapshot Json + publishedAt DateTime @default(now()) + createdBy String? + + restaurant Restaurant @relation("RestaurantVersions", fields: [restaurantId], references: [id], onDelete: Cascade) + publishedFor Restaurant? @relation("PublishedVersion") + + @@index([restaurantId]) +} + +// Working DRAFT (not what the public sees). +model Section { + id String @id @default(cuid()) + restaurantId String + name Json // { es, en } + order Int @default(0) + createdAt DateTime @default(now()) + + restaurant Restaurant @relation(fields: [restaurantId], references: [id], onDelete: Cascade) + products Product[] + + @@index([restaurantId]) +} + +// Working DRAFT product. +model Product { + id String @id @default(cuid()) + sectionId String + restaurantId String + name Json // { es, en } + description Json @default("{}") // { es, en } + price Decimal @default(0) @db.Decimal(10, 2) + order Int @default(0) + isActive Boolean @default(true) + allergens String[] @default([]) + dietTags String[] @default([]) + macros Json @default("{}") // { protein, carbs, sugar, fat, fiber, kcal } + media Json @default("[]") // [{ type, path, order }] + translationStatus Json @default("{}") // { en: auto|reviewed } + createdAt DateTime @default(now()) + + section Section @relation(fields: [sectionId], references: [id], onDelete: Cascade) + restaurant Restaurant @relation(fields: [restaurantId], references: [id], onDelete: Cascade) + + @@index([restaurantId]) + @@index([sectionId]) +} + +model Order { + id String @id @default(cuid()) + restaurantId String + tableNumber Int + items Json // [{ productId, name, qty }] + status String @default("active") // active | completed + createdAt DateTime @default(now()) + completedAt DateTime? + + restaurant Restaurant @relation(fields: [restaurantId], references: [id], onDelete: Cascade) + + @@index([restaurantId, status]) +} diff --git a/prisma/seed.ts b/prisma/seed.ts new file mode 100644 index 0000000..6a1a66c --- /dev/null +++ b/prisma/seed.ts @@ -0,0 +1,91 @@ +import { PrismaClient } from '@prisma/client'; +import bcrypt from 'bcryptjs'; +import crypto from 'crypto'; + +const prisma = new PrismaClient(); + +// Seeds a demo restaurant so the app is browsable right after setup. +async function main() { + const slug = 'demo'; + const existing = await prisma.restaurant.findUnique({ where: { slug } }); + if (existing) { + console.log('Demo restaurant already exists:', `/${slug}`); + return; + } + + const editorSecret = crypto.randomBytes(32).toString('base64url'); + const hashedPassword = await bcrypt.hash('demo1234', 10); + + const restaurant = await prisma.restaurant.create({ + data: { + slug, + name: 'La Collina', + editorSecret, + username: 'admin', + hashedPassword, + defaultLocale: 'es', + ordersEnabled: true, + palette: { + background: '#f4f1ec', + surface: 'rgba(255,255,255,0.55)', + accent: '#b45309', + text: '#2a2520', + tab: 'rgba(255,255,255,0.45)', + }, + }, + }); + + const starters = await prisma.section.create({ + data: { restaurantId: restaurant.id, name: { es: 'Entradas', en: 'Starters' }, order: 0 }, + }); + const mains = await prisma.section.create({ + data: { restaurantId: restaurant.id, name: { es: 'Platos fuertes', en: 'Main dishes' }, order: 1 }, + }); + + await prisma.product.create({ + data: { + sectionId: starters.id, + restaurantId: restaurant.id, + name: { es: 'Ensalada de la casa', en: 'House salad' }, + description: { + es: 'Verdes frescos, aderezo de la casa y nueces tostadas.', + en: 'Fresh greens, house dressing and toasted walnuts.', + }, + price: 120, + order: 0, + dietTags: ['vegetariano'], + allergens: ['frutos secos'], + macros: { protein: 6, carbs: 12, sugar: 4, fat: 9, fiber: 5, kcal: 180 }, + translationStatus: { en: 'reviewed' }, + }, + }); + + await prisma.product.create({ + data: { + sectionId: mains.id, + restaurantId: restaurant.id, + name: { es: 'Salmón a la parrilla', en: 'Grilled salmon' }, + description: { + es: 'Salmón con vegetales de temporada y puré de papa.', + en: 'Salmon with seasonal vegetables and mashed potato.', + }, + price: 320, + order: 0, + allergens: ['pescado'], + macros: { protein: 38, carbs: 22, sugar: 3, fat: 18, fiber: 4, kcal: 420 }, + translationStatus: { en: 'reviewed' }, + }, + }); + + console.log('Seeded demo restaurant.'); + console.log('Public:', `/${slug}`); + console.log('Editor:', `/${slug}/editor?k=${editorSecret}`); + console.log('Login: admin / demo1234'); +} + +main() + .catch((e) => { + console.error(e); + process.exit(1); + }) + .finally(() => prisma.$disconnect()); diff --git a/src/app/[slug]/editor/login/page.tsx b/src/app/[slug]/editor/login/page.tsx new file mode 100644 index 0000000..186cdd8 --- /dev/null +++ b/src/app/[slug]/editor/login/page.tsx @@ -0,0 +1,27 @@ +import { notFound } from 'next/navigation'; +import { prisma } from '@/lib/prisma'; +import EditorLogin from '@/components/editor/EditorLogin'; + +export const dynamic = 'force-dynamic'; + +export default async function EditorLoginPage({ + params, + searchParams, +}: { + params: { slug: string }; + searchParams: { k?: string }; +}) { + const restaurant = await prisma.restaurant.findUnique({ + where: { slug: params.slug }, + select: { name: true, active: true }, + }); + if (!restaurant || !restaurant.active) notFound(); + + return ( + + ); +} diff --git a/src/app/[slug]/editor/page.tsx b/src/app/[slug]/editor/page.tsx new file mode 100644 index 0000000..c5a6632 --- /dev/null +++ b/src/app/[slug]/editor/page.tsx @@ -0,0 +1,70 @@ +import { redirect, notFound } from 'next/navigation'; +import { prisma } from '@/lib/prisma'; +import { getEditorSession } from '@/lib/auth'; +import { paletteToCssVars } from '@/lib/palette'; +import type { EditorData } from '@/components/editor/types'; +import type { Palette } from '@/lib/types'; +import Editor from '@/components/editor/Editor'; + +export const dynamic = 'force-dynamic'; + +export default async function EditorPage({ + params, + searchParams, +}: { + params: { slug: string }; + searchParams: { k?: string }; +}) { + const restaurant = await prisma.restaurant.findUnique({ + where: { slug: params.slug }, + include: { + publishedVersion: { select: { versionName: true } }, + sections: { + orderBy: { order: 'asc' }, + include: { products: { orderBy: { order: 'asc' } } }, + }, + }, + }); + if (!restaurant || !restaurant.active) notFound(); + + const session = await getEditorSession(params.slug); + if (!session) { + const k = searchParams.k ? `?k=${encodeURIComponent(searchParams.k)}` : ''; + redirect(`/${params.slug}/editor/login${k}`); + } + + const data: EditorData = { + slug: restaurant.slug, + name: restaurant.name, + ordersEnabled: restaurant.ordersEnabled, + defaultLocale: restaurant.defaultLocale as 'es' | 'en', + palette: (restaurant.palette as Palette) ?? {}, + publishedVersionName: restaurant.publishedVersion?.versionName ?? null, + sections: restaurant.sections.map((s) => ({ + id: s.id, + name: s.name as { es?: string; en?: string }, + order: s.order, + products: s.products.map((p) => ({ + id: p.id, + sectionId: p.sectionId, + name: p.name as { es?: string; en?: string }, + description: p.description as { es?: string; en?: string }, + price: Number(p.price), + order: p.order, + isActive: p.isActive, + allergens: p.allergens, + dietTags: p.dietTags, + macros: p.macros as Record, + media: p.media as { type: 'image' | 'video'; path: string; order: number }[], + translationStatus: p.translationStatus as { en?: 'auto' | 'reviewed' }, + })), + })), + }; + + return ( +
+ + +
+ ); +} diff --git a/src/app/[slug]/page.tsx b/src/app/[slug]/page.tsx new file mode 100644 index 0000000..5081bee --- /dev/null +++ b/src/app/[slug]/page.tsx @@ -0,0 +1,41 @@ +import { notFound } from 'next/navigation'; +import { prisma } from '@/lib/prisma'; +import { paletteToCssVars } from '@/lib/palette'; +import type { MenuSnapshot } from '@/lib/types'; +import PublicMenu from '@/components/public/PublicMenu'; + +export const dynamic = 'force-dynamic'; + +async function getPublishedMenu(slug: string): Promise { + const restaurant = await prisma.restaurant.findUnique({ + where: { slug }, + include: { publishedVersion: true }, + }); + if (!restaurant || !restaurant.active) return null; + if (!restaurant.publishedVersion) { + // No version published yet — show an empty shell using live restaurant data. + return { + restaurant: { + name: restaurant.name, + slug: restaurant.slug, + palette: (restaurant.palette as MenuSnapshot['restaurant']['palette']) ?? {}, + ordersEnabled: restaurant.ordersEnabled, + defaultLocale: restaurant.defaultLocale as 'es' | 'en', + }, + sections: [], + }; + } + return restaurant.publishedVersion.snapshot as unknown as MenuSnapshot; +} + +export default async function PublicMenuPage({ params }: { params: { slug: string } }) { + const menu = await getPublishedMenu(params.slug); + if (!menu) notFound(); + + return ( +
+ + +
+ ); +} diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx new file mode 100644 index 0000000..8b764ff --- /dev/null +++ b/src/app/admin/page.tsx @@ -0,0 +1,27 @@ +import { isAdminAuthed } from '@/lib/auth'; +import { prisma } from '@/lib/prisma'; +import AdminLogin from '@/components/admin/AdminLogin'; +import AdminPanel from '@/components/admin/AdminPanel'; + +export const dynamic = 'force-dynamic'; + +export default async function AdminPage() { + const authed = await isAdminAuthed(); + if (!authed) return ; + + const restaurants = await prisma.restaurant.findMany({ + orderBy: { createdAt: 'desc' }, + select: { + id: true, + slug: true, + name: true, + editorSecret: true, + username: true, + active: true, + createdAt: true, + }, + }); + + const baseUrl = process.env.APP_BASE_URL || ''; + return ({ ...r, createdAt: r.createdAt.toISOString() }))} baseUrl={baseUrl} />; +} diff --git a/src/app/api/[slug]/ai-consult/route.ts b/src/app/api/[slug]/ai-consult/route.ts new file mode 100644 index 0000000..58cff7c --- /dev/null +++ b/src/app/api/[slug]/ai-consult/route.ts @@ -0,0 +1,94 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { getAnthropic, HAIKU_MODEL } from '@/lib/anthropic'; +import { pickText } from '@/lib/text'; +import type { Locale } from '@/i18n/config'; +import type { MenuSnapshot } from '@/lib/types'; + +export const dynamic = 'force-dynamic'; + +// Build a compact text context of the published menu for the model. +function buildMenuContext(menu: MenuSnapshot, locale: Locale): string { + const lines: string[] = []; + for (const section of menu.sections) { + lines.push(`## ${pickText(section.name, locale)}`); + for (const p of section.products) { + if (!p.isActive) continue; + const macros = Object.entries(p.macros) + .filter(([, v]) => v != null) + .map(([k, v]) => `${k}:${v}`) + .join(', '); + lines.push( + `- ${pickText(p.name, locale)} ($${p.price.toFixed(2)}): ${pickText(p.description, locale)}` + + (p.dietTags.length ? ` | dieta: ${p.dietTags.join(', ')}` : '') + + (p.allergens.length ? ` | alérgenos: ${p.allergens.join(', ')}` : '') + + (macros ? ` | macros: ${macros}` : ''), + ); + } + } + return lines.join('\n'); +} + +export async function POST(req: Request, { params }: { params: { slug: string } }) { + const body = await req.json().catch(() => null); + const question = String(body?.question ?? '').trim(); + const locale: Locale = body?.locale === 'en' ? 'en' : 'es'; + if (!question) return NextResponse.json({ error: 'invalid' }, { status: 400 }); + + const restaurant = await prisma.restaurant.findUnique({ + where: { slug: params.slug }, + include: { publishedVersion: true }, + }); + if (!restaurant?.publishedVersion) { + return NextResponse.json({ error: 'not_published' }, { status: 404 }); + } + + const menu = restaurant.publishedVersion.snapshot as unknown as MenuSnapshot; + const context = buildMenuContext(menu, locale); + + const system = + locale === 'en' + ? `You are a friendly menu consultant for the restaurant "${menu.restaurant.name}". ` + + `Recommend ONLY dishes that appear in the menu below. Always answer in English. ` + + `Give exactly 3 recommendations, each citing the real dish name and a short reason it fits. ` + + `Reply ONLY with JSON: {"intro": string, "recommendations": [{"dish": string, "reason": string}]}.` + : `Eres un consultor amable del menú del restaurante "${menu.restaurant.name}". ` + + `Recomienda SOLO platillos que aparezcan en el menú de abajo. Responde siempre en español. ` + + `Da exactamente 3 recomendaciones, cada una citando el nombre real del platillo y una razón breve. ` + + `Responde SOLO con JSON: {"intro": string, "recommendations": [{"dish": string, "reason": string}]}.`; + + try { + const client = getAnthropic(); + const msg = await client.messages.create({ + model: HAIKU_MODEL, + max_tokens: 700, + system, + messages: [ + { + role: 'user', + content: `MENÚ:\n${context}\n\nPREGUNTA: ${question}`, + }, + ], + }); + + const text = msg.content.find((c) => c.type === 'text')?.text ?? '{}'; + const json = JSON.parse(extractJson(text)); + return NextResponse.json({ + intro: typeof json.intro === 'string' ? json.intro : undefined, + recommendations: Array.isArray(json.recommendations) ? json.recommendations.slice(0, 3) : [], + }); + } catch (err) { + console.error('ai-consult error', err); + return NextResponse.json({ error: 'ai_failed' }, { status: 502 }); + } +} + +// Tolerate models that wrap JSON in prose or code fences. +function extractJson(text: string): string { + const fenced = text.match(/```(?:json)?\s*([\s\S]*?)```/); + if (fenced) return fenced[1]; + const start = text.indexOf('{'); + const end = text.lastIndexOf('}'); + if (start !== -1 && end !== -1) return text.slice(start, end + 1); + return text; +} diff --git a/src/app/api/[slug]/auth/login/route.ts b/src/app/api/[slug]/auth/login/route.ts new file mode 100644 index 0000000..94b0c03 --- /dev/null +++ b/src/app/api/[slug]/auth/login/route.ts @@ -0,0 +1,36 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { editorCookieName, signEditorToken, verifyPassword } from '@/lib/auth'; + +export async function POST(req: Request, { params }: { params: { slug: string } }) { + const body = await req.json().catch(() => null); + const username = String(body?.username ?? ''); + const password = String(body?.password ?? ''); + const secret = String(body?.secret ?? ''); + + const restaurant = await prisma.restaurant.findUnique({ where: { slug: params.slug } }); + if (!restaurant || !restaurant.active) { + return NextResponse.json({ error: 'not_found' }, { status: 404 }); + } + + // Both layers: secret link AND credentials. + if (secret !== restaurant.editorSecret) { + return NextResponse.json({ error: 'invalid_link' }, { status: 403 }); + } + const ok = + username === restaurant.username && (await verifyPassword(password, restaurant.hashedPassword)); + if (!ok) { + return NextResponse.json({ error: 'invalid' }, { status: 401 }); + } + + const token = await signEditorToken({ slug: restaurant.slug, restaurantId: restaurant.id }); + const res = NextResponse.json({ ok: true }); + res.cookies.set(editorCookieName(restaurant.slug), token, { + httpOnly: true, + sameSite: 'lax', + secure: process.env.NODE_ENV === 'production', + path: '/', + maxAge: 60 * 60 * 24 * 7, + }); + return res; +} diff --git a/src/app/api/[slug]/auth/logout/route.ts b/src/app/api/[slug]/auth/logout/route.ts new file mode 100644 index 0000000..d32a8c3 --- /dev/null +++ b/src/app/api/[slug]/auth/logout/route.ts @@ -0,0 +1,8 @@ +import { NextResponse } from 'next/server'; +import { editorCookieName } from '@/lib/auth'; + +export async function POST(_req: Request, { params }: { params: { slug: string } }) { + const res = NextResponse.json({ ok: true }); + res.cookies.set(editorCookieName(params.slug), '', { path: '/', maxAge: 0 }); + return res; +} diff --git a/src/app/api/[slug]/call-waiter/route.ts b/src/app/api/[slug]/call-waiter/route.ts new file mode 100644 index 0000000..4bd6c63 --- /dev/null +++ b/src/app/api/[slug]/call-waiter/route.ts @@ -0,0 +1,18 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { publish } from '@/lib/orders-bus'; + +export async function POST(req: Request, { params }: { params: { slug: string } }) { + const restaurant = await prisma.restaurant.findUnique({ where: { slug: params.slug } }); + if (!restaurant || !restaurant.active) { + return NextResponse.json({ error: 'not_found' }, { status: 404 }); + } + + const body = await req.json().catch(() => null); + const tableNumber = Number(body?.tableNumber); + if (!tableNumber) return NextResponse.json({ error: 'invalid' }, { status: 400 }); + + // Broadcast to the editor's orders stream as an ephemeral waiter call. + publish(params.slug, { type: 'waiter', data: { tableNumber, at: new Date().toISOString() } }); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/[slug]/menu/route.ts b/src/app/api/[slug]/menu/route.ts new file mode 100644 index 0000000..3d7d57a --- /dev/null +++ b/src/app/api/[slug]/menu/route.ts @@ -0,0 +1,20 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import type { MenuSnapshot } from '@/lib/types'; + +export const dynamic = 'force-dynamic'; + +// Public menu: serves the PUBLISHED version snapshot, never the draft. +export async function GET(_req: Request, { params }: { params: { slug: string } }) { + const restaurant = await prisma.restaurant.findUnique({ + where: { slug: params.slug }, + include: { publishedVersion: true }, + }); + if (!restaurant || !restaurant.active) { + return NextResponse.json({ error: 'not_found' }, { status: 404 }); + } + if (!restaurant.publishedVersion) { + return NextResponse.json({ error: 'not_published' }, { status: 404 }); + } + return NextResponse.json(restaurant.publishedVersion.snapshot as unknown as MenuSnapshot); +} diff --git a/src/app/api/[slug]/order/route.ts b/src/app/api/[slug]/order/route.ts new file mode 100644 index 0000000..659cadc --- /dev/null +++ b/src/app/api/[slug]/order/route.ts @@ -0,0 +1,33 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { publish } from '@/lib/orders-bus'; +import type { OrderItem } from '@/lib/types'; + +export async function POST(req: Request, { params }: { params: { slug: string } }) { + const restaurant = await prisma.restaurant.findUnique({ where: { slug: params.slug } }); + if (!restaurant || !restaurant.active) { + return NextResponse.json({ error: 'not_found' }, { status: 404 }); + } + if (!restaurant.ordersEnabled) { + return NextResponse.json({ error: 'orders_disabled' }, { status: 403 }); + } + + const body = await req.json().catch(() => null); + const tableNumber = Number(body?.tableNumber); + const items: OrderItem[] = Array.isArray(body?.items) ? body.items : []; + if (!tableNumber || items.length === 0) { + return NextResponse.json({ error: 'invalid' }, { status: 400 }); + } + + const order = await prisma.order.create({ + data: { + restaurantId: restaurant.id, + tableNumber, + items: items as unknown as object, + status: 'active', + }, + }); + + publish(params.slug, { type: 'order', data: order }); + return NextResponse.json({ ok: true, id: order.id }); +} diff --git a/src/app/api/[slug]/orders/[id]/route.ts b/src/app/api/[slug]/orders/[id]/route.ts new file mode 100644 index 0000000..bc48628 --- /dev/null +++ b/src/app/api/[slug]/orders/[id]/route.ts @@ -0,0 +1,39 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { requireEditor } from '@/lib/guard'; +import { publish } from '@/lib/orders-bus'; + +// Complete (or otherwise update) an order. +export async function PATCH( + req: Request, + { params }: { params: { slug: string; id: string } }, +) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => ({})); + const status = body?.status === 'completed' ? 'completed' : 'active'; + + const result = await prisma.order.updateMany({ + where: { id: params.id, restaurantId: guard.restaurant.id }, + data: { status, completedAt: status === 'completed' ? new Date() : null }, + }); + if (result.count === 0) return NextResponse.json({ error: 'not_found' }, { status: 404 }); + + publish(params.slug, { type: 'order-update', data: { id: params.id, status } }); + return NextResponse.json({ ok: true }); +} + +export async function DELETE( + _req: Request, + { params }: { params: { slug: string; id: string } }, +) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + await prisma.order.deleteMany({ + where: { id: params.id, restaurantId: guard.restaurant.id }, + }); + publish(params.slug, { type: 'order-update', data: { id: params.id, status: 'deleted' } }); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/[slug]/orders/stream/route.ts b/src/app/api/[slug]/orders/stream/route.ts new file mode 100644 index 0000000..86cba7c --- /dev/null +++ b/src/app/api/[slug]/orders/stream/route.ts @@ -0,0 +1,59 @@ +import { prisma } from '@/lib/prisma'; +import { subscribe } from '@/lib/orders-bus'; +import { getEditorSession } from '@/lib/auth'; + +export const dynamic = 'force-dynamic'; + +// SSE stream of orders + waiter calls for the editor dashboard. +export async function GET(_req: Request, { params }: { params: { slug: string } }) { + const session = await getEditorSession(params.slug); + if (!session) return new Response('unauthorized', { status: 401 }); + + const restaurant = await prisma.restaurant.findUnique({ where: { slug: params.slug } }); + if (!restaurant) return new Response('not_found', { status: 404 }); + + const encoder = new TextEncoder(); + let heartbeat: ReturnType; + + const stream = new ReadableStream({ + async start(controller) { + const send = (event: { type: string; data: unknown }) => { + controller.enqueue( + encoder.encode(`event: ${event.type}\ndata: ${JSON.stringify(event.data)}\n\n`), + ); + }; + + // Replay current active orders on connect. + const active = await prisma.order.findMany({ + where: { restaurantId: restaurant.id, status: 'active' }, + orderBy: { createdAt: 'asc' }, + }); + send({ type: 'snapshot', data: active }); + + const unsubscribe = subscribe(params.slug, send); + + heartbeat = setInterval(() => { + controller.enqueue(encoder.encode(`: ping\n\n`)); + }, 25000); + + // Clean up when the client disconnects. + _req.signal.addEventListener('abort', () => { + clearInterval(heartbeat); + unsubscribe(); + try { + controller.close(); + } catch { + /* already closed */ + } + }); + }, + }); + + return new Response(stream, { + headers: { + 'Content-Type': 'text/event-stream', + 'Cache-Control': 'no-cache, no-transform', + Connection: 'keep-alive', + }, + }); +} diff --git a/src/app/api/[slug]/palette/route.ts b/src/app/api/[slug]/palette/route.ts new file mode 100644 index 0000000..04349a2 --- /dev/null +++ b/src/app/api/[slug]/palette/route.ts @@ -0,0 +1,19 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { requireEditor } from '@/lib/guard'; + +export async function PATCH(req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + const palette = body?.palette; + if (!palette || typeof palette !== 'object') { + return NextResponse.json({ error: 'invalid' }, { status: 400 }); + } + await prisma.restaurant.update({ + where: { id: guard.restaurant.id }, + data: { palette: palette as object }, + }); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/[slug]/products/[id]/route.ts b/src/app/api/[slug]/products/[id]/route.ts new file mode 100644 index 0000000..fad9b7c --- /dev/null +++ b/src/app/api/[slug]/products/[id]/route.ts @@ -0,0 +1,54 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { requireEditor } from '@/lib/guard'; + +const FIELDS = [ + 'name', + 'description', + 'price', + 'isActive', + 'allergens', + 'dietTags', + 'macros', + 'media', + 'translationStatus', + 'sectionId', +] as const; + +export async function PATCH( + req: Request, + { params }: { params: { slug: string; id: string } }, +) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + if (!body) return NextResponse.json({ error: 'invalid' }, { status: 400 }); + + const data: Record = {}; + for (const f of FIELDS) { + if (body[f] !== undefined) { + data[f] = body[f]; + } + } + + const result = await prisma.product.updateMany({ + where: { id: params.id, restaurantId: guard.restaurant.id }, + data: data as Parameters[0]['data'], + }); + if (result.count === 0) return NextResponse.json({ error: 'not_found' }, { status: 404 }); + return NextResponse.json({ ok: true }); +} + +export async function DELETE( + _req: Request, + { params }: { params: { slug: string; id: string } }, +) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + await prisma.product.deleteMany({ + where: { id: params.id, restaurantId: guard.restaurant.id }, + }); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/[slug]/products/route.ts b/src/app/api/[slug]/products/route.ts new file mode 100644 index 0000000..88bd8d8 --- /dev/null +++ b/src/app/api/[slug]/products/route.ts @@ -0,0 +1,56 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { requireEditor } from '@/lib/guard'; + +// Create a product in a section, or batch-reorder products. +export async function POST(req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + const sectionId = String(body?.sectionId ?? ''); + if (!sectionId) return NextResponse.json({ error: 'invalid' }, { status: 400 }); + + const section = await prisma.section.findFirst({ + where: { id: sectionId, restaurantId: guard.restaurant.id }, + }); + if (!section) return NextResponse.json({ error: 'not_found' }, { status: 404 }); + + const count = await prisma.product.count({ where: { sectionId } }); + const product = await prisma.product.create({ + data: { + sectionId, + restaurantId: guard.restaurant.id, + name: (body?.name as object) ?? { es: '', en: '' }, + description: (body?.description as object) ?? {}, + price: body?.price ?? 0, + order: count, + allergens: body?.allergens ?? [], + dietTags: body?.dietTags ?? [], + macros: (body?.macros as object) ?? {}, + media: (body?.media as object) ?? [], + translationStatus: (body?.translationStatus as object) ?? {}, + }, + }); + return NextResponse.json(product); +} + +// Reorder: body { sectionId, ids: string[] }. +export async function PATCH(req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + const ids: string[] = Array.isArray(body?.ids) ? body.ids : []; + const sectionId: string | undefined = body?.sectionId; + + await prisma.$transaction( + ids.map((id, order) => + prisma.product.updateMany({ + where: { id, restaurantId: guard.restaurant.id }, + data: { order, ...(sectionId ? { sectionId } : {}) }, + }), + ), + ); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/[slug]/publish/route.ts b/src/app/api/[slug]/publish/route.ts new file mode 100644 index 0000000..bfeb2ce --- /dev/null +++ b/src/app/api/[slug]/publish/route.ts @@ -0,0 +1,19 @@ +import { NextResponse } from 'next/server'; +import { requireEditor } from '@/lib/guard'; +import { publishVersion } from '@/lib/menu'; + +export async function POST(req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + const versionName = String(body?.versionName ?? '').trim(); + if (!versionName) return NextResponse.json({ error: 'invalid' }, { status: 400 }); + + const version = await publishVersion( + guard.restaurant.id, + versionName, + guard.restaurant.username, + ); + return NextResponse.json(version); +} diff --git a/src/app/api/[slug]/qr/route.ts b/src/app/api/[slug]/qr/route.ts new file mode 100644 index 0000000..a4c2ed4 --- /dev/null +++ b/src/app/api/[slug]/qr/route.ts @@ -0,0 +1,46 @@ +import { NextResponse } from 'next/server'; +import QRCode from 'qrcode'; +import { prisma } from '@/lib/prisma'; + +export const dynamic = 'force-dynamic'; + +// Generates the public-menu QR as PNG or SVG. +export async function GET(req: Request, { params }: { params: { slug: string } }) { + const restaurant = await prisma.restaurant.findUnique({ + where: { slug: params.slug }, + select: { id: true }, + }); + if (!restaurant) return NextResponse.json({ error: 'not_found' }, { status: 404 }); + + const format = new URL(req.url).searchParams.get('format') === 'svg' ? 'svg' : 'png'; + const base = process.env.APP_BASE_URL || new URL(req.url).origin; + const url = `${base}/${params.slug}`; + + if (format === 'svg') { + const svg = await QRCode.toString(url, { + type: 'svg', + margin: 2, + width: 1024, + color: { dark: '#2a2520', light: '#ffffff' }, + }); + return new NextResponse(svg, { + headers: { + 'Content-Type': 'image/svg+xml', + 'Content-Disposition': `attachment; filename="menu-${params.slug}.svg"`, + }, + }); + } + + const buffer = await QRCode.toBuffer(url, { + type: 'png', + margin: 2, + width: 1024, + color: { dark: '#2a2520', light: '#ffffff' }, + }); + return new NextResponse(new Uint8Array(buffer), { + headers: { + 'Content-Type': 'image/png', + 'Content-Disposition': `attachment; filename="menu-${params.slug}.png"`, + }, + }); +} diff --git a/src/app/api/[slug]/sections/[id]/route.ts b/src/app/api/[slug]/sections/[id]/route.ts new file mode 100644 index 0000000..bf790d4 --- /dev/null +++ b/src/app/api/[slug]/sections/[id]/route.ts @@ -0,0 +1,35 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { requireEditor } from '@/lib/guard'; + +export async function PATCH( + req: Request, + { params }: { params: { slug: string; id: string } }, +) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + const data: { name?: object } = {}; + if (body?.name) data.name = body.name as object; + + const result = await prisma.section.updateMany({ + where: { id: params.id, restaurantId: guard.restaurant.id }, + data, + }); + if (result.count === 0) return NextResponse.json({ error: 'not_found' }, { status: 404 }); + return NextResponse.json({ ok: true }); +} + +export async function DELETE( + _req: Request, + { params }: { params: { slug: string; id: string } }, +) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + await prisma.section.deleteMany({ + where: { id: params.id, restaurantId: guard.restaurant.id }, + }); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/[slug]/sections/route.ts b/src/app/api/[slug]/sections/route.ts new file mode 100644 index 0000000..daddfdf --- /dev/null +++ b/src/app/api/[slug]/sections/route.ts @@ -0,0 +1,38 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { requireEditor } from '@/lib/guard'; + +// Create a new section, or reorder sections (operate on the DRAFT). +export async function POST(req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + const count = await prisma.section.count({ where: { restaurantId: guard.restaurant.id } }); + const section = await prisma.section.create({ + data: { + restaurantId: guard.restaurant.id, + name: (body?.name as object) ?? { es: 'Nueva sección', en: 'New section' }, + order: count, + }, + }); + return NextResponse.json(section); +} + +// Batch reorder: body { ids: string[] } in the new order. +export async function PATCH(req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + const ids: string[] = Array.isArray(body?.ids) ? body.ids : []; + await prisma.$transaction( + ids.map((id, order) => + prisma.section.updateMany({ + where: { id, restaurantId: guard.restaurant.id }, + data: { order }, + }), + ), + ); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/[slug]/settings/route.ts b/src/app/api/[slug]/settings/route.ts new file mode 100644 index 0000000..ecad385 --- /dev/null +++ b/src/app/api/[slug]/settings/route.ts @@ -0,0 +1,19 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { requireEditor } from '@/lib/guard'; + +// Toggle ordersEnabled, defaultLocale, etc. +export async function PATCH(req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + const data: { ordersEnabled?: boolean; defaultLocale?: string } = {}; + if (typeof body?.ordersEnabled === 'boolean') data.ordersEnabled = body.ordersEnabled; + if (body?.defaultLocale === 'es' || body?.defaultLocale === 'en') { + data.defaultLocale = body.defaultLocale; + } + + await prisma.restaurant.update({ where: { id: guard.restaurant.id }, data }); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/[slug]/translate/route.ts b/src/app/api/[slug]/translate/route.ts new file mode 100644 index 0000000..f35f174 --- /dev/null +++ b/src/app/api/[slug]/translate/route.ts @@ -0,0 +1,32 @@ +import { NextResponse } from 'next/server'; +import { requireEditor } from '@/lib/guard'; +import { getAnthropic, HAIKU_MODEL } from '@/lib/anthropic'; + +// Translate a single field with Claude Haiku to fill the missing locale. +export async function POST(req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const body = await req.json().catch(() => null); + const text = String(body?.text ?? '').trim(); + const from: 'es' | 'en' = body?.from === 'en' ? 'en' : 'es'; + const to: 'es' | 'en' = from === 'es' ? 'en' : 'es'; + if (!text) return NextResponse.json({ error: 'invalid' }, { status: 400 }); + + const langName = { es: 'Spanish', en: 'English' }; + try { + const client = getAnthropic(); + const msg = await client.messages.create({ + model: HAIKU_MODEL, + max_tokens: 400, + system: `You translate restaurant menu text from ${langName[from]} to ${langName[to]}. ` + + `Keep it natural and appetizing. Reply with ONLY the translation, no quotes, no notes.`, + messages: [{ role: 'user', content: text }], + }); + const translated = msg.content.find((c) => c.type === 'text')?.text?.trim() ?? ''; + return NextResponse.json({ translation: translated, to }); + } catch (err) { + console.error('translate error', err); + return NextResponse.json({ error: 'ai_failed' }, { status: 502 }); + } +} diff --git a/src/app/api/[slug]/upload/route.ts b/src/app/api/[slug]/upload/route.ts new file mode 100644 index 0000000..5c9f75f --- /dev/null +++ b/src/app/api/[slug]/upload/route.ts @@ -0,0 +1,24 @@ +import { NextResponse } from 'next/server'; +import { requireEditor } from '@/lib/guard'; +import { saveUpload } from '@/lib/upload'; + +export const dynamic = 'force-dynamic'; + +export async function POST(req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const form = await req.formData().catch(() => null); + const file = form?.get('file'); + if (!(file instanceof File)) { + return NextResponse.json({ error: 'invalid' }, { status: 400 }); + } + + try { + const saved = await saveUpload(guard.restaurant.slug, file); + return NextResponse.json(saved); + } catch (err) { + console.error('upload error', err); + return NextResponse.json({ error: 'upload_failed' }, { status: 400 }); + } +} diff --git a/src/app/api/[slug]/versions/[id]/restore/route.ts b/src/app/api/[slug]/versions/[id]/restore/route.ts new file mode 100644 index 0000000..f289c2c --- /dev/null +++ b/src/app/api/[slug]/versions/[id]/restore/route.ts @@ -0,0 +1,25 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { requireEditor } from '@/lib/guard'; +import { restoreSnapshotToDraft } from '@/lib/menu'; +import type { MenuSnapshot } from '@/lib/types'; + +// Load a stored version's snapshot back into the working draft. +export async function POST( + _req: Request, + { params }: { params: { slug: string; id: string } }, +) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const version = await prisma.menuVersion.findFirst({ + where: { id: params.id, restaurantId: guard.restaurant.id }, + }); + if (!version) return NextResponse.json({ error: 'not_found' }, { status: 404 }); + + await restoreSnapshotToDraft( + guard.restaurant.id, + version.snapshot as unknown as MenuSnapshot, + ); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/[slug]/versions/route.ts b/src/app/api/[slug]/versions/route.ts new file mode 100644 index 0000000..7fec4ba --- /dev/null +++ b/src/app/api/[slug]/versions/route.ts @@ -0,0 +1,21 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { requireEditor } from '@/lib/guard'; +import { MAX_VERSIONS } from '@/lib/menu'; + +// List the last 5 versions for the editor's history panel. +export async function GET(_req: Request, { params }: { params: { slug: string } }) { + const guard = await requireEditor(params.slug); + if ('error' in guard) return guard.error; + + const versions = await prisma.menuVersion.findMany({ + where: { restaurantId: guard.restaurant.id }, + orderBy: { publishedAt: 'desc' }, + take: MAX_VERSIONS, + select: { id: true, versionName: true, publishedAt: true, createdBy: true }, + }); + return NextResponse.json({ + versions, + publishedVersionId: guard.restaurant.publishedVersionId, + }); +} diff --git a/src/app/api/admin/login/route.ts b/src/app/api/admin/login/route.ts new file mode 100644 index 0000000..c99b321 --- /dev/null +++ b/src/app/api/admin/login/route.ts @@ -0,0 +1,23 @@ +import { NextResponse } from 'next/server'; +import { ADMIN_COOKIE, checkAdminCredentials, signAdminToken } from '@/lib/auth'; + +export async function POST(req: Request) { + const body = await req.json().catch(() => null); + const user = String(body?.user ?? ''); + const password = String(body?.password ?? ''); + + if (!checkAdminCredentials(user, password)) { + return NextResponse.json({ error: 'invalid' }, { status: 401 }); + } + + const token = await signAdminToken(); + const res = NextResponse.json({ ok: true }); + res.cookies.set(ADMIN_COOKIE, token, { + httpOnly: true, + sameSite: 'lax', + secure: process.env.NODE_ENV === 'production', + path: '/', + maxAge: 60 * 60 * 24, + }); + return res; +} diff --git a/src/app/api/admin/restaurants/[id]/route.ts b/src/app/api/admin/restaurants/[id]/route.ts new file mode 100644 index 0000000..933e596 --- /dev/null +++ b/src/app/api/admin/restaurants/[id]/route.ts @@ -0,0 +1,16 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { isAdminAuthed } from '@/lib/auth'; + +// Activate/deactivate a restaurant. +export async function PATCH(req: Request, { params }: { params: { id: string } }) { + if (!(await isAdminAuthed())) { + return NextResponse.json({ error: 'unauthorized' }, { status: 401 }); + } + const body = await req.json().catch(() => null); + const data: { active?: boolean } = {}; + if (typeof body?.active === 'boolean') data.active = body.active; + + await prisma.restaurant.update({ where: { id: params.id }, data }); + return NextResponse.json({ ok: true }); +} diff --git a/src/app/api/admin/restaurants/route.ts b/src/app/api/admin/restaurants/route.ts new file mode 100644 index 0000000..076b422 --- /dev/null +++ b/src/app/api/admin/restaurants/route.ts @@ -0,0 +1,93 @@ +import { NextResponse } from 'next/server'; +import { prisma } from '@/lib/prisma'; +import { + generatePassword, + generateSecret, + hashPassword, + isAdminAuthed, +} from '@/lib/auth'; + +function slugify(input: string): string { + return input + .toLowerCase() + .normalize('NFD') + .replace(/\p{Diacritic}/gu, '') + .replace(/[^a-z0-9]+/g, '-') + .replace(/^-+|-+$/g, '') + .slice(0, 48); +} + +const SUGGESTED_SECTIONS = [ + { es: 'Entradas', en: 'Starters' }, + { es: 'Platos fuertes', en: 'Main dishes' }, + { es: 'Bebidas', en: 'Drinks' }, + { es: 'Postres', en: 'Desserts' }, +]; + +export async function GET() { + if (!(await isAdminAuthed())) { + return NextResponse.json({ error: 'unauthorized' }, { status: 401 }); + } + const restaurants = await prisma.restaurant.findMany({ + orderBy: { createdAt: 'desc' }, + select: { + id: true, + slug: true, + name: true, + editorSecret: true, + username: true, + active: true, + ordersEnabled: true, + createdAt: true, + }, + }); + return NextResponse.json({ restaurants }); +} + +export async function POST(req: Request) { + if (!(await isAdminAuthed())) { + return NextResponse.json({ error: 'unauthorized' }, { status: 401 }); + } + + const body = await req.json().catch(() => null); + const name = String(body?.name ?? '').trim(); + const defaultLocale = body?.defaultLocale === 'en' ? 'en' : 'es'; + if (!name) return NextResponse.json({ error: 'invalid' }, { status: 400 }); + + let slug = slugify(body?.slug || name); + if (!slug) return NextResponse.json({ error: 'invalid_slug' }, { status: 400 }); + // Ensure unique slug. + let suffix = 1; + const base = slug; + while (await prisma.restaurant.findUnique({ where: { slug } })) { + slug = `${base}-${suffix++}`; + } + + const editorSecret = generateSecret(); + const username = body?.username?.trim() || 'admin'; + const plainPassword = body?.password?.trim() || generatePassword(); + const hashedPassword = await hashPassword(plainPassword); + + const restaurant = await prisma.restaurant.create({ + data: { + slug, + name, + editorSecret, + username, + hashedPassword, + defaultLocale, + sections: { + create: SUGGESTED_SECTIONS.map((s, i) => ({ name: s, order: i })), + }, + }, + }); + + return NextResponse.json({ + id: restaurant.id, + slug: restaurant.slug, + name: restaurant.name, + editorSecret, + username, + password: plainPassword, // shown once + }); +} diff --git a/src/app/api/uploads/[...path]/route.ts b/src/app/api/uploads/[...path]/route.ts new file mode 100644 index 0000000..864739d --- /dev/null +++ b/src/app/api/uploads/[...path]/route.ts @@ -0,0 +1,40 @@ +import { NextResponse } from 'next/server'; +import { promises as fs } from 'fs'; +import path from 'path'; +import { UPLOAD_DIR } from '@/lib/upload'; + +export const dynamic = 'force-dynamic'; + +const MIME: Record = { + jpg: 'image/jpeg', + jpeg: 'image/jpeg', + png: 'image/png', + webp: 'image/webp', + avif: 'image/avif', + gif: 'image/gif', + mp4: 'video/mp4', + webm: 'video/webm', + mov: 'video/quicktime', +}; + +// Serves files stored in the upload volume. Resolves and validates the path +// stays inside UPLOAD_DIR to prevent traversal. +export async function GET(_req: Request, { params }: { params: { path: string[] } }) { + const rel = params.path.join('/'); + const full = path.resolve(UPLOAD_DIR, rel); + if (!full.startsWith(path.resolve(UPLOAD_DIR) + path.sep)) { + return new NextResponse('forbidden', { status: 403 }); + } + try { + const data = await fs.readFile(full); + const ext = full.split('.').pop()?.toLowerCase() ?? ''; + return new NextResponse(new Uint8Array(data), { + headers: { + 'Content-Type': MIME[ext] ?? 'application/octet-stream', + 'Cache-Control': 'public, max-age=31536000, immutable', + }, + }); + } catch { + return new NextResponse('not found', { status: 404 }); + } +} diff --git a/src/app/globals.css b/src/app/globals.css new file mode 100644 index 0000000..349b7cb --- /dev/null +++ b/src/app/globals.css @@ -0,0 +1,94 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + /* Default restaurant palette (overridden per-restaurant at runtime). */ + --bg: #f4f1ec; + --bg-2: #e9e3da; + --surface: rgba(255, 255, 255, 0.55); + --accent: #b45309; + --text: #2a2520; + --tab: rgba(255, 255, 255, 0.45); +} + +html, +body { + padding: 0; + margin: 0; + min-height: 100%; +} + +body { + color: var(--text); + font-family: var(--font-inter), system-ui, sans-serif; + background: + radial-gradient(1200px 800px at 80% -10%, rgba(255, 255, 255, 0.6), transparent 60%), + radial-gradient(1000px 700px at -10% 110%, rgba(255, 255, 255, 0.4), transparent 55%), + linear-gradient(160deg, var(--bg), var(--bg-2)); + background-attachment: fixed; +} + +@layer components { + .glass { + background: var(--surface); + backdrop-filter: blur(18px) saturate(140%); + -webkit-backdrop-filter: blur(18px) saturate(140%); + border: 1px solid rgba(255, 255, 255, 0.6); + box-shadow: + 0 8px 32px rgba(31, 38, 135, 0.08), + inset 0 1px 0 rgba(255, 255, 255, 0.7); + } + + .glass-soft { + background: rgba(255, 255, 255, 0.35); + backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); + border: 1px solid rgba(255, 255, 255, 0.5); + } + + .glass-pill { + background: var(--tab); + backdrop-filter: blur(14px); + -webkit-backdrop-filter: blur(14px); + border: 1px solid rgba(255, 255, 255, 0.55); + } + + .display { + font-family: var(--font-fraunces), Georgia, serif; + } +} + +/* 3D flip card primitives */ +.flip-scene { + perspective: 1400px; +} +.flip-card { + position: relative; + transform-style: preserve-3d; + transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); +} +.flip-card.is-flipped { + transform: rotateY(180deg); +} +.flip-face { + backface-visibility: hidden; + -webkit-backface-visibility: hidden; + position: absolute; + inset: 0; +} +.flip-front { + position: relative; +} +.flip-back { + transform: rotateY(180deg); +} + +/* hide horizontal scrollbar on section tabs */ +.no-scrollbar::-webkit-scrollbar { + display: none; +} +.no-scrollbar { + -ms-overflow-style: none; + scrollbar-width: none; +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx new file mode 100644 index 0000000..3ccd715 --- /dev/null +++ b/src/app/layout.tsx @@ -0,0 +1,47 @@ +import type { Metadata, Viewport } from 'next'; +import { Fraunces, Inter } from 'next/font/google'; +import { NextIntlClientProvider } from 'next-intl'; +import { getLocale, getMessages } from 'next-intl/server'; +import './globals.css'; + +const fraunces = Fraunces({ + subsets: ['latin'], + variable: '--font-fraunces', + display: 'swap', +}); +const inter = Inter({ + subsets: ['latin'], + variable: '--font-inter', + display: 'swap', +}); + +export const metadata: Metadata = { + title: 'Menú inteligente — Collina Systems', + description: 'Menús digitales elegantes para restaurantes.', +}; + +export const viewport: Viewport = { + width: 'device-width', + initialScale: 1, + maximumScale: 1, + themeColor: '#f4f1ec', +}; + +export default async function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + const locale = await getLocale(); + const messages = await getMessages(); + + return ( + + + + {children} + + + + ); +} diff --git a/src/app/page.tsx b/src/app/page.tsx new file mode 100644 index 0000000..f36bafb --- /dev/null +++ b/src/app/page.tsx @@ -0,0 +1,20 @@ +import Link from 'next/link'; + +export default function Home() { + return ( +
+
+

Menú inteligente

+

+ Menús digitales elegantes para restaurantes · Collina Systems +

+ + Panel maestro + +
+
+ ); +} diff --git a/src/components/LanguageSwitch.tsx b/src/components/LanguageSwitch.tsx new file mode 100644 index 0000000..28309bd --- /dev/null +++ b/src/components/LanguageSwitch.tsx @@ -0,0 +1,37 @@ +'use client'; + +import { useLocale } from 'next-intl'; +import { useRouter } from 'next/navigation'; +import { useTransition } from 'react'; +import { LOCALE_COOKIE, locales, type Locale } from '@/i18n/config'; + +// Floating ES/EN toggle. Writes a cookie and refreshes server components so the +// whole interface switches instantly. +export default function LanguageSwitch({ className = '' }: { className?: string }) { + const locale = useLocale() as Locale; + const router = useRouter(); + const [pending, startTransition] = useTransition(); + + function setLocale(next: Locale) { + if (next === locale) return; + document.cookie = `${LOCALE_COOKIE}=${next}; path=/; max-age=31536000; samesite=lax`; + startTransition(() => router.refresh()); + } + + return ( +
+ {locales.map((l) => ( + + ))} +
+ ); +} diff --git a/src/components/admin/AdminLogin.tsx b/src/components/admin/AdminLogin.tsx new file mode 100644 index 0000000..3055b8d --- /dev/null +++ b/src/components/admin/AdminLogin.tsx @@ -0,0 +1,54 @@ +'use client'; + +import { useState } from 'react'; +import { useRouter } from 'next/navigation'; + +export default function AdminLogin() { + const router = useRouter(); + const [user, setUser] = useState(''); + const [password, setPassword] = useState(''); + const [error, setError] = useState(false); + const [loading, setLoading] = useState(false); + + async function submit(e: React.FormEvent) { + e.preventDefault(); + setLoading(true); + setError(false); + const res = await fetch('/api/admin/login', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ user, password }), + }); + setLoading(false); + if (res.ok) router.refresh(); + else setError(true); + } + + return ( +
+
+

Panel maestro Collina

+ setUser(e.target.value)} + placeholder="usuario" + className="glass-soft rounded-2xl px-4 py-3 outline-none" + /> + setPassword(e.target.value)} + placeholder="contraseña" + className="glass-soft rounded-2xl px-4 py-3 outline-none" + /> + {error &&

Credenciales incorrectas

} + +
+
+ ); +} diff --git a/src/components/admin/AdminPanel.tsx b/src/components/admin/AdminPanel.tsx new file mode 100644 index 0000000..1d548f5 --- /dev/null +++ b/src/components/admin/AdminPanel.tsx @@ -0,0 +1,175 @@ +'use client'; + +import { useState } from 'react'; + +type Restaurant = { + id: string; + slug: string; + name: string; + editorSecret: string; + username: string; + active: boolean; + createdAt: string; +}; + +type Created = { + slug: string; + name: string; + editorSecret: string; + username: string; + password: string; +}; + +export default function AdminPanel({ + initialRestaurants, + baseUrl, +}: { + initialRestaurants: Restaurant[]; + baseUrl: string; +}) { + const [restaurants, setRestaurants] = useState(initialRestaurants); + const [name, setName] = useState(''); + const [slug, setSlug] = useState(''); + const [defaultLocale, setDefaultLocale] = useState('es'); + const [creating, setCreating] = useState(false); + const [justCreated, setJustCreated] = useState(null); + + function publicLink(s: string) { + return `${baseUrl}/${s}`; + } + function editorLink(r: { slug: string; editorSecret: string }) { + return `${baseUrl}/${r.slug}/editor?k=${r.editorSecret}`; + } + + async function create(e: React.FormEvent) { + e.preventDefault(); + if (!name.trim()) return; + setCreating(true); + const res = await fetch('/api/admin/restaurants', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ name, slug, defaultLocale }), + }); + setCreating(false); + if (res.ok) { + const data: Created = await res.json(); + setJustCreated(data); + setName(''); + setSlug(''); + const list = await fetch('/api/admin/restaurants').then((r) => r.json()); + setRestaurants(list.restaurants); + } + } + + async function toggleActive(r: Restaurant) { + await fetch(`/api/admin/restaurants/${r.id}`, { + method: 'PATCH', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ active: !r.active }), + }); + setRestaurants((prev) => + prev.map((x) => (x.id === r.id ? { ...x, active: !x.active } : x)), + ); + } + + return ( +
+

Panel maestro Collina

+ +
+

Nuevo restaurante

+
+ + + + +
+ + {justCreated && ( +
+

+ Restaurante «{justCreated.name}» creado. Guarda estas credenciales (se muestran una vez): +

+
    +
  • + Usuario: {justCreated.username} +
  • +
  • + Contraseña: {justCreated.password} +
  • +
  • + Link de editor: {editorLink(justCreated)} +
  • +
  • + Link público: {publicLink(justCreated.slug)} +
  • +
+
+ )} +
+ +
+

Restaurantes

+
+ {restaurants.length === 0 &&

Aún no hay restaurantes.

} + {restaurants.map((r) => ( +
+
+
+
{r.name}
+
/{r.slug}
+
+ +
+ +
+ ))} +
+
+
+ ); +} diff --git a/src/components/editor/CatalogTab.tsx b/src/components/editor/CatalogTab.tsx new file mode 100644 index 0000000..744ed52 --- /dev/null +++ b/src/components/editor/CatalogTab.tsx @@ -0,0 +1,261 @@ +'use client'; + +import { useState } from 'react'; +import { useLocale, useTranslations } from 'next-intl'; +import type { Locale } from '@/i18n/config'; +import type { EditorProduct, EditorSection } from './types'; +import { pickText } from '@/lib/text'; +import { api } from './api'; +import ProductEditor from './ProductEditor'; +import SectionTitleEditor from './SectionTitleEditor'; +import VersionHistory from './VersionHistory'; + +export default function CatalogTab({ + slug, + sections, + setSections, + ordersEnabled, + onPublish, + onRestored, +}: { + slug: string; + sections: EditorSection[]; + setSections: React.Dispatch>; + ordersEnabled: boolean; + onPublish: () => void; + onRestored: (name: string | null) => void; +}) { + const t = useTranslations('editor'); + const locale = useLocale() as Locale; + const [editing, setEditing] = useState<{ product: EditorProduct } | null>(null); + const [dragSection, setDragSection] = useState(null); + const [dragProduct, setDragProduct] = useState<{ sectionId: string; id: string } | null>(null); + + async function addSection() { + const name = { es: 'Nueva sección', en: 'New section' }; + const created = await api<{ id: string }>(slug, '/sections', { method: 'POST', json: { name } }); + setSections((prev) => [...prev, { id: created.id, name, order: prev.length, products: [] }]); + } + + async function deleteSection(id: string) { + await api(slug, `/sections/${id}`, { method: 'DELETE' }); + setSections((prev) => prev.filter((s) => s.id !== id)); + } + + async function addProduct(sectionId: string) { + const created = await api(slug, '/products', { + method: 'POST', + json: { sectionId, name: { es: '', en: '' } }, + }); + const product: EditorProduct = { + ...created, + price: Number(created.price), + macros: created.macros ?? {}, + media: created.media ?? [], + allergens: created.allergens ?? [], + dietTags: created.dietTags ?? [], + translationStatus: created.translationStatus ?? {}, + }; + setSections((prev) => + prev.map((s) => (s.id === sectionId ? { ...s, products: [...s.products, product] } : s)), + ); + setEditing({ product }); + } + + function applyProduct(updated: EditorProduct) { + setSections((prev) => + prev.map((s) => + s.id === updated.sectionId + ? { ...s, products: s.products.map((p) => (p.id === updated.id ? updated : p)) } + : s, + ), + ); + } + + async function deleteProduct(p: EditorProduct) { + await api(slug, `/products/${p.id}`, { method: 'DELETE' }); + setSections((prev) => + prev.map((s) => + s.id === p.sectionId ? { ...s, products: s.products.filter((x) => x.id !== p.id) } : s, + ), + ); + setEditing(null); + } + + async function toggleActive(p: EditorProduct) { + const next = !p.isActive; + await api(slug, `/products/${p.id}`, { method: 'PATCH', json: { isActive: next } }); + applyProduct({ ...p, isActive: next }); + } + + // Section reordering (native drag). + function reorderSections(targetId: string) { + if (!dragSection || dragSection === targetId) return; + setSections((prev) => { + const from = prev.findIndex((s) => s.id === dragSection); + const to = prev.findIndex((s) => s.id === targetId); + const next = [...prev]; + const [moved] = next.splice(from, 1); + next.splice(to, 0, moved); + api(slug, '/sections', { method: 'PATCH', json: { ids: next.map((s) => s.id) } }); + return next; + }); + } + + function reorderProducts(sectionId: string, targetId: string) { + if (!dragProduct || dragProduct.sectionId !== sectionId || dragProduct.id === targetId) return; + setSections((prev) => + prev.map((s) => { + if (s.id !== sectionId) return s; + const from = s.products.findIndex((p) => p.id === dragProduct.id); + const to = s.products.findIndex((p) => p.id === targetId); + const products = [...s.products]; + const [moved] = products.splice(from, 1); + products.splice(to, 0, moved); + api(slug, '/products', { method: 'PATCH', json: { sectionId, ids: products.map((p) => p.id) } }); + return { ...s, products }; + }), + ); + } + + function status(p: EditorProduct): 'complete' | 'missing' { + const hasMacros = Object.values(p.macros).some((v) => v != null); + const hasMedia = p.media.length > 0; + const hasName = !!(p.name.es || p.name.en); + return hasMacros && hasMedia && hasName ? 'complete' : 'missing'; + } + + return ( +
+
+ + 👁 {t('viewMenu')} + + +
+ + {sections.map((s) => ( +
setDragSection(s.id)} + onDragEnd={() => setDragSection(null)} + onDragOver={(e) => e.preventDefault()} + onDrop={() => reorderSections(s.id)} + > +
+ + ⋮⋮ + + + setSections((prev) => prev.map((x) => (x.id === s.id ? { ...x, name } : x))) + } + /> + +
+ +
+ {s.products.map((p) => ( +
{ + e.stopPropagation(); + setDragProduct({ sectionId: s.id, id: p.id }); + }} + onDragEnd={() => setDragProduct(null)} + onDragOver={(e) => e.preventDefault()} + onDrop={(e) => { + e.stopPropagation(); + reorderProducts(s.id, p.id); + }} + > + ⋮⋮ +
+ {p.media[0] ? ( + p.media[0].type === 'video' ? ( + // eslint-disable-next-line jsx-a11y/media-has-caption +
+ + + +
+ ))} +
+ + +
+ ))} + + + + + + {editing && ( + setEditing(null)} + onSave={applyProduct} + onDelete={deleteProduct} + /> + )} +
+ ); +} diff --git a/src/components/editor/Editor.tsx b/src/components/editor/Editor.tsx new file mode 100644 index 0000000..6960154 --- /dev/null +++ b/src/components/editor/Editor.tsx @@ -0,0 +1,90 @@ +'use client'; + +import { useState } from 'react'; +import { useTranslations } from 'next-intl'; +import type { EditorData, EditorSection } from './types'; +import LanguageSwitch from '@/components/LanguageSwitch'; +import CatalogTab from './CatalogTab'; +import PaletteTab from './PaletteTab'; +import OrdersTab from './OrdersTab'; +import QrTab from './QrTab'; +import PublishModal from './PublishModal'; + +type Tab = 'catalog' | 'palette' | 'orders' | 'qr'; + +export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: string }) { + const t = useTranslations('editor'); + const [tab, setTab] = useState('catalog'); + const [sections, setSections] = useState(data.sections); + const [ordersEnabled, setOrdersEnabled] = useState(data.ordersEnabled); + const [publishOpen, setPublishOpen] = useState(false); + const [publishedName, setPublishedName] = useState(data.publishedVersionName); + + const tabs: { id: Tab; label: string; icon: string }[] = [ + { id: 'catalog', label: t('catalog'), icon: '📋' }, + { id: 'palette', label: t('palette'), icon: '🎨' }, + { id: 'orders', label: t('orders'), icon: '🔔' }, + { id: 'qr', label: t('qr'), icon: '🔳' }, + ]; + + return ( +
+
+
+

{data.name}

+

+ {publishedName ? `${t('publishedVersion')}: ${publishedName}` : t('noVersion')} +

+
+ +
+ + {tab === 'catalog' && ( + setPublishOpen(true)} + onRestored={(name) => setPublishedName(name)} + /> + )} + {tab === 'palette' && } + {tab === 'orders' && ( + + )} + {tab === 'qr' && } + + {/* Bottom tab bar */} + + + {publishOpen && ( + setPublishOpen(false)} + onPublished={(name) => { + setPublishedName(name); + setPublishOpen(false); + }} + /> + )} +
+ ); +} diff --git a/src/components/editor/EditorLogin.tsx b/src/components/editor/EditorLogin.tsx new file mode 100644 index 0000000..c55374a --- /dev/null +++ b/src/components/editor/EditorLogin.tsx @@ -0,0 +1,72 @@ +'use client'; + +import { useState } from 'react'; +import { useRouter } from 'next/navigation'; +import { useTranslations } from 'next-intl'; + +export default function EditorLogin({ + slug, + name, + secret, +}: { + slug: string; + name: string; + secret: string; +}) { + const t = useTranslations('auth'); + const router = useRouter(); + const [username, setUsername] = useState(''); + const [password, setPassword] = useState(''); + const [error, setError] = useState(null); + const [loading, setLoading] = useState(false); + + async function submit(e: React.FormEvent) { + e.preventDefault(); + setLoading(true); + setError(null); + const res = await fetch(`/api/${slug}/auth/login`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ username, password, secret }), + }); + setLoading(false); + if (res.ok) { + router.push(`/${slug}/editor`); + router.refresh(); + } else { + const data = await res.json().catch(() => ({})); + setError(data.error === 'invalid_link' ? t('invalidLink') : t('invalid')); + } + } + + return ( +
+
+

{name}

+

{t('login')}

+ {!secret &&

{t('invalidLink')}

} + setUsername(e.target.value)} + placeholder={t('username')} + autoCapitalize="none" + className="glass-soft rounded-2xl px-4 py-3 outline-none" + /> + setPassword(e.target.value)} + placeholder={t('password')} + className="glass-soft rounded-2xl px-4 py-3 outline-none" + /> + {error &&

{error}

} + +
+
+ ); +} diff --git a/src/components/editor/OrdersTab.tsx b/src/components/editor/OrdersTab.tsx new file mode 100644 index 0000000..db0d9f4 --- /dev/null +++ b/src/components/editor/OrdersTab.tsx @@ -0,0 +1,176 @@ +'use client'; + +import { useEffect, useRef, useState } from 'react'; +import { useTranslations } from 'next-intl'; +import type { OrderItem } from '@/lib/types'; +import { api } from './api'; + +type Order = { + id: string; + tableNumber: number; + items: OrderItem[]; + createdAt: string; + status: string; +}; + +type WaiterCall = { tableNumber: number; at: string }; + +export default function OrdersTab({ + slug, + ordersEnabled, + setOrdersEnabled, +}: { + slug: string; + ordersEnabled: boolean; + setOrdersEnabled: (v: boolean) => void; +}) { + const t = useTranslations('editor'); + const [orders, setOrders] = useState([]); + const [waiterCalls, setWaiterCalls] = useState([]); + const [now, setNow] = useState(() => 0); + const esRef = useRef(null); + + // Tick every second to drive timers (avoids Date in render init). + useEffect(() => { + setNow(Date.now()); + const id = setInterval(() => setNow(Date.now()), 1000); + return () => clearInterval(id); + }, []); + + useEffect(() => { + if (!ordersEnabled) return; + const es = new EventSource(`/api/${slug}/orders/stream`); + esRef.current = es; + + es.addEventListener('snapshot', (e) => { + setOrders(JSON.parse((e as MessageEvent).data)); + }); + es.addEventListener('order', (e) => { + const order: Order = JSON.parse((e as MessageEvent).data); + setOrders((prev) => [...prev, order]); + }); + es.addEventListener('order-update', (e) => { + const { id, status } = JSON.parse((e as MessageEvent).data); + setOrders((prev) => + status === 'active' ? prev : prev.filter((o) => o.id !== id), + ); + }); + es.addEventListener('waiter', (e) => { + const call: WaiterCall = JSON.parse((e as MessageEvent).data); + setWaiterCalls((prev) => [call, ...prev].slice(0, 8)); + }); + + return () => es.close(); + }, [slug, ordersEnabled]); + + async function toggleOrders() { + const next = !ordersEnabled; + setOrdersEnabled(next); + await api(slug, '/settings', { method: 'PATCH', json: { ordersEnabled: next } }); + } + + async function complete(o: Order) { + setOrders((prev) => prev.filter((x) => x.id !== o.id)); + await api(slug, `/orders/${o.id}`, { method: 'PATCH', json: { status: 'completed' } }); + } + + function elapsed(createdAt: string): { label: string; color: string } { + const secs = Math.max(0, Math.floor((now - new Date(createdAt).getTime()) / 1000)); + const m = Math.floor(secs / 60); + const s = secs % 60; + const label = `${m}:${s.toString().padStart(2, '0')}`; + // green → amber → red as time grows. + const color = secs < 300 ? '#15803d' : secs < 600 ? '#b45309' : '#dc2626'; + return { label, color }; + } + + return ( +
+
+ {t('enableOrders')} + +
+ + {!ordersEnabled && ( +

{t('ordersDisabled')}

+ )} + + {ordersEnabled && waiterCalls.length > 0 && ( +
+ {waiterCalls.map((c, i) => ( +
+ 🔔{' '} + + {t('table')} {c.tableNumber} + + +
+ ))} +
+ )} + + {ordersEnabled && ( +
+ {orders.map((o) => { + const e = elapsed(o.createdAt); + return ( +
+ +
+ + {t('table')} {o.tableNumber} + + + {e.label} + +
+
    + {o.items.map((it, idx) => ( +
  • + {it.name} + ×{it.qty} +
  • + ))} +
+ +
+ ); + })} +
+ )} +
+ ); +} diff --git a/src/components/editor/PaletteTab.tsx b/src/components/editor/PaletteTab.tsx new file mode 100644 index 0000000..4875d08 --- /dev/null +++ b/src/components/editor/PaletteTab.tsx @@ -0,0 +1,114 @@ +'use client'; + +import { useState } from 'react'; +import { useTranslations } from 'next-intl'; +import type { Palette } from '@/lib/types'; +import { PALETTE_PRESETS } from '@/lib/palette'; +import { api } from './api'; + +const FIELDS: { key: keyof Palette; label: string }[] = [ + { key: 'background', label: 'Fondo' }, + { key: 'accent', label: 'Acento' }, + { key: 'text', label: 'Texto' }, +]; + +export default function PaletteTab({ + slug, + initialPalette, +}: { + slug: string; + initialPalette: Palette; +}) { + const t = useTranslations('editor'); + const tc = useTranslations('common'); + const [palette, setPalette] = useState({ + ...PALETTE_PRESETS[0].palette, + ...initialPalette, + }); + const [saving, setSaving] = useState(false); + const [saved, setSaved] = useState(false); + + function update(next: Palette) { + setPalette(next); + setSaved(false); + } + + async function save() { + setSaving(true); + try { + await api(slug, '/palette', { method: 'PATCH', json: { palette } }); + setSaved(true); + } finally { + setSaving(false); + } + } + + return ( +
+ {/* Live preview */} +
+
+

+ Vista previa +

+ +
+
+ + {/* Presets */} +
+ {PALETTE_PRESETS.map((p) => ( + + ))} +
+ + {/* Custom colors */} +
+
+ {FIELDS.map((f) => ( + + ))} +
+
+ +

⚠️ {t('paletteHint')}

+ + +
+ ); +} diff --git a/src/components/editor/ProductEditor.tsx b/src/components/editor/ProductEditor.tsx new file mode 100644 index 0000000..8aecd87 --- /dev/null +++ b/src/components/editor/ProductEditor.tsx @@ -0,0 +1,420 @@ +'use client'; + +import { useState } from 'react'; +import { useTranslations } from 'next-intl'; +import type { EditorProduct, EditorSection } from './types'; +import { MACRO_KEYS } from '@/lib/macros'; +import { api } from './api'; + +const ALLERGENS = ['gluten', 'lácteos', 'frutos secos', 'mariscos', 'huevo', 'soya', 'pescado']; +const DIET_TAGS = ['vegetariano', 'vegano', 'sin gluten', 'sin lácteos', 'keto', 'picante']; + +export default function ProductEditor({ + slug, + product, + sections, + onClose, + onSave, + onDelete, +}: { + slug: string; + product: EditorProduct; + sections: EditorSection[]; + onClose: () => void; + onSave: (p: EditorProduct) => void; + onDelete: (p: EditorProduct) => void; +}) { + const t = useTranslations('editor'); + const tm = useTranslations('macros'); + const [draft, setDraft] = useState(product); + const [saving, setSaving] = useState(false); + const [translating, setTranslating] = useState(null); + const [uploading, setUploading] = useState(false); + + function set(key: K, value: EditorProduct[K]) { + setDraft((d) => ({ ...d, [key]: value })); + } + + async function save() { + setSaving(true); + try { + await api(slug, `/products/${draft.id}`, { + method: 'PATCH', + json: { + name: draft.name, + description: draft.description, + price: draft.price, + sectionId: draft.sectionId, + allergens: draft.allergens, + dietTags: draft.dietTags, + macros: draft.macros, + media: draft.media, + translationStatus: draft.translationStatus, + }, + }); + onSave(draft); + onClose(); + } finally { + setSaving(false); + } + } + + async function translate(field: 'name' | 'description') { + const from = draft[field].es ? 'es' : 'en'; + const text = draft[field][from]; + if (!text) return; + setTranslating(field); + try { + const res = await api<{ translation: string; to: 'es' | 'en' }>(slug, '/translate', { + method: 'POST', + json: { text, from }, + }); + setDraft((d) => ({ + ...d, + [field]: { ...d[field], [res.to]: res.translation }, + translationStatus: { ...d.translationStatus, en: 'auto' as const }, + })); + } finally { + setTranslating(null); + } + } + + async function upload(files: FileList | null) { + if (!files?.length) return; + setUploading(true); + try { + const added: EditorProduct['media'] = []; + for (const file of Array.from(files)) { + const form = new FormData(); + form.append('file', file); + const res = await api<{ path: string; type: 'image' | 'video' }>(slug, '/upload', { + method: 'POST', + body: form, + }); + added.push({ type: res.type, path: res.path, order: draft.media.length + added.length }); + } + setDraft((d) => ({ ...d, media: [...d.media, ...added] })); + } finally { + setUploading(false); + } + } + + function moveMedia(index: number, dir: -1 | 1) { + setDraft((d) => { + const media = [...d.media]; + const to = index + dir; + if (to < 0 || to >= media.length) return d; + [media[index], media[to]] = [media[to], media[index]]; + return { ...d, media: media.map((m, i) => ({ ...m, order: i })) }; + }); + } + + function removeMedia(index: number) { + setDraft((d) => ({ + ...d, + media: d.media.filter((_, i) => i !== index).map((m, i) => ({ ...m, order: i })), + })); + } + + function toggleIn(list: string[], value: string): string[] { + return list.includes(value) ? list.filter((x) => x !== value) : [...list, value]; + } + + const enStatus = draft.translationStatus.en; + + return ( +
+
+
+

{t('edit')}

+ +
+ + {/* Name ES/EN */} + +
+ set('name', { ...draft.name, es: v })} + /> +
+ + setDraft((d) => ({ + ...d, + name: { ...d.name, en: v }, + translationStatus: { ...d.translationStatus, en: 'reviewed' }, + })) + } + /> +
+ translate('name')} + /> +
+
+ + {/* Description ES/EN */} + +
+