From 823ef9a28c66212e98f050021c519f2a9282b714 Mon Sep 17 00:00:00 2001 From: Bivekich Date: Wed, 16 Jul 2025 18:00:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE=D1=81=D1=82=D0=B8,=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D1=81?= =?UTF-8?q?=D1=82=D0=B8=D0=BB=D0=B8=20=D0=B8=20=D1=83=D0=BB=D1=83=D1=87?= =?UTF-8?q?=D1=88=D0=B5=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82?= =?UTF-8?q?=D1=83=D1=80=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D0=B0?= =?UTF-8?q?.=20=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=20README?= =?UTF-8?q?=20=D1=81=20=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=D0=BC=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=B8=20=D1=82=D0=B5=D1=85=D0=BD=D0=BE=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=B8=D0=B9.=20=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B0=20=D0=B0=D0=BD=D0=B8=D0=BC?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B8=20=D0=B0=D0=B4=D0=B0=D0=BF?= =?UTF-8?q?=D1=82=D0=B8=D0=B2=D0=BD=D1=8B=D0=B9=20=D0=B4=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D0=B9=D0=BD.=20=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=20=D1=81=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=D0=BC=20Apollo?= =?UTF-8?q?=20Client.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + README.md | 130 +- components.json | 21 + package-lock.json | 4973 ++++++++++++++++- package.json | 46 +- prisma/schema.prisma | 191 + src/app/api/graphql/route.ts | 65 + src/app/api/upload-avatar/route.ts | 104 + src/app/dashboard/page.tsx | 10 + src/app/globals.css | 376 +- src/app/layout.tsx | 37 +- src/app/login/page.tsx | 12 + src/app/market/page.tsx | 10 + src/app/page.tsx | 117 +- src/app/register/page.tsx | 27 + src/app/settings/page.tsx | 10 + src/components/auth-guard.tsx | 65 + src/components/auth/auth-flow.tsx | 269 + src/components/auth/auth-layout.tsx | 140 + src/components/auth/cabinet-select-step.tsx | 114 + src/components/auth/confirmation-step.tsx | 360 ++ src/components/auth/inn-step.tsx | 219 + src/components/auth/marketplace-api-step.tsx | 367 ++ src/components/auth/phone-step.tsx | 140 + src/components/auth/sms-step.tsx | 225 + src/components/dashboard/dashboard-home.tsx | 109 + src/components/dashboard/dashboard.tsx | 31 + src/components/dashboard/sidebar.tsx | 141 + src/components/dashboard/user-settings.tsx | 1130 ++++ .../market/market-counterparties.tsx | 326 ++ src/components/market/market-dashboard.tsx | 97 + src/components/market/market-fulfillment.tsx | 125 + src/components/market/market-logistics.tsx | 125 + src/components/market/market-sellers.tsx | 125 + src/components/market/market-wholesale.tsx | 125 + src/components/market/organization-avatar.tsx | 92 + src/components/market/organization-card.tsx | 268 + .../market/organization-details-modal.tsx | 431 ++ src/components/ui/alert.tsx | 66 + src/components/ui/avatar.tsx | 53 + src/components/ui/badge.tsx | 46 + src/components/ui/button.tsx | 61 + src/components/ui/card.tsx | 92 + src/components/ui/checkbox.tsx | 32 + src/components/ui/dialog.tsx | 143 + src/components/ui/input.tsx | 35 + src/components/ui/label.tsx | 24 + src/components/ui/phone-input.tsx | 108 + src/components/ui/progress.tsx | 31 + src/components/ui/select.tsx | 185 + src/components/ui/separator.tsx | 28 + src/components/ui/skeleton.tsx | 13 + src/components/ui/slider.tsx | 63 + src/components/ui/sonner.tsx | 25 + src/components/ui/switch.tsx | 31 + src/components/ui/tabs.tsx | 66 + src/graphql/mutations.ts | 358 ++ src/graphql/queries.ts | 169 + src/graphql/resolvers.ts | 1363 +++++ src/graphql/typedefs.ts | 229 + src/hooks/useApolloRefresh.ts | 12 + src/hooks/useAuth.ts | 367 ++ src/lib/apollo-client.ts | 125 + src/lib/prisma.ts | 11 + src/lib/utils.ts | 25 + src/services/dadata-service.ts | 289 + src/services/marketplace-service.ts | 223 + src/services/s3-service.ts | 78 + src/services/sms-service.ts | 243 + 69 files changed, 15539 insertions(+), 210 deletions(-) create mode 100644 components.json create mode 100644 prisma/schema.prisma create mode 100644 src/app/api/graphql/route.ts create mode 100644 src/app/api/upload-avatar/route.ts create mode 100644 src/app/dashboard/page.tsx create mode 100644 src/app/login/page.tsx create mode 100644 src/app/market/page.tsx create mode 100644 src/app/register/page.tsx create mode 100644 src/app/settings/page.tsx create mode 100644 src/components/auth-guard.tsx create mode 100644 src/components/auth/auth-flow.tsx create mode 100644 src/components/auth/auth-layout.tsx create mode 100644 src/components/auth/cabinet-select-step.tsx create mode 100644 src/components/auth/confirmation-step.tsx create mode 100644 src/components/auth/inn-step.tsx create mode 100644 src/components/auth/marketplace-api-step.tsx create mode 100644 src/components/auth/phone-step.tsx create mode 100644 src/components/auth/sms-step.tsx create mode 100644 src/components/dashboard/dashboard-home.tsx create mode 100644 src/components/dashboard/dashboard.tsx create mode 100644 src/components/dashboard/sidebar.tsx create mode 100644 src/components/dashboard/user-settings.tsx create mode 100644 src/components/market/market-counterparties.tsx create mode 100644 src/components/market/market-dashboard.tsx create mode 100644 src/components/market/market-fulfillment.tsx create mode 100644 src/components/market/market-logistics.tsx create mode 100644 src/components/market/market-sellers.tsx create mode 100644 src/components/market/market-wholesale.tsx create mode 100644 src/components/market/organization-avatar.tsx create mode 100644 src/components/market/organization-card.tsx create mode 100644 src/components/market/organization-details-modal.tsx create mode 100644 src/components/ui/alert.tsx create mode 100644 src/components/ui/avatar.tsx create mode 100644 src/components/ui/badge.tsx create mode 100644 src/components/ui/button.tsx create mode 100644 src/components/ui/card.tsx create mode 100644 src/components/ui/checkbox.tsx create mode 100644 src/components/ui/dialog.tsx create mode 100644 src/components/ui/input.tsx create mode 100644 src/components/ui/label.tsx create mode 100644 src/components/ui/phone-input.tsx create mode 100644 src/components/ui/progress.tsx create mode 100644 src/components/ui/select.tsx create mode 100644 src/components/ui/separator.tsx create mode 100644 src/components/ui/skeleton.tsx create mode 100644 src/components/ui/slider.tsx create mode 100644 src/components/ui/sonner.tsx create mode 100644 src/components/ui/switch.tsx create mode 100644 src/components/ui/tabs.tsx create mode 100644 src/graphql/mutations.ts create mode 100644 src/graphql/queries.ts create mode 100644 src/graphql/resolvers.ts create mode 100644 src/graphql/typedefs.ts create mode 100644 src/hooks/useApolloRefresh.ts create mode 100644 src/hooks/useAuth.ts create mode 100644 src/lib/apollo-client.ts create mode 100644 src/lib/prisma.ts create mode 100644 src/lib/utils.ts create mode 100644 src/services/dadata-service.ts create mode 100644 src/services/marketplace-service.ts create mode 100644 src/services/s3-service.ts create mode 100644 src/services/sms-service.ts diff --git a/.gitignore b/.gitignore index 5ef6a52..f390d12 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +/src/generated/prisma diff --git a/README.md b/README.md index e215bc4..dad0482 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,122 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# SferaV - Система управления бизнесом -## Getting Started +Красивое приложение для авторизации и управления кабинетами Фулфилмент и Wildberries с современным фиолетовым дизайном. -First, run the development server: +## ✨ Особенности -```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev +- 🎨 **Современный UI/UX** - Фиолетовые градиенты и стеклянный эффект +- 📱 **Адаптивный дизайн** - Отлично работает на всех устройствах +- 🔐 **Многоэтапная авторизация** - Номер телефона → SMS → Выбор кабинета → Данные +- 📞 **Умная маска телефона** - Автоформатирование номера +7 (999) 999-99-99 +- 💼 **Два типа кабинетов** - Фулфилмент (ИНН) и Wildberries (API ключ) +- ⚡ **Быстрая навигация** - Плавные переходы между этапами + +## 🛠 Технологии + +- **Next.js 15** - React фреймворк +- **TypeScript** - Типизация +- **Tailwind CSS 4** - Стилизация +- **shadcn/ui** - UI компоненты +- **react-input-mask** - Маска ввода + +## 🚀 Быстрый старт + +1. **Установка зависимостей:** + ```bash + npm install + ``` + +2. **Запуск приложения:** + ```bash + npm run dev + ``` + +3. **Откройте браузер:** + ``` + http://localhost:3000 + ``` + +## 📱 Этапы авторизации + +### 1. Ввод номера телефона +- Красивая маска ввода с автоформатированием +- Валидация российских номеров (+7) +- Плавная анимация при вводе + +### 2. Подтверждение SMS +- 4 отдельных поля для цифр кода +- Автопереключение между полями +- Возможность вернуться к изменению номера + +### 3. Выбор типа кабинета +- Фулфилмент кабинет (складские операции) +- Wildberries кабинет (маркетплейс) +- Интерактивные карточки с описанием + +### 4. Ввод данных +- **Фулфилмент:** ИНН организации (10-12 цифр) +- **Wildberries:** API ключ с инструкцией получения + +## 🎨 Дизайн + +- **Цветовая схема:** Фиолетовые градиенты +- **Эффекты:** Стеклянные поверхности, размытие +- **Анимации:** Плавные переходы и hover эффекты +- **Типографика:** Современные шрифты с хорошей читаемостью + +## 📂 Структура проекта + +``` +src/ +├── app/ # Next.js App Router +│ ├── globals.css # Глобальные стили +│ ├── layout.tsx # Основной layout +│ └── page.tsx # Главная страница +├── components/ +│ ├── auth/ # Компоненты авторизации +│ │ ├── auth-flow.tsx # Основной флоу +│ │ ├── auth-layout.tsx # Layout для этапов +│ │ ├── phone-step.tsx # Ввод телефона +│ │ ├── sms-step.tsx # Ввод SMS +│ │ ├── cabinet-select-step.tsx # Выбор кабинета +│ │ ├── inn-step.tsx # Ввод ИНН +│ │ └── wb-api-step.tsx # Ввод API ключа WB +│ └── ui/ # shadcn/ui компоненты +│ ├── button.tsx +│ ├── card.tsx +│ ├── input.tsx +│ ├── label.tsx +│ ├── phone-input.tsx +│ └── select.tsx +└── lib/ + └── utils.ts # Утилиты ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +## 🔧 Настройка -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +### Цвета +Фиолетовая тема настроена в `src/app/globals.css` с использованием CSS переменных oklch. -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. +### Компоненты +Все UI компоненты основаны на shadcn/ui и адаптированы под дизайн системы. -## Learn More +## 📝 Будущие улучшения -To learn more about Next.js, take a look at the following resources: +- [ ] Интеграция с реальным API для SMS +- [ ] Сохранение состояния в localStorage +- [ ] Темная/светлая темы +- [ ] Интернационализация (i18n) +- [ ] Мобильное приложение +- [ ] Анимации между этапами -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. +## 🤝 Вклад в проект -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! +Приветствуются все улучшения! Создавайте issues и pull requests. -## Deploy on Vercel +## 📄 Лицензия -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. +MIT License - используйте свободно! -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +--- + +Сделано с ❤️ для удобной работы с маркетплейсами diff --git a/components.json b/components.json new file mode 100644 index 0000000..ffe928f --- /dev/null +++ b/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/app/globals.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "iconLibrary": "lucide" +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d8f97a8..40af6c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,44 @@ "name": "sferav", "version": "0.1.0", "dependencies": { + "@apollo/client": "^3.13.8", + "@apollo/server": "^4.12.2", + "@as-integrations/express5": "^1.1.1", + "@as-integrations/next": "^3.2.0", + "@aws-sdk/client-s3": "^3.846.0", + "@prisma/client": "^6.12.0", + "@radix-ui/react-avatar": "^1.1.10", + "@radix-ui/react-checkbox": "^1.3.2", + "@radix-ui/react-dialog": "^1.1.14", + "@radix-ui/react-label": "^2.1.7", + "@radix-ui/react-progress": "^1.1.7", + "@radix-ui/react-select": "^2.2.5", + "@radix-ui/react-separator": "^1.1.7", + "@radix-ui/react-slider": "^1.3.5", + "@radix-ui/react-slot": "^1.2.3", + "@radix-ui/react-switch": "^1.2.5", + "@radix-ui/react-tabs": "^1.1.12", + "@types/cors": "^2.8.19", + "@types/express": "^5.0.3", + "@types/jsonwebtoken": "^9.0.10", + "axios": "^1.10.0", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "cors": "^2.8.5", + "express": "^5.1.0", + "graphql": "^16.11.0", + "graphql-tag": "^2.12.6", + "graphql-ws": "^6.0.6", + "jsonwebtoken": "^9.0.2", + "lucide-react": "^0.525.0", "next": "15.4.1", + "next-themes": "^0.4.6", + "prisma": "^6.12.0", "react": "19.1.0", - "react-dom": "19.1.0" + "react-dom": "19.1.0", + "react-imask": "^7.6.1", + "sonner": "^2.0.6", + "tailwind-merge": "^3.3.1" }, "devDependencies": { "@eslint/eslintrc": "^3", @@ -21,6 +56,7 @@ "eslint": "^9", "eslint-config-next": "15.4.1", "tailwindcss": "^4", + "tw-animate-css": "^1.3.5", "typescript": "^5" } }, @@ -51,6 +87,1515 @@ "node": ">=6.0.0" } }, + "node_modules/@apollo/cache-control-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@apollo/cache-control-types/-/cache-control-types-1.0.3.tgz", + "integrity": "sha512-F17/vCp7QVwom9eG7ToauIKdAxpSoadsJnqIfyryLFSkLSOEqu+eC5Z3N8OXcUVStuOMcNHlyraRsA6rRICu4g==", + "license": "MIT", + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/client": { + "version": "3.13.8", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.13.8.tgz", + "integrity": "sha512-YM9lQpm0VfVco4DSyKooHS/fDTiKQcCHfxr7i3iL6a0kP/jNO5+4NFK6vtRDxaYisd5BrwOZHLJpPBnvRVpKPg==", + "license": "MIT", + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "@wry/caches": "^1.0.0", + "@wry/equality": "^0.5.6", + "@wry/trie": "^0.5.0", + "graphql-tag": "^2.12.6", + "hoist-non-react-statics": "^3.3.2", + "optimism": "^0.18.0", + "prop-types": "^15.7.2", + "rehackt": "^0.1.0", + "symbol-observable": "^4.0.0", + "ts-invariant": "^0.10.3", + "tslib": "^2.3.0", + "zen-observable-ts": "^1.2.5" + }, + "peerDependencies": { + "graphql": "^15.0.0 || ^16.0.0", + "graphql-ws": "^5.5.5 || ^6.0.3", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc", + "subscriptions-transport-ws": "^0.9.0 || ^0.11.0" + }, + "peerDependenciesMeta": { + "graphql-ws": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "subscriptions-transport-ws": { + "optional": true + } + } + }, + "node_modules/@apollo/protobufjs": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.7.tgz", + "integrity": "sha512-Lahx5zntHPZia35myYDBRuF58tlwPskwHc5CWBZC/4bMKB6siTBWwtMrkqXcsNwQiFSzSx5hKdRPUmemrEp3Gg==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "long": "^4.0.0" + }, + "bin": { + "apollo-pbjs": "bin/pbjs", + "apollo-pbts": "bin/pbts" + } + }, + "node_modules/@apollo/server": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@apollo/server/-/server-4.12.2.tgz", + "integrity": "sha512-jKRlf+sBMMdKYrjMoiWKne42Eb6paBfDOr08KJnUaeaiyWFj+/040FjVPQI7YGLfdwnYIsl1NUUqS2UdgezJDg==", + "license": "MIT", + "dependencies": { + "@apollo/cache-control-types": "^1.0.3", + "@apollo/server-gateway-interface": "^1.1.1", + "@apollo/usage-reporting-protobuf": "^4.1.1", + "@apollo/utils.createhash": "^2.0.2", + "@apollo/utils.fetcher": "^2.0.0", + "@apollo/utils.isnodelike": "^2.0.0", + "@apollo/utils.keyvaluecache": "^2.1.0", + "@apollo/utils.logger": "^2.0.0", + "@apollo/utils.usagereporting": "^2.1.0", + "@apollo/utils.withrequired": "^2.0.0", + "@graphql-tools/schema": "^9.0.0", + "@types/express": "^4.17.13", + "@types/express-serve-static-core": "^4.17.30", + "@types/node-fetch": "^2.6.1", + "async-retry": "^1.2.1", + "cors": "^2.8.5", + "express": "^4.21.1", + "loglevel": "^1.6.8", + "lru-cache": "^7.10.1", + "negotiator": "^0.6.3", + "node-abort-controller": "^3.1.1", + "node-fetch": "^2.6.7", + "uuid": "^9.0.0", + "whatwg-mimetype": "^3.0.0" + }, + "engines": { + "node": ">=14.16.0" + }, + "peerDependencies": { + "graphql": "^16.6.0" + } + }, + "node_modules/@apollo/server-gateway-interface": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@apollo/server-gateway-interface/-/server-gateway-interface-1.1.1.tgz", + "integrity": "sha512-pGwCl/po6+rxRmDMFgozKQo2pbsSwE91TpsDBAOgf74CRDPXHHtM88wbwjab0wMMZh95QfR45GGyDIdhY24bkQ==", + "license": "MIT", + "dependencies": { + "@apollo/usage-reporting-protobuf": "^4.1.1", + "@apollo/utils.fetcher": "^2.0.0", + "@apollo/utils.keyvaluecache": "^2.1.0", + "@apollo/utils.logger": "^2.0.0" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/server/node_modules/@types/express": { + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.23.tgz", + "integrity": "sha512-Crp6WY9aTYP3qPi2wGDo9iUe/rceX01UMhnF1jmwDcKCFM6cx7YhGP/Mpr3y9AASpfHixIG0E6azCcL5OcDHsQ==", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@apollo/server/node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@apollo/server/node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/@apollo/server/node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@apollo/server/node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@apollo/server/node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/@apollo/server/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/@apollo/server/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/@apollo/server/node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@apollo/server/node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@apollo/server/node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@apollo/server/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@apollo/server/node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@apollo/server/node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@apollo/server/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@apollo/server/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@apollo/server/node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@apollo/server/node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/@apollo/server/node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@apollo/server/node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@apollo/server/node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/@apollo/server/node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@apollo/server/node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/@apollo/server/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/@apollo/server/node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@apollo/usage-reporting-protobuf": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.1.1.tgz", + "integrity": "sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==", + "license": "MIT", + "dependencies": { + "@apollo/protobufjs": "1.2.7" + } + }, + "node_modules/@apollo/utils.createhash": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@apollo/utils.createhash/-/utils.createhash-2.0.2.tgz", + "integrity": "sha512-UkS3xqnVFLZ3JFpEmU/2cM2iKJotQXMoSTgxXsfQgXLC5gR1WaepoXagmYnPSA7Q/2cmnyTYK5OgAgoC4RULPg==", + "license": "MIT", + "dependencies": { + "@apollo/utils.isnodelike": "^2.0.1", + "sha.js": "^2.4.11" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.dropunuseddefinitions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.dropunuseddefinitions/-/utils.dropunuseddefinitions-2.0.1.tgz", + "integrity": "sha512-EsPIBqsSt2BwDsv8Wu76LK5R1KtsVkNoO4b0M5aK0hx+dGg9xJXuqlr7Fo34Dl+y83jmzn+UvEW+t1/GP2melA==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.fetcher": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.fetcher/-/utils.fetcher-2.0.1.tgz", + "integrity": "sha512-jvvon885hEyWXd4H6zpWeN3tl88QcWnHp5gWF5OPF34uhvoR+DFqcNxs9vrRaBBSY3qda3Qe0bdud7tz2zGx1A==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.isnodelike": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.isnodelike/-/utils.isnodelike-2.0.1.tgz", + "integrity": "sha512-w41XyepR+jBEuVpoRM715N2ZD0xMD413UiJx8w5xnAZD2ZkSJnMJBoIzauK83kJpSgNuR6ywbV29jG9NmxjK0Q==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.keyvaluecache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-2.1.1.tgz", + "integrity": "sha512-qVo5PvUUMD8oB9oYvq4ViCjYAMWnZ5zZwEjNF37L2m1u528x5mueMlU+Cr1UinupCgdB78g+egA1G98rbJ03Vw==", + "license": "MIT", + "dependencies": { + "@apollo/utils.logger": "^2.0.1", + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.logger": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-2.0.1.tgz", + "integrity": "sha512-YuplwLHaHf1oviidB7MxnCXAdHp3IqYV8n0momZ3JfLniae92eYqMIx+j5qJFX6WKJPs6q7bczmV4lXIsTu5Pg==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.printwithreducedwhitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.printwithreducedwhitespace/-/utils.printwithreducedwhitespace-2.0.1.tgz", + "integrity": "sha512-9M4LUXV/fQBh8vZWlLvb/HyyhjJ77/I5ZKu+NBWV/BmYGyRmoEP9EVAy7LCVoY3t8BDcyCAGfxJaLFCSuQkPUg==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.removealiases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.removealiases/-/utils.removealiases-2.0.1.tgz", + "integrity": "sha512-0joRc2HBO4u594Op1nev+mUF6yRnxoUH64xw8x3bX7n8QBDYdeYgY4tF0vJReTy+zdn2xv6fMsquATSgC722FA==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.sortast": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.sortast/-/utils.sortast-2.0.1.tgz", + "integrity": "sha512-eciIavsWpJ09za1pn37wpsCGrQNXUhM0TktnZmHwO+Zy9O4fu/WdB4+5BvVhFiZYOXvfjzJUcc+hsIV8RUOtMw==", + "license": "MIT", + "dependencies": { + "lodash.sortby": "^4.7.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.stripsensitiveliterals": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.stripsensitiveliterals/-/utils.stripsensitiveliterals-2.0.1.tgz", + "integrity": "sha512-QJs7HtzXS/JIPMKWimFnUMK7VjkGQTzqD9bKD1h3iuPAqLsxd0mUNVbkYOPTsDhUKgcvUOfOqOJWYohAKMvcSA==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.usagereporting": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.usagereporting/-/utils.usagereporting-2.1.0.tgz", + "integrity": "sha512-LPSlBrn+S17oBy5eWkrRSGb98sWmnEzo3DPTZgp8IQc8sJe0prDgDuppGq4NeQlpoqEHz0hQeYHAOA0Z3aQsxQ==", + "license": "MIT", + "dependencies": { + "@apollo/usage-reporting-protobuf": "^4.1.0", + "@apollo/utils.dropunuseddefinitions": "^2.0.1", + "@apollo/utils.printwithreducedwhitespace": "^2.0.1", + "@apollo/utils.removealiases": "2.0.1", + "@apollo/utils.sortast": "^2.0.1", + "@apollo/utils.stripsensitiveliterals": "^2.0.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.withrequired": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.withrequired/-/utils.withrequired-2.0.1.tgz", + "integrity": "sha512-YBDiuAX9i1lLc6GeTy1m7DGLFn/gMnvXqlalOIMjM7DeOgIacEjjfwPqb0M1CQ2v11HhR15d1NmxJoRCfrNqcA==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@as-integrations/express5": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@as-integrations/express5/-/express5-1.1.1.tgz", + "integrity": "sha512-bOXlKomcbLhezrcuy8zKFhYwe6EItVIomOJExtiwkzPW6tYm4f886zeMx8CI+r548L8QLuyzfQPio8ZFEmHXxQ==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@apollo/server": "^4.0.0 || 5.0.0-rc.0", + "express": "^5.0.0" + } + }, + "node_modules/@as-integrations/next": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@as-integrations/next/-/next-3.2.0.tgz", + "integrity": "sha512-JTVtRwHdOQTixIacmvfdUukSqNytEHfgvg+K9P8cW7JeF4SCPXat+i9abSII3/cbR6/GQwFZ6gq+c4R0nmSzMg==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@apollo/server": "^4.0.0", + "next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0" + } + }, + "node_modules/@aws-crypto/crc32": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-5.2.0.tgz", + "integrity": "sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-crypto/crc32c": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32c/-/crc32c-5.2.0.tgz", + "integrity": "sha512-+iWb8qaHLYKrNvGRbiYRHSdKRWhto5XlZUEBwDjYNf+ly5SVYG6zEoYIdxvf5R3zyeP16w4PLBn3rH1xc74Rag==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/sha1-browser": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha1-browser/-/sha1-browser-5.2.0.tgz", + "integrity": "sha512-OH6lveCFfcDjX4dbAvCFSYUjJZjDr/3XJ3xHtjn3Oj5b9RjojQo8npoLeA/bNwkOkrSQ0wgrHzXk4tDRxGKJeg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha1-browser/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", + "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-js": "^5.2.0", + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", + "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", + "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", + "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-s3": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.846.0.tgz", + "integrity": "sha512-+C9qRJ7SFN+Bi2DJqfJ73Aj4ORpic9Jk5boosiOZj+TZi6qYHW6TCUqxheiC6JT/0xtE5C7VFIhW/UP/CAh0Tw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha1-browser": "5.2.0", + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.846.0", + "@aws-sdk/credential-provider-node": "3.846.0", + "@aws-sdk/middleware-bucket-endpoint": "3.840.0", + "@aws-sdk/middleware-expect-continue": "3.840.0", + "@aws-sdk/middleware-flexible-checksums": "3.846.0", + "@aws-sdk/middleware-host-header": "3.840.0", + "@aws-sdk/middleware-location-constraint": "3.840.0", + "@aws-sdk/middleware-logger": "3.840.0", + "@aws-sdk/middleware-recursion-detection": "3.840.0", + "@aws-sdk/middleware-sdk-s3": "3.846.0", + "@aws-sdk/middleware-ssec": "3.840.0", + "@aws-sdk/middleware-user-agent": "3.846.0", + "@aws-sdk/region-config-resolver": "3.840.0", + "@aws-sdk/signature-v4-multi-region": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@aws-sdk/util-endpoints": "3.845.0", + "@aws-sdk/util-user-agent-browser": "3.840.0", + "@aws-sdk/util-user-agent-node": "3.846.0", + "@aws-sdk/xml-builder": "3.821.0", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.7.0", + "@smithy/eventstream-serde-browser": "^4.0.4", + "@smithy/eventstream-serde-config-resolver": "^4.1.2", + "@smithy/eventstream-serde-node": "^4.0.4", + "@smithy/fetch-http-handler": "^5.1.0", + "@smithy/hash-blob-browser": "^4.0.4", + "@smithy/hash-node": "^4.0.4", + "@smithy/hash-stream-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/md5-js": "^4.0.4", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.15", + "@smithy/middleware-retry": "^4.1.16", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.1.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/smithy-client": "^4.4.7", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.23", + "@smithy/util-defaults-mode-node": "^4.0.23", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.6", + "@smithy/util-stream": "^4.2.3", + "@smithy/util-utf8": "^4.0.0", + "@smithy/util-waiter": "^4.0.6", + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.846.0.tgz", + "integrity": "sha512-7MgMl3nlwf2ixad5Xe8pFHtcwFchkx37MEvGuB00tn5jyBp3AQQ4dK3iHtj2HjhXcXD0G67zVPvH4/QNOL7/gw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.846.0", + "@aws-sdk/middleware-host-header": "3.840.0", + "@aws-sdk/middleware-logger": "3.840.0", + "@aws-sdk/middleware-recursion-detection": "3.840.0", + "@aws-sdk/middleware-user-agent": "3.846.0", + "@aws-sdk/region-config-resolver": "3.840.0", + "@aws-sdk/types": "3.840.0", + "@aws-sdk/util-endpoints": "3.845.0", + "@aws-sdk/util-user-agent-browser": "3.840.0", + "@aws-sdk/util-user-agent-node": "3.846.0", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.7.0", + "@smithy/fetch-http-handler": "^5.1.0", + "@smithy/hash-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.15", + "@smithy/middleware-retry": "^4.1.16", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.1.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/smithy-client": "^4.4.7", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.23", + "@smithy/util-defaults-mode-node": "^4.0.23", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.6", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/core": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.846.0.tgz", + "integrity": "sha512-7CX0pM906r4WSS68fCTNMTtBCSkTtf3Wggssmx13gD40gcWEZXsU00KzPp1bYheNRyPlAq3rE22xt4wLPXbuxA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@aws-sdk/xml-builder": "3.821.0", + "@smithy/core": "^3.7.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/property-provider": "^4.0.4", + "@smithy/protocol-http": "^5.1.2", + "@smithy/signature-v4": "^5.1.2", + "@smithy/smithy-client": "^4.4.7", + "@smithy/types": "^4.3.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-utf8": "^4.0.0", + "fast-xml-parser": "5.2.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.846.0.tgz", + "integrity": "sha512-QuCQZET9enja7AWVISY+mpFrEIeHzvkx/JEEbHYzHhUkxcnC2Kq2c0bB7hDihGD0AZd3Xsm653hk1O97qu69zg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/property-provider": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.846.0.tgz", + "integrity": "sha512-Jh1iKUuepdmtreMYozV2ePsPcOF5W9p3U4tWhi3v6nDvz0GsBjzjAROW+BW8XMz9vAD3I9R+8VC3/aq63p5nlw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/fetch-http-handler": "^5.1.0", + "@smithy/node-http-handler": "^4.1.0", + "@smithy/property-provider": "^4.0.4", + "@smithy/protocol-http": "^5.1.2", + "@smithy/smithy-client": "^4.4.7", + "@smithy/types": "^4.3.1", + "@smithy/util-stream": "^4.2.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.846.0.tgz", + "integrity": "sha512-GUxaBBKsYx1kOlRbcs77l6BVyG9K70zekJX+5hdwTEgJq7AoHl/XYoWiDxPf6zQ7J4euixPJoyRhpNbJjAXdFw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.846.0", + "@aws-sdk/credential-provider-env": "3.846.0", + "@aws-sdk/credential-provider-http": "3.846.0", + "@aws-sdk/credential-provider-process": "3.846.0", + "@aws-sdk/credential-provider-sso": "3.846.0", + "@aws-sdk/credential-provider-web-identity": "3.846.0", + "@aws-sdk/nested-clients": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/credential-provider-imds": "^4.0.6", + "@smithy/property-provider": "^4.0.4", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.846.0.tgz", + "integrity": "sha512-du2DsXYRfQ8VIt/gXGThhT8KdUEt2j9W91W87Bl9IA5DINt4nSZv+gzh8LqHBYsTSqoUpKb+qIfP1RjZM/8r0A==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.846.0", + "@aws-sdk/credential-provider-http": "3.846.0", + "@aws-sdk/credential-provider-ini": "3.846.0", + "@aws-sdk/credential-provider-process": "3.846.0", + "@aws-sdk/credential-provider-sso": "3.846.0", + "@aws-sdk/credential-provider-web-identity": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/credential-provider-imds": "^4.0.6", + "@smithy/property-provider": "^4.0.4", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.846.0.tgz", + "integrity": "sha512-mEpwDYarJSH+CIXnnHN0QOe0MXI+HuPStD6gsv3z/7Q6ESl8KRWon3weFZCDnqpiJMUVavlDR0PPlAFg2MQoPg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/property-provider": "^4.0.4", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.846.0.tgz", + "integrity": "sha512-Dxz9dpdjfxUsSfW92SAldu9wy8wgEbskn4BNWBFHslQHTmqurmR0ci4P1SMxJJKd498AUEoIAzZOtjGOC38irQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.846.0", + "@aws-sdk/core": "3.846.0", + "@aws-sdk/token-providers": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/property-provider": "^4.0.4", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.846.0.tgz", + "integrity": "sha512-j6zOd+kynPQJzmVwSKSUTpsLXAf7vKkr7hCPbQyqC8ZqkIuExsRqu2vRQjX2iH/MKhwZ+qEWMxPMhfDoyv7Gag==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.846.0", + "@aws-sdk/nested-clients": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/property-provider": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-bucket-endpoint": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.840.0.tgz", + "integrity": "sha512-+gkQNtPwcSMmlwBHFd4saVVS11In6ID1HczNzpM3MXKXRBfSlbZJbCt6wN//AZ8HMklZEik4tcEOG0qa9UY8SQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@aws-sdk/util-arn-parser": "3.804.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-config-provider": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-expect-continue": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.840.0.tgz", + "integrity": "sha512-iJg2r6FKsKKvdiU4oCOuCf7Ro/YE0Q2BT/QyEZN3/Rt8Nr4SAZiQOlcBXOCpGvuIKOEAhvDOUnW3aDHL01PdVw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-flexible-checksums": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.846.0.tgz", + "integrity": "sha512-CdkeVfkwt3+bDLhmOwBxvkUf6oY9iUhvosaUnqkoPsOqIiUEN54yTGOnO8A0wLz6mMsZ6aBlfFrQhFnxt3c+yw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@aws-crypto/crc32c": "5.2.0", + "@aws-crypto/util": "5.2.0", + "@aws-sdk/core": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-stream": "^4.2.3", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.840.0.tgz", + "integrity": "sha512-ub+hXJAbAje94+Ya6c6eL7sYujoE8D4Bumu1NUI8TXjUhVVn0HzVWQjpRLshdLsUp1AW7XyeJaxyajRaJQ8+Xg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-location-constraint": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.840.0.tgz", + "integrity": "sha512-KVLD0u0YMF3aQkVF8bdyHAGWSUY6N1Du89htTLgqCcIhSxxAJ9qifrosVZ9jkAzqRW99hcufyt2LylcVU2yoKQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.840.0.tgz", + "integrity": "sha512-lSV8FvjpdllpGaRspywss4CtXV8M7NNNH+2/j86vMH+YCOZ6fu2T/TyFd/tHwZ92vDfHctWkRbQxg0bagqwovA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.840.0.tgz", + "integrity": "sha512-Gu7lGDyfddyhIkj1Z1JtrY5NHb5+x/CRiB87GjaSrKxkDaydtX2CU977JIABtt69l9wLbcGDIQ+W0uJ5xPof7g==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-s3": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.846.0.tgz", + "integrity": "sha512-jP9x+2Q87J5l8FOP+jlAd7vGLn0cC6G9QGmf386e5OslBPqxXKcl3RjqGLIOKKos2mVItY3ApP5xdXQx7jGTVA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@aws-sdk/util-arn-parser": "3.804.0", + "@smithy/core": "^3.7.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/protocol-http": "^5.1.2", + "@smithy/signature-v4": "^5.1.2", + "@smithy/smithy-client": "^4.4.7", + "@smithy/types": "^4.3.1", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-stream": "^4.2.3", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-ssec": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.840.0.tgz", + "integrity": "sha512-CBZP9t1QbjDFGOrtnUEHL1oAvmnCUUm7p0aPNbIdSzNtH42TNKjPRN3TuEIJDGjkrqpL3MXyDSmNayDcw/XW7Q==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.846.0.tgz", + "integrity": "sha512-85/oUc2jMXqQWo+HHH7WwrdqqArzhMmTmBCpXZwklBHG+ZMzTS5Wug2B0HhGDVWo9aYRMeikSq4lsrpHFVd2MQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@aws-sdk/util-endpoints": "3.845.0", + "@smithy/core": "^3.7.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.846.0.tgz", + "integrity": "sha512-LCXPVtNQnkTuE8inPCtpfWN2raE/ndFBKf5OIbuHnC/0XYGOUl5q7VsJz471zJuN9FX3WMfopaFwmNc7cQNMpQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.846.0", + "@aws-sdk/middleware-host-header": "3.840.0", + "@aws-sdk/middleware-logger": "3.840.0", + "@aws-sdk/middleware-recursion-detection": "3.840.0", + "@aws-sdk/middleware-user-agent": "3.846.0", + "@aws-sdk/region-config-resolver": "3.840.0", + "@aws-sdk/types": "3.840.0", + "@aws-sdk/util-endpoints": "3.845.0", + "@aws-sdk/util-user-agent-browser": "3.840.0", + "@aws-sdk/util-user-agent-node": "3.846.0", + "@smithy/config-resolver": "^4.1.4", + "@smithy/core": "^3.7.0", + "@smithy/fetch-http-handler": "^5.1.0", + "@smithy/hash-node": "^4.0.4", + "@smithy/invalid-dependency": "^4.0.4", + "@smithy/middleware-content-length": "^4.0.4", + "@smithy/middleware-endpoint": "^4.1.15", + "@smithy/middleware-retry": "^4.1.16", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/node-http-handler": "^4.1.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/smithy-client": "^4.4.7", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-body-length-node": "^4.0.0", + "@smithy/util-defaults-mode-browser": "^4.0.23", + "@smithy/util-defaults-mode-node": "^4.0.23", + "@smithy/util-endpoints": "^3.0.6", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.6", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.840.0.tgz", + "integrity": "sha512-Qjnxd/yDv9KpIMWr90ZDPtRj0v75AqGC92Lm9+oHXZ8p1MjG5JE2CW0HL8JRgK9iKzgKBL7pPQRXI8FkvEVfrA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/types": "^4.3.1", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/signature-v4-multi-region": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.846.0.tgz", + "integrity": "sha512-ZMfIMxUljqZzPJGOcraC6erwq/z1puNMU35cO1a/WdhB+LdYknMn1lr7SJuH754QwNzzIlZbEgg4hoHw50+DpQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-sdk-s3": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/signature-v4": "^5.1.2", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.846.0.tgz", + "integrity": "sha512-sGNk3xclK7xx+rIJZDJC4FNFqaSSqN0nSr+AdVdQ+/iKQKaUA6hixRbXaQ7I7M5mhqS6fMW1AsqVRywQq2BSMw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.846.0", + "@aws-sdk/nested-clients": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/property-provider": "^4.0.4", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.840.0.tgz", + "integrity": "sha512-xliuHaUFZxEx1NSXeLLZ9Dyu6+EJVQKEoD+yM+zqUo3YDZ7medKJWY6fIOKiPX/N7XbLdBYwajb15Q7IL8KkeA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-arn-parser": { + "version": "3.804.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.804.0.tgz", + "integrity": "sha512-wmBJqn1DRXnZu3b4EkE6CWnoWMo1ZMvlfkqU5zPz67xx1GMaXlDCchFvKAXMjk4jn/L1O3tKnoFDNsoLV1kgNQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.845.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.845.0.tgz", + "integrity": "sha512-MBmOf0Pb4q6xs9V7jXT1+qciW2965yvaoZUlUUnxUEoX6zxWROeIu/gttASc4vSjOHr/+64hmFkxjeBUF37FJA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-endpoints": "^3.0.6", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.804.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.804.0.tgz", + "integrity": "sha512-zVoRfpmBVPodYlnMjgVjfGoEZagyRF5IPn3Uo6ZvOZp24chnW/FRstH7ESDHDDRga4z3V+ElUQHKpFDXWyBW5A==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.840.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.840.0.tgz", + "integrity": "sha512-JdyZM3EhhL4PqwFpttZu1afDpPJCCc3eyZOLi+srpX11LsGj6sThf47TYQN75HT1CarZ7cCdQHGzP2uy3/xHfQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.840.0", + "@smithy/types": "^4.3.1", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.846.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.846.0.tgz", + "integrity": "sha512-MXYXCplw76xe8A9ejVaIru6Carum/2LQbVtNHsIa4h0TlafLdfulywsoMWL1F53Y9XxQSeOKyyqDKLNOgRVimw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.846.0", + "@aws-sdk/types": "3.840.0", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/xml-builder": { + "version": "3.821.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.821.0.tgz", + "integrity": "sha512-DIIotRnefVL6DiaHtO6/21DhJ4JZnnIwdNbpwiAhdt/AVbttcE4yw925gsjur0OGv5BTYXQXU3YnANBYnZjuQA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@babel/runtime-corejs3": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.28.0.tgz", + "integrity": "sha512-nlIXnSqLcBij8K8TtkxbBJgfzfvi75V1pAKSM7dUXejGw12vJAqez74jZrHTsJ3Z+Aczc5Q/6JgNjKRMsVU44g==", + "license": "MIT", + "dependencies": { + "core-js-pure": "^3.43.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@emnapi/core": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.4.4.tgz", @@ -225,6 +1770,94 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@floating-ui/core": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.2.tgz", + "integrity": "sha512-wNB5ooIKHQc+Kui96jE/n69rHFWAVoxn5CAzL1Xdd8FG03cgY3MLO+GF9U3W737fYDSgPWA6MReKhBQBop6Pcw==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.2.tgz", + "integrity": "sha512-7cfaOQuCS27HD7DX+6ib2OrnW+b4ZBwDNnCcT0uTyidcmyWb03FnQqJybDBoCnpdxwBSfA94UAYlRCt7mV+TbA==", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.7.2", + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.4.tgz", + "integrity": "sha512-JbbpPhp38UmXDDAu60RJmbeme37Jbgsm7NrHGgzYYFKmblzRUh6Pa641dII6LsjwF4XlScDrde2UAzDo/b9KPw==", + "license": "MIT", + "dependencies": { + "@floating-ui/dom": "^1.7.2" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.10.tgz", + "integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==", + "license": "MIT" + }, + "node_modules/@graphql-tools/merge": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz", + "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==", + "license": "MIT", + "dependencies": { + "@graphql-tools/utils": "^9.2.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@graphql-tools/schema": { + "version": "9.0.19", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz", + "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==", + "license": "MIT", + "dependencies": { + "@graphql-tools/merge": "^8.4.1", + "@graphql-tools/utils": "^9.2.1", + "tslib": "^2.4.0", + "value-or-promise": "^1.0.12" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@graphql-tools/utils": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", + "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", + "license": "MIT", + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@graphql-typed-document-node/core": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", + "license": "MIT", + "peerDependencies": { + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -966,6 +2599,970 @@ "node": ">=12.4.0" } }, + "node_modules/@prisma/client": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.12.0.tgz", + "integrity": "sha512-wn98bJ3Cj6edlF4jjpgXwbnQIo/fQLqqQHPk2POrZPxTlhY3+n90SSIF3LMRVa8VzRFC/Gec3YKJRxRu+AIGVA==", + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "prisma": "*", + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/@prisma/config": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.12.0.tgz", + "integrity": "sha512-HovZWzhWEMedHxmjefQBRZa40P81N7/+74khKFz9e1AFjakcIQdXgMWKgt20HaACzY+d1LRBC+L4tiz71t9fkg==", + "license": "Apache-2.0", + "dependencies": { + "jiti": "2.4.2" + } + }, + "node_modules/@prisma/debug": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.12.0.tgz", + "integrity": "sha512-plbz6z72orcqr0eeio7zgUrZj5EudZUpAeWkFTA/DDdXEj28YHDXuiakvR6S7sD6tZi+jiwQEJAPeV6J6m/tEQ==", + "license": "Apache-2.0" + }, + "node_modules/@prisma/engines": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.12.0.tgz", + "integrity": "sha512-4BRZZUaAuB4p0XhTauxelvFs7IllhPmNLvmla0bO1nkECs8n/o1pUvAVbQ/VOrZR5DnF4HED0PrGai+rIOVePA==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.12.0", + "@prisma/engines-version": "6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc", + "@prisma/fetch-engine": "6.12.0", + "@prisma/get-platform": "6.12.0" + } + }, + "node_modules/@prisma/engines-version": { + "version": "6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc.tgz", + "integrity": "sha512-70vhecxBJlRr06VfahDzk9ow4k1HIaSfVUT3X0/kZoHCMl9zbabut4gEXAyzJZxaCGi5igAA7SyyfBI//mmkbQ==", + "license": "Apache-2.0" + }, + "node_modules/@prisma/fetch-engine": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.12.0.tgz", + "integrity": "sha512-EamoiwrK46rpWaEbLX9aqKDPOd8IyLnZAkiYXFNuq0YsU0Z8K09/rH8S7feOWAVJ3xzeSgcEJtBlVDrajM9Sag==", + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.12.0", + "@prisma/engines-version": "6.12.0-15.8047c96bbd92db98a2abc7c9323ce77c02c89dbc", + "@prisma/get-platform": "6.12.0" + } + }, + "node_modules/@prisma/get-platform": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.12.0.tgz", + "integrity": "sha512-nRerTGhTlgyvcBlyWgt8OLNIV7QgJS2XYXMJD1hysorMCuLAjuDDuoxmVt7C2nLxbuxbWPp7OuFRHC23HqD9dA==", + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.12.0" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, + "node_modules/@radix-ui/number": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.1.tgz", + "integrity": "sha512-MkKCwxlXTgz6CFoJx3pCwn07GKp36+aZyu/u2Ln2VrA5DcdyCZkASEDBTd8x5whTQQL5CiYf4prXKLcgQdv29g==", + "license": "MIT" + }, + "node_modules/@radix-ui/primitive": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.2.tgz", + "integrity": "sha512-XnbHrrprsNqZKQhStrSwgRUQzoCI1glLzdw79xiZPoofhGICeZRSQ3dIxAKH1gb3OHfNf4d6f+vAv3kil2eggA==", + "license": "MIT" + }, + "node_modules/@radix-ui/react-arrow": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.7.tgz", + "integrity": "sha512-F+M1tLhO+mlQaOWspE8Wstg+z6PwxwRd8oQ8IXceWz92kfAmalTRf0EjrouQeo7QssEPfCn05B4Ihs1K9WQ/7w==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-avatar": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.1.10.tgz", + "integrity": "sha512-V8piFfWapM5OmNCXTzVQY+E1rDa53zY+MQ4Y7356v4fFz6vqCyUtIz2rUD44ZEdwg78/jKmMJHj07+C/Z/rcog==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-is-hydrated": "0.1.0", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-checkbox": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.3.2.tgz", + "integrity": "sha512-yd+dI56KZqawxKZrJ31eENUwqc1QSqg4OZ15rybGjF2ZNwMO+wCyHzAVLRp9qoYJf7kYy0YpZ2b0JCzJ42HZpA==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.2", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-presence": "1.1.4", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-controllable-state": "1.2.2", + "@radix-ui/react-use-previous": "1.1.1", + "@radix-ui/react-use-size": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-collection": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.7.tgz", + "integrity": "sha512-Fh9rGN0MoI4ZFUNyfFVNU4y9LUz93u9/0K+yLgA2bwRojxM8JU1DyvvMBabnZPBgMWREAJvU2jjVzq+LrFUglw==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-slot": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-compose-refs": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz", + "integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-context": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.2.tgz", + "integrity": "sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dialog": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.14.tgz", + "integrity": "sha512-+CpweKjqpzTmwRwcYECQcNYbI8V9VSQt0SNFKeEBLgfucbsLssU6Ppq7wUdNXEGb573bMjFhVjKVll8rmV6zMw==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.2", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-dismissable-layer": "1.1.10", + "@radix-ui/react-focus-guards": "1.1.2", + "@radix-ui/react-focus-scope": "1.1.7", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-portal": "1.1.9", + "@radix-ui/react-presence": "1.1.4", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-slot": "1.2.3", + "@radix-ui/react-use-controllable-state": "1.2.2", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.6.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-direction": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.1.tgz", + "integrity": "sha512-1UEWRX6jnOA2y4H5WczZ44gOOjTEmlqv1uNW4GAJEO5+bauCBhv8snY65Iw5/VOS/ghKN9gr2KjnLKxrsvoMVw==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.10.tgz", + "integrity": "sha512-IM1zzRV4W3HtVgftdQiiOmA0AdJlCtMLe00FXaHwgt3rAnNsIyDqshvkIW3hj/iu5hu8ERP7KIYki6NkqDxAwQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.2", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-escape-keydown": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-focus-guards": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.2.tgz", + "integrity": "sha512-fyjAACV62oPV925xFCrH8DR5xWhg9KYtJT4s3u54jxp+L/hbpTY2kIeEFFbFe+a/HCE94zGQMZLIpVTPVZDhaA==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-focus-scope": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.7.tgz", + "integrity": "sha512-t2ODlkXBQyn7jkl6TNaw/MtVEVvIGelJDCG41Okq/KwUsJBwQ4XVZsHAVUkK4mBv3ewiAS3PGuUWuY2BoK4ZUw==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-id": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.1.tgz", + "integrity": "sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-label": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.7.tgz", + "integrity": "sha512-YT1GqPSL8kJn20djelMX7/cTRp/Y9w5IZHvfxQTVHrOqa2yMl7i/UfMqKRU5V7mEyKTrUVgJXhNQPVCG8PBLoQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-popper": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.7.tgz", + "integrity": "sha512-IUFAccz1JyKcf/RjB552PlWwxjeCJB8/4KxT7EhBHOJM+mN7LdW+B3kacJXILm32xawcMMjb2i0cIZpo+f9kiQ==", + "license": "MIT", + "dependencies": { + "@floating-ui/react-dom": "^2.0.0", + "@radix-ui/react-arrow": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-layout-effect": "1.1.1", + "@radix-ui/react-use-rect": "1.1.1", + "@radix-ui/react-use-size": "1.1.1", + "@radix-ui/rect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-portal": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.9.tgz", + "integrity": "sha512-bpIxvq03if6UNwXZ+HTK71JLh4APvnXntDc6XOX8UVq4XQOVl7lwok0AvIl+b8zgCw3fSaVTZMpAPPagXbKmHQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-presence": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.4.tgz", + "integrity": "sha512-ueDqRbdc4/bkaQT3GIpLQssRlFgWaL/U2z/S31qRwwLWoxHLgry3SIfCwhxeQNbirEUXFa+lq3RL3oBYXtcmIA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-primitive": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz", + "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-slot": "1.2.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-progress": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.1.7.tgz", + "integrity": "sha512-vPdg/tF6YC/ynuBIJlk1mm7Le0VgW6ub6J2UWnTQ7/D23KXcPI1qy+0vBkgKgd38RCMJavBXpB83HPNFMTb0Fg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-roving-focus": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.10.tgz", + "integrity": "sha512-dT9aOXUen9JSsxnMPv/0VqySQf5eDQ6LCk5Sw28kamz8wSOW2bJdlX2Bg5VUIIcV+6XlHpWTIuTPCf/UNIyq8Q==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.2", + "@radix-ui/react-collection": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-controllable-state": "1.2.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-select": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.2.5.tgz", + "integrity": "sha512-HnMTdXEVuuyzx63ME0ut4+sEMYW6oouHWNGUZc7ddvUWIcfCva/AMoqEW/3wnEllriMWBa0RHspCYnfCWJQYmA==", + "license": "MIT", + "dependencies": { + "@radix-ui/number": "1.1.1", + "@radix-ui/primitive": "1.1.2", + "@radix-ui/react-collection": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-dismissable-layer": "1.1.10", + "@radix-ui/react-focus-guards": "1.1.2", + "@radix-ui/react-focus-scope": "1.1.7", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-popper": "1.2.7", + "@radix-ui/react-portal": "1.1.9", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-slot": "1.2.3", + "@radix-ui/react-use-callback-ref": "1.1.1", + "@radix-ui/react-use-controllable-state": "1.2.2", + "@radix-ui/react-use-layout-effect": "1.1.1", + "@radix-ui/react-use-previous": "1.1.1", + "@radix-ui/react-visually-hidden": "1.2.3", + "aria-hidden": "^1.2.4", + "react-remove-scroll": "^2.6.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-separator": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.7.tgz", + "integrity": "sha512-0HEb8R9E8A+jZjvmFCy/J4xhbXy3TV+9XSnGJ3KvTtjlIUy/YQ/p6UYZvi7YbeoeXdyU9+Y3scizK6hkY37baA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-slider": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slider/-/react-slider-1.3.5.tgz", + "integrity": "sha512-rkfe2pU2NBAYfGaxa3Mqosi7VZEWX5CxKaanRv0vZd4Zhl9fvQrg0VM93dv3xGLGfrHuoTRF3JXH8nb9g+B3fw==", + "license": "MIT", + "dependencies": { + "@radix-ui/number": "1.1.1", + "@radix-ui/primitive": "1.1.2", + "@radix-ui/react-collection": "1.1.7", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-controllable-state": "1.2.2", + "@radix-ui/react-use-layout-effect": "1.1.1", + "@radix-ui/react-use-previous": "1.1.1", + "@radix-ui/react-use-size": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-slot": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz", + "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.2" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-switch": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.2.5.tgz", + "integrity": "sha512-5ijLkak6ZMylXsaImpZ8u4Rlf5grRmoc0p0QeX9VJtlrM4f5m3nCTX8tWga/zOA8PZYIR/t0p2Mnvd7InrJ6yQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.2", + "@radix-ui/react-compose-refs": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-use-controllable-state": "1.2.2", + "@radix-ui/react-use-previous": "1.1.1", + "@radix-ui/react-use-size": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-tabs": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.12.tgz", + "integrity": "sha512-GTVAlRVrQrSw3cEARM0nAx73ixrWDPNZAruETn3oHCNP6SbZ/hNxdxp+u7VkIEv3/sFoLq1PfcHrl7Pnp0CDpw==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.1.2", + "@radix-ui/react-context": "1.1.2", + "@radix-ui/react-direction": "1.1.1", + "@radix-ui/react-id": "1.1.1", + "@radix-ui/react-presence": "1.1.4", + "@radix-ui/react-primitive": "2.1.3", + "@radix-ui/react-roving-focus": "1.1.10", + "@radix-ui/react-use-controllable-state": "1.2.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-callback-ref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.1.tgz", + "integrity": "sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.2.tgz", + "integrity": "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-effect-event": "0.0.2", + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-effect-event": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.2.tgz", + "integrity": "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-escape-keydown": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.1.tgz", + "integrity": "sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-callback-ref": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-is-hydrated": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.0.tgz", + "integrity": "sha512-U+UORVEq+cTnRIaostJv9AGdV3G6Y+zbVd+12e18jQ5A3c0xL03IhnHuiU4UV69wolOQp5GfR58NW/EgdQhwOA==", + "license": "MIT", + "dependencies": { + "use-sync-external-store": "^1.5.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-layout-effect": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz", + "integrity": "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-previous": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.1.tgz", + "integrity": "sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-rect": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.1.tgz", + "integrity": "sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w==", + "license": "MIT", + "dependencies": { + "@radix-ui/rect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-use-size": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.1.tgz", + "integrity": "sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-visually-hidden": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.3.tgz", + "integrity": "sha512-pzJq12tEaaIhqjbzpCuv/OypJY/BPavOofm+dbab+MHLajy277+1lLm6JFcGgF5eskJ6mquGirhXY2GD/8u8Ug==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-primitive": "2.1.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/rect": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.1.tgz", + "integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==", + "license": "MIT" + }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", @@ -980,6 +3577,725 @@ "dev": true, "license": "MIT" }, + "node_modules/@smithy/abort-controller": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.4.tgz", + "integrity": "sha512-gJnEjZMvigPDQWHrW3oPrFhQtkrgqBkyjj3pCIdF3A5M6vsZODG93KNlfJprv6bp4245bdT32fsHK4kkH3KYDA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/chunked-blob-reader": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-5.0.0.tgz", + "integrity": "sha512-+sKqDBQqb036hh4NPaUiEkYFkTUGYzRsn3EuFhyfQfMy6oGHEUJDurLP9Ufb5dasr/XiAmPNMr6wa9afjQB+Gw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/chunked-blob-reader-native": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-4.0.0.tgz", + "integrity": "sha512-R9wM2yPmfEMsUmlMlIgSzOyICs0x9uu7UTHoccMyt7BWw8shcGM8HqB355+BZCPBcySvbTYMs62EgEQkNxz2ig==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-base64": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/config-resolver": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.1.4.tgz", + "integrity": "sha512-prmU+rDddxHOH0oNcwemL+SwnzcG65sBF2yXRO7aeXIn/xTlq2pX7JLVbkBnVLowHLg4/OL4+jBmv9hVrVGS+w==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.1.3", + "@smithy/types": "^4.3.1", + "@smithy/util-config-provider": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/core": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.7.0.tgz", + "integrity": "sha512-7ov8hu/4j0uPZv8b27oeOFtIBtlFmM3ibrPv/Omx1uUdoXvcpJ00U+H/OWWC/keAguLlcqwtyL2/jTlSnApgNQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/middleware-serde": "^4.0.8", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-body-length-browser": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-stream": "^4.2.3", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/credential-provider-imds": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.6.tgz", + "integrity": "sha512-hKMWcANhUiNbCJouYkZ9V3+/Qf9pteR1dnwgdyzR09R4ODEYx8BbUysHwRSyex4rZ9zapddZhLFTnT4ZijR4pw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.1.3", + "@smithy/property-provider": "^4.0.4", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-codec": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-4.0.4.tgz", + "integrity": "sha512-7XoWfZqWb/QoR/rAU4VSi0mWnO2vu9/ltS6JZ5ZSZv0eovLVfDfu0/AX4ub33RsJTOth3TiFWSHS5YdztvFnig==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@smithy/types": "^4.3.1", + "@smithy/util-hex-encoding": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-browser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-4.0.4.tgz", + "integrity": "sha512-3fb/9SYaYqbpy/z/H3yIi0bYKyAa89y6xPmIqwr2vQiUT2St+avRt8UKwsWt9fEdEasc5d/V+QjrviRaX1JRFA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/eventstream-serde-universal": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-4.1.2.tgz", + "integrity": "sha512-JGtambizrWP50xHgbzZI04IWU7LdI0nh/wGbqH3sJesYToMi2j/DcoElqyOcqEIG/D4tNyxgRuaqBXWE3zOFhQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-node": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-4.0.4.tgz", + "integrity": "sha512-RD6UwNZ5zISpOWPuhVgRz60GkSIp0dy1fuZmj4RYmqLVRtejFqQ16WmfYDdoSoAjlp1LX+FnZo+/hkdmyyGZ1w==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/eventstream-serde-universal": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-4.0.4.tgz", + "integrity": "sha512-UeJpOmLGhq1SLox79QWw/0n2PFX+oPRE1ZyRMxPIaFEfCqWaqpB7BU9C8kpPOGEhLF7AwEqfFbtwNxGy4ReENA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/eventstream-codec": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/fetch-http-handler": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.1.0.tgz", + "integrity": "sha512-mADw7MS0bYe2OGKkHYMaqarOXuDwRbO6ArD91XhHcl2ynjGCFF+hvqf0LyQcYxkA1zaWjefSkU7Ne9mqgApSgQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.1.2", + "@smithy/querystring-builder": "^4.0.4", + "@smithy/types": "^4.3.1", + "@smithy/util-base64": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-blob-browser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-4.0.4.tgz", + "integrity": "sha512-WszRiACJiQV3QG6XMV44i5YWlkrlsM5Yxgz4jvsksuu7LDXA6wAtypfPajtNTadzpJy3KyJPoWehYpmZGKUFIQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/chunked-blob-reader": "^5.0.0", + "@smithy/chunked-blob-reader-native": "^4.0.0", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-node": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.4.tgz", + "integrity": "sha512-qnbTPUhCVnCgBp4z4BUJUhOEkVwxiEi1cyFM+Zj6o+aY8OFGxUQleKWq8ltgp3dujuhXojIvJWdoqpm6dVO3lQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-stream-node": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-4.0.4.tgz", + "integrity": "sha512-wHo0d8GXyVmpmMh/qOR0R7Y46/G1y6OR8U+bSTB4ppEzRxd1xVAQ9xOE9hOc0bSjhz0ujCPAbfNLkLrpa6cevg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/invalid-dependency": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.4.tgz", + "integrity": "sha512-bNYMi7WKTJHu0gn26wg8OscncTt1t2b8KcsZxvOv56XA6cyXtOAAAaNP7+m45xfppXfOatXF3Sb1MNsLUgVLTw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/is-array-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", + "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/md5-js": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.0.4.tgz", + "integrity": "sha512-uGLBVqcOwrLvGh/v/jw423yWHq/ofUGK1W31M2TNspLQbUV1Va0F5kTxtirkoHawODAZcjXTSGi7JwbnPcDPJg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-content-length": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.4.tgz", + "integrity": "sha512-F7gDyfI2BB1Kc+4M6rpuOLne5LOcEknH1n6UQB69qv+HucXBR1rkzXBnQTB2q46sFy1PM/zuSJOB532yc8bg3w==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-endpoint": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.1.15.tgz", + "integrity": "sha512-L2M0oz+r6Wv0KZ90MgClXmWkV7G72519Hd5/+K5i3gQMu4WNQykh7ERr58WT3q60dd9NqHSMc3/bAK0FsFg3Fw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.7.0", + "@smithy/middleware-serde": "^4.0.8", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", + "@smithy/url-parser": "^4.0.4", + "@smithy/util-middleware": "^4.0.4", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-retry": { + "version": "4.1.16", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.1.16.tgz", + "integrity": "sha512-PpPhMpC6U1fLW0evKnC8gJtmobBYn0oi4RrIKGhN1a86t6XgVEK+Vb9C8dh5PPXb3YDr8lE6aYKh1hd3OikmWw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.1.3", + "@smithy/protocol-http": "^5.1.2", + "@smithy/service-error-classification": "^4.0.6", + "@smithy/smithy-client": "^4.4.7", + "@smithy/types": "^4.3.1", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-retry": "^4.0.6", + "tslib": "^2.6.2", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-serde": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.8.tgz", + "integrity": "sha512-iSSl7HJoJaGyMIoNn2B7czghOVwJ9nD7TMvLhMWeSB5vt0TnEYyRRqPJu/TqW76WScaNvYYB8nRoiBHR9S1Ddw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-stack": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.4.tgz", + "integrity": "sha512-kagK5ggDrBUCCzI93ft6DjteNSfY8Ulr83UtySog/h09lTIOAJ/xUSObutanlPT0nhoHAkpmW9V5K8oPyLh+QA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/node-config-provider": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.1.3.tgz", + "integrity": "sha512-HGHQr2s59qaU1lrVH6MbLlmOBxadtzTsoO4c+bF5asdgVik3I8o7JIOzoeqWc5MjVa+vD36/LWE0iXKpNqooRw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^4.0.4", + "@smithy/shared-ini-file-loader": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/node-http-handler": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.1.0.tgz", + "integrity": "sha512-vqfSiHz2v8b3TTTrdXi03vNz1KLYYS3bhHCDv36FYDqxT7jvTll1mMnCrkD+gOvgwybuunh/2VmvOMqwBegxEg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^4.0.4", + "@smithy/protocol-http": "^5.1.2", + "@smithy/querystring-builder": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/property-provider": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.4.tgz", + "integrity": "sha512-qHJ2sSgu4FqF4U/5UUp4DhXNmdTrgmoAai6oQiM+c5RZ/sbDwJ12qxB1M6FnP+Tn/ggkPZf9ccn4jqKSINaquw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/protocol-http": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.1.2.tgz", + "integrity": "sha512-rOG5cNLBXovxIrICSBm95dLqzfvxjEmuZx4KK3hWwPFHGdW3lxY0fZNXfv2zebfRO7sJZ5pKJYHScsqopeIWtQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/querystring-builder": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.4.tgz", + "integrity": "sha512-SwREZcDnEYoh9tLNgMbpop+UTGq44Hl9tdj3rf+yeLcfH7+J8OXEBaMc2kDxtyRHu8BhSg9ADEx0gFHvpJgU8w==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "@smithy/util-uri-escape": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/querystring-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.4.tgz", + "integrity": "sha512-6yZf53i/qB8gRHH/l2ZwUG5xgkPgQF15/KxH0DdXMDHjesA9MeZje/853ifkSY0x4m5S+dfDZ+c4x439PF0M2w==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/service-error-classification": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.6.tgz", + "integrity": "sha512-RRoTDL//7xi4tn5FrN2NzH17jbgmnKidUqd4KvquT0954/i6CXXkh1884jBiunq24g9cGtPBEXlU40W6EpNOOg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/shared-ini-file-loader": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.4.tgz", + "integrity": "sha512-63X0260LoFBjrHifPDs+nM9tV0VMkOTl4JRMYNuKh/f5PauSjowTfvF3LogfkWdcPoxsA9UjqEOgjeYIbhb7Nw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/signature-v4": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.1.2.tgz", + "integrity": "sha512-d3+U/VpX7a60seHziWnVZOHuEgJlclufjkS6zhXvxcJgkJq4UWdH5eOBLzHRMx6gXjsdT9h6lfpmLzbrdupHgQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^4.0.0", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-middleware": "^4.0.4", + "@smithy/util-uri-escape": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/smithy-client": { + "version": "4.4.7", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.4.7.tgz", + "integrity": "sha512-x+MxBNOcG7rY9i5QsbdgvvRJngKKvUJrbU5R5bT66PTH3e6htSupJ4Q+kJ3E7t6q854jyl57acjpPi6qG1OY5g==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.7.0", + "@smithy/middleware-endpoint": "^4.1.15", + "@smithy/middleware-stack": "^4.0.4", + "@smithy/protocol-http": "^5.1.2", + "@smithy/types": "^4.3.1", + "@smithy/util-stream": "^4.2.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/types": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.3.1.tgz", + "integrity": "sha512-UqKOQBL2x6+HWl3P+3QqFD4ncKq0I8Nuz9QItGv5WuKuMHuuwlhvqcZCoXGfc+P1QmfJE7VieykoYYmrOoFJxA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/url-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.4.tgz", + "integrity": "sha512-eMkc144MuN7B0TDA4U2fKs+BqczVbk3W+qIvcoCY6D1JY3hnAdCuhCZODC+GAeaxj0p6Jroz4+XMUn3PCxQQeQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/querystring-parser": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-base64": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", + "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-body-length-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", + "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-body-length-node": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", + "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-buffer-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", + "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-config-provider": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", + "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.0.23", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.23.tgz", + "integrity": "sha512-NqRi6VvEIwpJ+KSdqI85+HH46H7uVoNqVTs2QO7p1YKnS7k8VZnunJj8R5KdmmVnTojkaL1OMPyZC8uR5F7fSg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^4.0.4", + "@smithy/smithy-client": "^4.4.7", + "@smithy/types": "^4.3.1", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-node": { + "version": "4.0.23", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.23.tgz", + "integrity": "sha512-NE9NtEVigFa+HHJ5bBeQT7KF3KiltW880CLN9TnWWL55akeou3ziRAHO22QSUPgPZ/nqMfPXi/LGMQ6xQvXPNQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/config-resolver": "^4.1.4", + "@smithy/credential-provider-imds": "^4.0.6", + "@smithy/node-config-provider": "^4.1.3", + "@smithy/property-provider": "^4.0.4", + "@smithy/smithy-client": "^4.4.7", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-endpoints": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.6.tgz", + "integrity": "sha512-YARl3tFL3WgPuLzljRUnrS2ngLiUtkwhQtj8PAL13XZSyUiNLQxwG3fBBq3QXFqGFUXepIN73pINp3y8c2nBmA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.1.3", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-hex-encoding": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", + "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-middleware": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.4.tgz", + "integrity": "sha512-9MLKmkBmf4PRb0ONJikCbCwORACcil6gUWojwARCClT7RmLzF04hUR4WdRprIXal7XVyrddadYNfp2eF3nrvtQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-retry": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.6.tgz", + "integrity": "sha512-+YekoF2CaSMv6zKrA6iI/N9yva3Gzn4L6n35Luydweu5MMPYpiGZlWqehPHDHyNbnyaYlz/WJyYAZnC+loBDZg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/service-error-classification": "^4.0.6", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-stream": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.2.3.tgz", + "integrity": "sha512-cQn412DWHHFNKrQfbHY8vSFI3nTROY1aIKji9N0tpp8gUABRilr7wdf8fqBbSlXresobM+tQFNk6I+0LXK/YZg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/fetch-http-handler": "^5.1.0", + "@smithy/node-http-handler": "^4.1.0", + "@smithy/types": "^4.3.1", + "@smithy/util-base64": "^4.0.0", + "@smithy/util-buffer-from": "^4.0.0", + "@smithy/util-hex-encoding": "^4.0.0", + "@smithy/util-utf8": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-uri-escape": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", + "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-utf8": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", + "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^4.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-waiter": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-4.0.6.tgz", + "integrity": "sha512-slcr1wdRbX7NFphXZOxtxRNA7hXAAtJAXJDE/wdoMAos27SIquVCKiSqfB6/28YzQ8FCsB5NKkhdM5gMADbqxg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^4.0.4", + "@smithy/types": "^4.3.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@swc/helpers": { "version": "0.5.15", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", @@ -1276,6 +4592,34 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/body-parser": { + "version": "1.19.6", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz", + "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cors": { + "version": "2.8.19", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", + "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", @@ -1283,6 +4627,47 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/express": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.3.tgz", + "integrity": "sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw==", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^5.0.0", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", + "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/express/node_modules/@types/express-serve-static-core": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.7.tgz", + "integrity": "sha512-R+33OsgWw7rOhD1emjU7dzCDHucJrgJXMA5PYCzJxVil0dsyx5iBEPHqpPfiKNJQb7lZ1vxwoLR4Z87bBUpeGQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz", + "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", + "license": "MIT" + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1297,21 +4682,70 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.10", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.10.tgz", + "integrity": "sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA==", + "license": "MIT", + "dependencies": { + "@types/ms": "*", + "@types/node": "*" + } + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", + "license": "MIT" + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "license": "MIT" + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "20.19.8", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.8.tgz", "integrity": "sha512-HzbgCY53T6bfu4tT7Aq3TvViJyHjLjPNaAS3HOuMc9pw97KHsUtXNX4L+wu59g1WnjsZSko35MbEqnO58rihhw==", - "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.21.0" } }, + "node_modules/@types/node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "license": "MIT" + }, "node_modules/@types/react": { "version": "19.1.8", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.8.tgz", "integrity": "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "csstype": "^3.0.2" @@ -1321,12 +4755,39 @@ "version": "19.1.6", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.6.tgz", "integrity": "sha512-4hOiT/dwO8Ko0gV1m/TJZYk3y0KBnY9vzDh7W+DH17b2HFSOGgdj33dhihPeuy3l0q23+4e+hoXHV6hCC4dCXw==", - "dev": true, + "devOptional": true, "license": "MIT", "peerDependencies": { "@types/react": "^19.0.0" } }, + "node_modules/@types/send": { + "version": "0.17.5", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", + "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.8.tgz", + "integrity": "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==", + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/@types/uuid": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz", + "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", + "license": "MIT" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.37.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.37.0.tgz", @@ -1884,6 +5345,76 @@ "win32" ] }, + "node_modules/@wry/caches": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", + "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wry/context": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", + "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wry/equality": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", + "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wry/trie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", + "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/accepts/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/acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", @@ -1947,6 +5478,18 @@ "dev": true, "license": "Python-2.0" }, + "node_modules/aria-hidden": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz", + "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/aria-query": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", @@ -1974,6 +5517,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, "node_modules/array-includes": { "version": "3.1.9", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", @@ -2134,11 +5683,25 @@ "node": ">= 0.4" } }, + "node_modules/async-retry": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "license": "MIT", + "dependencies": { + "retry": "0.13.1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" @@ -2160,6 +5723,17 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz", + "integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/axobject-query": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", @@ -2177,6 +5751,32 @@ "dev": true, "license": "MIT" }, + "node_modules/body-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", + "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.0", + "http-errors": "^2.0.0", + "iconv-lite": "^0.6.3", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.0", + "type-is": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/bowser": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==", + "license": "MIT" + }, "node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", @@ -2201,11 +5801,25 @@ "node": ">=8" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.0", @@ -2224,7 +5838,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -2238,7 +5851,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -2308,12 +5920,33 @@ "node": ">=18" } }, + "node_modules/class-variance-authority": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz", + "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", + "license": "Apache-2.0", + "dependencies": { + "clsx": "^2.1.1" + }, + "funding": { + "url": "https://polar.sh/cva" + } + }, "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/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": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", @@ -2359,6 +5992,18 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2366,6 +6011,69 @@ "dev": true, "license": "MIT" }, + "node_modules/content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/core-js-pure": { + "version": "3.44.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.44.0.tgz", + "integrity": "sha512-gvMQAGB4dfVUxpYD0k3Fq8J+n5bB6Ytl15lqlZrOIXFzxOhtPaObfkQGHtMRdyjIf7z2IeNULwi1jEwyS+ltKQ==", + "hasInstallScript": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -2385,7 +6093,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/damerau-levenshtein": { @@ -2453,7 +6161,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -2478,7 +6185,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", @@ -2510,6 +6216,34 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, "node_modules/detect-libc": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", @@ -2520,6 +6254,12 @@ "node": ">=8" } }, + "node_modules/detect-node-es": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", + "license": "MIT" + }, "node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -2537,7 +6277,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -2548,6 +6287,21 @@ "node": ">= 0.4" } }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2555,6 +6309,15 @@ "dev": true, "license": "MIT" }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/enhanced-resolve": { "version": "5.18.2", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.2.tgz", @@ -2642,7 +6405,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2652,7 +6414,6 @@ "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" @@ -2690,7 +6451,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -2703,7 +6463,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -2746,6 +6505,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -3185,6 +6950,57 @@ "node": ">=0.10.0" } }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", + "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3236,6 +7052,24 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-xml-parser": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", + "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^2.1.0" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fastq": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", @@ -3272,6 +7106,23 @@ "node": ">=8" } }, + "node_modules/finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -3310,11 +7161,30 @@ "dev": true, "license": "ISC" }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", - "dev": true, "license": "MIT", "dependencies": { "is-callable": "^1.2.7" @@ -3326,11 +7196,65 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/form-data": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", + "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/form-data/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "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" @@ -3371,7 +7295,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -3392,11 +7315,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-nonce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", + "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/get-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", @@ -3484,7 +7415,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3507,6 +7437,60 @@ "dev": true, "license": "MIT" }, + "node_modules/graphql": { + "version": "16.11.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.11.0.tgz", + "integrity": "sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==", + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, + "node_modules/graphql-tag": { + "version": "2.12.6", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", + "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" + } + }, + "node_modules/graphql-ws": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-6.0.6.tgz", + "integrity": "sha512-zgfER9s+ftkGKUZgc0xbx8T7/HMO4AV5/YuYiFc+AtgcO5T0v8AxYYNQ+ltzuzDZgNkYJaFspm5MMYLjQzrkmw==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@fastify/websocket": "^10 || ^11", + "crossws": "~0.3", + "graphql": "^15.10.1 || ^16", + "uWebSockets.js": "^20", + "ws": "^8" + }, + "peerDependenciesMeta": { + "@fastify/websocket": { + "optional": true + }, + "crossws": { + "optional": true + }, + "uWebSockets.js": { + "optional": true + }, + "ws": { + "optional": true + } + } + }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -3534,7 +7518,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" @@ -3563,7 +7546,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3576,7 +7558,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" @@ -3592,7 +7573,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -3601,6 +7581,52 @@ "node": ">= 0.4" } }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "license": "BSD-3-Clause", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -3611,6 +7637,18 @@ "node": ">= 4" } }, + "node_modules/imask": { + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/imask/-/imask-7.6.1.tgz", + "integrity": "sha512-sJlIFM7eathUEMChTh9Mrfw/IgiWgJqBKq2VNbyXvBZ7ev/IlO6/KQTKlV/Fm+viQMLrFLG/zCuudrLIwgK2dg==", + "license": "MIT", + "dependencies": { + "@babel/runtime-corejs3": "^7.24.4" + }, + "engines": { + "npm": ">=4.0.0" + } + }, "node_modules/import-fresh": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", @@ -3638,6 +7676,12 @@ "node": ">=0.8.19" } }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -3653,6 +7697,15 @@ "node": ">= 0.4" } }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -3745,7 +7798,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3916,6 +7968,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -4003,7 +8061,6 @@ "version": "1.1.15", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", - "dev": true, "license": "MIT", "dependencies": { "which-typed-array": "^1.1.16" @@ -4065,7 +8122,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true, "license": "MIT" }, "node_modules/isexe": { @@ -4097,7 +8153,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", - "dev": true, "license": "MIT", "bin": { "jiti": "lib/jiti-cli.mjs" @@ -4107,7 +8162,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, "license": "MIT" }, "node_modules/js-yaml": { @@ -4157,6 +8211,28 @@ "json5": "lib/cli.js" } }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "license": "MIT", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", @@ -4173,6 +8249,27 @@ "node": ">=4.0" } }, + "node_modules/jwa": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", + "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "license": "MIT", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -4472,6 +8569,42 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -4479,11 +8612,41 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "license": "MIT" + }, + "node_modules/loglevel": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", + "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, "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==", - "dev": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -4492,6 +8655,24 @@ "loose-envify": "cli.js" } }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/lucide-react": { + "version": "0.525.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.525.0.tgz", + "integrity": "sha512-Tm1txJ2OkymCGkvwoHt33Y2JpN5xucVq1slHcgE6Lk0WjDfjgKWor5CdVER8U6DvcfMwh4M8XxmpTiyzfmfDYQ==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/magic-string": { "version": "0.30.17", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", @@ -4506,12 +8687,32 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" } }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4522,6 +8723,15 @@ "node": ">= 8" } }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -4536,6 +8746,39 @@ "node": ">=8.6" } }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -4602,7 +8845,6 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, "license": "MIT" }, "node_modules/nanoid": { @@ -4698,6 +8940,16 @@ } } }, + "node_modules/next-themes": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.6.tgz", + "integrity": "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" + } + }, "node_modules/next/node_modules/postcss": { "version": "8.4.31", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", @@ -4726,11 +8978,36 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/node-abort-controller": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "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" @@ -4740,7 +9017,6 @@ "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4849,6 +9125,39 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optimism": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.1.tgz", + "integrity": "sha512-mLXNwWPa9dgFyDqkNi54sjDyNJ9/fTI6WGBLgnXku1vdKY/jovHfZT5r+aiVeFFLOz+foPNOm5YJ4mqgld2GBQ==", + "license": "MIT", + "dependencies": { + "@wry/caches": "^1.0.0", + "@wry/context": "^0.7.0", + "@wry/trie": "^0.5.0", + "tslib": "^2.3.0" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -4930,6 +9239,15 @@ "node": ">=6" } }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4957,6 +9275,15 @@ "dev": true, "license": "MIT" }, + "node_modules/path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -4980,7 +9307,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -5025,11 +9351,35 @@ "node": ">= 0.8.0" } }, + "node_modules/prisma": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.12.0.tgz", + "integrity": "sha512-pmV7NEqQej9WjizN6RSNIwf7Y+jeh9mY1JEX2WjGxJi4YZWexClhde1yz/FuvAM+cTwzchcMytu2m4I6wPkIzg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/config": "6.12.0", + "@prisma/engines": "6.12.0" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.4.0", @@ -5037,6 +9387,25 @@ "react-is": "^16.13.1" } }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -5047,6 +9416,21 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -5068,6 +9452,30 @@ ], "license": "MIT" }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", + "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.6.3", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/react": { "version": "19.1.0", "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", @@ -5089,13 +9497,97 @@ "react": "^19.1.0" } }, + "node_modules/react-imask": { + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/react-imask/-/react-imask-7.6.1.tgz", + "integrity": "sha512-vLNfzcCz62Yzx/GRGh5tiCph9Gbh2cZu+Tz8OiO5it2eNuuhpA0DWhhSlOtVtSJ80+Bx+vFK5De8eQ9AmbkXzA==", + "license": "MIT", + "dependencies": { + "imask": "^7.6.1", + "prop-types": "^15.8.1" + }, + "engines": { + "npm": ">=4.0.0" + }, + "peerDependencies": { + "react": ">=0.14.0" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, "license": "MIT" }, + "node_modules/react-remove-scroll": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.1.tgz", + "integrity": "sha512-HpMh8+oahmIdOuS5aFKKY6Pyog+FNaZV/XyJOq7b4YFwsFHe5yYfdbIalI4k3vU2nSDql7YskmUseHsRrJqIPA==", + "license": "MIT", + "dependencies": { + "react-remove-scroll-bar": "^2.3.7", + "react-style-singleton": "^2.2.3", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.3", + "use-sidecar": "^1.1.3" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-remove-scroll-bar": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz", + "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==", + "license": "MIT", + "dependencies": { + "react-style-singleton": "^2.2.2", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-style-singleton": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz", + "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==", + "license": "MIT", + "dependencies": { + "get-nonce": "^1.0.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -5140,6 +9632,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/rehackt": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", + "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -5181,6 +9691,15 @@ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", @@ -5192,6 +9711,22 @@ "node": ">=0.10.0" } }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -5236,6 +9771,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "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/safe-push-apply": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", @@ -5271,6 +9826,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, "node_modules/scheduler": { "version": "0.26.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", @@ -5281,7 +9842,6 @@ "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", - "devOptional": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -5290,11 +9850,47 @@ "node": ">=10" } }, + "node_modules/send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", + "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "mime-types": "^3.0.1", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", @@ -5339,6 +9935,32 @@ "node": ">= 0.4" } }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/sha.js": { + "version": "2.4.12", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz", + "integrity": "sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==", + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.0" + }, + "bin": { + "sha.js": "bin.js" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/sharp": { "version": "0.34.3", "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.3.tgz", @@ -5409,7 +10031,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -5429,7 +10050,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -5446,7 +10066,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -5465,7 +10084,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", @@ -5491,6 +10109,16 @@ "is-arrayish": "^0.3.1" } }, + "node_modules/sonner": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.6.tgz", + "integrity": "sha512-yHFhk8T/DK3YxjFQXIrcHT1rGEeTLliVzWbO0xN8GberVun2RiBnxAjXAYpZrqwEVHBG9asI/Li8TAAhN9m59Q==", + "license": "MIT", + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", + "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -5507,6 +10135,15 @@ "dev": true, "license": "MIT" }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/stop-iteration-iterator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", @@ -5657,6 +10294,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", + "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, "node_modules/styled-jsx": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", @@ -5706,6 +10355,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/tailwind-merge": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.3.1.tgz", + "integrity": "sha512-gBXpgUm/3rp1lMZZrM/w7D8GKqshif0zAymAhbCyIt8KMe+0v9DQ7cdYLR4FHH/cKpdTXb+A/tKKU3eolfsI+g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, "node_modules/tailwindcss": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.11.tgz", @@ -5786,6 +10454,20 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/to-buffer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.1.tgz", + "integrity": "sha512-tB82LpAIWjhLYbqjx3X4zEeHN6M8CiuOEy2JY8SEQVdYRe3CCHOFaqrBW1doLDrfpWhplcW7BL+bO3/6S3pcDQ==", + "license": "MIT", + "dependencies": { + "isarray": "^2.0.5", + "safe-buffer": "^5.2.1", + "typed-array-buffer": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -5799,6 +10481,21 @@ "node": ">=8.0" } }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, "node_modules/ts-api-utils": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", @@ -5812,6 +10509,18 @@ "typescript": ">=4.8.4" } }, + "node_modules/ts-invariant": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", + "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", + "license": "MIT", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -5831,6 +10540,16 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/tw-animate-css": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.3.5.tgz", + "integrity": "sha512-t3u+0YNoloIhj1mMXs779P6MO9q3p3mvGn4k1n3nJPqJw/glZcuijG2qTSN4z4mgNRfW5ZC3aXJFLwDtiipZXA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Wombosvideo" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -5844,11 +10563,24 @@ "node": ">= 0.8.0" } }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/typed-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", - "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", @@ -5926,7 +10658,7 @@ "version": "5.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -5959,9 +10691,17 @@ "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/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/unrs-resolver": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.11.1.tgz", @@ -6007,6 +10747,123 @@ "punycode": "^2.1.0" } }, + "node_modules/use-callback-ref": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", + "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-sidecar": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz", + "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", + "license": "MIT", + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-sync-external-store": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz", + "integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/value-or-promise": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", + "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6094,7 +10951,6 @@ "version": "1.1.19", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", - "dev": true, "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", @@ -6122,6 +10978,12 @@ "node": ">=0.10.0" } }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, "node_modules/yallist": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", @@ -6144,6 +11006,21 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zen-observable": { + "version": "0.8.15", + "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", + "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==", + "license": "MIT" + }, + "node_modules/zen-observable-ts": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", + "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", + "license": "MIT", + "dependencies": { + "zen-observable": "0.8.15" + } } } } diff --git a/package.json b/package.json index 2d93506..e95e59d 100644 --- a/package.json +++ b/package.json @@ -9,19 +9,55 @@ "lint": "next lint" }, "dependencies": { + "@apollo/client": "^3.13.8", + "@apollo/server": "^4.12.2", + "@as-integrations/express5": "^1.1.1", + "@as-integrations/next": "^3.2.0", + "@aws-sdk/client-s3": "^3.846.0", + "@prisma/client": "^6.12.0", + "@radix-ui/react-avatar": "^1.1.10", + "@radix-ui/react-checkbox": "^1.3.2", + "@radix-ui/react-dialog": "^1.1.14", + "@radix-ui/react-label": "^2.1.7", + "@radix-ui/react-progress": "^1.1.7", + "@radix-ui/react-select": "^2.2.5", + "@radix-ui/react-separator": "^1.1.7", + "@radix-ui/react-slider": "^1.3.5", + "@radix-ui/react-slot": "^1.2.3", + "@radix-ui/react-switch": "^1.2.5", + "@radix-ui/react-tabs": "^1.1.12", + "@types/cors": "^2.8.19", + "@types/express": "^5.0.3", + "@types/jsonwebtoken": "^9.0.10", + "axios": "^1.10.0", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "cors": "^2.8.5", + "express": "^5.1.0", + "graphql": "^16.11.0", + "graphql-tag": "^2.12.6", + "graphql-ws": "^6.0.6", + "jsonwebtoken": "^9.0.2", + "lucide-react": "^0.525.0", + "next": "15.4.1", + "next-themes": "^0.4.6", + "prisma": "^6.12.0", "react": "19.1.0", "react-dom": "19.1.0", - "next": "15.4.1" + "react-imask": "^7.6.1", + "sonner": "^2.0.6", + "tailwind-merge": "^3.3.1" }, "devDependencies": { - "typescript": "^5", + "@eslint/eslintrc": "^3", + "@tailwindcss/postcss": "^4", "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", - "@tailwindcss/postcss": "^4", - "tailwindcss": "^4", "eslint": "^9", "eslint-config-next": "15.4.1", - "@eslint/eslintrc": "^3" + "tailwindcss": "^4", + "tw-animate-css": "^1.3.5", + "typescript": "^5" } } diff --git a/prisma/schema.prisma b/prisma/schema.prisma new file mode 100644 index 0000000..3e27f7d --- /dev/null +++ b/prisma/schema.prisma @@ -0,0 +1,191 @@ +// This is your Prisma schema file, +// learn more about it in the docs: https://pris.ly/d/prisma-schema + +generator client { + provider = "prisma-client-js" +} + +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +// Модель пользователя +model User { + id String @id @default(cuid()) + phone String @unique + avatar String? // URL аватара в S3 + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + // Связь с организацией + organization Organization? @relation(fields: [organizationId], references: [id]) + organizationId String? + + // SMS коды для авторизации + smsCodes SmsCode[] + + @@map("users") +} + +// Модель для SMS кодов +model SmsCode { + id String @id @default(cuid()) + code String + phone String + expiresAt DateTime + isUsed Boolean @default(false) + attempts Int @default(0) + maxAttempts Int @default(3) + createdAt DateTime @default(now()) + + // Связь с пользователем + user User? @relation(fields: [userId], references: [id]) + userId String? + + @@map("sms_codes") +} + +// Модель организации +model Organization { + id String @id @default(cuid()) + inn String @unique + kpp String? // КПП + name String? // Краткое наименование + fullName String? // Полное наименование + ogrn String? // ОГРН организации + ogrnDate DateTime? // Дата выдачи ОГРН + type OrganizationType + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + // Адрес организации + address String? // Адрес одной строкой + addressFull String? // Полный адрес с индексом + + // Статус организации + status String? // ACTIVE, LIQUIDATED и т.д. + actualityDate DateTime? // Дата последних изменений + registrationDate DateTime? // Дата регистрации + liquidationDate DateTime? // Дата ликвидации + + // Руководитель + managementName String? // ФИО или наименование руководителя + managementPost String? // Должность руководителя + + // ОПФ (Организационно-правовая форма) + opfCode String? // Код ОКОПФ + opfFull String? // Полное название ОПФ + opfShort String? // Краткое название ОПФ + + // Коды статистики + okato String? // Код ОКАТО + oktmo String? // Код ОКТМО + okpo String? // Код ОКПО + okved String? // Основной код ОКВЭД + + // Контакты + phones Json? // Массив телефонов + emails Json? // Массив email адресов + + // Финансовые данные + employeeCount Int? // Численность сотрудников + revenue BigInt? // Выручка + taxSystem String? // Система налогообложения + + // Полные данные из DaData (для полноты) + dadataData Json? + + // Связи + users User[] + apiKeys ApiKey[] + + // Связи контрагентов + sentRequests CounterpartyRequest[] @relation("SentRequests") + receivedRequests CounterpartyRequest[] @relation("ReceivedRequests") + organizationCounterparties Counterparty[] @relation("OrganizationCounterparties") + counterpartyOf Counterparty[] @relation("CounterpartyOf") + + @@map("organizations") +} + +// Модель для API ключей маркетплейсов +model ApiKey { + id String @id @default(cuid()) + marketplace MarketplaceType + apiKey String + isActive Boolean @default(true) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + // Данные для валидации (например, информация о продавце) + validationData Json? + + // Связь с организацией + organization Organization @relation(fields: [organizationId], references: [id]) + organizationId String + + @@unique([organizationId, marketplace]) + @@map("api_keys") +} + +// Тип организации +enum OrganizationType { + FULFILLMENT // Фулфилмент + SELLER // Селлер + LOGIST // Логистика + WHOLESALE // Оптовик +} + +// Тип маркетплейса +enum MarketplaceType { + WILDBERRIES + OZON +} + +// Модель для заявок на добавление в контрагенты +model CounterpartyRequest { + id String @id @default(cuid()) + status CounterpartyRequestStatus @default(PENDING) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + // Кто отправил заявку + sender Organization @relation("SentRequests", fields: [senderId], references: [id]) + senderId String + + // Кому отправили заявку + receiver Organization @relation("ReceivedRequests", fields: [receiverId], references: [id]) + receiverId String + + // Комментарий к заявке + message String? + + @@unique([senderId, receiverId]) + @@map("counterparty_requests") +} + +// Модель для связей контрагентов +model Counterparty { + id String @id @default(cuid()) + createdAt DateTime @default(now()) + + // Основная организация + organization Organization @relation("OrganizationCounterparties", fields: [organizationId], references: [id]) + organizationId String + + // Контрагент + counterparty Organization @relation("CounterpartyOf", fields: [counterpartyId], references: [id]) + counterpartyId String + + @@unique([organizationId, counterpartyId]) + @@map("counterparties") +} + +// Статус заявки на добавление в контрагенты +enum CounterpartyRequestStatus { + PENDING // Ожидает ответа + ACCEPTED // Принята + REJECTED // Отклонена + CANCELLED // Отменена отправителем +} diff --git a/src/app/api/graphql/route.ts b/src/app/api/graphql/route.ts new file mode 100644 index 0000000..7b2a2de --- /dev/null +++ b/src/app/api/graphql/route.ts @@ -0,0 +1,65 @@ +import { ApolloServer } from '@apollo/server' +import { startServerAndCreateNextHandler } from '@as-integrations/next' +import { NextRequest } from 'next/server' +import jwt from 'jsonwebtoken' +import { typeDefs } from '@/graphql/typedefs' +import { resolvers } from '@/graphql/resolvers' + +// Интерфейс для контекста +interface Context { + user?: { + id: string + phone: string + } +} + +// Создаем Apollo Server +const server = new ApolloServer({ + typeDefs, + resolvers, +}) + +// Создаем Next.js handler +const handler = startServerAndCreateNextHandler(server, { + context: async (req: NextRequest) => { + // Извлекаем токен из заголовка Authorization + const authHeader = req.headers.get('authorization') + const token = authHeader?.replace('Bearer ', '') + + console.log('GraphQL Context - Auth header:', authHeader) + console.log('GraphQL Context - Token:', token ? `${token.substring(0, 20)}...` : 'No token') + + if (!token) { + console.log('GraphQL Context - No token provided') + return { user: undefined } + } + + try { + // Верифицируем JWT токен + const decoded = jwt.verify(token, process.env.JWT_SECRET!) as { + userId: string + phone: string + } + + console.log('GraphQL Context - Decoded user:', { id: decoded.userId, phone: decoded.phone }) + + return { + user: { + id: decoded.userId, + phone: decoded.phone + } + } + } catch (error) { + console.error('GraphQL Context - Invalid token:', error) + return { user: undefined } + } + } +}) + +export async function GET(request: NextRequest) { + return handler(request) +} + +export async function POST(request: NextRequest) { + return handler(request) +} \ No newline at end of file diff --git a/src/app/api/upload-avatar/route.ts b/src/app/api/upload-avatar/route.ts new file mode 100644 index 0000000..b8070ba --- /dev/null +++ b/src/app/api/upload-avatar/route.ts @@ -0,0 +1,104 @@ +import { NextRequest, NextResponse } from 'next/server' +import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3' + +const s3Client = new S3Client({ + region: 'ru-1', + endpoint: 'https://s3.twcstorage.ru', + credentials: { + accessKeyId: 'I6XD2OR7YO2ZN6L6Z629', + secretAccessKey: '9xCOoafisG0aB9lJNvdLO1UuK73fBvMcpHMdijrJ' + }, + forcePathStyle: true +}) + +const BUCKET_NAME = '617774af-sfera' + +export async function POST(request: NextRequest) { + try { + const formData = await request.formData() + const file = formData.get('file') as File + const key = formData.get('key') as string + + if (!file || !key) { + return NextResponse.json( + { error: 'File and key are required' }, + { status: 400 } + ) + } + + // Проверяем тип файла + if (!file.type.startsWith('image/')) { + return NextResponse.json( + { error: 'Only image files are allowed' }, + { status: 400 } + ) + } + + // Ограничиваем размер файла (5MB) + if (file.size > 5 * 1024 * 1024) { + return NextResponse.json( + { error: 'File size must be less than 5MB' }, + { status: 400 } + ) + } + + // Конвертируем файл в Buffer + const buffer = Buffer.from(await file.arrayBuffer()) + + // Загружаем в S3 + const command = new PutObjectCommand({ + Bucket: BUCKET_NAME, + Key: key, + Body: buffer, + ContentType: file.type, + ACL: 'public-read' + }) + + await s3Client.send(command) + + // Возвращаем URL файла + const url = `https://s3.twcstorage.ru/${BUCKET_NAME}/${key}` + + return NextResponse.json({ + success: true, + url, + key + }) + + } catch (error) { + console.error('Error uploading avatar:', error) + return NextResponse.json( + { error: 'Failed to upload avatar' }, + { status: 500 } + ) + } +} + +export async function DELETE(request: NextRequest) { + try { + const { key } = await request.json() + + if (!key) { + return NextResponse.json( + { error: 'Key is required' }, + { status: 400 } + ) + } + + // TODO: Добавить удаление из S3 + // const command = new DeleteObjectCommand({ + // Bucket: BUCKET_NAME, + // Key: key + // }) + // await s3Client.send(command) + + return NextResponse.json({ success: true }) + + } catch (error) { + console.error('Error deleting avatar:', error) + return NextResponse.json( + { error: 'Failed to delete avatar' }, + { status: 500 } + ) + } +} \ No newline at end of file diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx new file mode 100644 index 0000000..8525bce --- /dev/null +++ b/src/app/dashboard/page.tsx @@ -0,0 +1,10 @@ +import { AuthGuard } from "@/components/auth-guard" +import { DashboardHome } from "@/components/dashboard/dashboard-home" + +export default function DashboardPage() { + return ( + + + + ) +} \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index a2dc41e..bacc02d 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,26 +1,378 @@ @import "tailwindcss"; +@import "tw-animate-css"; -:root { - --background: #ffffff; - --foreground: #171717; -} +@custom-variant dark (&:is(.dark *)); @theme inline { --color-background: var(--background); --color-foreground: var(--foreground); --font-sans: var(--font-geist-sans); --font-mono: var(--font-geist-mono); + --color-sidebar-ring: var(--sidebar-ring); + --color-sidebar-border: var(--sidebar-border); + --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); + --color-sidebar-accent: var(--sidebar-accent); + --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); + --color-sidebar-primary: var(--sidebar-primary); + --color-sidebar-foreground: var(--sidebar-foreground); + --color-sidebar: var(--sidebar); + --color-chart-5: var(--chart-5); + --color-chart-4: var(--chart-4); + --color-chart-3: var(--chart-3); + --color-chart-2: var(--chart-2); + --color-chart-1: var(--chart-1); + --color-ring: var(--ring); + --color-input: var(--input); + --color-border: var(--border); + --color-destructive: var(--destructive); + --color-accent-foreground: var(--accent-foreground); + --color-accent: var(--accent); + --color-muted-foreground: var(--muted-foreground); + --color-muted: var(--muted); + --color-secondary-foreground: var(--secondary-foreground); + --color-secondary: var(--secondary); + --color-primary-foreground: var(--primary-foreground); + --color-primary: var(--primary); + --color-popover-foreground: var(--popover-foreground); + --color-popover: var(--popover); + --color-card-foreground: var(--card-foreground); + --color-card: var(--card); + --radius-sm: calc(var(--radius) - 4px); + --radius-md: calc(var(--radius) - 2px); + --radius-lg: var(--radius); + --radius-xl: calc(var(--radius) + 4px); } -@media (prefers-color-scheme: dark) { - :root { - --background: #0a0a0a; - --foreground: #ededed; +:root { + --radius: 0.625rem; + --background: oklch(0.98 0.02 320); + --foreground: oklch(0.145 0 0); + --card: oklch(1 0 0); + --card-foreground: oklch(0.145 0 0); + --popover: oklch(1 0 0); + --popover-foreground: oklch(0.145 0 0); + --primary: oklch(0.65 0.28 315); + --primary-foreground: oklch(0.985 0 0); + --secondary: oklch(0.94 0.08 315); + --secondary-foreground: oklch(0.205 0 0); + --muted: oklch(0.94 0.05 315); + --muted-foreground: oklch(0.556 0 0); + --accent: oklch(0.90 0.12 315); + --accent-foreground: oklch(0.205 0 0); + --destructive: oklch(0.577 0.245 27.325); + --border: oklch(0.90 0.08 315); + --input: oklch(0.96 0.05 315); + --ring: oklch(0.65 0.28 315); + --chart-1: oklch(0.70 0.25 315); + --chart-2: oklch(0.65 0.22 290); + --chart-3: oklch(0.60 0.20 340); + --chart-4: oklch(0.75 0.18 305); + --chart-5: oklch(0.68 0.24 325); + --sidebar: oklch(0.985 0 0); + --sidebar-foreground: oklch(0.145 0 0); + --sidebar-primary: oklch(0.65 0.28 315); + --sidebar-primary-foreground: oklch(0.985 0 0); + --sidebar-accent: oklch(0.90 0.12 315); + --sidebar-accent-foreground: oklch(0.205 0 0); + --sidebar-border: oklch(0.90 0.08 315); + --sidebar-ring: oklch(0.65 0.28 315); +} + +.dark { + --background: oklch(0.08 0.08 315); + --foreground: oklch(0.985 0 0); + --card: oklch(0.12 0.08 315); + --card-foreground: oklch(0.985 0 0); + --popover: oklch(0.12 0.08 315); + --popover-foreground: oklch(0.985 0 0); + --primary: oklch(0.75 0.32 315); + --primary-foreground: oklch(0.08 0.08 315); + --secondary: oklch(0.18 0.12 315); + --secondary-foreground: oklch(0.985 0 0); + --muted: oklch(0.18 0.10 315); + --muted-foreground: oklch(0.708 0 0); + --accent: oklch(0.20 0.15 315); + --accent-foreground: oklch(0.985 0 0); + --destructive: oklch(0.704 0.191 22.216); + --border: oklch(0.22 0.12 315); + --input: oklch(0.15 0.10 315); + --ring: oklch(0.75 0.32 315); + --chart-1: oklch(0.75 0.32 315); + --chart-2: oklch(0.70 0.28 290); + --chart-3: oklch(0.65 0.25 340); + --chart-4: oklch(0.80 0.20 305); + --chart-5: oklch(0.72 0.30 325); + --sidebar: oklch(0.12 0.08 315); + --sidebar-foreground: oklch(0.985 0 0); + --sidebar-primary: oklch(0.75 0.32 315); + --sidebar-primary-foreground: oklch(0.08 0.08 315); + --sidebar-accent: oklch(0.20 0.15 315); + --sidebar-accent-foreground: oklch(0.985 0 0); + --sidebar-border: oklch(0.22 0.12 315); + --sidebar-ring: oklch(0.75 0.32 315); +} + +@layer base { + * { + @apply border-border outline-ring/50; + } + body { + @apply bg-background text-foreground; } } -body { - background: var(--background); - color: var(--foreground); - font-family: Arial, Helvetica, sans-serif; +@layer utilities { + .gradient-purple { + background: linear-gradient(135deg, + oklch(0.75 0.32 315) 0%, + oklch(0.68 0.28 280) 30%, + oklch(0.65 0.30 250) 70%, + oklch(0.60 0.25 330) 100%); + } + + .gradient-purple-light { + background: linear-gradient(135deg, + oklch(0.95 0.12 315) 0%, + oklch(0.96 0.10 280) 50%, + oklch(0.98 0.08 250) 100%); + } + + .bg-gradient-smooth { + background: linear-gradient(135deg, + oklch(0.22 0.20 315) 0%, + oklch(0.20 0.18 280) 30%, + oklch(0.18 0.16 250) 60%, + oklch(0.15 0.12 330) 100%); + } + + .text-gradient-bright { + background: linear-gradient(135deg, + oklch(0.85 0.35 315) 0%, + oklch(0.80 0.32 280) 40%, + oklch(0.75 0.30 250) 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + text-shadow: 0 0 20px oklch(0.75 0.32 315 / 0.4); + } + + .text-gradient { + background: linear-gradient(135deg, + oklch(0.75 0.32 315) 0%, + oklch(0.70 0.30 280) 50%, + oklch(0.68 0.28 250) 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; + } + + /* Glass Morphism Effects */ + .glass-card { + background: rgba(255, 255, 255, 0.12); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: + 0 8px 32px rgba(168, 85, 247, 0.18), + 0 4px 16px rgba(147, 51, 234, 0.12), + inset 0 1px 0 rgba(255, 255, 255, 0.3); + transition: all 0.3s ease; + } + + .glass-card:hover { + background: rgba(255, 255, 255, 0.15); + border: 1px solid rgba(255, 255, 255, 0.3); + box-shadow: + 0 12px 40px rgba(168, 85, 247, 0.25), + 0 6px 20px rgba(147, 51, 234, 0.18), + inset 0 1px 0 rgba(255, 255, 255, 0.4); + } + + .glass-input { + background: rgba(255, 255, 255, 0.08); + backdrop-filter: blur(12px); + border: 1px solid rgba(255, 255, 255, 0.15); + transition: all 0.3s ease; + } + + .glass-input:focus { + background: rgba(255, 255, 255, 0.12); + border: 1px solid rgba(168, 85, 247, 0.5); + box-shadow: + 0 0 0 3px rgba(168, 85, 247, 0.15), + 0 4px 16px rgba(147, 51, 234, 0.25); + } + + .glass-button { + background: linear-gradient(135deg, + rgba(168, 85, 247, 0.9) 0%, + rgba(120, 119, 248, 0.9) 40%, + rgba(59, 130, 246, 0.85) 100%); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: + 0 8px 32px rgba(168, 85, 247, 0.35), + inset 0 1px 0 rgba(255, 255, 255, 0.2); + transition: all 0.3s ease; + position: relative; + overflow: hidden; + } + + .glass-button::before { + content: ''; + position: absolute; + top: 0; + left: -100%; + width: 100%; + height: 100%; + background: linear-gradient(90deg, + transparent, + rgba(255, 255, 255, 0.25), + transparent); + transition: left 0.5s ease; + } + + .glass-button:hover::before { + left: 100%; + } + + .glass-button:hover { + background: linear-gradient(135deg, + rgba(168, 85, 247, 1) 0%, + rgba(120, 119, 248, 1) 40%, + rgba(59, 130, 246, 0.95) 100%); + box-shadow: + 0 12px 40px rgba(168, 85, 247, 0.45), + inset 0 1px 0 rgba(255, 255, 255, 0.3); + transform: translateY(-2px); + } + + .glass-button:active { + transform: translateY(0); + box-shadow: + 0 4px 16px rgba(168, 85, 247, 0.35), + inset 0 1px 0 rgba(255, 255, 255, 0.2); + } + + .glass-secondary { + background: rgba(255, 255, 255, 0.1); + backdrop-filter: blur(16px); + border: 1px solid rgba(255, 255, 255, 0.15); + transition: all 0.3s ease; + } + + .glass-secondary:hover { + background: rgba(255, 255, 255, 0.15); + border: 1px solid rgba(255, 255, 255, 0.25); + box-shadow: 0 8px 24px rgba(139, 69, 199, 0.15); + } + + /* Обеспечиваем курсор pointer для всех кликабельных элементов */ + button, [role="button"], [data-state] { + cursor: pointer; + } + + /* Специальные стили для вкладок */ + [data-slot="tabs-list"] { + background: rgba(255, 255, 255, 0.12); + backdrop-filter: blur(20px); + border: 1px solid rgba(255, 255, 255, 0.2); + } + + [data-slot="tabs-trigger"] { + cursor: pointer !important; + transition: all 0.3s ease; + } + + [data-slot="tabs-trigger"]:hover { + background: rgba(255, 255, 255, 0.1); + } + + [data-slot="tabs-trigger"][data-state="active"] { + background: rgba(255, 255, 255, 0.2) !important; + color: white !important; + border: 1px solid rgba(255, 255, 255, 0.3); + } + + /* Animated Background */ + .bg-animated { + background: linear-gradient(135deg, + oklch(0.22 0.20 315) 0%, + oklch(0.18 0.16 300) 40%, + oklch(0.15 0.12 330) 100%); + position: relative; + overflow: hidden; + } + + .bg-animated::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: + radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.35) 0%, transparent 50%), + radial-gradient(circle at 80% 20%, rgba(120, 119, 248, 0.35) 0%, transparent 50%), + radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 50%), + radial-gradient(circle at 60% 30%, rgba(192, 132, 252, 0.20) 0%, transparent 50%); + animation: float 20s ease-in-out infinite; + } + + @keyframes float { + 0%, 100% { opacity: 1; transform: translateY(0px) rotate(0deg); } + 33% { opacity: 0.8; transform: translateY(-20px) rotate(2deg); } + 66% { opacity: 0.9; transform: translateY(10px) rotate(-1deg); } + } + + /* Floating Particles Effect */ + .particles { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + overflow: hidden; + z-index: 1; + } + + .particle { + position: absolute; + background: rgba(255, 255, 255, 0.3); + border-radius: 50%; + animation: particleFloat 15s linear infinite; + } + + .particle:nth-child(1) { width: 3px; height: 3px; left: 10%; animation-delay: 0s; } + .particle:nth-child(2) { width: 2px; height: 2px; left: 20%; animation-delay: 2s; } + .particle:nth-child(3) { width: 4px; height: 4px; left: 30%; animation-delay: 4s; } + .particle:nth-child(4) { width: 2px; height: 2px; left: 40%; animation-delay: 6s; } + .particle:nth-child(5) { width: 3px; height: 3px; left: 50%; animation-delay: 8s; } + .particle:nth-child(6) { width: 2px; height: 2px; left: 60%; animation-delay: 10s; } + .particle:nth-child(7) { width: 4px; height: 4px; left: 70%; animation-delay: 12s; } + .particle:nth-child(8) { width: 2px; height: 2px; left: 80%; animation-delay: 14s; } + .particle:nth-child(9) { width: 3px; height: 3px; left: 90%; animation-delay: 16s; } + + @keyframes particleFloat { + 0% { transform: translateY(100vh) rotate(0deg); opacity: 0; } + 10% { opacity: 1; } + 90% { opacity: 1; } + 100% { transform: translateY(-100px) rotate(360deg); opacity: 0; } + } + + /* Enhanced Glow Effects */ + .glow-purple { + box-shadow: + 0 0 20px rgba(168, 85, 247, 0.5), + 0 0 40px rgba(120, 119, 248, 0.35), + 0 0 60px rgba(59, 130, 246, 0.2), + 0 0 80px rgba(192, 132, 252, 0.15); + } + + .glow-text { + text-shadow: + 0 0 10px rgba(168, 85, 247, 0.6), + 0 0 20px rgba(120, 119, 248, 0.45), + 0 0 30px rgba(59, 130, 246, 0.3), + 0 0 40px rgba(192, 132, 252, 0.25); + } } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f7fa87e..87f2c5f 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,34 +1,21 @@ -import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; -import "./globals.css"; +"use client" -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); - -export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", -}; +import { ApolloProvider } from '@apollo/client' +import { apolloClient } from '@/lib/apollo-client' +import "./globals.css" export default function RootLayout({ children, -}: Readonly<{ - children: React.ReactNode; -}>) { +}: { + children: React.ReactNode +}) { return ( - - + + + {children} + - ); + ) } diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx new file mode 100644 index 0000000..151a1f6 --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,12 @@ +import { AuthGuard } from "@/components/auth-guard" +import { AuthFlow } from "@/components/auth/auth-flow" +import { redirect } from "next/navigation" + +export default function LoginPage() { + return ( + }> + {/* Если пользователь авторизован, перенаправляем в дашборд */} + {redirect('/dashboard')} + + ) +} \ No newline at end of file diff --git a/src/app/market/page.tsx b/src/app/market/page.tsx new file mode 100644 index 0000000..f989987 --- /dev/null +++ b/src/app/market/page.tsx @@ -0,0 +1,10 @@ +import { AuthGuard } from "@/components/auth-guard" +import { MarketDashboard } from "@/components/market/market-dashboard" + +export default function MarketPage() { + return ( + + + + ) +} \ No newline at end of file diff --git a/src/app/page.tsx b/src/app/page.tsx index a932894..e10f422 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,103 +1,24 @@ -import Image from "next/image"; +"use client" + +import { useEffect } from "react" +import { useRouter } from "next/navigation" +import { useAuth } from "@/hooks/useAuth" export default function Home() { - return ( -
-
- Next.js logo -
    -
  1. - Get started by editing{" "} - - src/app/page.tsx - - . -
  2. -
  3. - Save and see your changes instantly. -
  4. -
+ const router = useRouter() + const { user } = useAuth() + + useEffect(() => { + if (user) { + router.replace('/dashboard') + } else { + router.replace('/login') + } + }, [router, user]) - -
- + return ( +
+
Загрузка...
- ); + ) } diff --git a/src/app/register/page.tsx b/src/app/register/page.tsx new file mode 100644 index 0000000..01901bf --- /dev/null +++ b/src/app/register/page.tsx @@ -0,0 +1,27 @@ +"use client" + +import { Suspense } from 'react' +import { AuthGuard } from "@/components/auth-guard" +import { AuthFlow } from "@/components/auth/auth-flow" +import { redirect } from "next/navigation" +import { useSearchParams } from 'next/navigation' + +function RegisterContent() { + const searchParams = useSearchParams() + const partnerCode = searchParams.get('partner') + + return ( + }> + {/* Если пользователь авторизован, перенаправляем в дашборд */} + {redirect('/dashboard')} + + ) +} + +export default function RegisterPage() { + return ( + Загрузка...
}> + + + ) +} \ No newline at end of file diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx new file mode 100644 index 0000000..18bcb38 --- /dev/null +++ b/src/app/settings/page.tsx @@ -0,0 +1,10 @@ +import { AuthGuard } from "@/components/auth-guard" +import { UserSettings } from "@/components/dashboard/user-settings" + +export default function SettingsPage() { + return ( + + + + ) +} \ No newline at end of file diff --git a/src/components/auth-guard.tsx b/src/components/auth-guard.tsx new file mode 100644 index 0000000..6b90aa8 --- /dev/null +++ b/src/components/auth-guard.tsx @@ -0,0 +1,65 @@ +"use client" + +import { useAuth } from '@/hooks/useAuth' +import { useEffect, useState, useRef } from 'react' +import { AuthFlow } from './auth/auth-flow' + +interface AuthGuardProps { + children: React.ReactNode + fallback?: React.ReactNode +} + +export function AuthGuard({ children, fallback }: AuthGuardProps) { + const { isAuthenticated, isLoading, checkAuth, user } = useAuth() + const [isChecking, setIsChecking] = useState(true) + const initRef = useRef(false) // Защита от повторных инициализаций + + useEffect(() => { + const initAuth = async () => { + if (initRef.current) { + console.log('AuthGuard - Already initialized, skipping') + return + } + + initRef.current = true + console.log('AuthGuard - Initializing auth check') + await checkAuth() + setIsChecking(false) + console.log('AuthGuard - Auth check completed, authenticated:', isAuthenticated, 'user:', !!user) + } + + initAuth() + }, []) // Убираем checkAuth из зависимостей чтобы избежать повторных вызовов + + // Дополнительное логирование состояний + useEffect(() => { + console.log('AuthGuard - State update:', { + isChecking, + isLoading, + isAuthenticated, + hasUser: !!user + }) + }, [isChecking, isLoading, isAuthenticated, user]) + + // Показываем лоадер пока проверяем авторизацию + if (isChecking || isLoading) { + return ( +
+
+
+

Проверяем авторизацию...

+
+
+ ) + } + + // Если не авторизован, показываем форму авторизации + if (!isAuthenticated) { + console.log('AuthGuard - User not authenticated, showing auth flow') + return fallback || + } + + // Если авторизован, показываем защищенный контент + console.log('AuthGuard - User authenticated, showing dashboard') + return <>{children} +} \ No newline at end of file diff --git a/src/components/auth/auth-flow.tsx b/src/components/auth/auth-flow.tsx new file mode 100644 index 0000000..78845fb --- /dev/null +++ b/src/components/auth/auth-flow.tsx @@ -0,0 +1,269 @@ +"use client" + +import { useState, useEffect } from "react" +import { PhoneStep } from "./phone-step" +import { SmsStep } from "./sms-step" +import { CabinetSelectStep } from "./cabinet-select-step" +import { InnStep } from "./inn-step" +import { MarketplaceApiStep } from "./marketplace-api-step" +import { ConfirmationStep } from "./confirmation-step" +import { CheckCircle } from "lucide-react" +import { useAuth } from '@/hooks/useAuth' + +type AuthStep = 'phone' | 'sms' | 'cabinet-select' | 'inn' | 'marketplace-api' | 'confirmation' | 'complete' +type CabinetType = 'fulfillment' | 'seller' | 'logist' | 'wholesale' + +interface OrganizationData { + name?: string + fullName?: string + address?: string + isActive?: boolean +} + +interface ApiKeyValidation { + sellerId?: string + sellerName?: string + isValid?: boolean +} + +interface AuthData { + phone: string + smsCode: string + cabinetType: CabinetType | null + inn: string + organizationData: OrganizationData | null + wbApiKey: string + wbApiValidation: ApiKeyValidation | null + ozonApiKey: string + ozonApiValidation: ApiKeyValidation | null + isAuthenticated: boolean + partnerCode?: string | null +} + +interface AuthFlowProps { + partnerCode?: string | null +} + +export function AuthFlow({ partnerCode }: AuthFlowProps = {}) { + const [step, setStep] = useState('phone') + const [authData, setAuthData] = useState({ + phone: '', + smsCode: '', + cabinetType: null, + inn: '', + organizationData: null, + wbApiKey: '', + wbApiValidation: null, + ozonApiKey: '', + ozonApiValidation: null, + isAuthenticated: false, + partnerCode: partnerCode + }) + + const { verifySmsCode, checkAuth } = useAuth() + + // При завершении авторизации инициируем проверку и перенаправление + useEffect(() => { + if (step === 'complete') { + const timer = setTimeout(() => { + // Принудительно перенаправляем в дашборд + window.location.href = '/dashboard' + }, 2000) // Задержка для показа сообщения о завершении + + return () => clearTimeout(timer) + } + }, [step]) + + const handlePhoneNext = (phone: string) => { + setAuthData(prev => ({ ...prev, phone })) + setStep('sms') + } + + const handleSmsNext = async (smsCode: string) => { + setAuthData(prev => ({ ...prev, smsCode, isAuthenticated: true })) + + // SMS код уже проверен в SmsStep компоненте + // Просто переходим к следующему шагу + setStep('cabinet-select') + } + + const handleCabinetNext = (cabinetType: CabinetType) => { + setAuthData(prev => ({ ...prev, cabinetType })) + if (cabinetType === 'fulfillment' || cabinetType === 'logist' || cabinetType === 'wholesale') { + setStep('inn') + } else { + setStep('marketplace-api') + } + } + + const handleInnNext = (inn: string, organizationData?: OrganizationData) => { + setAuthData(prev => ({ + ...prev, + inn, + organizationData: organizationData || null + })) + setStep('confirmation') + } + + const handleMarketplaceApiNext = (apiData: { + wbApiKey?: string + wbApiValidation?: ApiKeyValidation + ozonApiKey?: string + ozonApiValidation?: ApiKeyValidation + }) => { + setAuthData(prev => ({ + ...prev, + wbApiKey: apiData.wbApiKey || '', + wbApiValidation: apiData.wbApiValidation || null, + ozonApiKey: apiData.ozonApiKey || '', + ozonApiValidation: apiData.ozonApiValidation || null + })) + setStep('confirmation') + } + + const handleConfirmation = () => { + setStep('complete') + } + + const handlePhoneBack = () => { + setStep('phone') + } + + const handleSmsBack = () => { + setStep('phone') + } + + const handleCabinetBack = () => { + setStep('sms') + } + + const handleInnBack = () => { + setStep('cabinet-select') + } + + const handleMarketplaceApiBack = () => { + setStep('cabinet-select') + } + + const handleConfirmationBack = () => { + if (authData.cabinetType === 'fulfillment' || authData.cabinetType === 'logist' || authData.cabinetType === 'wholesale') { + setStep('inn') + } else { + setStep('marketplace-api') + } + } + + if (step === 'complete') { + return ( +
+ {/* Floating Particles */} +
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +

Добро пожаловать!

+

Регистрация успешно завершена

+
+

Тип кабинета:

+

+ { + authData.cabinetType === 'fulfillment' ? 'Фулфилмент' : + authData.cabinetType === 'logist' ? 'Логистика' : + authData.cabinetType === 'wholesale' ? 'Оптовик' : + 'Селлер' + } +

+
+
+
+ Переход в личный кабинет... +
+
+
+
+ ) + } + + return ( + <> + {step === 'phone' && } + {step === 'sms' && ( + + )} + {step === 'cabinet-select' && ( + + )} + {step === 'inn' && ( + + )} + {step === 'marketplace-api' && ( + + )} + {step === 'confirmation' && ( + + )} + {step === 'complete' && ( +
+
+
+ +
+
+
+

+ Регистрация завершена! +

+

+ Ваш {authData.cabinetType === 'fulfillment' ? 'фулфилмент кабинет' : + authData.cabinetType === 'seller' ? 'селлер кабинет' : + authData.cabinetType === 'logist' ? 'логистический кабинет' : 'оптовый кабинет'} + {' '}успешно создан +

+
+
+

+ Переход в личный кабинет... +

+
+
+ )} + + ) +} \ No newline at end of file diff --git a/src/components/auth/auth-layout.tsx b/src/components/auth/auth-layout.tsx new file mode 100644 index 0000000..79e25f6 --- /dev/null +++ b/src/components/auth/auth-layout.tsx @@ -0,0 +1,140 @@ +"use client" + +import { ReactNode } from "react" +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" +import { Badge } from "@/components/ui/badge" +import { Progress } from "@/components/ui/progress" +import { Separator } from "@/components/ui/separator" +import { Truck, Package, ShoppingCart } from "lucide-react" + +interface AuthLayoutProps { + children: ReactNode + title: string + description?: string + currentStep?: number + totalSteps?: number + stepName?: string +} + +export function AuthLayout({ + children, + title, + description, + currentStep = 1, + totalSteps = 5, + stepName = "Авторизация" +}: AuthLayoutProps) { + const progressValue = (currentStep / totalSteps) * 100 + const showProgress = currentStep > 1 // Показываем прогресс только после первого шага + + return ( +
+ {/* Floating Particles */} +
+
+
+
+
+
+
+
+
+
+
+ + {/* Контейнер для выравнивания левой и правой частей */} +
+ {/* Левая часть - Информация о продукте */} +
+
+

+ SferaV +

+

Управление бизнесом

+ +
+
+
+ +

Фулфилмент

+
+

Полный цикл обработки заказов от получения до доставки клиенту

+
+
+
+ +

Логистика

+
+

Управление складскими операциями и доставкой товаров

+
+
+
+ +

Селлер

+
+

Интеграция с маркетплейсами и управление продажами

+
+
+
+
+ + {/* Правая часть - Форма авторизации */} +
+
+ {/* Мобильный заголовок */} +
+

+ SferaV +

+

Управление бизнесом

+
+ + {/* Progress Section - показываем только после первого шага */} + {showProgress && ( +
+
+ + Шаг {currentStep} из {totalSteps} + + + {stepName} + +
+ +
+ )} + + + + + {title} + + {description && ( + <> + + + {description} + + + )} + + + {children} + + + + {/* Дополнительная информация */} +
+

+ Регистрируясь, вы соглашаетесь с условиями использования +

+
+
+
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/auth/cabinet-select-step.tsx b/src/components/auth/cabinet-select-step.tsx new file mode 100644 index 0000000..e70cbcf --- /dev/null +++ b/src/components/auth/cabinet-select-step.tsx @@ -0,0 +1,114 @@ +"use client" + +import { Button } from "@/components/ui/button" +import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar" +import { Badge } from "@/components/ui/badge" +import { AuthLayout } from "./auth-layout" +import { Package, ShoppingCart, ArrowLeft, Truck, Building2 } from "lucide-react" + +interface CabinetSelectStepProps { + onNext: (cabinetType: 'fulfillment' | 'seller' | 'logist' | 'wholesale') => void + onBack: () => void +} + +export function CabinetSelectStep({ onNext, onBack }: CabinetSelectStepProps) { + const cabinets = [ + { + id: 'fulfillment' as const, + title: 'Фулфилмент', + description: 'Склады и логистика', + icon: Package, + features: ['Склады', 'Логистика', 'ИНН'], + color: 'blue' + }, + { + id: 'seller' as const, + title: 'Селлер', + description: 'Продажи на маркетплейсах', + icon: ShoppingCart, + features: ['Wildberries', 'Ozon', 'Аналитика'], + color: 'purple' + }, + { + id: 'logist' as const, + title: 'Логистика', + description: 'Логистические решения', + icon: Truck, + features: ['Доставка', 'Склады', 'ИНН'], + color: 'green' + }, + { + id: 'wholesale' as const, + title: 'Оптовик', + description: 'Оптовые продажи', + icon: Building2, + features: ['Опт', 'Поставки', 'ИНН'], + color: 'orange' + } + ] + + return ( + +
+
+ {cabinets.map((cabinet) => { + const IconComponent = cabinet.icon + return ( + + ) + })} +
+ + +
+
+ ) +} \ No newline at end of file diff --git a/src/components/auth/confirmation-step.tsx b/src/components/auth/confirmation-step.tsx new file mode 100644 index 0000000..822eff7 --- /dev/null +++ b/src/components/auth/confirmation-step.tsx @@ -0,0 +1,360 @@ +"use client" + +import { useState } from "react" +import { Button } from "@/components/ui/button" +import { AuthLayout } from "./auth-layout" +import { Package, UserCheck, Phone, FileText, Key, ArrowLeft, Check, Zap, Truck, Building2 } from "lucide-react" +import { Badge } from "@/components/ui/badge" +import { useAuth } from '@/hooks/useAuth' + +interface OrganizationData { + name?: string + fullName?: string + address?: string + isActive?: boolean +} + +interface ApiKeyValidation { + sellerId?: string + sellerName?: string + isValid?: boolean +} + +interface ConfirmationStepProps { + data: { + phone: string + cabinetType: 'fulfillment' | 'seller' | 'logist' | 'wholesale' + inn?: string + organizationData?: OrganizationData + wbApiKey?: string + wbApiValidation?: ApiKeyValidation + ozonApiKey?: string + ozonApiValidation?: ApiKeyValidation + } + onConfirm: () => void + onBack: () => void +} + +export function ConfirmationStep({ data, onConfirm, onBack }: ConfirmationStepProps) { + const [isLoading, setIsLoading] = useState(false) + const [error, setError] = useState(null) + + const { registerFulfillmentOrganization, registerSellerOrganization } = useAuth() + + const formatPhone = (phone: string) => { + return phone || "+7 (___) ___-__-__" + } + + const formatApiKey = (key?: string) => { + if (!key) return "" + return key.substring(0, 4) + "•".repeat(key.length - 8) + key.substring(key.length - 4) + } + + const handleConfirm = async () => { + setIsLoading(true) + setError(null) + + try { + let result + + if ((data.cabinetType === 'fulfillment' || data.cabinetType === 'logist' || data.cabinetType === 'wholesale') && data.inn) { + result = await registerFulfillmentOrganization( + data.phone.replace(/\D/g, ''), + data.inn + ) + } else if (data.cabinetType === 'seller') { + result = await registerSellerOrganization({ + phone: data.phone.replace(/\D/g, ''), + wbApiKey: data.wbApiKey, + ozonApiKey: data.ozonApiKey + }) + } + + if (result?.success) { + onConfirm() + } else { + setError(result?.message || 'Ошибка при регистрации организации') + } + } catch (error: unknown) { + console.error('Registration error:', error) + setError('Произошла ошибка при регистрации. Попробуйте еще раз.') + } finally { + setIsLoading(false) + } + } + + return ( + +
+ {/* Объединенная карточка с данными */} +
+ {/* Телефон */} +
+
+ + Телефон: +
+
+ {formatPhone(data.phone)} + + + +
+
+ + {/* Тип кабинета */} +
+
+ {data.cabinetType === 'fulfillment' ? ( + + ) : data.cabinetType === 'logist' ? ( + + ) : data.cabinetType === 'wholesale' ? ( + + ) : ( + + )} + Кабинет: +
+
+ + {data.cabinetType === 'fulfillment' ? 'Фулфилмент' : + data.cabinetType === 'logist' ? 'Логистика' : + data.cabinetType === 'wholesale' ? 'Оптовик' : + 'Селлер'} + + + {data.cabinetType === 'fulfillment' ? ( + + ) : data.cabinetType === 'logist' ? ( + + ) : data.cabinetType === 'wholesale' ? ( + + ) : ( + + )} + +
+
+ + {/* Данные организации */} + {(data.cabinetType === 'fulfillment' || data.cabinetType === 'logist' || data.cabinetType === 'wholesale') && data.inn && ( + <> +
+
+ + ИНН: +
+
+ {data.inn} + + + +
+
+ + {/* Данные организации из DaData */} + {data.organizationData && ( + <> + {data.organizationData.name && ( +
+ Название: + + {data.organizationData.name} + +
+ )} + + {data.organizationData.fullName && data.organizationData.fullName !== data.organizationData.name && ( +
+ Полное название: + + {data.organizationData.fullName} + +
+ )} + + {data.organizationData.address && ( +
+ Адрес: + + {data.organizationData.address} + +
+ )} + +
+ Статус: + + {data.organizationData.isActive ? ( + <> + + Активна + + ) : ( + <> + + Неактивна + + )} + +
+ + )} + + )} + + {/* API ключи для селлера */} + {data.cabinetType === 'seller' && (data.wbApiKey || data.ozonApiKey) && ( + <> +
+ + API ключи: + + + Активны + +
+ + {data.wbApiKey && ( +
+
+
+ Wildberries + + WB + +
+ {data.wbApiValidation?.sellerName ? ( + + {data.wbApiValidation.sellerName} + + ) : ( + + + Подключен + + )} +
+ + {data.wbApiValidation && ( + <> + {data.wbApiValidation.sellerName && ( +
+ Магазин: + + {data.wbApiValidation.sellerName} + +
+ )} + {data.wbApiValidation.sellerId && ( +
+ ID продавца: + + {data.wbApiValidation.sellerId} + +
+ )} + + )} +
+ )} + + {data.ozonApiKey && ( +
+
+
+ Ozon + + OZ + +
+ + + Подключен + +
+ + {data.ozonApiValidation && ( + <> + {data.ozonApiValidation.sellerName && ( +
+ Магазин: + + {data.ozonApiValidation.sellerName} + +
+ )} + {data.ozonApiValidation.sellerId && ( +
+ ID продавца: + + {data.ozonApiValidation.sellerId} + +
+ )} + + )} +
+ )} + + )} +
+ + {error && ( +
+

{error}

+
+ )} + +
+ + + +
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/auth/inn-step.tsx b/src/components/auth/inn-step.tsx new file mode 100644 index 0000000..1bc2262 --- /dev/null +++ b/src/components/auth/inn-step.tsx @@ -0,0 +1,219 @@ +"use client" + +import { useState } from "react" +import { Button } from "@/components/ui/button" +import { GlassInput } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { Alert, AlertDescription } from "@/components/ui/alert" +import { AuthLayout } from "./auth-layout" +import { FileText, ArrowLeft, Building, Check, AlertTriangle } from "lucide-react" +import { Badge } from "@/components/ui/badge" +import { useMutation } from '@apollo/client' +import { VERIFY_INN } from '@/graphql/mutations' + +interface InnStepProps { + onNext: (inn: string, organizationData?: OrganizationData) => void + onBack: () => void +} + +interface OrganizationData { + name: string + address: string + isActive: boolean +} + +export function InnStep({ onNext, onBack }: InnStepProps) { + const [inn, setInn] = useState("") + const [isLoading, setIsLoading] = useState(false) + const [error, setError] = useState(null) + const [organizationData, setOrganizationData] = useState(null) + + const [verifyInn] = useMutation(VERIFY_INN) + + const formatInn = (value: string) => { + const numbers = value.replace(/\D/g, '') + return numbers.slice(0, 12) // Максимум 12 цифр для ИНН + } + + const handleInnChange = (e: React.ChangeEvent) => { + const formatted = formatInn(e.target.value) + setInn(formatted) + setError(null) + setOrganizationData(null) + } + + const isValidInn = (inn: string) => { + return inn.length === 10 || inn.length === 12 + } + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + + if (!isValidInn(inn)) { + setError('ИНН должен содержать 10 или 12 цифр') + return + } + + setIsLoading(true) + setError(null) + setOrganizationData(null) + + try { + const { data } = await verifyInn({ + variables: { inn } + }) + + if (data.verifyInn.success && data.verifyInn.organization) { + const org = data.verifyInn.organization + const newOrgData = { + name: org.name, + address: org.address, + isActive: org.isActive + } + setOrganizationData(newOrgData) + + if (org.isActive) { + // Автоматически переходим дальше для активных организаций + setTimeout(() => { + onNext(inn, newOrgData) + }, 1500) + } + } else { + setError('Организация с таким ИНН не найдена') + } + } catch (error: unknown) { + console.error('INN verification error:', error) + setError('Ошибка проверки ИНН. Попробуйте позже.') + } finally { + setIsLoading(false) + } + } + + const handleContinueInactive = () => { + if (organizationData && !organizationData.isActive) { + onNext(inn, organizationData) + } + } + + return ( + +
+ + + + Фулфилмент кабинет - склады и логистика + + + +
+
+
+ + {organizationData && ( + + {organizationData.isActive ? ( + <> + + Активна + + ) : ( + <> + + Неактивна + + )} + + )} +
+ + + + {error && ( +

{error}

+ )} +
+ + {organizationData && ( +
+

{organizationData.name}

+

{organizationData.address}

+ + {organizationData.isActive ? ( +
+ + Организация активна +
+ ) : ( +
+ + Организация неактивна +
+ )} +
+ )} + +
+ {!organizationData && ( + + )} + + {organizationData && !organizationData.isActive && ( + + )} + + +
+
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/auth/marketplace-api-step.tsx b/src/components/auth/marketplace-api-step.tsx new file mode 100644 index 0000000..50970f3 --- /dev/null +++ b/src/components/auth/marketplace-api-step.tsx @@ -0,0 +1,367 @@ +"use client" + +import { useState, useEffect, useRef } from "react" +import { Button } from "@/components/ui/button" +import { GlassInput } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { Checkbox } from "@/components/ui/checkbox" +import { AuthLayout } from "./auth-layout" +import { Key, ArrowLeft, ShoppingCart, Check, X } from "lucide-react" +import { Badge } from "@/components/ui/badge" +import { useMutation } from '@apollo/client' +import { ADD_MARKETPLACE_API_KEY } from '@/graphql/mutations' +import { getAuthToken } from '@/lib/apollo-client' + +interface ApiValidationData { + sellerId?: string + sellerName?: string + isValid?: boolean +} + +interface MarketplaceApiStepProps { + onNext: (apiData: { + wbApiKey?: string + wbApiValidation?: ApiValidationData + ozonApiKey?: string + ozonApiValidation?: ApiValidationData + }) => void + onBack: () => void +} + +interface ApiKeyValidation { + [key: string]: { + isValid: boolean | null + isValidating: boolean + error?: string + } +} + +export function MarketplaceApiStep({ onNext, onBack }: MarketplaceApiStepProps) { + const [selectedMarketplaces, setSelectedMarketplaces] = useState([]) + const [wbApiKey, setWbApiKey] = useState("") + const [ozonApiKey, setOzonApiKey] = useState("") + const [validationStates, setValidationStates] = useState({}) + const [isSubmitting, setIsSubmitting] = useState(false) + const [wbValidationData, setWbValidationData] = useState(null) + const [ozonValidationData, setOzonValidationData] = useState(null) + + const [addMarketplaceApiKey] = useMutation(ADD_MARKETPLACE_API_KEY) + + const handleMarketplaceToggle = (marketplace: string) => { + if (selectedMarketplaces.includes(marketplace)) { + setSelectedMarketplaces(prev => prev.filter(m => m !== marketplace)) + if (marketplace === 'wildberries') setWbApiKey("") + if (marketplace === 'ozon') setOzonApiKey("") + // Сбрасываем состояние валидации + setValidationStates(prev => ({ + ...prev, + [marketplace]: { isValid: null, isValidating: false } + })) + } else { + setSelectedMarketplaces(prev => [...prev, marketplace]) + } + } + + const validateApiKey = async (marketplace: string, apiKey: string) => { + if (!apiKey || !isValidApiKey(apiKey)) return + + setValidationStates(prev => ({ + ...prev, + [marketplace]: { isValid: null, isValidating: true } + })) + + try { + const { data } = await addMarketplaceApiKey({ + variables: { + input: { + marketplace: marketplace.toUpperCase(), + apiKey, + validateOnly: true + } + } + }) + + setValidationStates(prev => ({ + ...prev, + [marketplace]: { + isValid: data.addMarketplaceApiKey.success, + isValidating: false, + error: data.addMarketplaceApiKey.success ? undefined : data.addMarketplaceApiKey.message + } + })) + + // Сохраняем данные валидации + if (data.addMarketplaceApiKey.success && data.addMarketplaceApiKey.apiKey?.validationData) { + const validationData = data.addMarketplaceApiKey.apiKey.validationData + if (marketplace === 'wildberries') { + setWbValidationData({ + sellerId: validationData.sellerId, + sellerName: validationData.sellerName, + isValid: true + }) + } else if (marketplace === 'ozon') { + setOzonValidationData({ + sellerId: validationData.sellerId, + sellerName: validationData.sellerName, + isValid: true + }) + } + } + } catch (error: unknown) { + setValidationStates(prev => ({ + ...prev, + [marketplace]: { + isValid: false, + isValidating: false, + error: 'Ошибка валидации API ключа' + } + })) + } + } + + const handleApiKeyChange = (marketplace: string, value: string) => { + if (marketplace === 'wildberries') { + setWbApiKey(value) + } else if (marketplace === 'ozon') { + setOzonApiKey(value) + } + + // Сбрасываем состояние валидации при изменении + setValidationStates(prev => ({ + ...prev, + [marketplace]: { isValid: null, isValidating: false } + })) + } + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + + if (selectedMarketplaces.length === 0) return + + setIsSubmitting(true) + + // Валидируем все выбранные маркетплейсы + const validationPromises = [] + + if (selectedMarketplaces.includes('wildberries') && isValidApiKey(wbApiKey)) { + validationPromises.push(validateApiKey('wildberries', wbApiKey)) + } + + if (selectedMarketplaces.includes('ozon') && isValidApiKey(ozonApiKey)) { + validationPromises.push(validateApiKey('ozon', ozonApiKey)) + } + + // Ждем завершения всех валидаций + await Promise.all(validationPromises) + + // Небольшая задержка чтобы состояние обновилось + await new Promise(resolve => setTimeout(resolve, 100)) + + // Проверяем результаты валидации + let hasValidationErrors = false + + for (const marketplace of selectedMarketplaces) { + const validation = validationStates[marketplace] + if (!validation || validation.isValid !== true) { + hasValidationErrors = true + break + } + } + + if (!hasValidationErrors) { + const apiData: { + wbApiKey?: string + wbApiValidation?: ApiValidationData + ozonApiKey?: string + ozonApiValidation?: ApiValidationData + } = {} + + if (selectedMarketplaces.includes('wildberries') && isValidApiKey(wbApiKey)) { + apiData.wbApiKey = wbApiKey + if (wbValidationData) { + apiData.wbApiValidation = wbValidationData + } + } + + if (selectedMarketplaces.includes('ozon') && isValidApiKey(ozonApiKey)) { + apiData.ozonApiKey = ozonApiKey + if (ozonValidationData) { + apiData.ozonApiValidation = ozonValidationData + } + } + + onNext(apiData) + } + + setIsSubmitting(false) + } + + const isValidApiKey = (key: string) => { + return key.length >= 10 && /^[a-zA-Z0-9-_.]+$/.test(key) + } + + const isFormValid = () => { + if (selectedMarketplaces.length === 0) return false + + for (const marketplace of selectedMarketplaces) { + const apiKey = marketplace === 'wildberries' ? wbApiKey : ozonApiKey + + if (!isValidApiKey(apiKey)) { + return false + } + } + + return true + } + + const getValidationBadge = (marketplace: string) => { + const validation = validationStates[marketplace] + + if (!validation || validation.isValid === null) return null + + if (validation.isValidating) { + return ( + + Проверка... + + ) + } + + if (validation.isValid) { + return ( + + + Валидный + + ) + } + + return ( + + + Невалидный + + ) + } + + const marketplaces = [ + { + id: 'wildberries', + name: 'Wildberries', + badge: 'Популярный', + badgeColor: 'purple', + apiKey: wbApiKey, + setApiKey: (value: string) => handleApiKeyChange('wildberries', value), + placeholder: 'API ключ Wildberries' + }, + { + id: 'ozon', + name: 'Ozon', + badge: 'Быстро растёт', + badgeColor: 'blue', + apiKey: ozonApiKey, + setApiKey: (value: string) => handleApiKeyChange('ozon', value), + placeholder: 'API ключ Ozon' + } + ] + + return ( + +
+
+
+ +
+

Кабинет селлера

+

Управление продажами на маркетплейсах

+
+
+
+ +
+
+ {marketplaces.map((marketplace) => ( +
+
+
+
+ handleMarketplaceToggle(marketplace.id)} + className="border-white/30 data-[state=checked]:bg-purple-500" + /> + +
+
+ + {marketplace.badge} + + {selectedMarketplaces.includes(marketplace.id) && getValidationBadge(marketplace.id)} +
+
+ + {selectedMarketplaces.includes(marketplace.id) && ( +
+ marketplace.setApiKey(e.target.value)} + className="h-10 text-sm" + /> +

+ {marketplace.id === 'wildberries' + ? 'Личный кабинет → Настройки → Доступ к API' + : 'Кабинет продавца → API → Генерация ключа' + } +

+ {validationStates[marketplace.id]?.error && ( +

+ {validationStates[marketplace.id].error} +

+ )} +
+ )} +
+
+ ))} +
+ +
+ + + +
+
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/auth/phone-step.tsx b/src/components/auth/phone-step.tsx new file mode 100644 index 0000000..0f1e083 --- /dev/null +++ b/src/components/auth/phone-step.tsx @@ -0,0 +1,140 @@ +"use client" + +import { useState } from "react" +import { Button } from "@/components/ui/button" +import { GlassInput } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { AuthLayout } from "./auth-layout" +import { Phone, ArrowRight } from "lucide-react" +import { useMutation } from '@apollo/client' +import { SEND_SMS_CODE } from '@/graphql/mutations' + +interface PhoneStepProps { + onNext: (phone: string) => void +} + +export function PhoneStep({ onNext }: PhoneStepProps) { + const [phone, setPhone] = useState("") + const [isLoading, setIsLoading] = useState(false) + const [error, setError] = useState(null) + + const [sendSmsCode] = useMutation(SEND_SMS_CODE) + + const formatPhoneNumber = (value: string) => { + const numbers = value.replace(/\D/g, '') + + if (numbers.length === 0) return '' + if (numbers[0] === '8') { + const withoutFirst = numbers.slice(1) + return formatRussianNumber('7' + withoutFirst) + } + if (numbers[0] === '7') { + return formatRussianNumber(numbers) + } + + return formatRussianNumber('7' + numbers) + } + + const formatRussianNumber = (numbers: string) => { + if (numbers.length <= 1) return '+7' + if (numbers.length <= 4) return `+7 (${numbers.slice(1)}` + if (numbers.length <= 7) return `+7 (${numbers.slice(1, 4)}) ${numbers.slice(4)}` + if (numbers.length <= 9) return `+7 (${numbers.slice(1, 4)}) ${numbers.slice(4, 7)}-${numbers.slice(7)}` + return `+7 (${numbers.slice(1, 4)}) ${numbers.slice(4, 7)}-${numbers.slice(7, 9)}-${numbers.slice(9, 11)}` + } + + const handlePhoneChange = (e: React.ChangeEvent) => { + const formatted = formatPhoneNumber(e.target.value) + setPhone(formatted) + setError(null) + } + + const isValidPhone = (phone: string) => { + const numbers = phone.replace(/\D/g, '') + return numbers.length === 11 && (numbers.startsWith('7') || numbers.startsWith('8')) + } + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + + if (!isValidPhone(phone)) { + setError('Введите корректный номер телефона') + return + } + + setIsLoading(true) + setError(null) + + try { + const cleanPhone = phone.replace(/\D/g, '') + const formattedPhone = cleanPhone.startsWith('8') + ? '7' + cleanPhone.slice(1) + : cleanPhone + + const { data } = await sendSmsCode({ + variables: { phone: formattedPhone } + }) + + if (data.sendSmsCode.success) { + onNext(phone) + } else { + setError('Ошибка отправки SMS. Попробуйте позже.') + } + } catch (error: unknown) { + console.error('SMS sending error:', error) + setError(error instanceof Error ? error.message : 'Ошибка отправки SMS. Попробуйте позже.') + } finally { + setIsLoading(false) + } + } + + return ( + +
+
+ + { + // Устанавливаем курсор в начало если поле пустое или содержит только +7 + if (phone === '' || phone === '+7') { + setTimeout(() => { + e.target.setSelectionRange(0, 0); + }, 0); + } + }} + /> + {error && ( +

{error}

+ )} +
+ + +
+
+ ) +} \ No newline at end of file diff --git a/src/components/auth/sms-step.tsx b/src/components/auth/sms-step.tsx new file mode 100644 index 0000000..7adb147 --- /dev/null +++ b/src/components/auth/sms-step.tsx @@ -0,0 +1,225 @@ +"use client" + +import { useState, useRef, KeyboardEvent, useEffect } from "react" +import { Button } from "@/components/ui/button" +import { GlassInput } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { Badge } from "@/components/ui/badge" +import { Alert, AlertDescription } from "@/components/ui/alert" +import { AuthLayout } from "./auth-layout" +import { MessageSquare, ArrowLeft, Clock, RefreshCw, Check } from "lucide-react" +import { useMutation } from '@apollo/client' +import { SEND_SMS_CODE } from '@/graphql/mutations' +import { useAuth } from '@/hooks/useAuth' + +interface SmsStepProps { + phone: string + onNext: (code: string) => void + onBack: () => void +} + +export function SmsStep({ phone, onNext, onBack }: SmsStepProps) { + const [code, setCode] = useState(["", "", "", ""]) + const [timeLeft, setTimeLeft] = useState(60) + const [canResend, setCanResend] = useState(false) + const [isLoading, setIsLoading] = useState(false) + const [error, setError] = useState(null) + const inputRefs = useRef<(HTMLInputElement | null)[]>([]) + + const { verifySmsCode, checkAuth } = useAuth() + const [sendSmsCode] = useMutation(SEND_SMS_CODE) + + // Автофокус на первое поле при загрузке + useEffect(() => { + if (inputRefs.current[0]) { + inputRefs.current[0].focus() + } + }, []) + + // Таймер для повторной отправки + useEffect(() => { + if (timeLeft > 0) { + const timer = setTimeout(() => setTimeLeft(timeLeft - 1), 1000) + return () => clearTimeout(timer) + } else { + setCanResend(true) + } + }, [timeLeft]) + + const handleInputChange = (index: number, value: string) => { + if (value.length > 1) return // Разрешаем только одну цифру + if (!/^\d*$/.test(value)) return // Разрешаем только цифры + + const newCode = [...code] + newCode[index] = value + setCode(newCode) + setError(null) + + // Автоматически переключаемся на следующее поле + if (value && index < 3) { + inputRefs.current[index + 1]?.focus() + } + } + + const handleKeyDown = (index: number, e: KeyboardEvent) => { + if (e.key === "Backspace" && !code[index] && index > 0) { + inputRefs.current[index - 1]?.focus() + } + } + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + const fullCode = code.join("") + if (fullCode.length === 4) { + setIsLoading(true) + setError(null) + + try { + const cleanPhone = phone.replace(/\D/g, '') + const formattedPhone = cleanPhone.startsWith('8') + ? '7' + cleanPhone.slice(1) + : cleanPhone + + const result = await verifySmsCode(formattedPhone, fullCode) + + if (result.success) { + console.log('SmsStep - SMS verification successful, user:', result.user) + + // Проверяем есть ли у пользователя уже организация + if (result.user?.organization) { + console.log('SmsStep - User already has organization, redirecting to dashboard') + // Если организация уже есть, перенаправляем прямо в кабинет + window.location.href = '/dashboard' + return + } + + // Если организации нет, продолжаем поток регистрации + onNext(fullCode) + } else { + setError('Неверный код. Проверьте SMS и попробуйте еще раз.') + setCode(["", "", "", ""]) + inputRefs.current[0]?.focus() + } + } catch (error: unknown) { + console.error('Error verifying SMS code:', error) + setError('Ошибка проверки кода. Попробуйте еще раз.') + setCode(["", "", "", ""]) + inputRefs.current[0]?.focus() + } finally { + setIsLoading(false) + } + } + } + + const handleResend = async () => { + setTimeLeft(60) + setCanResend(false) + setError(null) + + try { + const cleanPhone = phone.replace(/\D/g, '') + const formattedPhone = cleanPhone.startsWith('8') + ? '7' + cleanPhone.slice(1) + : cleanPhone + + await sendSmsCode({ + variables: { phone: formattedPhone } + }) + } catch (error: unknown) { + console.error('Error resending SMS:', error) + setError('Ошибка отправки SMS. Попробуйте позже.') + } + } + + const isValidCode = code.every(digit => digit !== "") + + return ( + +
+
+
+
+ + {isValidCode && ( + + + Готово + + )} +
+ +
+ {code.map((digit, index) => ( + { inputRefs.current[index] = el }} + type="text" + inputMode="numeric" + maxLength={1} + value={digit} + onChange={(e) => handleInputChange(index, e.target.value)} + onKeyDown={(e) => handleKeyDown(index, e)} + className={`w-12 h-12 text-center text-lg font-semibold ${error ? 'border-red-400/50' : ''}`} + /> + ))} +
+ + {error && ( +

{error}

+ )} +
+ +
+ + + +
+ +
+ {!canResend ? ( +
+ + Повторная отправка через {timeLeft}с +
+ ) : ( + + )} +
+
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/dashboard/dashboard-home.tsx b/src/components/dashboard/dashboard-home.tsx new file mode 100644 index 0000000..e949f9b --- /dev/null +++ b/src/components/dashboard/dashboard-home.tsx @@ -0,0 +1,109 @@ +"use client" + +import { useAuth } from '@/hooks/useAuth' +import { Card } from '@/components/ui/card' +import { Building2, Phone } from 'lucide-react' +import { Sidebar } from './sidebar' + +export function DashboardHome() { + const { user } = useAuth() + + const getOrganizationName = () => { + if (user?.organization?.name) { + return user.organization.name + } + if (user?.organization?.fullName) { + return user.organization.fullName + } + return 'Вашей организации' + } + + const getCabinetType = () => { + if (!user?.organization?.type) return 'кабинета' + + switch (user.organization.type) { + case 'FULFILLMENT': + return 'фулфилмент кабинета' + case 'SELLER': + return 'селлер кабинета' + case 'LOGIST': + return 'логистического кабинета' + case 'WHOLESALE': + return 'оптового кабинета' + default: + return 'кабинета' + } + } + + return ( +
+ +
+
+
+

+ Добро пожаловать! +

+

+ Главная панель управления {getCabinetType()} +

+
+ +
+ {/* Информация об организации */} + +
+ +

Организация

+
+
+

+ {getOrganizationName()} +

+ {user?.organization?.inn && ( +

+ ИНН: {user.organization.inn} +

+ )} +
+
+ + {/* Контактная информация */} + +
+ +

Контакты

+
+
+

+ +{user?.phone} +

+

+ Основной номер +

+
+
+ + {/* Статистика или дополнительная информация */} + +
+
+ SF +
+

SferaV

+
+
+

+ Система управления бизнесом +

+

+ Версия 1.0 +

+
+
+
+
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/dashboard/dashboard.tsx b/src/components/dashboard/dashboard.tsx new file mode 100644 index 0000000..3290140 --- /dev/null +++ b/src/components/dashboard/dashboard.tsx @@ -0,0 +1,31 @@ +"use client" + +import { useState } from 'react' +import { Sidebar } from './sidebar' +import { UserSettings } from './user-settings' +import { DashboardHome } from './dashboard-home' + +export type DashboardSection = 'home' | 'settings' + +export function Dashboard() { + const [activeSection, setActiveSection] = useState('home') + + const renderContent = () => { + switch (activeSection) { + case 'settings': + return + case 'home': + default: + return + } + } + + return ( +
+ +
+ {renderContent()} +
+
+ ) +} \ No newline at end of file diff --git a/src/components/dashboard/sidebar.tsx b/src/components/dashboard/sidebar.tsx new file mode 100644 index 0000000..c9f5266 --- /dev/null +++ b/src/components/dashboard/sidebar.tsx @@ -0,0 +1,141 @@ +"use client" + +import { useAuth } from '@/hooks/useAuth' +import { Button } from '@/components/ui/button' +import { Card } from '@/components/ui/card' +import { Separator } from '@/components/ui/separator' +import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar' +import { useRouter, usePathname } from 'next/navigation' +import { + Settings, + LogOut, + Building2, + Store +} from 'lucide-react' + +export function Sidebar() { + const { user, logout } = useAuth() + const router = useRouter() + const pathname = usePathname() + + const getInitials = () => { + const orgName = getOrganizationName() + return orgName.charAt(0).toUpperCase() + } + + const getOrganizationName = () => { + if (user?.organization?.name) { + return user.organization.name + } + if (user?.organization?.fullName) { + return user.organization.fullName + } + return 'Организация' + } + + const getCabinetType = () => { + if (!user?.organization?.type) return 'Кабинет' + + switch (user.organization.type) { + case 'FULFILLMENT': + return 'Фулфилмент' + case 'SELLER': + return 'Селлер' + case 'LOGIST': + return 'Логистика' + case 'WHOLESALE': + return 'Оптовик' + default: + return 'Кабинет' + } + } + + const handleSettingsClick = () => { + router.push('/settings') + } + + const handleMarketClick = () => { + router.push('/market') + } + + const isSettingsActive = pathname === '/settings' + const isMarketActive = pathname.startsWith('/market') + + return ( +
+
+ + + {/* Информация о пользователе */} + +
+ + {user?.avatar ? ( + + ) : null} + + {getInitials()} + + +
+
+ +

+ {getOrganizationName()} +

+
+

+ {getCabinetType()} +

+
+
+
+ + {/* Навигация */} +
+ + + +
+ + {/* Кнопка выхода */} +
+ +
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/dashboard/user-settings.tsx b/src/components/dashboard/user-settings.tsx new file mode 100644 index 0000000..72d30de --- /dev/null +++ b/src/components/dashboard/user-settings.tsx @@ -0,0 +1,1130 @@ +"use client" + +import { useAuth } from '@/hooks/useAuth' +import { useMutation } from '@apollo/client' +import { UPDATE_USER_PROFILE, UPDATE_ORGANIZATION_BY_INN } from '@/graphql/mutations' +import { formatPhone } from '@/lib/utils' +import S3Service from '@/services/s3-service' +import { Card } from '@/components/ui/card' +import { Avatar, AvatarFallback } from '@/components/ui/avatar' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import { Badge } from '@/components/ui/badge' +import { Alert, AlertDescription } from '@/components/ui/alert' +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' +import { Sidebar } from './sidebar' +import { + User, + Building2, + Phone, + Mail, + MapPin, + CreditCard, + Key, + Edit3, + ExternalLink, + Copy, + CheckCircle, + AlertTriangle, + MessageCircle, + Save, + RefreshCw, + Calendar, + Settings, + Upload, + Camera +} from 'lucide-react' +import { useState, useEffect } from 'react' + +export function UserSettings() { + const { user } = useAuth() + const [updateUserProfile, { loading: isSaving }] = useMutation(UPDATE_USER_PROFILE) + const [updateOrganizationByInn, { loading: isUpdatingOrganization }] = useMutation(UPDATE_ORGANIZATION_BY_INN) + const [isEditing, setIsEditing] = useState(false) + const [saveMessage, setSaveMessage] = useState<{ type: 'success' | 'error', text: string } | null>(null) + const [partnerLink, setPartnerLink] = useState('') + const [isGenerating, setIsGenerating] = useState(false) + const [isUploadingAvatar, setIsUploadingAvatar] = useState(false) + + // Инициализируем данные из пользователя и организации + const [formData, setFormData] = useState({ + // Контактные данные организации + orgPhone: '', // телефон организации, не пользователя + managerName: '', + telegram: '', + whatsapp: '', + email: '', + + // Организация - данные могут быть заполнены из DaData + orgName: '', + address: '', + + // Юридические данные - могут быть заполнены из DaData + fullName: '', + inn: '', + ogrn: '', + registrationPlace: '', + + // Финансовые данные - требуют ручного заполнения + bankName: '', + bik: '', + accountNumber: '', + corrAccount: '' + }) + + // Загружаем данные организации при монтировании компонента + useEffect(() => { + if (user?.organization) { + const org = user.organization + + // Извлекаем первый телефон из phones JSON + let orgPhone = '' + if (org.phones && Array.isArray(org.phones) && org.phones.length > 0) { + orgPhone = org.phones[0].value || org.phones[0] || '' + } else if (org.phones && typeof org.phones === 'object') { + const phoneValues = Object.values(org.phones) + if (phoneValues.length > 0) { + orgPhone = String(phoneValues[0]) + } + } + + // Извлекаем email из emails JSON + let email = '' + if (org.emails && Array.isArray(org.emails) && org.emails.length > 0) { + email = org.emails[0].value || org.emails[0] || '' + } else if (org.emails && typeof org.emails === 'object') { + const emailValues = Object.values(org.emails) + if (emailValues.length > 0) { + email = String(emailValues[0]) + } + } + + // Извлекаем дополнительные данные из managementPost (JSON) + let customContacts: { + managerName?: string + telegram?: string + whatsapp?: string + bankDetails?: { + bankName?: string + bik?: string + accountNumber?: string + corrAccount?: string + } + } = {} + try { + if (org.managementPost && typeof org.managementPost === 'string') { + customContacts = JSON.parse(org.managementPost) + } + } catch (e) { + console.warn('Ошибка парсинга managementPost:', e) + } + + setFormData({ + orgPhone: orgPhone, + managerName: customContacts?.managerName || '', + telegram: customContacts?.telegram || '', + whatsapp: customContacts?.whatsapp || '', + email: email, + orgName: org.name || '', + address: org.address || '', + fullName: org.fullName || '', + inn: org.inn || '', + ogrn: org.ogrn || '', + registrationPlace: org.address || '', + bankName: customContacts?.bankDetails?.bankName || '', + bik: customContacts?.bankDetails?.bik || '', + accountNumber: customContacts?.bankDetails?.accountNumber || '', + corrAccount: customContacts?.bankDetails?.corrAccount || '' + }) + } + }, [user]) + + const getInitials = () => { + const orgName = user?.organization?.name || user?.organization?.fullName + if (orgName) { + return orgName.charAt(0).toUpperCase() + } + return user?.phone ? user.phone.slice(-2).toUpperCase() : 'О' + } + + const getCabinetTypeName = () => { + if (!user?.organization?.type) return 'Не указан' + + switch (user.organization.type) { + case 'FULFILLMENT': + return 'Фулфилмент' + case 'SELLER': + return 'Селлер' + case 'LOGIST': + return 'Логистика' + case 'WHOLESALE': + return 'Оптовик' + default: + return 'Не указан' + } + } + + // Обновленная функция для проверки заполненности профиля + const checkProfileCompleteness = () => { + // Базовые поля (обязательные для всех) + const baseFields = [ + { field: 'orgPhone', label: 'Телефон организации', value: formData.orgPhone }, + { field: 'managerName', label: 'Имя управляющего', value: formData.managerName }, + { field: 'email', label: 'Email', value: formData.email } + ] + + // Дополнительные поля в зависимости от типа кабинета + const additionalFields = [] + if (user?.organization?.type === 'FULFILLMENT' || user?.organization?.type === 'LOGIST' || user?.organization?.type === 'WHOLESALE') { + // Финансовые данные - всегда обязательны для бизнес-кабинетов + additionalFields.push( + { field: 'bankName', label: 'Название банка', value: formData.bankName }, + { field: 'bik', label: 'БИК', value: formData.bik }, + { field: 'accountNumber', label: 'Расчетный счет', value: formData.accountNumber }, + { field: 'corrAccount', label: 'Корр. счет', value: formData.corrAccount } + ) + } + + const allRequiredFields = [...baseFields, ...additionalFields] + const filledRequiredFields = allRequiredFields.filter(field => field.value && field.value.trim() !== '').length + + // Подсчитываем бонусные баллы за автоматически заполненные поля + let autoFilledFields = 0 + let totalAutoFields = 0 + + // Номер телефона пользователя для авторизации (не считаем в процентах заполненности) + // Телефон организации учитывается отдельно как обычное поле + + // Данные организации из DaData (если есть ИНН) + if (formData.inn || user?.organization?.inn) { + totalAutoFields += 5 // ИНН + название + адрес + полное название + ОГРН + + if (formData.inn || user?.organization?.inn) autoFilledFields += 1 // ИНН + if (formData.orgName || user?.organization?.name) autoFilledFields += 1 // Название + if (formData.address || user?.organization?.address) autoFilledFields += 1 // Адрес + if (formData.fullName || user?.organization?.fullName) autoFilledFields += 1 // Полное название + if (formData.ogrn || user?.organization?.ogrn) autoFilledFields += 1 // ОГРН + } + + // Место регистрации + if (formData.registrationPlace || user?.organization?.registrationDate) { + autoFilledFields += 1 + totalAutoFields += 1 + } + + const totalPossibleFields = allRequiredFields.length + totalAutoFields + const totalFilledFields = filledRequiredFields + autoFilledFields + + const percentage = totalPossibleFields > 0 ? Math.round((totalFilledFields / totalPossibleFields) * 100) : 0 + const missingFields = allRequiredFields.filter(field => !field.value || field.value.trim() === '').map(field => field.label) + + return { percentage, missingFields } + } + + const profileStatus = checkProfileCompleteness() + const isIncomplete = profileStatus.percentage < 100 + + const generatePartnerLink = async () => { + if (!user?.id) return + + setIsGenerating(true) + setSaveMessage(null) + + try { + // Генерируем уникальный код партнера + const partnerCode = btoa(user.id + Date.now()).replace(/[^a-zA-Z0-9]/g, '').substring(0, 12) + const link = `${window.location.origin}/register?partner=${partnerCode}` + + setPartnerLink(link) + setSaveMessage({ type: 'success', text: 'Партнерская ссылка сгенерирована!' }) + + // TODO: Сохранить партнерский код в базе данных + console.log('Partner code generated:', partnerCode) + + } catch (error) { + console.error('Error generating partner link:', error) + setSaveMessage({ type: 'error', text: 'Ошибка при генерации ссылки' }) + } finally { + setIsGenerating(false) + } + } + + const handleCopyLink = async () => { + if (!partnerLink) { + await generatePartnerLink() + return + } + + try { + await navigator.clipboard.writeText(partnerLink) + setSaveMessage({ type: 'success', text: 'Ссылка скопирована!' }) + } catch (error) { + console.error('Error copying to clipboard:', error) + setSaveMessage({ type: 'error', text: 'Ошибка при копировании' }) + } + } + + const handleOpenLink = async () => { + if (!partnerLink) { + await generatePartnerLink() + return + } + window.open(partnerLink, '_blank') + } + + const handleAvatarUpload = async (event: React.ChangeEvent) => { + const file = event.target.files?.[0] + if (!file || !user?.id) return + + setIsUploadingAvatar(true) + setSaveMessage(null) + + try { + const avatarUrl = await S3Service.uploadAvatar(file, user.id) + + // Обновляем аватар пользователя через GraphQL + const result = await updateUserProfile({ + variables: { + input: { + avatar: avatarUrl + } + } + }) + + if (result.data?.updateUserProfile?.success) { + setSaveMessage({ type: 'success', text: 'Аватар успешно обновлен! Обновляем страницу...' }) + setTimeout(() => { + window.location.reload() + }, 1000) + } else { + throw new Error('Failed to update avatar') + } + + } catch (error) { + console.error('Error uploading avatar:', error) + setSaveMessage({ type: 'error', text: 'Ошибка при загрузке аватара' }) + } finally { + setIsUploadingAvatar(false) + } + } + + // Функции для валидации и масок + const validateEmail = (email: string) => { + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ + return emailRegex.test(email) + } + + const formatPhoneInput = (value: string) => { + const cleaned = value.replace(/\D/g, '') + if (cleaned.length <= 1) return cleaned + if (cleaned.length <= 4) return `+7 (${cleaned.slice(1)}` + if (cleaned.length <= 7) return `+7 (${cleaned.slice(1, 4)}) ${cleaned.slice(4)}` + if (cleaned.length <= 9) return `+7 (${cleaned.slice(1, 4)}) ${cleaned.slice(4, 7)}-${cleaned.slice(7)}` + return `+7 (${cleaned.slice(1, 4)}) ${cleaned.slice(4, 7)}-${cleaned.slice(7, 9)}-${cleaned.slice(9, 11)}` + } + + const formatTelegram = (value: string) => { + // Убираем все символы кроме букв, цифр, _ и @ + let cleaned = value.replace(/[^a-zA-Z0-9_@]/g, '') + + // Убираем лишние символы @ + cleaned = cleaned.replace(/@+/g, '@') + + // Если есть символы после удаления @ и строка не начинается с @, добавляем @ + if (cleaned && !cleaned.startsWith('@')) { + cleaned = '@' + cleaned + } + + // Ограничиваем длину (максимум 32 символа для Telegram) + if (cleaned.length > 33) { + cleaned = cleaned.substring(0, 33) + } + + return cleaned + } + + const validateName = (name: string) => { + return /^[а-яёА-ЯЁa-zA-Z\s-]+$/.test(name) && name.trim().length >= 2 + } + + const handleInputChange = (field: string, value: string) => { + let processedValue = value + + // Применяем маски и валидации + switch (field) { + case 'orgPhone': + case 'whatsapp': + processedValue = formatPhoneInput(value) + break + case 'telegram': + processedValue = formatTelegram(value) + break + case 'email': + // Для email не применяем маску, только валидацию при потере фокуса + break + case 'managerName': + // Разрешаем только буквы, пробелы и дефисы + processedValue = value.replace(/[^а-яёА-ЯЁa-zA-Z\s-]/g, '') + break + } + + setFormData(prev => ({ ...prev, [field]: processedValue })) + } + + // Функции для проверки ошибок + const getFieldError = (field: string, value: string) => { + if (!isEditing || !value.trim()) return null + + switch (field) { + case 'email': + return !validateEmail(value) ? 'Неверный формат email' : null + case 'managerName': + return !validateName(value) ? 'Только буквы, пробелы и дефисы' : null + case 'orgPhone': + case 'whatsapp': + const cleaned = value.replace(/\D/g, '') + return cleaned.length !== 11 ? 'Неверный формат телефона' : null + case 'telegram': + return value.length < 6 ? 'Минимум 5 символов после @' : null + case 'inn': + const innCleaned = value.replace(/\D/g, '') + if (innCleaned.length !== 10 && innCleaned.length !== 12) { + return 'ИНН должен содержать 10 или 12 цифр' + } + return null + default: + return null + } + } + + // Проверка наличия ошибок валидации + const hasValidationErrors = () => { + const fields = ['orgPhone', 'managerName', 'telegram', 'whatsapp', 'email', 'inn'] + return fields.some(field => { + const value = formData[field as keyof typeof formData] + return getFieldError(field, value) + }) + } + + const handleSave = async () => { + // Сброс предыдущих сообщений + setSaveMessage(null) + + try { + // Проверяем, изменился ли ИНН и нужно ли обновить данные организации + const currentInn = formData.inn || user?.organization?.inn || '' + const originalInn = user?.organization?.inn || '' + const innCleaned = currentInn.replace(/\D/g, '') + const originalInnCleaned = originalInn.replace(/\D/g, '') + + // Если ИНН изменился и валиден, сначала обновляем данные организации + if (innCleaned !== originalInnCleaned && (innCleaned.length === 10 || innCleaned.length === 12)) { + setSaveMessage({ type: 'success', text: 'Обновляем данные организации...' }) + + const orgResult = await updateOrganizationByInn({ + variables: { inn: innCleaned } + }) + + if (!orgResult.data?.updateOrganizationByInn?.success) { + setSaveMessage({ + type: 'error', + text: orgResult.data?.updateOrganizationByInn?.message || 'Ошибка при обновлении данных организации' + }) + return + } + + setSaveMessage({ type: 'success', text: 'Данные организации обновлены. Сохраняем профиль...' }) + } + + const result = await updateUserProfile({ + variables: { + input: { + orgPhone: formData.orgPhone, + managerName: formData.managerName, + telegram: formData.telegram, + whatsapp: formData.whatsapp, + email: formData.email, + bankName: formData.bankName, + bik: formData.bik, + accountNumber: formData.accountNumber, + corrAccount: formData.corrAccount + } + } + }) + + if (result.data?.updateUserProfile?.success) { + setSaveMessage({ type: 'success', text: 'Профиль успешно сохранен! Обновляем страницу...' }) + + // Простое обновление страницы после успешного сохранения + setTimeout(() => { + window.location.reload() + }, 1000) + } else { + setSaveMessage({ + type: 'error', + text: result.data?.updateUserProfile?.message || 'Ошибка при сохранении профиля' + }) + } + } catch (error) { + console.error('Error saving profile:', error) + setSaveMessage({ type: 'error', text: 'Ошибка при сохранении профиля' }) + } + } + + const formatDate = (dateString?: string) => { + if (!dateString) return '' + try { + let date: Date + + // Проверяем, является ли строка числом (Unix timestamp) + if (/^\d+$/.test(dateString)) { + // Если это Unix timestamp в миллисекундах + const timestamp = parseInt(dateString, 10) + date = new Date(timestamp) + } else { + // Обычная строка даты + date = new Date(dateString) + } + + if (isNaN(date.getTime())) { + console.warn('Invalid date string:', dateString) + return 'Неверная дата' + } + + return date.toLocaleDateString('ru-RU', { + year: 'numeric', + month: 'long', + day: 'numeric' + }) + } catch (error) { + console.error('Error formatting date:', error, dateString) + return 'Ошибка даты' + } + } + + return ( +
+ +
+
+ {/* Заголовок - фиксированная высота */} +
+
+

Настройки профиля

+

Управление информацией о профиле и организации

+
+
+ {/* Компактный индикатор прогресса */} + {isIncomplete && ( +
+
+ {profileStatus.percentage}% +
+
+ Осталось {profileStatus.missingFields.length} { + profileStatus.missingFields.length === 1 ? 'поле' : + profileStatus.missingFields.length < 5 ? 'поля' : 'полей' + } +
+
+ )} + + {isEditing ? ( + <> + + + + ) : ( + + )} +
+
+ + {/* Сообщения о сохранении */} + {saveMessage && ( + + + {saveMessage.text} + + + )} + + {/* Основной контент с вкладками - заполняет оставшееся пространство */} +
+ + + + + Профиль + + + + Организация + + {(user?.organization?.type === 'FULFILLMENT' || user?.organization?.type === 'LOGIST' || user?.organization?.type === 'WHOLESALE') && ( + + + Финансовые + + )} + {user?.organization?.type === 'SELLER' && ( + + + API + + )} + + + Инструменты + + + + {/* Профиль пользователя */} + + +
+
+ + {user?.avatar ? ( + Аватар + ) : ( + + {getInitials()} + + )} + +
+ + +
+
+
+

+ {user?.organization?.name || user?.organization?.fullName || 'Пользователь'} +

+ + {getCabinetTypeName()} + +

+ Авторизован по номеру: {formatPhone(user?.phone || '')} +

+ {user?.createdAt && ( +

+ + Дата регистрации: {formatDate(user.createdAt)} +

+ )} +
+ +
+ +
+
+
+ + handleInputChange('orgPhone', e.target.value)} + placeholder="+7 (999) 999-99-99" + readOnly={!isEditing} + className={`glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70 ${ + getFieldError('orgPhone', formData.orgPhone) ? 'border-red-400' : '' + }`} + /> + {getFieldError('orgPhone', formData.orgPhone) ? ( +

+ + {getFieldError('orgPhone', formData.orgPhone)} +

+ ) : !formData.orgPhone && ( +

+ + Рекомендуется указать +

+ )} +
+ +
+ + handleInputChange('managerName', e.target.value)} + placeholder="Иван Иванов" + readOnly={!isEditing} + className={`glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70 ${ + getFieldError('managerName', formData.managerName) ? 'border-red-400' : '' + }`} + /> + {getFieldError('managerName', formData.managerName) && ( +

+ + {getFieldError('managerName', formData.managerName)} +

+ )} +
+
+ +
+
+ + handleInputChange('telegram', e.target.value)} + placeholder="@username" + readOnly={!isEditing} + className={`glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70 ${ + getFieldError('telegram', formData.telegram) ? 'border-red-400' : '' + }`} + /> + {getFieldError('telegram', formData.telegram) && ( +

+ + {getFieldError('telegram', formData.telegram)} +

+ )} +
+ +
+ + handleInputChange('whatsapp', e.target.value)} + placeholder="+7 (999) 999-99-99" + readOnly={!isEditing} + className={`glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70 ${ + getFieldError('whatsapp', formData.whatsapp) ? 'border-red-400' : '' + }`} + /> + {getFieldError('whatsapp', formData.whatsapp) && ( +

+ + {getFieldError('whatsapp', formData.whatsapp)} +

+ )} +
+ +
+ + handleInputChange('email', e.target.value)} + placeholder="example@company.com" + readOnly={!isEditing} + className={`glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70 ${ + getFieldError('email', formData.email) ? 'border-red-400' : '' + }`} + /> + {getFieldError('email', formData.email) && ( +

+ + {getFieldError('email', formData.email)} +

+ )} +
+
+
+
+
+ + {/* Организация и юридические данные */} + + +
+ +

Организация и юридические данные

+ {(formData.inn || user?.organization?.inn) && ( + + )} +
+ + {/* Общая подпись про реестр */} +
+

+ + При сохранении с измененным ИНН мы автоматически обновляем все остальные данные из федерального реестра +

+
+ +
+ {/* Названия */} +
+
+ + handleInputChange('orgName', e.target.value)} + placeholder="Название организации" + readOnly={!isEditing || !!(formData.orgName || user?.organization?.name)} + className="glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70" + /> +
+ +
+ + +
+
+ + {/* Адреса */} +
+
+ + handleInputChange('address', e.target.value)} + placeholder="г. Москва, ул. Примерная, д. 1" + readOnly={!isEditing || !!(formData.address || user?.organization?.address)} + className="glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70" + /> +
+ +
+ + +
+
+ + {/* ИНН, ОГРН, КПП */} +
+
+ + { + handleInputChange('inn', e.target.value) + }} + placeholder="Введите ИНН организации" + readOnly={!isEditing} + disabled={isUpdatingOrganization} + className={`glass-input text-white placeholder:text-white/40 h-10 ${ + !isEditing ? 'read-only:opacity-70' : '' + } ${getFieldError('inn', formData.inn) ? 'border-red-400' : ''} ${ + isUpdatingOrganization ? 'opacity-50' : '' + }`} + /> + {getFieldError('inn', formData.inn) && ( +

+ {getFieldError('inn', formData.inn)} +

+ )} +
+ +
+ + +
+ +
+ + +
+
+ + {/* Руководитель и статус */} +
+ {user?.organization?.managementName && ( +
+ + +
+ )} + + {user?.organization?.status && ( +
+ + +
+ )} +
+ + {/* Дата регистрации */} + {user?.organization?.registrationDate && ( +
+
+ + +
+
+ )} +
+
+
+ + + + {/* Финансовые данные */} + {(user?.organization?.type === 'FULFILLMENT' || user?.organization?.type === 'LOGIST' || user?.organization?.type === 'WHOLESALE') && ( + + +
+ +

Финансовые данные

+ {formData.bankName && formData.bik && formData.accountNumber && formData.corrAccount && ( + + )} +
+ +
+
+ + handleInputChange('bankName', e.target.value)} + placeholder="ПАО Сбербанк" + readOnly={!isEditing} + className="glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70" + /> +
+ +
+
+ + handleInputChange('bik', e.target.value)} + placeholder="044525225" + readOnly={!isEditing} + className="glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70" + /> +
+ +
+ + handleInputChange('corrAccount', e.target.value)} + placeholder="30101810400000000225" + readOnly={!isEditing} + className="glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70" + /> +
+
+ +
+ + handleInputChange('accountNumber', e.target.value)} + placeholder="40702810123456789012" + readOnly={!isEditing} + className="glass-input text-white placeholder:text-white/40 h-10 read-only:opacity-70" + /> +
+
+
+
+ )} + + {/* API ключи для селлера */} + {user?.organization?.type === 'SELLER' && ( + + +
+ +

API ключи маркетплейсов

+ {user?.organization?.apiKeys?.length > 0 && ( + + )} +
+ +
+
+ + key.marketplace === 'WILDBERRIES') ? '••••••••••••••••••••' : ''} + readOnly + className="glass-input text-white h-10 read-only:opacity-70" + /> + {user?.organization?.apiKeys?.find(key => key.marketplace === 'WILDBERRIES') && ( +

+ + API ключ настроен +

+ )} +
+ +
+ + key.marketplace === 'OZON') ? '••••••••••••••••••••' : ''} + readOnly + className="glass-input text-white h-10 read-only:opacity-70" + /> + {user?.organization?.apiKeys?.find(key => key.marketplace === 'OZON') && ( +

+ + API ключ настроен +

+ )} +
+
+
+
+ )} + + {/* Инструменты */} + + +
+ +

Инструменты

+
+ + {(user?.organization?.type === 'FULFILLMENT' || user?.organization?.type === 'LOGIST' || user?.organization?.type === 'WHOLESALE') && ( +
+
+

Партнерская программа

+

+ Приглашайте новых контрагентов по уникальной ссылке. При регистрации они автоматически становятся вашими партнерами. +

+ +
+
+ +
+ + {partnerLink && ( +
+
+ + +
+

+ Ваша партнерская ссылка сгенерирована и готова к использованию +

+
+ )} +
+
+
+ )} +
+
+
+
+
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/market/market-counterparties.tsx b/src/components/market/market-counterparties.tsx new file mode 100644 index 0000000..577f6df --- /dev/null +++ b/src/components/market/market-counterparties.tsx @@ -0,0 +1,326 @@ +"use client" + +import { useState } from 'react' +import { useQuery, useMutation } from '@apollo/client' +import { Card } from '@/components/ui/card' +import { Button } from '@/components/ui/button' +import { Badge } from '@/components/ui/badge' +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' +import { + Users, + Clock, + Send, + CheckCircle, + XCircle, + ArrowUpCircle, + ArrowDownCircle +} from 'lucide-react' +import { OrganizationCard } from './organization-card' +import { GET_MY_COUNTERPARTIES, GET_INCOMING_REQUESTS, GET_OUTGOING_REQUESTS } from '@/graphql/queries' +import { RESPOND_TO_COUNTERPARTY_REQUEST, CANCEL_COUNTERPARTY_REQUEST, REMOVE_COUNTERPARTY } from '@/graphql/mutations' + +interface Organization { + id: string + inn: string + name?: string + fullName?: string + type: 'FULFILLMENT' | 'SELLER' | 'LOGIST' | 'WHOLESALE' + address?: string + phones?: Array<{ value: string }> + emails?: Array<{ value: string }> + createdAt: string + users?: Array<{ id: string, avatar?: string }> +} + +interface CounterpartyRequest { + id: string + message?: string + status: 'PENDING' | 'ACCEPTED' | 'REJECTED' | 'CANCELLED' + createdAt: string + sender: Organization + receiver: Organization +} + +export function MarketCounterparties() { + const { data: counterpartiesData, loading: counterpartiesLoading, refetch: refetchCounterparties } = useQuery(GET_MY_COUNTERPARTIES) + const { data: incomingData, loading: incomingLoading, refetch: refetchIncoming } = useQuery(GET_INCOMING_REQUESTS) + const { data: outgoingData, loading: outgoingLoading, refetch: refetchOutgoing } = useQuery(GET_OUTGOING_REQUESTS) + + const [respondToRequest] = useMutation(RESPOND_TO_COUNTERPARTY_REQUEST, { + onCompleted: () => { + refetchIncoming() + refetchCounterparties() + } + }) + + const [cancelRequest] = useMutation(CANCEL_COUNTERPARTY_REQUEST, { + onCompleted: () => { + refetchOutgoing() + } + }) + + const [removeCounterparty] = useMutation(REMOVE_COUNTERPARTY, { + onCompleted: () => { + refetchCounterparties() + } + }) + + const handleAcceptRequest = async (requestId: string) => { + try { + await respondToRequest({ + variables: { requestId, response: 'ACCEPTED' } + }) + } catch (error) { + console.error('Ошибка при принятии заявки:', error) + } + } + + const handleRejectRequest = async (requestId: string) => { + try { + await respondToRequest({ + variables: { requestId, response: 'REJECTED' } + }) + } catch (error) { + console.error('Ошибка при отклонении заявки:', error) + } + } + + const handleCancelRequest = async (requestId: string) => { + try { + await cancelRequest({ + variables: { requestId } + }) + } catch (error) { + console.error('Ошибка при отмене заявки:', error) + } + } + + const handleRemoveCounterparty = async (organizationId: string) => { + try { + await removeCounterparty({ + variables: { organizationId } + }) + } catch (error) { + console.error('Ошибка при удалении контрагента:', error) + } + } + + const formatDate = (dateString: string) => { + if (!dateString) return '' + try { + let date: Date + + // Проверяем, является ли строка числом (Unix timestamp) + if (/^\d+$/.test(dateString)) { + // Если это Unix timestamp в миллисекундах + const timestamp = parseInt(dateString, 10) + date = new Date(timestamp) + } else { + // Обычная строка даты + date = new Date(dateString) + } + + if (isNaN(date.getTime())) { + return 'Неверная дата' + } + + return date.toLocaleDateString('ru-RU', { + year: 'numeric', + month: 'long', + day: 'numeric' + }) + } catch (error) { + return 'Ошибка даты' + } + } + + const counterparties = counterpartiesData?.myCounterparties || [] + const incomingRequests = incomingData?.incomingRequests || [] + const outgoingRequests = outgoingData?.outgoingRequests || [] + + return ( +
+
+ +
+

Мои контрагенты

+

Управление контрагентами и заявками

+
+
+ +
+ + + + + Контрагенты ({counterparties.length}) + + + + Входящие ({incomingRequests.length}) + + + + Исходящие ({outgoingRequests.length}) + + + + + {counterpartiesLoading ? ( +
+
Загрузка...
+
+ ) : counterparties.length === 0 ? ( +
+
+ +

У вас пока нет контрагентов

+

+ Перейдите на другие вкладки, чтобы найти партнеров +

+
+
+ ) : ( +
+ {counterparties.map((organization: Organization) => ( + + ))} +
+ )} +
+ + + {incomingLoading ? ( +
+
Загрузка...
+
+ ) : incomingRequests.length === 0 ? ( +
+
+ +

Нет входящих заявок

+
+
+ ) : ( +
+ {incomingRequests.map((request: CounterpartyRequest) => ( + +
+
+
+
+ {(request.sender.name || request.sender.fullName || 'O').charAt(0).toUpperCase()} +
+
+
+

+ {request.sender.name || request.sender.fullName} +

+

ИНН: {request.sender.inn}

+ {request.message && ( +

"{request.message}"

+ )} +
+ + {formatDate(request.createdAt)} +
+
+
+ +
+ + +
+
+
+ ))} +
+ )} +
+ + + {outgoingLoading ? ( +
+
Загрузка...
+
+ ) : outgoingRequests.length === 0 ? ( +
+
+ +

Нет исходящих заявок

+
+
+ ) : ( +
+ {outgoingRequests.map((request: CounterpartyRequest) => ( + +
+
+
+
+ {(request.receiver.name || request.receiver.fullName || 'O').charAt(0).toUpperCase()} +
+
+
+

+ {request.receiver.name || request.receiver.fullName} +

+

ИНН: {request.receiver.inn}

+ {request.message && ( +

"{request.message}"

+ )} +
+
+ + {formatDate(request.createdAt)} +
+ + {request.status === 'PENDING' ? 'Ожидает' : request.status === 'REJECTED' ? 'Отклонено' : request.status} + +
+
+
+ + {request.status === 'PENDING' && ( + + )} +
+
+ ))} +
+ )} +
+
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/market/market-dashboard.tsx b/src/components/market/market-dashboard.tsx new file mode 100644 index 0000000..6937aa2 --- /dev/null +++ b/src/components/market/market-dashboard.tsx @@ -0,0 +1,97 @@ +"use client" + +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' +import { Card } from '@/components/ui/card' +import { Sidebar } from '@/components/dashboard/sidebar' +import { MarketCounterparties } from './market-counterparties' +import { MarketFulfillment } from './market-fulfillment' +import { MarketSellers } from './market-sellers' +import { MarketLogistics } from './market-logistics' +import { MarketWholesale } from './market-wholesale' + +export function MarketDashboard() { + return ( +
+ +
+
+ {/* Заголовок - фиксированная высота */} +
+
+

Маркет

+

Управление контрагентами и поиск партнеров

+
+
+ + {/* Основной контент с табами */} +
+ + + + Мои контрагенты + + + Фулфилмент + + + Селлеры + + + Логистика + + + Оптовик + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/market/market-fulfillment.tsx b/src/components/market/market-fulfillment.tsx new file mode 100644 index 0000000..0a44a92 --- /dev/null +++ b/src/components/market/market-fulfillment.tsx @@ -0,0 +1,125 @@ +"use client" + +import { useState } from 'react' +import { useQuery, useMutation } from '@apollo/client' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { Search, Package } from 'lucide-react' +import { OrganizationCard } from './organization-card' +import { SEARCH_ORGANIZATIONS } from '@/graphql/queries' +import { SEND_COUNTERPARTY_REQUEST } from '@/graphql/mutations' + +interface Organization { + id: string + inn: string + name?: string + fullName?: string + type: 'FULFILLMENT' | 'SELLER' | 'LOGIST' | 'WHOLESALE' + address?: string + phones?: Array<{ value: string }> + emails?: Array<{ value: string }> + createdAt: string + users?: Array<{ id: string, avatar?: string }> + isCounterparty?: boolean +} + +export function MarketFulfillment() { + const [searchTerm, setSearchTerm] = useState('') + + const { data, loading, refetch } = useQuery(SEARCH_ORGANIZATIONS, { + variables: { type: 'FULFILLMENT', search: searchTerm || null } + }) + + const [sendRequest, { loading: sendingRequest }] = useMutation(SEND_COUNTERPARTY_REQUEST, { + onCompleted: () => { + refetch() + } + }) + + const handleSearch = () => { + refetch({ type: 'FULFILLMENT', search: searchTerm || null }) + } + + const handleSendRequest = async (organizationId: string, message: string) => { + try { + await sendRequest({ + variables: { + receiverId: organizationId, + message: message || 'Заявка на добавление в контрагенты' + } + }) + } catch (error) { + console.error('Ошибка отправки заявки:', error) + } + } + + const organizations = data?.searchOrganizations || [] + + return ( +
+ {/* Поиск */} +
+
+ + setSearchTerm(e.target.value)} + onKeyDown={(e) => e.key === 'Enter' && handleSearch()} + className="pl-10 glass-input text-white placeholder:text-white/40 h-10" + /> +
+ +
+ + {/* Заголовок с иконкой */} +
+ +
+

Фулфилмент-центры

+

Найдите и добавьте фулфилмент-центры в контрагенты

+
+
+ + {/* Результаты поиска */} +
+ {loading ? ( +
+
Поиск...
+
+ ) : organizations.length === 0 ? ( +
+
+ +

+ {searchTerm ? 'Фулфилмент-центры не найдены' : 'Введите запрос для поиска фулфилментов'} +

+

+ Попробуйте изменить условия поиска +

+
+
+ ) : ( +
+ {organizations.map((organization: Organization) => ( + + ))} +
+ )} +
+
+ ) +} \ No newline at end of file diff --git a/src/components/market/market-logistics.tsx b/src/components/market/market-logistics.tsx new file mode 100644 index 0000000..7199bac --- /dev/null +++ b/src/components/market/market-logistics.tsx @@ -0,0 +1,125 @@ +"use client" + +import { useState } from 'react' +import { useQuery, useMutation } from '@apollo/client' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { Search, Truck } from 'lucide-react' +import { OrganizationCard } from './organization-card' +import { SEARCH_ORGANIZATIONS } from '@/graphql/queries' +import { SEND_COUNTERPARTY_REQUEST } from '@/graphql/mutations' + +interface Organization { + id: string + inn: string + name?: string + fullName?: string + type: 'FULFILLMENT' | 'SELLER' | 'LOGIST' | 'WHOLESALE' + address?: string + phones?: Array<{ value: string }> + emails?: Array<{ value: string }> + createdAt: string + users?: Array<{ id: string, avatar?: string }> + isCounterparty?: boolean +} + +export function MarketLogistics() { + const [searchTerm, setSearchTerm] = useState('') + + const { data, loading, refetch } = useQuery(SEARCH_ORGANIZATIONS, { + variables: { type: 'LOGIST', search: searchTerm || null } + }) + + const [sendRequest, { loading: sendingRequest }] = useMutation(SEND_COUNTERPARTY_REQUEST, { + onCompleted: () => { + refetch() + } + }) + + const handleSearch = () => { + refetch({ type: 'LOGIST', search: searchTerm || null }) + } + + const handleSendRequest = async (organizationId: string, message: string) => { + try { + await sendRequest({ + variables: { + receiverId: organizationId, + message: message || 'Заявка на добавление в контрагенты' + } + }) + } catch (error) { + console.error('Ошибка отправки заявки:', error) + } + } + + const organizations = data?.searchOrganizations || [] + + return ( +
+ {/* Поиск */} +
+
+ + setSearchTerm(e.target.value)} + onKeyDown={(e) => e.key === 'Enter' && handleSearch()} + className="pl-10 glass-input text-white placeholder:text-white/40 h-10" + /> +
+ +
+ + {/* Заголовок с иконкой */} +
+ +
+

Логистика

+

Найдите и добавьте логистические компании в контрагенты

+
+
+ + {/* Результаты поиска */} +
+ {loading ? ( +
+
Поиск...
+
+ ) : organizations.length === 0 ? ( +
+
+ +

+ {searchTerm ? 'Логистические компании не найдены' : 'Введите запрос для поиска'} +

+

+ Попробуйте изменить условия поиска +

+
+
+ ) : ( +
+ {organizations.map((organization: Organization) => ( + + ))} +
+ )} +
+
+ ) +} \ No newline at end of file diff --git a/src/components/market/market-sellers.tsx b/src/components/market/market-sellers.tsx new file mode 100644 index 0000000..3d0d5b9 --- /dev/null +++ b/src/components/market/market-sellers.tsx @@ -0,0 +1,125 @@ +"use client" + +import { useState } from 'react' +import { useQuery, useMutation } from '@apollo/client' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { Search, ShoppingCart } from 'lucide-react' +import { OrganizationCard } from './organization-card' +import { SEARCH_ORGANIZATIONS } from '@/graphql/queries' +import { SEND_COUNTERPARTY_REQUEST } from '@/graphql/mutations' + +interface Organization { + id: string + inn: string + name?: string + fullName?: string + type: 'FULFILLMENT' | 'SELLER' | 'LOGIST' | 'WHOLESALE' + address?: string + phones?: Array<{ value: string }> + emails?: Array<{ value: string }> + createdAt: string + users?: Array<{ id: string, avatar?: string }> + isCounterparty?: boolean +} + +export function MarketSellers() { + const [searchTerm, setSearchTerm] = useState('') + + const { data, loading, refetch } = useQuery(SEARCH_ORGANIZATIONS, { + variables: { type: 'SELLER', search: searchTerm || null } + }) + + const [sendRequest, { loading: sendingRequest }] = useMutation(SEND_COUNTERPARTY_REQUEST, { + onCompleted: () => { + refetch() + } + }) + + const handleSearch = () => { + refetch({ type: 'SELLER', search: searchTerm || null }) + } + + const handleSendRequest = async (organizationId: string, message: string) => { + try { + await sendRequest({ + variables: { + receiverId: organizationId, + message: message || 'Заявка на добавление в контрагенты' + } + }) + } catch (error) { + console.error('Ошибка отправки заявки:', error) + } + } + + const organizations = data?.searchOrganizations || [] + + return ( +
+ {/* Поиск */} +
+
+ + setSearchTerm(e.target.value)} + onKeyDown={(e) => e.key === 'Enter' && handleSearch()} + className="pl-10 glass-input text-white placeholder:text-white/40 h-10" + /> +
+ +
+ + {/* Заголовок с иконкой */} +
+ +
+

Селлеры

+

Найдите и добавьте селлеров в контрагенты

+
+
+ + {/* Результаты поиска */} +
+ {loading ? ( +
+
Поиск...
+
+ ) : organizations.length === 0 ? ( +
+
+ +

+ {searchTerm ? 'Селлеры не найдены' : 'Введите запрос для поиска селлеров'} +

+

+ Попробуйте изменить условия поиска +

+
+
+ ) : ( +
+ {organizations.map((organization: Organization) => ( + + ))} +
+ )} +
+
+ ) +} \ No newline at end of file diff --git a/src/components/market/market-wholesale.tsx b/src/components/market/market-wholesale.tsx new file mode 100644 index 0000000..1bbbe80 --- /dev/null +++ b/src/components/market/market-wholesale.tsx @@ -0,0 +1,125 @@ +"use client" + +import { useState } from 'react' +import { useQuery, useMutation } from '@apollo/client' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { Search, Boxes } from 'lucide-react' +import { OrganizationCard } from './organization-card' +import { SEARCH_ORGANIZATIONS } from '@/graphql/queries' +import { SEND_COUNTERPARTY_REQUEST } from '@/graphql/mutations' + +interface Organization { + id: string + inn: string + name?: string + fullName?: string + type: 'FULFILLMENT' | 'SELLER' | 'LOGIST' | 'WHOLESALE' + address?: string + phones?: Array<{ value: string }> + emails?: Array<{ value: string }> + createdAt: string + users?: Array<{ id: string, avatar?: string }> + isCounterparty?: boolean +} + +export function MarketWholesale() { + const [searchTerm, setSearchTerm] = useState('') + + const { data, loading, refetch } = useQuery(SEARCH_ORGANIZATIONS, { + variables: { type: 'WHOLESALE', search: searchTerm || null } + }) + + const [sendRequest, { loading: sendingRequest }] = useMutation(SEND_COUNTERPARTY_REQUEST, { + onCompleted: () => { + refetch() + } + }) + + const handleSearch = () => { + refetch({ type: 'WHOLESALE', search: searchTerm || null }) + } + + const handleSendRequest = async (organizationId: string, message: string) => { + try { + await sendRequest({ + variables: { + receiverId: organizationId, + message: message || 'Заявка на добавление в контрагенты' + } + }) + } catch (error) { + console.error('Ошибка отправки заявки:', error) + } + } + + const organizations = data?.searchOrganizations || [] + + return ( +
+ {/* Поиск */} +
+
+ + setSearchTerm(e.target.value)} + onKeyDown={(e) => e.key === 'Enter' && handleSearch()} + className="pl-10 glass-input text-white placeholder:text-white/40 h-10" + /> +
+ +
+ + {/* Заголовок с иконкой */} +
+ +
+

Оптовики

+

Найдите и добавьте оптовые компании в контрагенты

+
+
+ + {/* Результаты поиска */} +
+ {loading ? ( +
+
Поиск...
+
+ ) : organizations.length === 0 ? ( +
+
+ +

+ {searchTerm ? 'Оптовые компании не найдены' : 'Введите запрос для поиска оптовиков'} +

+

+ Попробуйте изменить условия поиска +

+
+
+ ) : ( +
+ {organizations.map((organization: Organization) => ( + + ))} +
+ )} +
+
+ ) +} \ No newline at end of file diff --git a/src/components/market/organization-avatar.tsx b/src/components/market/organization-avatar.tsx new file mode 100644 index 0000000..d673a56 --- /dev/null +++ b/src/components/market/organization-avatar.tsx @@ -0,0 +1,92 @@ +"use client" + +import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar' +import { cn } from '@/lib/utils' + +interface User { + id: string + avatar?: string | null +} + +interface Organization { + id: string + name?: string | null + fullName?: string | null + users?: User[] +} + +interface OrganizationAvatarProps { + organization: Organization + size?: 'sm' | 'md' | 'lg' + className?: string +} + +// Цвета для fallback аватарок +const FALLBACK_COLORS = [ + 'bg-blue-500', + 'bg-green-500', + 'bg-purple-500', + 'bg-orange-500', + 'bg-pink-500', + 'bg-indigo-500', + 'bg-teal-500', + 'bg-red-500', + 'bg-yellow-500', + 'bg-cyan-500' +] + +function getInitials(name: string): string { + return name + .split(' ') + .map(word => word.charAt(0)) + .join('') + .toUpperCase() + .slice(0, 2) +} + +function getColorForOrganization(organizationId: string): string { + const hash = organizationId.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0) + return FALLBACK_COLORS[hash % FALLBACK_COLORS.length] +} + +function getSizes(size: 'sm' | 'md' | 'lg') { + switch (size) { + case 'sm': + return { avatar: 'size-8', text: 'text-xs' } + case 'md': + return { avatar: 'size-10', text: 'text-sm' } + case 'lg': + return { avatar: 'size-12', text: 'text-base' } + default: + return { avatar: 'size-8', text: 'text-xs' } + } +} + +export function OrganizationAvatar({ + organization, + size = 'md', + className +}: OrganizationAvatarProps) { + // Берем аватарку первого пользователя организации + const userAvatar = organization.users?.[0]?.avatar + + // Получаем имя для инициалов + const displayName = organization.name || organization.fullName || 'Организация' + const initials = getInitials(displayName) + + // Получаем цвет для fallback + const fallbackColor = getColorForOrganization(organization.id) + + const sizes = getSizes(size) + + return ( + + {userAvatar && ( + + )} + + {initials} + + + ) +} \ No newline at end of file diff --git a/src/components/market/organization-card.tsx b/src/components/market/organization-card.tsx new file mode 100644 index 0000000..9e1b009 --- /dev/null +++ b/src/components/market/organization-card.tsx @@ -0,0 +1,268 @@ +"use client" + +import { Badge } from '@/components/ui/badge' +import { Button } from '@/components/ui/button' +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog' +import { Input } from '@/components/ui/input' +import { + Phone, + Mail, + MapPin, + Calendar, + Plus, + Send, + Trash2 +} from 'lucide-react' +import { OrganizationAvatar } from './organization-avatar' +import { useState } from 'react' + +interface Organization { + id: string + inn: string + name?: string + fullName?: string + type: 'FULFILLMENT' | 'SELLER' | 'LOGIST' | 'WHOLESALE' + address?: string + phones?: Array<{ value: string }> + emails?: Array<{ value: string }> + createdAt: string + users?: Array<{ id: string, avatar?: string }> + isCounterparty?: boolean +} + +interface OrganizationCardProps { + organization: Organization + onSendRequest?: (organizationId: string, message: string) => void + onRemove?: (organizationId: string) => void + showRemoveButton?: boolean + actionButtonText?: string + actionButtonColor?: string + requestSending?: boolean +} + +export function OrganizationCard({ + organization, + onSendRequest, + onRemove, + showRemoveButton = false, + actionButtonText = "Добавить", + actionButtonColor = "green", + requestSending = false +}: OrganizationCardProps) { + const [requestMessage, setRequestMessage] = useState('') + const [isDialogOpen, setIsDialogOpen] = useState(false) + + const formatDate = (dateString: string) => { + if (!dateString) return '' + try { + let date: Date + + // Проверяем, является ли строка числом (Unix timestamp) + if (/^\d+$/.test(dateString)) { + // Если это Unix timestamp в миллисекундах + const timestamp = parseInt(dateString, 10) + date = new Date(timestamp) + } else { + // Обычная строка даты + date = new Date(dateString) + } + + if (isNaN(date.getTime())) { + return 'Неверная дата' + } + + return date.toLocaleDateString('ru-RU', { + year: 'numeric', + month: 'long', + day: 'numeric' + }) + } catch (error) { + return 'Ошибка даты' + } + } + + const getTypeLabel = (type: string) => { + switch (type) { + case 'FULFILLMENT': return 'Фулфилмент' + case 'SELLER': return 'Селлер' + case 'LOGIST': return 'Логистика' + case 'WHOLESALE': return 'Оптовик' + default: return type + } + } + + const getTypeColor = (type: string) => { + switch (type) { + case 'FULFILLMENT': return 'bg-blue-500/20 text-blue-300 border-blue-500/30' + case 'SELLER': return 'bg-green-500/20 text-green-300 border-green-500/30' + case 'LOGIST': return 'bg-orange-500/20 text-orange-300 border-orange-500/30' + case 'WHOLESALE': return 'bg-purple-500/20 text-purple-300 border-purple-500/30' + default: return 'bg-gray-500/20 text-gray-300 border-gray-500/30' + } + } + + const getActionButtonColor = (color: string, isDisabled: boolean) => { + if (isDisabled) { + return "bg-gray-500/20 text-gray-400 border-gray-500/30 cursor-not-allowed" + } + + switch (color) { + case 'green': return 'bg-green-500/20 hover:bg-green-500/30 text-green-300 border-green-500/30' + case 'orange': return 'bg-orange-500/20 hover:bg-orange-500/30 text-orange-300 border-orange-500/30' + case 'yellow': return 'bg-yellow-500/20 hover:bg-yellow-500/30 text-yellow-300 border-yellow-500/30' + case 'red': return 'bg-red-500/20 hover:bg-red-500/30 text-red-300 border-red-500/30' + case 'blue': return 'bg-blue-500/20 hover:bg-blue-500/30 text-blue-300 border-blue-500/30' + default: return 'bg-gray-500/20 hover:bg-gray-500/30 text-gray-300 border-gray-500/30' + } + } + + const handleSendRequest = () => { + if (onSendRequest) { + onSendRequest(organization.id, requestMessage) + setRequestMessage('') + setIsDialogOpen(false) + } + } + + const handleRemove = () => { + if (onRemove) { + onRemove(organization.id) + } + } + + return ( +
+
+
+ +
+
+

+ {organization.name || organization.fullName} +

+
+ + {getTypeLabel(organization.type)} + + {organization.isCounterparty && ( + + Уже добавлен + + )} +
+
+ +
+

ИНН: {organization.inn}

+ {organization.address && ( +
+ + {organization.address} +
+ )} + {organization.phones && organization.phones.length > 0 && ( +
+ + {organization.phones[0].value} +
+ )} + {organization.emails && organization.emails.length > 0 && ( +
+ + {organization.emails[0].value} +
+ )} +
+ + {showRemoveButton ? 'Добавлен' : 'Зарегистрирован'} {formatDate(organization.createdAt)} +
+
+
+
+ + {showRemoveButton ? ( + + ) : ( + + + + + + + + + Отправить заявку в контрагенты + + + +
+
+
+ +
+

+ {organization.name || organization.fullName} +

+

ИНН: {organization.inn}

+
+
+
+ +
+ + setRequestMessage(e.target.value)} + className="glass-input text-white placeholder:text-white/40" + /> +
+ +
+ + +
+
+
+
+ )} +
+
+ ) +} \ No newline at end of file diff --git a/src/components/market/organization-details-modal.tsx b/src/components/market/organization-details-modal.tsx new file mode 100644 index 0000000..bc9d3f3 --- /dev/null +++ b/src/components/market/organization-details-modal.tsx @@ -0,0 +1,431 @@ +"use client" + +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog' +import { Card } from '@/components/ui/card' +import { Badge } from '@/components/ui/badge' +import { Separator } from '@/components/ui/separator' +import { + Building2, + Phone, + Mail, + MapPin, + Calendar, + FileText, + Users, + CreditCard, + Hash, + User, + Briefcase +} from 'lucide-react' +import { OrganizationAvatar } from './organization-avatar' + +interface User { + id: string + avatar?: string | null + phone: string + createdAt: string +} + +interface ApiKey { + id: string + marketplace: string + isActive: boolean + createdAt: string +} + +interface Organization { + id: string + inn: string + kpp?: string | null + name?: string | null + fullName?: string | null + type: 'FULFILLMENT' | 'SELLER' | 'LOGIST' | 'WHOLESALE' + address?: string | null + addressFull?: string | null + ogrn?: string | null + ogrnDate?: string | null + status?: string | null + actualityDate?: string | null + registrationDate?: string | null + liquidationDate?: string | null + managementName?: string | null + managementPost?: string | null + opfCode?: string | null + opfFull?: string | null + opfShort?: string | null + okato?: string | null + oktmo?: string | null + okpo?: string | null + okved?: string | null + employeeCount?: number | null + revenue?: string | null + taxSystem?: string | null + phones?: Array<{ value: string }> | null + emails?: Array<{ value: string }> | null + users?: User[] + apiKeys?: ApiKey[] + createdAt: string +} + +interface OrganizationDetailsModalProps { + organization: Organization | null + open: boolean + onOpenChange: (open: boolean) => void +} + +function formatDate(dateString?: string | null): string { + if (!dateString) return 'Не указана' + + try { + let date: Date + + // Проверяем, является ли строка числом (Unix timestamp) + if (/^\d+$/.test(dateString)) { + // Если это Unix timestamp в миллисекундах + const timestamp = parseInt(dateString, 10) + date = new Date(timestamp) + } else { + // Обычная строка даты + date = new Date(dateString) + } + + if (isNaN(date.getTime())) { + return 'Не указана' + } + + return date.toLocaleDateString('ru-RU', { + year: 'numeric', + month: 'long', + day: 'numeric' + }) + } catch (error) { + return 'Не указана' + } +} + +function getTypeLabel(type: string): string { + switch (type) { + case 'FULFILLMENT': + return 'Фулфилмент' + case 'SELLER': + return 'Селлер' + case 'LOGIST': + return 'Логистика' + case 'WHOLESALE': + return 'Оптовик' + default: + return type + } +} + +function getTypeColor(type: string): string { + switch (type) { + case 'FULFILLMENT': + return 'bg-blue-500/20 text-blue-300 border-blue-500/30' + case 'SELLER': + return 'bg-green-500/20 text-green-300 border-green-500/30' + case 'LOGIST': + return 'bg-orange-500/20 text-orange-300 border-orange-500/30' + case 'WHOLESALE': + return 'bg-purple-500/20 text-purple-300 border-purple-500/30' + default: + return 'bg-gray-500/20 text-gray-300 border-gray-500/30' + } +} + +export function OrganizationDetailsModal({ organization, open, onOpenChange }: OrganizationDetailsModalProps) { + if (!organization) return null + + const displayName = organization.name || organization.fullName || 'Неизвестная организация' + + return ( + + + + + +
+

{displayName}

+ + {getTypeLabel(organization.type)} + +
+
+
+ +
+ {/* Основная информация */} + +

+ + Основная информация +

+ +
+
+ ИНН: + {organization.inn} +
+ + {organization.kpp && ( +
+ КПП: + {organization.kpp} +
+ )} + + {organization.ogrn && ( +
+ ОГРН: + {organization.ogrn} +
+ )} + + {organization.status && ( +
+ Статус: + {organization.status} +
+ )} + +
+ Дата регистрации: + {formatDate(organization.registrationDate)} +
+
+
+ + {/* Контактная информация */} + +

+ + Контакты +

+ +
+ {organization.phones && organization.phones.length > 0 && ( +
+
Телефоны:
+ {organization.phones.map((phone, index) => ( +
+ + {phone.value} +
+ ))} +
+ )} + + {organization.emails && organization.emails.length > 0 && ( +
+
Email:
+ {organization.emails.map((email, index) => ( +
+ + {email.value} +
+ ))} +
+ )} + + {organization.address && ( +
+
Адрес:
+
+ + {organization.addressFull || organization.address} +
+
+ )} +
+
+ + {/* Руководство */} + {organization.managementName && ( + +

+ + Руководство +

+ +
+
+ Руководитель: + {organization.managementName} +
+ + {organization.managementPost && ( +
+ Должность: + {organization.managementPost} +
+ )} +
+
+ )} + + {/* Организационно-правовая форма */} + {organization.opfFull && ( + +

+ + ОПФ +

+ +
+
+ Полное название: + {organization.opfFull} +
+ + {organization.opfShort && ( +
+ Краткое название: + {organization.opfShort} +
+ )} + + {organization.opfCode && ( +
+ Код ОКОПФ: + {organization.opfCode} +
+ )} +
+
+ )} + + {/* Коды статистики */} + {(organization.okato || organization.oktmo || organization.okpo || organization.okved) && ( + +

+ + Коды статистики +

+ +
+ {organization.okato && ( +
+ ОКАТО: + {organization.okato} +
+ )} + + {organization.oktmo && ( +
+ ОКТМО: + {organization.oktmo} +
+ )} + + {organization.okpo && ( +
+ ОКПО: + {organization.okpo} +
+ )} + + {organization.okved && ( +
+ Основной ОКВЭД: + {organization.okved} +
+ )} +
+
+ )} + + {/* Финансовая информация */} + {(organization.employeeCount || organization.revenue || organization.taxSystem) && ( + +

+ + Финансовая информация +

+ +
+ {organization.employeeCount && ( +
+ Сотрудников: + {organization.employeeCount} +
+ )} + + {organization.revenue && ( +
+ Выручка: + {organization.revenue} +
+ )} + + {organization.taxSystem && ( +
+ Налоговая система: + {organization.taxSystem} +
+ )} +
+
+ )} + + {/* Пользователи */} + {organization.users && organization.users.length > 0 && ( + +

+ + Пользователи ({organization.users.length}) +

+ +
+ {organization.users.map((user, index) => ( +
+
+ + {user.phone} +
+ + {formatDate(user.createdAt)} + +
+ ))} +
+
+ )} + + {/* API ключи */} + {organization.apiKeys && organization.apiKeys.length > 0 && ( + +

+ + API ключи маркетплейсов +

+ +
+ {organization.apiKeys.map((apiKey, index) => ( +
+
+ + {apiKey.marketplace} + + + {apiKey.isActive ? 'Активен' : 'Неактивен'} + +
+ + {formatDate(apiKey.createdAt)} + +
+ ))} +
+
+ )} +
+
+
+ ) +} \ No newline at end of file diff --git a/src/components/ui/alert.tsx b/src/components/ui/alert.tsx new file mode 100644 index 0000000..1421354 --- /dev/null +++ b/src/components/ui/alert.tsx @@ -0,0 +1,66 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const alertVariants = cva( + "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", + { + variants: { + variant: { + default: "bg-card text-card-foreground", + destructive: + "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +function Alert({ + className, + variant, + ...props +}: React.ComponentProps<"div"> & VariantProps) { + return ( +
+ ) +} + +function AlertTitle({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function AlertDescription({ + className, + ...props +}: React.ComponentProps<"div">) { + return ( +
+ ) +} + +export { Alert, AlertTitle, AlertDescription } diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx new file mode 100644 index 0000000..71e428b --- /dev/null +++ b/src/components/ui/avatar.tsx @@ -0,0 +1,53 @@ +"use client" + +import * as React from "react" +import * as AvatarPrimitive from "@radix-ui/react-avatar" + +import { cn } from "@/lib/utils" + +function Avatar({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarImage({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function AvatarFallback({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { Avatar, AvatarImage, AvatarFallback } diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx new file mode 100644 index 0000000..0205413 --- /dev/null +++ b/src/components/ui/badge.tsx @@ -0,0 +1,46 @@ +import * as React from "react" +import { Slot } from "@radix-ui/react-slot" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const badgeVariants = cva( + "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", + { + variants: { + variant: { + default: + "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90", + secondary: + "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90", + destructive: + "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", + outline: + "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +function Badge({ + className, + variant, + asChild = false, + ...props +}: React.ComponentProps<"span"> & + VariantProps & { asChild?: boolean }) { + const Comp = asChild ? Slot : "span" + + return ( + + ) +} + +export { Badge, badgeVariants } diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx new file mode 100644 index 0000000..1ad7dee --- /dev/null +++ b/src/components/ui/button.tsx @@ -0,0 +1,61 @@ +import * as React from "react" +import { Slot } from "@radix-ui/react-slot" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const buttonVariants = cva( + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer", + { + variants: { + variant: { + default: + "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90", + destructive: + "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", + outline: + "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50", + secondary: + "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80", + ghost: + "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", + link: "text-primary underline-offset-4 hover:underline", + glass: "glass-button text-white font-semibold", + "glass-secondary": "glass-secondary text-white hover:text-white/90", + }, + size: { + default: "h-9 px-4 py-2 has-[>svg]:px-3", + sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5", + lg: "h-10 rounded-md px-6 has-[>svg]:px-4", + icon: "size-9", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + } +) + +function Button({ + className, + variant, + size, + asChild = false, + ...props +}: React.ComponentProps<"button"> & + VariantProps & { + asChild?: boolean + }) { + const Comp = asChild ? Slot : "button" + + return ( + + ) +} + +export { Button, buttonVariants } diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx new file mode 100644 index 0000000..d05bbc6 --- /dev/null +++ b/src/components/ui/card.tsx @@ -0,0 +1,92 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +function Card({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardHeader({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardTitle({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardDescription({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardAction({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardContent({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function CardFooter({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardAction, + CardDescription, + CardContent, +} diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx new file mode 100644 index 0000000..fa0e4b5 --- /dev/null +++ b/src/components/ui/checkbox.tsx @@ -0,0 +1,32 @@ +"use client" + +import * as React from "react" +import * as CheckboxPrimitive from "@radix-ui/react-checkbox" +import { CheckIcon } from "lucide-react" + +import { cn } from "@/lib/utils" + +function Checkbox({ + className, + ...props +}: React.ComponentProps) { + return ( + + + + + + ) +} + +export { Checkbox } diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx new file mode 100644 index 0000000..d9ccec9 --- /dev/null +++ b/src/components/ui/dialog.tsx @@ -0,0 +1,143 @@ +"use client" + +import * as React from "react" +import * as DialogPrimitive from "@radix-ui/react-dialog" +import { XIcon } from "lucide-react" + +import { cn } from "@/lib/utils" + +function Dialog({ + ...props +}: React.ComponentProps) { + return +} + +function DialogTrigger({ + ...props +}: React.ComponentProps) { + return +} + +function DialogPortal({ + ...props +}: React.ComponentProps) { + return +} + +function DialogClose({ + ...props +}: React.ComponentProps) { + return +} + +function DialogOverlay({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DialogContent({ + className, + children, + showCloseButton = true, + ...props +}: React.ComponentProps & { + showCloseButton?: boolean +}) { + return ( + + + + {children} + {showCloseButton && ( + + + Close + + )} + + + ) +} + +function DialogHeader({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function DialogFooter({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function DialogTitle({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function DialogDescription({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogOverlay, + DialogPortal, + DialogTitle, + DialogTrigger, +} diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx new file mode 100644 index 0000000..9994f38 --- /dev/null +++ b/src/components/ui/input.tsx @@ -0,0 +1,35 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +function Input({ className, type, ...props }: React.ComponentProps<"input">) { + return ( + + ) +} + +function GlassInput({ className, type, ...props }: React.ComponentProps<"input">) { + return ( + + ) +} + +export { Input, GlassInput } diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx new file mode 100644 index 0000000..fb5fbc3 --- /dev/null +++ b/src/components/ui/label.tsx @@ -0,0 +1,24 @@ +"use client" + +import * as React from "react" +import * as LabelPrimitive from "@radix-ui/react-label" + +import { cn } from "@/lib/utils" + +function Label({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { Label } diff --git a/src/components/ui/phone-input.tsx b/src/components/ui/phone-input.tsx new file mode 100644 index 0000000..65cf683 --- /dev/null +++ b/src/components/ui/phone-input.tsx @@ -0,0 +1,108 @@ +"use client" + +import * as React from "react" +import { IMaskInput } from "react-imask" +import { cn } from "@/lib/utils" + +export interface PhoneInputProps + extends Omit, 'onChange' | 'value'> { + onChange?: (value: string) => void + value?: string +} + +const PhoneInput = React.forwardRef( + ({ className, onChange, value, ...props }, ref) => { + const handleAccept = (value: string) => { + onChange?.(value) + } + + // Фильтруем пропсы, которые могут конфликтовать с IMaskInput + const { min, max, step, ...filteredProps } = props + + return ( + + ) + } +) +PhoneInput.displayName = "PhoneInput" + +const GlassPhoneInput = React.forwardRef( + ({ className, onChange, value, ...props }, ref) => { + const [isFocused, setIsFocused] = React.useState(false) + + const handleAccept = (value: string) => { + onChange?.(value) + } + + const handleFocus = (e: React.FocusEvent) => { + setIsFocused(true) + props.onFocus?.(e) + } + + const handleBlur = (e: React.FocusEvent) => { + setIsFocused(false) + props.onBlur?.(e) + } + + // Проверяем валидность номера + const isValid = value ? value.replace(/\D/g, '').length === 11 : false + const isEmpty = !value || value.replace(/\D/g, '').length === 0 + + // Фильтруем пропсы, которые могут конфликтовать с IMaskInput + const { min, max, step, onFocus, onBlur, ...filteredProps } = props + + return ( +
+ + + {/* Индикатор валидности */} +
+ {isValid && ( +
+ + + +
+ )} + {!isEmpty && !isValid && ( +
+ + + +
+ )} +
+
+ ) + } +) +GlassPhoneInput.displayName = "GlassPhoneInput" + +export { PhoneInput, GlassPhoneInput } \ No newline at end of file diff --git a/src/components/ui/progress.tsx b/src/components/ui/progress.tsx new file mode 100644 index 0000000..e7a416c --- /dev/null +++ b/src/components/ui/progress.tsx @@ -0,0 +1,31 @@ +"use client" + +import * as React from "react" +import * as ProgressPrimitive from "@radix-ui/react-progress" + +import { cn } from "@/lib/utils" + +function Progress({ + className, + value, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +export { Progress } diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx new file mode 100644 index 0000000..dcbbc0c --- /dev/null +++ b/src/components/ui/select.tsx @@ -0,0 +1,185 @@ +"use client" + +import * as React from "react" +import * as SelectPrimitive from "@radix-ui/react-select" +import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react" + +import { cn } from "@/lib/utils" + +function Select({ + ...props +}: React.ComponentProps) { + return +} + +function SelectGroup({ + ...props +}: React.ComponentProps) { + return +} + +function SelectValue({ + ...props +}: React.ComponentProps) { + return +} + +function SelectTrigger({ + className, + size = "default", + children, + ...props +}: React.ComponentProps & { + size?: "sm" | "default" +}) { + return ( + + {children} + + + + + ) +} + +function SelectContent({ + className, + children, + position = "popper", + ...props +}: React.ComponentProps) { + return ( + + + + + {children} + + + + + ) +} + +function SelectLabel({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function SelectItem({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + + + + + + + {children} + + ) +} + +function SelectSeparator({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function SelectScrollUpButton({ + className, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +function SelectScrollDownButton({ + className, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +export { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectScrollDownButton, + SelectScrollUpButton, + SelectSeparator, + SelectTrigger, + SelectValue, +} diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx new file mode 100644 index 0000000..275381c --- /dev/null +++ b/src/components/ui/separator.tsx @@ -0,0 +1,28 @@ +"use client" + +import * as React from "react" +import * as SeparatorPrimitive from "@radix-ui/react-separator" + +import { cn } from "@/lib/utils" + +function Separator({ + className, + orientation = "horizontal", + decorative = true, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { Separator } diff --git a/src/components/ui/skeleton.tsx b/src/components/ui/skeleton.tsx new file mode 100644 index 0000000..32ea0ef --- /dev/null +++ b/src/components/ui/skeleton.tsx @@ -0,0 +1,13 @@ +import { cn } from "@/lib/utils" + +function Skeleton({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +export { Skeleton } diff --git a/src/components/ui/slider.tsx b/src/components/ui/slider.tsx new file mode 100644 index 0000000..09391e8 --- /dev/null +++ b/src/components/ui/slider.tsx @@ -0,0 +1,63 @@ +"use client" + +import * as React from "react" +import * as SliderPrimitive from "@radix-ui/react-slider" + +import { cn } from "@/lib/utils" + +function Slider({ + className, + defaultValue, + value, + min = 0, + max = 100, + ...props +}: React.ComponentProps) { + const _values = React.useMemo( + () => + Array.isArray(value) + ? value + : Array.isArray(defaultValue) + ? defaultValue + : [min, max], + [value, defaultValue, min, max] + ) + + return ( + + + + + {Array.from({ length: _values.length }, (_, index) => ( + + ))} + + ) +} + +export { Slider } diff --git a/src/components/ui/sonner.tsx b/src/components/ui/sonner.tsx new file mode 100644 index 0000000..957524e --- /dev/null +++ b/src/components/ui/sonner.tsx @@ -0,0 +1,25 @@ +"use client" + +import { useTheme } from "next-themes" +import { Toaster as Sonner, ToasterProps } from "sonner" + +const Toaster = ({ ...props }: ToasterProps) => { + const { theme = "system" } = useTheme() + + return ( + + ) +} + +export { Toaster } diff --git a/src/components/ui/switch.tsx b/src/components/ui/switch.tsx new file mode 100644 index 0000000..6a2b524 --- /dev/null +++ b/src/components/ui/switch.tsx @@ -0,0 +1,31 @@ +"use client" + +import * as React from "react" +import * as SwitchPrimitive from "@radix-ui/react-switch" + +import { cn } from "@/lib/utils" + +function Switch({ + className, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +export { Switch } diff --git a/src/components/ui/tabs.tsx b/src/components/ui/tabs.tsx new file mode 100644 index 0000000..497ba5e --- /dev/null +++ b/src/components/ui/tabs.tsx @@ -0,0 +1,66 @@ +"use client" + +import * as React from "react" +import * as TabsPrimitive from "@radix-ui/react-tabs" + +import { cn } from "@/lib/utils" + +function Tabs({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function TabsList({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function TabsTrigger({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function TabsContent({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +export { Tabs, TabsList, TabsTrigger, TabsContent } diff --git a/src/graphql/mutations.ts b/src/graphql/mutations.ts new file mode 100644 index 0000000..a06ce60 --- /dev/null +++ b/src/graphql/mutations.ts @@ -0,0 +1,358 @@ +import { gql } from 'graphql-tag' + +export const SEND_SMS_CODE = gql` + mutation SendSmsCode($phone: String!) { + sendSmsCode(phone: $phone) { + success + message + } + } +` + +export const VERIFY_SMS_CODE = gql` + mutation VerifySmsCode($phone: String!, $code: String!) { + verifySmsCode(phone: $phone, code: $code) { + success + message + token + user { + id + phone + organization { + id + inn + kpp + name + fullName + address + addressFull + ogrn + ogrnDate + type + status + actualityDate + registrationDate + liquidationDate + managementName + managementPost + opfCode + opfFull + opfShort + okato + oktmo + okpo + okved + employeeCount + revenue + taxSystem + phones + emails + apiKeys { + id + marketplace + isActive + } + } + } + } + } +` + +export const VERIFY_INN = gql` + mutation VerifyInn($inn: String!) { + verifyInn(inn: $inn) { + success + message + organization { + name + fullName + address + isActive + } + } + } +` + +export const REGISTER_FULFILLMENT_ORGANIZATION = gql` + mutation RegisterFulfillmentOrganization($input: FulfillmentRegistrationInput!) { + registerFulfillmentOrganization(input: $input) { + success + message + user { + id + phone + organization { + id + inn + kpp + name + fullName + address + addressFull + ogrn + ogrnDate + type + status + actualityDate + registrationDate + liquidationDate + managementName + managementPost + opfCode + opfFull + opfShort + okato + oktmo + okpo + okved + employeeCount + revenue + taxSystem + phones + emails + apiKeys { + id + marketplace + isActive + } + } + } + } + } +` + +export const REGISTER_SELLER_ORGANIZATION = gql` + mutation RegisterSellerOrganization($input: SellerRegistrationInput!) { + registerSellerOrganization(input: $input) { + success + message + user { + id + phone + organization { + id + inn + kpp + name + fullName + address + addressFull + ogrn + ogrnDate + type + status + actualityDate + registrationDate + liquidationDate + managementName + managementPost + opfCode + opfFull + opfShort + okato + oktmo + okpo + okved + employeeCount + revenue + taxSystem + phones + emails + apiKeys { + id + marketplace + isActive + } + } + } + } + } +` + +export const ADD_MARKETPLACE_API_KEY = gql` + mutation AddMarketplaceApiKey($input: MarketplaceApiKeyInput!) { + addMarketplaceApiKey(input: $input) { + success + message + apiKey { + id + marketplace + isActive + validationData + } + } + } +` + +export const REMOVE_MARKETPLACE_API_KEY = gql` + mutation RemoveMarketplaceApiKey($marketplace: MarketplaceType!) { + removeMarketplaceApiKey(marketplace: $marketplace) + } +` + +export const UPDATE_USER_PROFILE = gql` + mutation UpdateUserProfile($input: UpdateUserProfileInput!) { + updateUserProfile(input: $input) { + success + message + user { + id + phone + organization { + id + inn + kpp + name + fullName + address + addressFull + ogrn + ogrnDate + type + status + actualityDate + registrationDate + liquidationDate + managementName + managementPost + opfCode + opfFull + opfShort + okato + oktmo + okpo + okved + employeeCount + revenue + taxSystem + phones + emails + apiKeys { + id + marketplace + isActive + } + } + } + } + } +` + +export const UPDATE_ORGANIZATION_BY_INN = gql` + mutation UpdateOrganizationByInn($inn: String!) { + updateOrganizationByInn(inn: $inn) { + success + message + user { + id + phone + organization { + id + inn + kpp + name + fullName + address + addressFull + ogrn + ogrnDate + type + status + actualityDate + registrationDate + liquidationDate + managementName + managementPost + opfCode + opfFull + opfShort + okato + oktmo + okpo + okved + employeeCount + revenue + taxSystem + phones + emails + apiKeys { + id + marketplace + isActive + } + } + } + } + } +` + +// Мутации для контрагентов +export const SEND_COUNTERPARTY_REQUEST = gql` + mutation SendCounterpartyRequest($organizationId: ID!, $message: String) { + sendCounterpartyRequest(organizationId: $organizationId, message: $message) { + success + message + request { + id + status + message + createdAt + sender { + id + inn + name + fullName + type + } + receiver { + id + inn + name + fullName + type + } + } + } + } +` + +export const RESPOND_TO_COUNTERPARTY_REQUEST = gql` + mutation RespondToCounterpartyRequest($requestId: ID!, $accept: Boolean!) { + respondToCounterpartyRequest(requestId: $requestId, accept: $accept) { + success + message + request { + id + status + message + createdAt + sender { + id + inn + name + fullName + type + } + receiver { + id + inn + name + fullName + type + } + } + } + } +` + +export const CANCEL_COUNTERPARTY_REQUEST = gql` + mutation CancelCounterpartyRequest($requestId: ID!) { + cancelCounterpartyRequest(requestId: $requestId) + } +` + +export const REMOVE_COUNTERPARTY = gql` + mutation RemoveCounterparty($organizationId: ID!) { + removeCounterparty(organizationId: $organizationId) + } +` \ No newline at end of file diff --git a/src/graphql/queries.ts b/src/graphql/queries.ts new file mode 100644 index 0000000..29c0293 --- /dev/null +++ b/src/graphql/queries.ts @@ -0,0 +1,169 @@ +import { gql } from 'graphql-tag' + +export const GET_ME = gql` + query GetMe { + me { + id + phone + avatar + createdAt + organization { + id + inn + kpp + name + fullName + address + addressFull + ogrn + ogrnDate + type + status + actualityDate + registrationDate + liquidationDate + managementName + managementPost + opfCode + opfFull + opfShort + okato + oktmo + okpo + okved + employeeCount + revenue + taxSystem + phones + emails + apiKeys { + id + marketplace + isActive + validationData + } + } + } + } +` + +// Запросы для контрагентов +export const SEARCH_ORGANIZATIONS = gql` + query SearchOrganizations($type: OrganizationType, $search: String) { + searchOrganizations(type: $type, search: $search) { + id + inn + name + fullName + type + address + phones + emails + createdAt + isCounterparty + users { + id + avatar + } + } + } +` + +export const GET_MY_COUNTERPARTIES = gql` + query GetMyCounterparties { + myCounterparties { + id + inn + name + fullName + type + address + phones + emails + createdAt + users { + id + avatar + } + } + } +` + +export const GET_INCOMING_REQUESTS = gql` + query GetIncomingRequests { + incomingRequests { + id + status + message + createdAt + sender { + id + inn + name + fullName + type + address + phones + emails + } + receiver { + id + inn + name + fullName + type + } + } + } +` + +export const GET_OUTGOING_REQUESTS = gql` + query GetOutgoingRequests { + outgoingRequests { + id + status + message + createdAt + sender { + id + inn + name + fullName + type + } + receiver { + id + inn + name + fullName + type + address + phones + emails + } + } + } +` + +export const GET_ORGANIZATION = gql` + query GetOrganization($id: ID!) { + organization(id: $id) { + id + inn + name + fullName + address + type + apiKeys { + id + marketplace + isActive + validationData + createdAt + updatedAt + } + createdAt + updatedAt + } + } +` \ No newline at end of file diff --git a/src/graphql/resolvers.ts b/src/graphql/resolvers.ts new file mode 100644 index 0000000..faf9ddc --- /dev/null +++ b/src/graphql/resolvers.ts @@ -0,0 +1,1363 @@ +import jwt from 'jsonwebtoken' +import { GraphQLError } from 'graphql' +import { GraphQLScalarType, Kind } from 'graphql' +import { prisma } from '@/lib/prisma' +import { SmsService } from '@/services/sms-service' +import { DaDataService } from '@/services/dadata-service' +import { MarketplaceService } from '@/services/marketplace-service' +import { Prisma } from '@prisma/client' + +// Сервисы +const smsService = new SmsService() +const dadataService = new DaDataService() +const marketplaceService = new MarketplaceService() + +// Интерфейсы для типизации +interface Context { + user?: { + id: string + phone: string + } +} + +interface AuthTokenPayload { + userId: string + phone: string +} + +// JWT утилиты +const generateToken = (payload: AuthTokenPayload): string => { + return jwt.sign(payload, process.env.JWT_SECRET!, { expiresIn: '30d' }) +} + +const verifyToken = (token: string): AuthTokenPayload => { + try { + return jwt.verify(token, process.env.JWT_SECRET!) as AuthTokenPayload + } catch (error) { + throw new GraphQLError('Недействительный токен', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } +} + +// Скалярный тип для JSON +const JSONScalar = new GraphQLScalarType({ + name: 'JSON', + description: 'JSON custom scalar type', + serialize(value: unknown) { + return value // значение отправляется клиенту + }, + parseValue(value: unknown) { + return value // значение получено от клиента + }, + parseLiteral(ast) { + switch (ast.kind) { + case Kind.STRING: + case Kind.BOOLEAN: + return ast.value + case Kind.INT: + case Kind.FLOAT: + return parseFloat(ast.value) + case Kind.OBJECT: { + const value = Object.create(null) + ast.fields.forEach(field => { + value[field.name.value] = parseLiteral(field.value) + }) + return value + } + case Kind.LIST: + return ast.values.map(parseLiteral) + default: + return null + } + } +}) + +function parseLiteral(ast: unknown): unknown { + const astNode = ast as { kind: string; value?: unknown; fields?: unknown[]; values?: unknown[] } + + switch (astNode.kind) { + case Kind.STRING: + case Kind.BOOLEAN: + return astNode.value + case Kind.INT: + case Kind.FLOAT: + return parseFloat(astNode.value as string) + case Kind.OBJECT: { + const value = Object.create(null) + if (astNode.fields) { + astNode.fields.forEach((field: unknown) => { + const fieldNode = field as { name: { value: string }; value: unknown } + value[fieldNode.name.value] = parseLiteral(fieldNode.value) + }) + } + return value + } + case Kind.LIST: + return ast.values.map(parseLiteral) + default: + return null + } +} + +export const resolvers = { + JSON: JSONScalar, + + Query: { + me: async (_: unknown, __: unknown, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + return await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { + organization: { + include: { + apiKeys: true + } + } + } + }) + }, + + organization: async (_: unknown, args: { id: string }, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const organization = await prisma.organization.findUnique({ + where: { id: args.id }, + include: { + apiKeys: true, + users: true + } + }) + + if (!organization) { + throw new GraphQLError('Организация не найдена') + } + + // Проверяем, что пользователь имеет доступ к этой организации + const hasAccess = organization.users.some(user => user.id === context.user!.id) + if (!hasAccess) { + throw new GraphQLError('Нет доступа к этой организации', { + extensions: { code: 'FORBIDDEN' } + }) + } + + return organization + }, + + // Поиск организаций по типу для добавления в контрагенты + searchOrganizations: async (_: unknown, args: { type?: string; search?: string }, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + // Получаем текущую организацию пользователя + const currentUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!currentUser?.organization) { + throw new GraphQLError('У пользователя нет организации') + } + + // Получаем уже существующих контрагентов для добавления флага + const existingCounterparties = await prisma.counterparty.findMany({ + where: { organizationId: currentUser.organization.id }, + select: { counterpartyId: true } + }) + + const existingCounterpartyIds = existingCounterparties.map(c => c.counterpartyId) + + const where: any = { + id: { not: currentUser.organization.id } // Исключаем только собственную организацию + } + + if (args.type) { + where.type = args.type + } + + if (args.search) { + where.OR = [ + { name: { contains: args.search, mode: 'insensitive' } }, + { fullName: { contains: args.search, mode: 'insensitive' } }, + { inn: { contains: args.search } } + ] + } + + const organizations = await prisma.organization.findMany({ + where, + take: 50, // Ограничиваем количество результатов + orderBy: { createdAt: 'desc' }, + include: { + users: true, + apiKeys: true + } + }) + + // Добавляем флаг isCounterparty к каждой организации + return organizations.map(org => ({ + ...org, + isCounterparty: existingCounterpartyIds.includes(org.id) + })) + }, + + // Мои контрагенты + myCounterparties: async (_: unknown, __: unknown, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const currentUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!currentUser?.organization) { + throw new GraphQLError('У пользователя нет организации') + } + + const counterparties = await prisma.counterparty.findMany({ + where: { organizationId: currentUser.organization.id }, + include: { + counterparty: { + include: { + users: true, + apiKeys: true + } + } + } + }) + + return counterparties.map(c => c.counterparty) + }, + + // Входящие заявки + incomingRequests: async (_: unknown, __: unknown, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const currentUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!currentUser?.organization) { + throw new GraphQLError('У пользователя нет организации') + } + + return await prisma.counterpartyRequest.findMany({ + where: { + receiverId: currentUser.organization.id, + status: 'PENDING' + }, + include: { + sender: { + include: { + users: true, + apiKeys: true + } + }, + receiver: { + include: { + users: true, + apiKeys: true + } + } + }, + orderBy: { createdAt: 'desc' } + }) + }, + + // Исходящие заявки + outgoingRequests: async (_: unknown, __: unknown, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const currentUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!currentUser?.organization) { + throw new GraphQLError('У пользователя нет организации') + } + + return await prisma.counterpartyRequest.findMany({ + where: { + senderId: currentUser.organization.id, + status: { in: ['PENDING', 'REJECTED'] } + }, + include: { + sender: { + include: { + users: true, + apiKeys: true + } + }, + receiver: { + include: { + users: true, + apiKeys: true + } + } + }, + orderBy: { createdAt: 'desc' } + }) + } + }, + + Mutation: { + sendSmsCode: async (_: unknown, args: { phone: string }) => { + const result = await smsService.sendSmsCode(args.phone) + return { + success: result.success, + message: result.message || 'SMS код отправлен' + } + }, + + verifySmsCode: async (_: unknown, args: { phone: string; code: string }) => { + const verificationResult = await smsService.verifySmsCode(args.phone, args.code) + + if (!verificationResult.success) { + return { + success: false, + message: verificationResult.message || 'Неверный код' + } + } + + // Найти или создать пользователя + const formattedPhone = args.phone.replace(/\D/g, '') + let user = await prisma.user.findUnique({ + where: { phone: formattedPhone }, + include: { + organization: { + include: { + apiKeys: true + } + } + } + }) + + if (!user) { + user = await prisma.user.create({ + data: { + phone: formattedPhone + }, + include: { + organization: { + include: { + apiKeys: true + } + } + } + }) + } + + const token = generateToken({ + userId: user.id, + phone: user.phone + }) + + console.log('verifySmsCode - Generated token:', token ? `${token.substring(0, 20)}...` : 'No token') + console.log('verifySmsCode - Full token:', token) + console.log('verifySmsCode - User object:', { id: user.id, phone: user.phone }) + + const result = { + success: true, + message: 'Авторизация успешна', + token, + user + } + + console.log('verifySmsCode - Returning result:', { + success: result.success, + hasToken: !!result.token, + hasUser: !!result.user, + message: result.message, + tokenPreview: result.token ? `${result.token.substring(0, 20)}...` : 'No token in result' + }) + + return result + }, + + verifyInn: async (_: unknown, args: { inn: string }) => { + // Валидируем ИНН + if (!dadataService.validateInn(args.inn)) { + return { + success: false, + message: 'Неверный формат ИНН' + } + } + + // Получаем данные организации из DaData + const organizationData = await dadataService.getOrganizationByInn(args.inn) + if (!organizationData) { + return { + success: false, + message: 'Организация с указанным ИНН не найдена' + } + } + + return { + success: true, + message: 'ИНН найден', + organization: { + name: organizationData.name, + fullName: organizationData.fullName, + address: organizationData.address, + isActive: organizationData.isActive + } + } + }, + + registerFulfillmentOrganization: async ( + _: unknown, + args: { input: { phone: string; inn: string } }, + context: Context + ) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const { inn } = args.input + + // Валидируем ИНН + if (!dadataService.validateInn(inn)) { + return { + success: false, + message: 'Неверный формат ИНН' + } + } + + // Получаем данные организации из DaData + const organizationData = await dadataService.getOrganizationByInn(inn) + if (!organizationData) { + return { + success: false, + message: 'Организация с указанным ИНН не найдена' + } + } + + try { + // Проверяем, что организация еще не зарегистрирована + const existingOrg = await prisma.organization.findUnique({ + where: { inn: organizationData.inn } + }) + + if (existingOrg) { + return { + success: false, + message: 'Организация с таким ИНН уже зарегистрирована' + } + } + + // Создаем организацию со всеми данными из DaData + const organization = await prisma.organization.create({ + data: { + inn: organizationData.inn, + kpp: organizationData.kpp, + name: organizationData.name, + fullName: organizationData.fullName, + address: organizationData.address, + addressFull: organizationData.addressFull, + ogrn: organizationData.ogrn, + ogrnDate: organizationData.ogrnDate, + + // Статус организации + status: organizationData.status, + actualityDate: organizationData.actualityDate, + registrationDate: organizationData.registrationDate, + liquidationDate: organizationData.liquidationDate, + + // Руководитель + managementName: organizationData.managementName, + managementPost: organizationData.managementPost, + + // ОПФ + opfCode: organizationData.opfCode, + opfFull: organizationData.opfFull, + opfShort: organizationData.opfShort, + + // Коды статистики + okato: organizationData.okato, + oktmo: organizationData.oktmo, + okpo: organizationData.okpo, + okved: organizationData.okved, + + // Контакты + phones: organizationData.phones ? JSON.parse(JSON.stringify(organizationData.phones)) : null, + emails: organizationData.emails ? JSON.parse(JSON.stringify(organizationData.emails)) : null, + + // Финансовые данные + employeeCount: organizationData.employeeCount, + revenue: organizationData.revenue, + taxSystem: organizationData.taxSystem, + + type: 'FULFILLMENT', + dadataData: JSON.parse(JSON.stringify(organizationData.rawData)) + } + }) + + // Привязываем пользователя к организации + const updatedUser = await prisma.user.update({ + where: { id: context.user.id }, + data: { organizationId: organization.id }, + include: { + organization: { + include: { + apiKeys: true + } + } + } + }) + + return { + success: true, + message: 'Фулфилмент организация успешно зарегистрирована', + user: updatedUser + } + + } catch (error) { + console.error('Error registering fulfillment organization:', error) + return { + success: false, + message: 'Ошибка при регистрации организации' + } + } + }, + + registerSellerOrganization: async ( + _: unknown, + args: { + input: { + phone: string + wbApiKey?: string + ozonApiKey?: string + ozonClientId?: string + } + }, + context: Context + ) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const { wbApiKey, ozonApiKey, ozonClientId } = args.input + + if (!wbApiKey && !ozonApiKey) { + return { + success: false, + message: 'Необходимо указать хотя бы один API ключ маркетплейса' + } + } + + try { + // Валидируем API ключи + const validationResults = [] + + if (wbApiKey) { + const wbResult = await marketplaceService.validateWildberriesApiKey(wbApiKey) + if (!wbResult.isValid) { + return { + success: false, + message: `Wildberries: ${wbResult.message}` + } + } + validationResults.push({ + marketplace: 'WILDBERRIES', + apiKey: wbApiKey, + data: wbResult.data + }) + } + + if (ozonApiKey && ozonClientId) { + const ozonResult = await marketplaceService.validateOzonApiKey(ozonApiKey, ozonClientId) + if (!ozonResult.isValid) { + return { + success: false, + message: `Ozon: ${ozonResult.message}` + } + } + validationResults.push({ + marketplace: 'OZON', + apiKey: ozonApiKey, + data: ozonResult.data + }) + } + + // Создаем организацию селлера - используем название магазина как основное имя + const shopName = validationResults[0]?.data?.sellerName || 'Магазин' + const organization = await prisma.organization.create({ + data: { + inn: validationResults[0]?.data?.inn || `SELLER_${Date.now()}`, + name: shopName, + fullName: `Интернет-магазин "${shopName}"`, + type: 'SELLER' + } + }) + + // Добавляем API ключи + for (const validation of validationResults) { + await prisma.apiKey.create({ + data: { + marketplace: validation.marketplace as 'WILDBERRIES' | 'OZON', + apiKey: validation.apiKey, + organizationId: organization.id, + validationData: validation.data + } + }) + } + + // Привязываем пользователя к организации + const updatedUser = await prisma.user.update({ + where: { id: context.user.id }, + data: { organizationId: organization.id }, + include: { + organization: { + include: { + apiKeys: true + } + } + } + }) + + return { + success: true, + message: 'Селлер организация успешно зарегистрирована', + user: updatedUser + } + + } catch (error) { + console.error('Error registering seller organization:', error) + return { + success: false, + message: 'Ошибка при регистрации организации' + } + } + }, + + addMarketplaceApiKey: async ( + _: unknown, + args: { + input: { + marketplace: 'WILDBERRIES' | 'OZON' + apiKey: string + clientId?: string + validateOnly?: boolean + } + }, + context: Context + ) => { + // Разрешаем валидацию без авторизации + if (!args.input.validateOnly && !context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const { marketplace, apiKey, clientId, validateOnly } = args.input + + // Валидируем API ключ + const validationResult = await marketplaceService.validateApiKey( + marketplace, + apiKey, + clientId + ) + + if (!validationResult.isValid) { + return { + success: false, + message: validationResult.message + } + } + + // Если это только валидация, возвращаем результат без сохранения + if (validateOnly) { + return { + success: true, + message: 'API ключ действителен', + apiKey: { + id: 'validate-only', + marketplace, + isActive: true, + validationData: validationResult, + createdAt: new Date().toISOString(), + updatedAt: new Date().toISOString() + } + } + } + + // Для сохранения API ключа нужна авторизация + if (!context.user) { + throw new GraphQLError('Требуется авторизация для сохранения API ключа', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const user = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!user?.organization) { + return { + success: false, + message: 'Пользователь не привязан к организации' + } + } + + + + try { + // Проверяем, что такого ключа еще нет + const existingKey = await prisma.apiKey.findUnique({ + where: { + organizationId_marketplace: { + organizationId: user.organization.id, + marketplace + } + } + }) + + if (existingKey) { + // Обновляем существующий ключ + const updatedKey = await prisma.apiKey.update({ + where: { id: existingKey.id }, + data: { + apiKey, + validationData: validationResult.data, + isActive: true + } + }) + + return { + success: true, + message: 'API ключ успешно обновлен', + apiKey: updatedKey + } + } else { + // Создаем новый ключ + const newKey = await prisma.apiKey.create({ + data: { + marketplace, + apiKey, + organizationId: user.organization.id, + validationData: validationResult.data + } + }) + + return { + success: true, + message: 'API ключ успешно добавлен', + apiKey: newKey + } + } + + } catch (error) { + console.error('Error adding marketplace API key:', error) + return { + success: false, + message: 'Ошибка при добавлении API ключа' + } + } + }, + + removeMarketplaceApiKey: async ( + _: unknown, + args: { marketplace: 'WILDBERRIES' | 'OZON' }, + context: Context + ) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const user = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!user?.organization) { + throw new GraphQLError('Пользователь не привязан к организации') + } + + try { + await prisma.apiKey.delete({ + where: { + organizationId_marketplace: { + organizationId: user.organization.id, + marketplace: args.marketplace + } + } + }) + + return true + } catch (error) { + console.error('Error removing marketplace API key:', error) + return false + } + }, + + updateUserProfile: async (_: unknown, args: { input: { + avatar?: string + orgPhone?: string + managerName?: string + telegram?: string + whatsapp?: string + email?: string + bankName?: string + bik?: string + accountNumber?: string + corrAccount?: string + } }, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const user = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { + organization: { + include: { + apiKeys: true + } + } + } + }) + + if (!user?.organization) { + throw new GraphQLError('Пользователь не привязан к организации') + } + + try { + const { input } = args + + // Обновляем аватар пользователя если указан + if (input.avatar) { + await prisma.user.update({ + where: { id: context.user.id }, + data: { avatar: input.avatar } + }) + } + + // Подготавливаем данные для обновления организации + const updateData: { + phones?: object + emails?: object + managementName?: string + managementPost?: string + } = {} + + // Обновляем контактные данные в JSON поле phones + if (input.orgPhone) { + updateData.phones = [{ value: input.orgPhone, type: 'main' }] + } + + // Обновляем email в JSON поле emails + if (input.email) { + updateData.emails = [{ value: input.email, type: 'main' }] + } + + // Сохраняем дополнительные контакты в custom полях + // Пока добавим их как дополнительные JSON поля + const customContacts: { + managerName?: string + telegram?: string + whatsapp?: string + bankDetails?: { + bankName?: string + bik?: string + accountNumber?: string + corrAccount?: string + } + } = {} + + if (input.managerName) { + customContacts.managerName = input.managerName + } + + if (input.telegram) { + customContacts.telegram = input.telegram + } + + if (input.whatsapp) { + customContacts.whatsapp = input.whatsapp + } + + if (input.bankName || input.bik || input.accountNumber || input.corrAccount) { + customContacts.bankDetails = { + bankName: input.bankName, + bik: input.bik, + accountNumber: input.accountNumber, + corrAccount: input.corrAccount + } + } + + // Если есть дополнительные контакты, сохраним их в поле managementPost временно + // В идеале нужно добавить отдельную таблицу для контактов + if (Object.keys(customContacts).length > 0) { + updateData.managementPost = JSON.stringify(customContacts) + } + + // Обновляем организацию + const updatedOrganization = await prisma.organization.update({ + where: { id: user.organization.id }, + data: updateData, + include: { + apiKeys: true + } + }) + + // Получаем обновленного пользователя + const updatedUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { + organization: { + include: { + apiKeys: true + } + } + } + }) + + return { + success: true, + message: 'Профиль успешно обновлен', + user: updatedUser + } + } catch (error) { + console.error('Error updating user profile:', error) + return { + success: false, + message: 'Ошибка при обновлении профиля' + } + } + }, + + updateOrganizationByInn: async (_: unknown, args: { inn: string }, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const user = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { + organization: { + include: { + apiKeys: true + } + } + } + }) + + if (!user?.organization) { + throw new GraphQLError('Пользователь не привязан к организации') + } + + try { + // Валидируем ИНН + if (!dadataService.validateInn(args.inn)) { + return { + success: false, + message: 'Неверный формат ИНН' + } + } + + // Получаем данные организации из DaData + const organizationData = await dadataService.getOrganizationByInn(args.inn) + if (!organizationData) { + return { + success: false, + message: 'Организация с указанным ИНН не найдена в федеральном реестре' + } + } + + // Проверяем, есть ли уже организация с таким ИНН в базе (кроме текущей) + const existingOrganization = await prisma.organization.findUnique({ + where: { inn: organizationData.inn } + }) + + if (existingOrganization && existingOrganization.id !== user.organization.id) { + return { + success: false, + message: `Организация с ИНН ${organizationData.inn} уже существует в системе` + } + } + + // Подготавливаем данные для обновления + const updateData: Prisma.OrganizationUpdateInput = { + kpp: organizationData.kpp, + name: organizationData.name, + fullName: organizationData.fullName, + address: organizationData.address, + addressFull: organizationData.addressFull, + ogrn: organizationData.ogrn, + ogrnDate: organizationData.ogrnDate ? organizationData.ogrnDate.toISOString() : null, + registrationDate: organizationData.registrationDate ? organizationData.registrationDate.toISOString() : null, + liquidationDate: organizationData.liquidationDate ? organizationData.liquidationDate.toISOString() : null, + managementName: organizationData.managementName, + managementPost: user.organization.managementPost, // Сохраняем кастомные данные пользователя + opfCode: organizationData.opfCode, + opfFull: organizationData.opfFull, + opfShort: organizationData.opfShort, + okato: organizationData.okato, + oktmo: organizationData.oktmo, + okpo: organizationData.okpo, + okved: organizationData.okved, + status: organizationData.status + } + + // Добавляем ИНН только если он отличается от текущего + if (user.organization.inn !== organizationData.inn) { + updateData.inn = organizationData.inn + } + + // Обновляем организацию + const updatedOrganization = await prisma.organization.update({ + where: { id: user.organization.id }, + data: updateData, + include: { + apiKeys: true + } + }) + + // Получаем обновленного пользователя + const updatedUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { + organization: { + include: { + apiKeys: true + } + } + } + }) + + return { + success: true, + message: 'Данные организации успешно обновлены', + user: updatedUser + } + } catch (error) { + console.error('Error updating organization by INN:', error) + return { + success: false, + message: 'Ошибка при обновлении данных организации' + } + } + }, + + logout: () => { + // В stateless JWT системе logout происходит на клиенте + // Можно добавить blacklist токенов, если нужно + return true + }, + + // Отправить заявку на добавление в контрагенты + sendCounterpartyRequest: async (_: unknown, args: { organizationId: string; message?: string }, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const currentUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!currentUser?.organization) { + throw new GraphQLError('У пользователя нет организации') + } + + if (currentUser.organization.id === args.organizationId) { + throw new GraphQLError('Нельзя отправить заявку самому себе') + } + + // Проверяем, что организация-получатель существует + const receiverOrganization = await prisma.organization.findUnique({ + where: { id: args.organizationId } + }) + + if (!receiverOrganization) { + throw new GraphQLError('Организация не найдена') + } + + try { + // Создаем или обновляем заявку + const request = await prisma.counterpartyRequest.upsert({ + where: { + senderId_receiverId: { + senderId: currentUser.organization.id, + receiverId: args.organizationId + } + }, + update: { + status: 'PENDING', + message: args.message, + updatedAt: new Date() + }, + create: { + senderId: currentUser.organization.id, + receiverId: args.organizationId, + message: args.message, + status: 'PENDING' + }, + include: { + sender: true, + receiver: true + } + }) + + return { + success: true, + message: 'Заявка отправлена', + request + } + } catch (error) { + console.error('Error sending counterparty request:', error) + return { + success: false, + message: 'Ошибка при отправке заявки' + } + } + }, + + // Ответить на заявку контрагента + respondToCounterpartyRequest: async (_: unknown, args: { requestId: string; accept: boolean }, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const currentUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!currentUser?.organization) { + throw new GraphQLError('У пользователя нет организации') + } + + try { + // Найти заявку и проверить права + const request = await prisma.counterpartyRequest.findUnique({ + where: { id: args.requestId }, + include: { + sender: true, + receiver: true + } + }) + + if (!request) { + throw new GraphQLError('Заявка не найдена') + } + + if (request.receiverId !== currentUser.organization.id) { + throw new GraphQLError('Нет прав на обработку этой заявки') + } + + if (request.status !== 'PENDING') { + throw new GraphQLError('Заявка уже обработана') + } + + const newStatus = args.accept ? 'ACCEPTED' : 'REJECTED' + + // Обновляем статус заявки + const updatedRequest = await prisma.counterpartyRequest.update({ + where: { id: args.requestId }, + data: { status: newStatus }, + include: { + sender: true, + receiver: true + } + }) + + // Если заявка принята, создаем связи контрагентов в обе стороны + if (args.accept) { + await prisma.$transaction([ + // Добавляем отправителя в контрагенты получателя + prisma.counterparty.create({ + data: { + organizationId: request.receiverId, + counterpartyId: request.senderId + } + }), + // Добавляем получателя в контрагенты отправителя + prisma.counterparty.create({ + data: { + organizationId: request.senderId, + counterpartyId: request.receiverId + } + }) + ]) + } + + return { + success: true, + message: args.accept ? 'Заявка принята' : 'Заявка отклонена', + request: updatedRequest + } + } catch (error) { + console.error('Error responding to counterparty request:', error) + return { + success: false, + message: 'Ошибка при обработке заявки' + } + } + }, + + // Отменить заявку + cancelCounterpartyRequest: async (_: unknown, args: { requestId: string }, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const currentUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!currentUser?.organization) { + throw new GraphQLError('У пользователя нет организации') + } + + try { + const request = await prisma.counterpartyRequest.findUnique({ + where: { id: args.requestId } + }) + + if (!request) { + throw new GraphQLError('Заявка не найдена') + } + + if (request.senderId !== currentUser.organization.id) { + throw new GraphQLError('Можно отменить только свои заявки') + } + + if (request.status !== 'PENDING') { + throw new GraphQLError('Можно отменить только ожидающие заявки') + } + + await prisma.counterpartyRequest.update({ + where: { id: args.requestId }, + data: { status: 'CANCELLED' } + }) + + return true + } catch (error) { + console.error('Error cancelling counterparty request:', error) + return false + } + }, + + // Удалить контрагента + removeCounterparty: async (_: unknown, args: { organizationId: string }, context: Context) => { + if (!context.user) { + throw new GraphQLError('Требуется авторизация', { + extensions: { code: 'UNAUTHENTICATED' } + }) + } + + const currentUser = await prisma.user.findUnique({ + where: { id: context.user.id }, + include: { organization: true } + }) + + if (!currentUser?.organization) { + throw new GraphQLError('У пользователя нет организации') + } + + try { + // Удаляем связь в обе стороны + await prisma.$transaction([ + prisma.counterparty.deleteMany({ + where: { + organizationId: currentUser.organization.id, + counterpartyId: args.organizationId + } + }), + prisma.counterparty.deleteMany({ + where: { + organizationId: args.organizationId, + counterpartyId: currentUser.organization.id + } + }) + ]) + + return true + } catch (error) { + console.error('Error removing counterparty:', error) + return false + } + } + }, + + // Резолверы типов + Organization: { + users: async (parent: { id: string; users?: unknown[] }) => { + // Если пользователи уже загружены через include, возвращаем их + if (parent.users) { + return parent.users + } + + // Иначе загружаем отдельно + return await prisma.user.findMany({ + where: { organizationId: parent.id } + }) + } + }, + + User: { + organization: async (parent: { organizationId?: string; organization?: unknown }) => { + // Если организация уже загружена через include, возвращаем её + if (parent.organization) { + return parent.organization + } + + // Иначе загружаем отдельно если есть organizationId + if (parent.organizationId) { + return await prisma.organization.findUnique({ + where: { id: parent.organizationId }, + include: { + apiKeys: true, + users: true + } + }) + } + + return null + } + } +} \ No newline at end of file diff --git a/src/graphql/typedefs.ts b/src/graphql/typedefs.ts new file mode 100644 index 0000000..53a21d2 --- /dev/null +++ b/src/graphql/typedefs.ts @@ -0,0 +1,229 @@ +import { gql } from 'graphql-tag' + +export const typeDefs = gql` + type Query { + me: User + organization(id: ID!): Organization + + # Поиск организаций по типу для добавления в контрагенты + searchOrganizations(type: OrganizationType, search: String): [Organization!]! + + # Мои контрагенты + myCounterparties: [Organization!]! + + # Входящие заявки + incomingRequests: [CounterpartyRequest!]! + + # Исходящие заявки + outgoingRequests: [CounterpartyRequest!]! + } + + type Mutation { + # Авторизация через SMS + sendSmsCode(phone: String!): SmsResponse! + verifySmsCode(phone: String!, code: String!): AuthResponse! + + # Валидация ИНН + verifyInn(inn: String!): InnValidationResponse! + + # Обновление профиля пользователя + updateUserProfile(input: UpdateUserProfileInput!): UpdateUserProfileResponse! + + # Обновление данных организации по ИНН + updateOrganizationByInn(inn: String!): UpdateOrganizationResponse! + + # Регистрация организации + registerFulfillmentOrganization(input: FulfillmentRegistrationInput!): AuthResponse! + registerSellerOrganization(input: SellerRegistrationInput!): AuthResponse! + + # Работа с API ключами + addMarketplaceApiKey(input: MarketplaceApiKeyInput!): ApiKeyResponse! + removeMarketplaceApiKey(marketplace: MarketplaceType!): Boolean! + + # Выход из системы + logout: Boolean! + + # Работа с контрагентами + sendCounterpartyRequest(organizationId: ID!, message: String): CounterpartyRequestResponse! + respondToCounterpartyRequest(requestId: ID!, accept: Boolean!): CounterpartyRequestResponse! + cancelCounterpartyRequest(requestId: ID!): Boolean! + removeCounterparty(organizationId: ID!): Boolean! + } + + # Типы данных + type User { + id: ID! + phone: String! + avatar: String + organization: Organization + createdAt: String! + updatedAt: String! + } + + type Organization { + id: ID! + inn: String! + kpp: String + name: String + fullName: String + address: String + addressFull: String + ogrn: String + ogrnDate: String + type: OrganizationType! + status: String + actualityDate: String + registrationDate: String + liquidationDate: String + managementName: String + managementPost: String + opfCode: String + opfFull: String + opfShort: String + okato: String + oktmo: String + okpo: String + okved: String + employeeCount: Int + revenue: String + taxSystem: String + phones: JSON + emails: JSON + users: [User!]! + apiKeys: [ApiKey!]! + isCounterparty: Boolean + createdAt: String! + updatedAt: String! + } + + type ApiKey { + id: ID! + marketplace: MarketplaceType! + isActive: Boolean! + validationData: JSON + createdAt: String! + updatedAt: String! + } + + # Входные типы для мутаций + input UpdateUserProfileInput { + # Аватар пользователя + avatar: String + + # Контактные данные организации + orgPhone: String + managerName: String + telegram: String + whatsapp: String + email: String + + # Банковские данные + bankName: String + bik: String + accountNumber: String + corrAccount: String + } + + input FulfillmentRegistrationInput { + phone: String! + inn: String! + } + + input SellerRegistrationInput { + phone: String! + wbApiKey: String + ozonApiKey: String + ozonClientId: String + } + + input MarketplaceApiKeyInput { + marketplace: MarketplaceType! + apiKey: String! + clientId: String # Для Ozon + validateOnly: Boolean # Только валидация без сохранения + } + + # Ответные типы + type SmsResponse { + success: Boolean! + message: String! + } + + type AuthResponse { + success: Boolean! + message: String! + token: String + user: User + } + + type InnValidationResponse { + success: Boolean! + message: String! + organization: ValidatedOrganization + } + + type ValidatedOrganization { + name: String! + fullName: String! + address: String! + isActive: Boolean! + } + + type ApiKeyResponse { + success: Boolean! + message: String! + apiKey: ApiKey + } + + type UpdateUserProfileResponse { + success: Boolean! + message: String! + user: User + } + + type UpdateOrganizationResponse { + success: Boolean! + message: String! + user: User + } + + # Enums + enum OrganizationType { + FULFILLMENT + SELLER + LOGIST + WHOLESALE + } + + enum MarketplaceType { + WILDBERRIES + OZON + } + + enum CounterpartyRequestStatus { + PENDING + ACCEPTED + REJECTED + CANCELLED + } + + # Типы для контрагентов + type CounterpartyRequest { + id: ID! + status: CounterpartyRequestStatus! + message: String + sender: Organization! + receiver: Organization! + createdAt: String! + updatedAt: String! + } + + type CounterpartyRequestResponse { + success: Boolean! + message: String! + request: CounterpartyRequest + } + + # JSON скаляр + scalar JSON +` \ No newline at end of file diff --git a/src/hooks/useApolloRefresh.ts b/src/hooks/useApolloRefresh.ts new file mode 100644 index 0000000..d5e4f9d --- /dev/null +++ b/src/hooks/useApolloRefresh.ts @@ -0,0 +1,12 @@ +import { useEffect } from 'react' +import { apolloClient } from '@/lib/apollo-client' + +export const useApolloRefresh = () => { + const refreshApolloClient = async () => { + // Сбрасываем кэш и перезапрашиваем все активные запросы + console.log('useApolloRefresh - Resetting Apollo cache and refetching queries') + await apolloClient.resetStore() + } + + return { refreshApolloClient } +} \ No newline at end of file diff --git a/src/hooks/useAuth.ts b/src/hooks/useAuth.ts new file mode 100644 index 0000000..910346a --- /dev/null +++ b/src/hooks/useAuth.ts @@ -0,0 +1,367 @@ +import { useMutation } from '@apollo/client' +import { useState, useEffect } from 'react' +import { + SEND_SMS_CODE, + VERIFY_SMS_CODE, + REGISTER_FULFILLMENT_ORGANIZATION, + REGISTER_SELLER_ORGANIZATION +} from '@/graphql/mutations' +import { GET_ME } from '@/graphql/queries' +import { setAuthToken, setUserData, removeAuthToken, getAuthToken, apolloClient } from '@/lib/apollo-client' +import { useApolloRefresh } from './useApolloRefresh' + +interface User { + id: string + phone: string + avatar?: string + createdAt?: string + organization?: { + id: string + inn: string + kpp?: string + name?: string + fullName?: string + address?: string + addressFull?: string + ogrn?: string + ogrnDate?: string + status?: string + actualityDate?: string + registrationDate?: string + liquidationDate?: string + managementName?: string + managementPost?: string + opfCode?: string + opfFull?: string + opfShort?: string + okato?: string + oktmo?: string + okpo?: string + okved?: string + employeeCount?: number + revenue?: string + taxSystem?: string + phones?: unknown + emails?: unknown + type: 'FULFILLMENT' | 'SELLER' | 'LOGIST' | 'WHOLESALE' + apiKeys: Array<{ + id: string + marketplace: 'WILDBERRIES' | 'OZON' + isActive: boolean + validationData?: unknown + }> + } +} + +interface UseAuthReturn { + // SMS методы + sendSmsCode: (phone: string) => Promise<{ success: boolean; message: string }> + verifySmsCode: (phone: string, code: string) => Promise<{ + success: boolean + message: string + user?: User + }> + + // Регистрация организаций + registerFulfillmentOrganization: (phone: string, inn: string) => Promise<{ + success: boolean + message: string + user?: User + }> + registerSellerOrganization: (data: { + phone: string + wbApiKey?: string + ozonApiKey?: string + ozonClientId?: string + }) => Promise<{ + success: boolean + message: string + user?: User + }> + + // Состояние + user: User | null + isAuthenticated: boolean + isLoading: boolean + checkAuth: () => Promise + logout: () => void +} + +export const useAuth = (): UseAuthReturn => { + // Инициализируем состояния с проверкой токена + const [isLoading, setIsLoading] = useState(false) + const [user, setUser] = useState(null) + const [isAuthenticated, setIsAuthenticated] = useState(() => { + // Проверяем наличие токена при инициализации + return !!getAuthToken() + }) + const [isCheckingAuth, setIsCheckingAuth] = useState(false) // Защита от повторных вызовов + const { refreshApolloClient } = useApolloRefresh() + + const [sendSmsCodeMutation] = useMutation(SEND_SMS_CODE) + const [verifySmsCodeMutation] = useMutation(VERIFY_SMS_CODE) + const [registerFulfillmentMutation] = useMutation(REGISTER_FULFILLMENT_ORGANIZATION) + const [registerSellerMutation] = useMutation(REGISTER_SELLER_ORGANIZATION) + + // Проверка авторизации при инициализации + const checkAuth = async () => { + if (isCheckingAuth) { + console.log('useAuth - checkAuth already in progress, skipping') + return + } + + const token = getAuthToken() + console.log('useAuth - checkAuth called, token exists:', !!token) + + if (!token) { + setIsAuthenticated(false) + setUser(null) + setIsCheckingAuth(false) + return + } + + setIsCheckingAuth(true) + + try { + console.log('useAuth - Making GET_ME query') + const { data } = await apolloClient.query({ + query: GET_ME, + errorPolicy: 'all', + fetchPolicy: 'network-only' // Всегда делаем свежий запрос + }) + + console.log('useAuth - GET_ME response:', !!data?.me) + if (data?.me) { + setUser(data.me) + setIsAuthenticated(true) + setUserData(data.me) + console.log('useAuth - User authenticated:', data.me.phone) + } else { + setIsAuthenticated(false) + setUser(null) + } + } catch (error: unknown) { + console.log('useAuth - GET_ME error:', error) + if ((error as { graphQLErrors?: Array<{ extensions?: { code?: string } }> })?.graphQLErrors?.some((e) => e.extensions?.code === 'UNAUTHENTICATED')) { + logout() + } else { + setIsAuthenticated(false) + setUser(null) + } + } finally { + setIsCheckingAuth(false) + } + } + + // Проверяем авторизацию при загрузке компонента только если нет данных пользователя + useEffect(() => { + const token = getAuthToken() + console.log('useAuth - useEffect init, token exists:', !!token, 'user exists:', !!user, 'isChecking:', isCheckingAuth) + + if (token && !user && !isCheckingAuth) { + console.log('useAuth - Running checkAuth because token exists but no user data') + checkAuth() + } else if (!token) { + console.log('useAuth - No token, setting unauthenticated state') + setIsAuthenticated(false) + setUser(null) + } + }, []) // eslint-disable-line react-hooks/exhaustive-deps + + const sendSmsCode = async (phone: string) => { + try { + setIsLoading(true) + const { data } = await sendSmsCodeMutation({ + variables: { phone } + }) + + return { + success: data.sendSmsCode.success, + message: data.sendSmsCode.message + } + } catch (error) { + console.error('Error sending SMS code:', error) + return { + success: false, + message: 'Ошибка при отправке SMS кода' + } + } finally { + setIsLoading(false) + } + } + + const verifySmsCode = async (phone: string, code: string) => { + try { + setIsLoading(true) + console.log('useAuth - Starting verifySmsCode mutation with:', { phone, code }) + + const { data } = await verifySmsCodeMutation({ + variables: { phone, code } + }) + + console.log('useAuth - GraphQL response data:', data) + const result = data.verifySmsCode + console.log('useAuth - SMS verification result:', { + success: result.success, + hasToken: !!result.token, + hasUser: !!result.user, + message: result.message + }) + + if (result.success && result.token && result.user) { + // Сохраняем токен и данные пользователя + console.log('useAuth - Saving token:', result.token ? `${result.token.substring(0, 20)}...` : 'No token') + setAuthToken(result.token) + setUserData(result.user) + + // Обновляем состояние хука + setUser(result.user) + setIsAuthenticated(true) + console.log('useAuth - State updated: user set, isAuthenticated=true') + + // Проверяем что токен действительно сохранился + const savedToken = typeof window !== 'undefined' ? localStorage.getItem('authToken') : null + console.log('useAuth - Token saved to localStorage:', savedToken ? `${savedToken.substring(0, 20)}...` : 'Not saved') + + // Принудительно обновляем Apollo Client + refreshApolloClient() + + return { + success: true, + message: result.message, + user: result.user + } + } + + return { + success: false, + message: result.message + } + } catch (error) { + console.error('Error verifying SMS code:', error) + console.error('Error details:', { + message: error instanceof Error ? error.message : 'Unknown error', + graphQLErrors: (error as { graphQLErrors?: unknown })?.graphQLErrors, + networkError: (error as { networkError?: unknown })?.networkError + }) + return { + success: false, + message: 'Ошибка при проверке SMS кода' + } + } finally { + setIsLoading(false) + } + } + + const registerFulfillmentOrganization = async (phone: string, inn: string) => { + try { + setIsLoading(true) + + // Проверяем токен перед запросом + const currentToken = typeof window !== 'undefined' ? localStorage.getItem('authToken') : null + console.log('useAuth - Token before registerFulfillment request:', currentToken ? `${currentToken.substring(0, 20)}...` : 'No token') + + const { data } = await registerFulfillmentMutation({ + variables: { + input: { phone, inn } + } + }) + + const result = data.registerFulfillmentOrganization + + if (result.success && result.user) { + // Обновляем данные пользователя + setUserData(result.user) + + return { + success: true, + message: result.message, + user: result.user + } + } + + return { + success: false, + message: result.message + } + } catch (error) { + console.error('Error registering fulfillment organization:', error) + return { + success: false, + message: 'Ошибка при регистрации фулфилмент организации' + } + } finally { + setIsLoading(false) + } + } + + const registerSellerOrganization = async (data: { + phone: string + wbApiKey?: string + ozonApiKey?: string + ozonClientId?: string + }) => { + try { + setIsLoading(true) + const { data: result } = await registerSellerMutation({ + variables: { input: data } + }) + + const registerResult = result.registerSellerOrganization + + if (registerResult.success && registerResult.user) { + // Обновляем данные пользователя + setUserData(registerResult.user) + + return { + success: true, + message: registerResult.message, + user: registerResult.user + } + } + + return { + success: false, + message: registerResult.message + } + } catch (error) { + console.error('Error registering seller organization:', error) + return { + success: false, + message: 'Ошибка при регистрации селлер организации' + } + } finally { + setIsLoading(false) + } + } + + const logout = () => { + console.log('useAuth - Logging out') + removeAuthToken() + setUser(null) + setIsAuthenticated(false) + refreshApolloClient() + + // Перенаправляем на главную страницу + if (typeof window !== 'undefined') { + window.location.href = '/' + } + } + + return { + // SMS методы + sendSmsCode, + verifySmsCode, + + // Регистрация организаций + registerFulfillmentOrganization, + registerSellerOrganization, + + // Состояние + user, + isAuthenticated, + isLoading, + checkAuth, + logout + } +} \ No newline at end of file diff --git a/src/lib/apollo-client.ts b/src/lib/apollo-client.ts new file mode 100644 index 0000000..2fbdbc8 --- /dev/null +++ b/src/lib/apollo-client.ts @@ -0,0 +1,125 @@ +import { ApolloClient, InMemoryCache, createHttpLink, from } from '@apollo/client' +import { setContext } from '@apollo/client/link/context' +import { onError } from '@apollo/client/link/error' + +// HTTP Link для GraphQL запросов +const httpLink = createHttpLink({ + uri: '/api/graphql', +}) + +// Auth Link для добавления JWT токена в заголовки +const authLink = setContext((operation, { headers }) => { + // Получаем токен из localStorage каждый раз + const token = typeof window !== 'undefined' ? localStorage.getItem('authToken') : null + + console.log(`Apollo Client - Operation: ${operation.operationName}, Token:`, token ? `${token.substring(0, 20)}...` : 'No token') + + const authHeaders = { + ...headers, + authorization: token ? `Bearer ${token}` : '', + } + + console.log('Apollo Client - Auth headers:', { authorization: authHeaders.authorization ? 'Bearer ***' : 'No auth' }) + + return { + headers: authHeaders + } +}) + +// Error Link для обработки ошибок +const errorLink = onError(({ graphQLErrors, networkError, operation, forward }) => { + if (graphQLErrors) { + graphQLErrors.forEach(({ message, locations, path, extensions }) => { + console.error( + `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}` + ) + + // Если токен недействителен, очищаем localStorage и перенаправляем на авторизацию + // Но не делаем редирект если пользователь уже на главной странице (в процессе авторизации) + if (extensions?.code === 'UNAUTHENTICATED') { + if (typeof window !== 'undefined') { + localStorage.removeItem('authToken') + localStorage.removeItem('userData') + // Перенаправляем на страницу авторизации только если не находимся на ней + if (window.location.pathname !== '/') { + window.location.href = '/' + } + } + } + }) + } + + if (networkError) { + console.error(`[Network error]: ${networkError}`) + } +}) + +// Создаем Apollo Client +export const apolloClient = new ApolloClient({ + link: from([ + errorLink, + authLink, + httpLink, + ]), + cache: new InMemoryCache({ + typePolicies: { + User: { + fields: { + organization: { + merge: true, + }, + }, + }, + Organization: { + fields: { + apiKeys: { + merge: false, + }, + }, + }, + }, + }), + defaultOptions: { + watchQuery: { + errorPolicy: 'all', + }, + query: { + errorPolicy: 'all', + }, + }, +}) + +// Утилитарные функции для работы с токеном и пользователем +export const setAuthToken = (token: string) => { + if (typeof window !== 'undefined') { + localStorage.setItem('authToken', token) + } +} + +export const removeAuthToken = () => { + if (typeof window !== 'undefined') { + localStorage.removeItem('authToken') + localStorage.removeItem('userData') + } +} + +export const getAuthToken = (): string | null => { + if (typeof window !== 'undefined') { + return localStorage.getItem('authToken') + } + return null +} + +export const setUserData = (userData: unknown) => { + if (typeof window !== 'undefined') { + localStorage.setItem('userData', JSON.stringify(userData)) + } +} + +export const getUserData = (): unknown | null => { + if (typeof window !== 'undefined') { + const data = localStorage.getItem('userData') + return data ? JSON.parse(data) : null + } + return null +} \ No newline at end of file diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts new file mode 100644 index 0000000..d7ea874 --- /dev/null +++ b/src/lib/prisma.ts @@ -0,0 +1,11 @@ +import { PrismaClient } from '@prisma/client' + +declare global { + var prisma: PrismaClient | undefined +} + +export const prisma = globalThis.prisma || new PrismaClient() + +if (process.env.NODE_ENV !== 'production') { + globalThis.prisma = prisma +} \ No newline at end of file diff --git a/src/lib/utils.ts b/src/lib/utils.ts new file mode 100644 index 0000000..90d0bb8 --- /dev/null +++ b/src/lib/utils.ts @@ -0,0 +1,25 @@ +import { clsx, type ClassValue } from "clsx" +import { twMerge } from "tailwind-merge" + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)) +} + +// Функция для форматирования номера телефона +export function formatPhone(phone: string): string { + if (!phone) return '' + + // Убираем все кроме цифр + const digits = phone.replace(/\D/g, '') + + // Если номер начинается с 8, заменяем на 7 + const normalizedDigits = digits.startsWith('8') ? '7' + digits.slice(1) : digits + + // Проверяем длину номера + if (normalizedDigits.length !== 11 || !normalizedDigits.startsWith('7')) { + return phone // Возвращаем как есть, если формат неправильный + } + + // Форматируем как +7 (999) 999-99-99 + return `+7 (${normalizedDigits.slice(1, 4)}) ${normalizedDigits.slice(4, 7)}-${normalizedDigits.slice(7, 9)}-${normalizedDigits.slice(9, 11)}` +} diff --git a/src/services/dadata-service.ts b/src/services/dadata-service.ts new file mode 100644 index 0000000..7791e65 --- /dev/null +++ b/src/services/dadata-service.ts @@ -0,0 +1,289 @@ +import axios from 'axios' + +export interface DaDataCompany { + value: string + unrestricted_value: string + data: { + kpp?: string + management?: { + name?: string + post?: string + } + hid: string + type: string + state?: { + status?: string + actuality_date?: number + registration_date?: number + liquidation_date?: number + } + opf?: { + code?: string + full?: string + short?: string + } + name: { + full_with_opf?: string + short_with_opf?: string + full?: string + short?: string + } + inn: string + ogrn?: string + ogrn_date?: number + okpo?: string + okato?: string + oktmo?: string + okved?: string + employee_count?: number + phones?: object[] + emails?: object[] + finance?: { + revenue?: number + tax_system?: string + } + address?: { + value?: string + unrestricted_value?: string + data?: { + region_with_type?: string + city_with_type?: string + } + } + } +} + +interface DaDataResponse { + suggestions: DaDataCompany[] +} + +export interface OrganizationData { + inn: string + kpp?: string + name: string + fullName: string + address: string + addressFull?: string + ogrn?: string + ogrnDate?: Date + isActive: boolean + type: 'FULFILLMENT' | 'SELLER' + + // Статус организации + status?: string + actualityDate?: Date + registrationDate?: Date + liquidationDate?: Date + + // Руководитель + managementName?: string + managementPost?: string + + // ОПФ + opfCode?: string + opfFull?: string + opfShort?: string + + // Коды статистики + okato?: string + oktmo?: string + okpo?: string + okved?: string + + // Контакты + phones?: object[] + emails?: object[] + + // Финансовые данные + employeeCount?: number + revenue?: bigint + taxSystem?: string + + rawData: DaDataCompany +} + +export class DaDataService { + private apiKey: string + private apiUrl: string + + constructor() { + this.apiKey = process.env.DADATA_API_KEY! + this.apiUrl = process.env.DADATA_API_URL! + + if (!this.apiKey || !this.apiUrl) { + throw new Error('DaData API credentials not configured') + } + } + + /** + * Получает информацию об организации по ИНН + */ + async getOrganizationByInn(inn: string): Promise { + try { + const response = await axios.post( + `${this.apiUrl}/findById/party`, + { + query: inn, + count: 1 + }, + { + headers: { + 'Authorization': `Token ${this.apiKey}`, + 'Content-Type': 'application/json', + 'Accept': 'application/json' + } + } + ) + + if (!response.data?.suggestions?.length) { + return null + } + + const company = response.data.suggestions[0] + + // Определяем тип организации на основе ОПФ + const organizationType = this.determineOrganizationType(company) + + return { + inn: company.data.inn, + kpp: company.data.kpp || undefined, + name: company.data.name.short || company.data.name.full || 'Название не указано', + fullName: company.data.name.full_with_opf || '', + address: company.data.address?.value || '', + addressFull: company.data.address?.unrestricted_value || undefined, + ogrn: company.data.ogrn || undefined, + ogrnDate: this.parseDate(company.data.ogrn_date), + + // Статус организации + status: company.data.state?.status, + actualityDate: this.parseDate(company.data.state?.actuality_date), + registrationDate: this.parseDate(company.data.state?.registration_date), + liquidationDate: this.parseDate(company.data.state?.liquidation_date), + + // Руководитель + managementName: company.data.management?.name, + managementPost: company.data.management?.post, + + // ОПФ + opfCode: company.data.opf?.code, + opfFull: company.data.opf?.full, + opfShort: company.data.opf?.short, + + // Коды статистики + okato: company.data.okato, + oktmo: company.data.oktmo, + okpo: company.data.okpo, + okved: company.data.okved, + + // Контакты + phones: company.data.phones || undefined, + emails: company.data.emails || undefined, + + // Финансовые данные + employeeCount: company.data.employee_count || undefined, + revenue: company.data.finance?.revenue ? BigInt(company.data.finance.revenue) : undefined, + taxSystem: company.data.finance?.tax_system || undefined, + + isActive: company.data.state?.status === 'ACTIVE', + type: organizationType, + rawData: company + } + + } catch (error) { + console.error('Error fetching organization data from DaData:', error) + return null + } + } + + /** + * Безопасно парсит дату из timestamp, возвращает undefined для некорректных дат + */ + private parseDate(timestamp?: number): Date | undefined { + if (!timestamp) return undefined + + try { + const date = new Date(timestamp * 1000) + // Проверяем, что дата валидна и разумна (между 1900 и 2100 годами) + if (isNaN(date.getTime()) || date.getFullYear() < 1900 || date.getFullYear() > 2100) { + return undefined + } + return date + } catch { + return undefined + } + } + + /** + * Определяет тип организации на основе ОПФ (организационно-правовая форма) + */ + private determineOrganizationType(company: DaDataCompany): 'FULFILLMENT' | 'SELLER' { + const opfCode = company.data.opf?.code + + // Индивидуальные предприниматели чаще работают как селлеры + if (company.data.type === 'INDIVIDUAL' || opfCode === '50102') { + return 'SELLER' + } + + // ООО, АО и другие юридические лица чаще работают с фулфилментом + return 'FULFILLMENT' + } + + /** + * Валидирует ИНН по контрольной сумме + */ + validateInn(inn: string): boolean { + const digits = inn.replace(/\D/g, '') + + if (digits.length !== 10 && digits.length !== 12) { + return false + } + + // Проверяем контрольную сумму для 10-значного ИНН (юридические лица) + if (digits.length === 10) { + const checksum = this.calculateInn10Checksum(digits) + return checksum === parseInt(digits[9]) + } + + // Проверяем контрольную сумму для 12-значного ИНН (ИП) + if (digits.length === 12) { + const checksum1 = this.calculateInn12Checksum1(digits) + const checksum2 = this.calculateInn12Checksum2(digits) + return checksum1 === parseInt(digits[10]) && checksum2 === parseInt(digits[11]) + } + + return false + } + + private calculateInn10Checksum(inn: string): number { + const weights = [2, 4, 10, 3, 5, 9, 4, 6, 8] + let sum = 0 + + for (let i = 0; i < 9; i++) { + sum += parseInt(inn[i]) * weights[i] + } + + return sum % 11 % 10 + } + + private calculateInn12Checksum1(inn: string): number { + const weights = [7, 2, 4, 10, 3, 5, 9, 4, 6, 8] + let sum = 0 + + for (let i = 0; i < 10; i++) { + sum += parseInt(inn[i]) * weights[i] + } + + return sum % 11 % 10 + } + + private calculateInn12Checksum2(inn: string): number { + const weights = [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8] + let sum = 0 + + for (let i = 0; i < 11; i++) { + sum += parseInt(inn[i]) * weights[i] + } + + return sum % 11 % 10 + } +} \ No newline at end of file diff --git a/src/services/marketplace-service.ts b/src/services/marketplace-service.ts new file mode 100644 index 0000000..5badd2f --- /dev/null +++ b/src/services/marketplace-service.ts @@ -0,0 +1,223 @@ +import axios from 'axios' + +export interface MarketplaceValidationResult { + isValid: boolean + message: string + data?: { + sellerId?: string + sellerName?: string + [key: string]: unknown + } +} + +export interface WildberriesSellerInfo { + id: number + name: string + inn: string + kpp?: string +} + +export interface OzonSellerInfo { + id: number + name: string + status: string +} + +export class MarketplaceService { + private wbApiUrl: string + private ozonApiUrl: string + + constructor() { + this.wbApiUrl = process.env.WILDBERRIES_API_URL || 'https://common-api.wildberries.ru' + this.ozonApiUrl = process.env.OZON_API_URL || 'https://api-seller.ozon.ru' + } + + /** + * Валидирует API ключ Wildberries + */ + async validateWildberriesApiKey(apiKey: string): Promise { + try { + // Пытаемся получить информацию о продавце + const response = await axios.get( + `${this.wbApiUrl}/api/v1/seller-info`, + { + headers: { + 'Authorization': apiKey, + 'Content-Type': 'application/json' + }, + timeout: 10000 + } + ) + + if (response.status === 200 && response.data) { + const sellerData = response.data + + return { + isValid: true, + message: 'API ключ Wildberries валиден', + data: { + sellerId: sellerData.id?.toString(), + sellerName: sellerData.name || sellerData.supplierName, + inn: sellerData.inn + } + } + } + + return { + isValid: false, + message: 'Не удалось получить информацию о продавце Wildberries' + } + + } catch (error) { + console.error('Wildberries API validation error:', error) + + if (axios.isAxiosError(error)) { + if (error.response?.status === 401) { + return { + isValid: false, + message: 'Неверный API ключ Wildberries' + } + } + + if (error.response?.status === 403) { + return { + isValid: false, + message: 'Доступ запрещён. Проверьте права API ключа Wildberries' + } + } + + if (error.code === 'ECONNABORTED') { + return { + isValid: false, + message: 'Превышено время ожидания ответа от Wildberries API' + } + } + } + + return { + isValid: false, + message: 'Ошибка при проверке API ключа Wildberries' + } + } + } + + /** + * Валидирует API ключ Ozon + */ + async validateOzonApiKey(apiKey: string, clientId?: string): Promise { + try { + // Для Ozon нужен Client-Id + if (!clientId) { + return { + isValid: false, + message: 'Для Ozon API требуется Client-Id' + } + } + + // Пытаемся получить информацию о продавце + const response = await axios.post( + `${this.ozonApiUrl}/v1/seller/info`, + {}, + { + headers: { + 'Api-Key': apiKey, + 'Client-Id': clientId, + 'Content-Type': 'application/json' + }, + timeout: 10000 + } + ) + + if (response.status === 200 && response.data?.result) { + const sellerData = response.data.result as OzonSellerInfo + + return { + isValid: true, + message: 'API ключ Ozon валиден', + data: { + sellerId: sellerData.id?.toString(), + sellerName: sellerData.name, + status: sellerData.status + } + } + } + + return { + isValid: false, + message: 'Не удалось получить информацию о продавце Ozon' + } + + } catch (error) { + console.error('Ozon API validation error:', error) + + if (axios.isAxiosError(error)) { + if (error.response?.status === 401) { + return { + isValid: false, + message: 'Неверный API ключ или Client-Id для Ozon' + } + } + + if (error.response?.status === 403) { + return { + isValid: false, + message: 'Доступ запрещён. Проверьте права API ключа Ozon' + } + } + + if (error.code === 'ECONNABORTED') { + return { + isValid: false, + message: 'Превышено время ожидания ответа от Ozon API' + } + } + } + + return { + isValid: false, + message: 'Ошибка при проверке API ключа Ozon' + } + } + } + + /** + * Общий метод валидации API ключа по типу маркетплейса + */ + async validateApiKey( + marketplace: 'WILDBERRIES' | 'OZON', + apiKey: string, + clientId?: string + ): Promise { + switch (marketplace) { + case 'WILDBERRIES': + return this.validateWildberriesApiKey(apiKey) + case 'OZON': + return this.validateOzonApiKey(apiKey, clientId) + default: + return { + isValid: false, + message: 'Неподдерживаемый тип маркетплейса' + } + } + } + + /** + * Проверяет формат API ключа перед отправкой запроса + */ + validateApiKeyFormat(marketplace: 'WILDBERRIES' | 'OZON', apiKey: string): boolean { + if (!apiKey || typeof apiKey !== 'string') { + return false + } + + switch (marketplace) { + case 'WILDBERRIES': + // Wildberries API ключи обычно содержат буквы, цифры и дефисы + return /^[a-zA-Z0-9\-_]{10,}$/.test(apiKey) + case 'OZON': + // Ozon API ключи обычно содержат буквы, цифры и дефисы + return /^[a-zA-Z0-9\-_]{10,}$/.test(apiKey) + default: + return false + } + } +} \ No newline at end of file diff --git a/src/services/s3-service.ts b/src/services/s3-service.ts new file mode 100644 index 0000000..fedb96c --- /dev/null +++ b/src/services/s3-service.ts @@ -0,0 +1,78 @@ +interface S3Config { + accessKeyId: string + secretAccessKey: string + region: string + endpoint: string + bucket: string +} + +const s3Config: S3Config = { + accessKeyId: 'I6XD2OR7YO2ZN6L6Z629', + secretAccessKey: '9xCOoafisG0aB9lJNvdLO1UuK73fBvMcpHMdijrJ', + region: 'ru-1', + endpoint: 'https://s3.twcstorage.ru', + bucket: '617774af-sfera' +} + +export class S3Service { + private static async createSignedUrl(fileName: string, fileType: string): Promise { + // Для простоты пока используем прямую загрузку через fetch + // В продакшене лучше генерировать signed URLs на backend + const timestamp = Date.now() + const key = `avatars/${timestamp}-${fileName}` + + return key + } + + static async uploadAvatar(file: File, userId: string): Promise { + const fileName = `${userId}-${Date.now()}.${file.name.split('.').pop()}` + const key = `avatars/${fileName}` + + try { + // Создаем FormData для загрузки + const formData = new FormData() + formData.append('file', file) + formData.append('key', key) + formData.append('bucket', s3Config.bucket) + + // Пока используем простую загрузку через наш API + // Позже можно будет сделать прямую загрузку в S3 + const response = await fetch('/api/upload-avatar', { + method: 'POST', + body: formData + }) + + if (!response.ok) { + throw new Error('Failed to upload avatar') + } + + const result = await response.json() + return result.url + + } catch (error) { + console.error('Error uploading avatar:', error) + throw error + } + } + + static getAvatarUrl(key: string): string { + return `${s3Config.endpoint}/${s3Config.bucket}/${key}` + } + + static async deleteAvatar(key: string): Promise { + try { + await fetch('/api/delete-avatar', { + method: 'DELETE', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ key }) + }) + } catch (error) { + console.error('Error deleting avatar:', error) + throw error + } + } +} + +export default S3Service \ No newline at end of file diff --git a/src/services/sms-service.ts b/src/services/sms-service.ts new file mode 100644 index 0000000..92c1f0f --- /dev/null +++ b/src/services/sms-service.ts @@ -0,0 +1,243 @@ +import axios from 'axios' +import { prisma } from '@/lib/prisma' + +export interface SmsResponse { + success: boolean + message: string +} + +export interface SmsVerificationResponse { + success: boolean + message: string +} + +export class SmsService { + private email: string + private apiKey: string + private isDevelopment: boolean + + constructor() { + this.email = process.env.SMS_AERO_EMAIL! + this.apiKey = process.env.SMS_AERO_API_KEY! + this.isDevelopment = process.env.NODE_ENV === 'development' || process.env.SMS_DEV_MODE === 'true' + + if (!this.isDevelopment && (!this.email || !this.apiKey)) { + throw new Error('SMS Aero credentials not configured') + } + } + + private generateSmsCode(): string { + if (this.isDevelopment) { + return '1234' + } + return Math.floor(1000 + Math.random() * 9000).toString() + } + + private validatePhoneNumber(phone: string): boolean { + const phoneRegex = /^7\d{10}$/ + return phoneRegex.test(phone) + } + + private formatPhoneNumber(phone: string): string { + // Убираем все символы кроме цифр + const cleanPhone = phone.replace(/\D/g, '') + + // Если номер начинается с 8, заменяем на 7 + if (cleanPhone.startsWith('8')) { + return '7' + cleanPhone.slice(1) + } + + // Если номер начинается с +7, убираем + + if (cleanPhone.startsWith('7')) { + return cleanPhone + } + + // Если номер без кода страны, добавляем 7 + if (cleanPhone.length === 10) { + return '7' + cleanPhone + } + + return cleanPhone + } + + async sendSmsCode(phone: string): Promise { + try { + const formattedPhone = this.formatPhoneNumber(phone) + + if (!this.validatePhoneNumber(formattedPhone)) { + return { + success: false, + message: 'Неверный формат номера телефона' + } + } + + const code = this.generateSmsCode() + const expiresAt = new Date(Date.now() + 5 * 60 * 1000) // 5 минут + + // Удаляем старые коды для этого номера + await prisma.smsCode.deleteMany({ + where: { phone: formattedPhone } + }) + + // Сохраняем код в базе данных + await prisma.smsCode.create({ + data: { + code, + phone: formattedPhone, + expiresAt, + attempts: 0, + maxAttempts: 3 + } + }) + + // В режиме разработки не отправляем SMS + if (this.isDevelopment) { + console.log(`Development mode: SMS code ${code} for phone ${formattedPhone}`) + return { + success: true, + message: 'SMS код отправлен успешно (режим разработки)' + } + } + + // Отправляем SMS через SMS Aero API с HTTP Basic Auth + const response = await axios.get( + `https://gate.smsaero.ru/v2/sms/send`, + { + params: { + number: formattedPhone, + text: `Код подтверждения SferaV: ${code}`, + sign: 'SMS Aero' + }, + auth: { + username: this.email, + password: this.apiKey + }, + headers: { + 'Accept': 'application/json' + } + } + ) + + console.log('SMS Aero response:', response.data) + + if (response.data.success) { + return { + success: true, + message: 'SMS код отправлен успешно' + } + } else { + console.error('SMS Aero API error:', response.data) + return { + success: false, + message: response.data.message || 'Ошибка при отправке SMS' + } + } + + } catch (error: unknown) { + console.error('Error sending SMS:', error) + + // Детальная информация об ошибке + if (axios.isAxiosError(error)) { + console.error('Response status:', error.response?.status) + console.error('Response data:', error.response?.data) + + if (error.response?.status === 401) { + return { + success: false, + message: 'Ошибка авторизации SMS API. Проверьте настройки.' + } + } + } + + return { + success: false, + message: 'Ошибка при отправке SMS' + } + } + } + + async verifySmsCode(phone: string, code: string): Promise { + try { + const formattedPhone = this.formatPhoneNumber(phone) + + if (!this.validatePhoneNumber(formattedPhone)) { + return { + success: false, + message: 'Неверный формат номера телефона' + } + } + + // Ищем активный код для этого номера + const smsCode = await prisma.smsCode.findFirst({ + where: { + phone: formattedPhone, + isUsed: false, + expiresAt: { + gte: new Date() + } + }, + orderBy: { + createdAt: 'desc' + } + }) + + if (!smsCode) { + return { + success: false, + message: 'Код не найден или истек' + } + } + + // Проверяем количество попыток + if (smsCode.attempts >= smsCode.maxAttempts) { + // Помечаем код как использованный при превышении лимита попыток + await prisma.smsCode.update({ + where: { id: smsCode.id }, + data: { isUsed: true } + }) + + return { + success: false, + message: 'Превышено количество попыток ввода кода' + } + } + + // Проверяем правильность кода + if (smsCode.code !== code) { + // Увеличиваем счетчик попыток при неправильном коде + await prisma.smsCode.update({ + where: { id: smsCode.id }, + data: { attempts: smsCode.attempts + 1 } + }) + + const remainingAttempts = smsCode.maxAttempts - smsCode.attempts - 1 + return { + success: false, + message: remainingAttempts > 0 + ? `Неверный код. Осталось попыток: ${remainingAttempts}` + : 'Неверный код. Превышено количество попыток' + } + } + + // Код правильный - помечаем как использованный + await prisma.smsCode.update({ + where: { id: smsCode.id }, + data: { isUsed: true } + }) + + return { + success: true, + message: 'Код подтвержден успешно' + } + + } catch (error) { + console.error('Error verifying SMS code:', error) + return { + success: false, + message: 'Ошибка при проверке кода' + } + } + } + + +} \ No newline at end of file