From 150cff53e3e8fdd78b08ed74fe4c3185751eed48 Mon Sep 17 00:00:00 2001 From: Chen Date: Mon, 1 Dec 2025 16:46:22 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=B6=E6=95=A3=E4=BF=AE=E6=94=B9=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + README.md | 72 +- backend/package.json | 3 +- backend/server.js | 4 +- flypic/app/server/database/db.js | 215 +++++- flypic/app/server/package-lock.json | 48 ++ flypic/app/server/package.json | 4 +- .../server/public/assets/index-BQRQ1pO1.js | 226 ++++++ .../server/public/assets/index-Ct4ORqFz.js | 186 ----- .../server/public/assets/index-DYf0hRmn.css | 1 - .../server/public/assets/index-lXh_CTLb.css | 1 + .../public/assets/layoutWorker-D6X91dDa.js | 1 + flypic/app/server/public/favicon.png | Bin 0 -> 4977 bytes flypic/app/server/public/favicon.svg | 12 + flypic/app/server/public/index.html | 8 +- flypic/app/server/routes/image.js | 215 +++++- flypic/app/server/routes/library.js | 121 +++- flypic/app/server/routes/scan.js | 170 ++++- flypic/app/server/routes/watch.js | 34 +- flypic/app/server/server.js | 118 +++- flypic/app/server/utils/config.js | 29 +- flypic/app/server/utils/fileWatcher.js | 262 +++---- flypic/app/server/utils/fileWatcherWorker.js | 64 ++ flypic/app/server/utils/scanManager.js | 245 +++++++ flypic/app/server/utils/scanner.js | 522 ++++++++++---- flypic/app/server/utils/thumbnail.js | 656 +++++++++++++++--- flypic/app/ui/config | 10 +- flypic/cmd/install_init | 15 + flypic/cmd/main | 10 +- flypic/manifest | 4 +- flypic/wizard/install | 31 + frontend/index.html | 4 +- frontend/public/favicon.png | Bin 0 -> 4977 bytes frontend/public/favicon.svg | 12 + frontend/vite.config.js | 2 +- scripts/build-fpk-docker.js | 8 +- scripts/build-fpk.js | 8 +- website/index.html | 40 +- 38 files changed, 2638 insertions(+), 724 deletions(-) create mode 100644 flypic/app/server/public/assets/index-BQRQ1pO1.js delete mode 100644 flypic/app/server/public/assets/index-Ct4ORqFz.js delete mode 100644 flypic/app/server/public/assets/index-DYf0hRmn.css create mode 100644 flypic/app/server/public/assets/index-lXh_CTLb.css create mode 100644 flypic/app/server/public/assets/layoutWorker-D6X91dDa.js create mode 100644 flypic/app/server/public/favicon.png create mode 100644 flypic/app/server/public/favicon.svg create mode 100644 flypic/app/server/utils/fileWatcherWorker.js create mode 100644 flypic/app/server/utils/scanManager.js create mode 100644 flypic/wizard/install create mode 100644 frontend/public/favicon.png create mode 100644 frontend/public/favicon.svg diff --git a/.gitignore b/.gitignore index a7f93af..5248b84 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ Knowledge base/ # 构建输出 dist/ +.zip # 测试数据 test-library/ diff --git a/README.md b/README.md index 09d7077..aee92b1 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,23 @@ -# FlyPic +# FlyPic 飞图 -一个轻量、快速、稳定的图片检索浏览应用,专为飞牛 fnOS 设计。 +专为飞牛 fnOS 设计的轻量、快速、稳定的图像素材检索浏览应用。 -## 核心特性 +## ✨ 核心特性 -- 🚀 **高性能**: 支持 10万-100万 级别图片浏览 -- 🎨 **Eagle 风格瀑布流**: 固定高度,宽度自适应,视觉整齐 -- 🔍 **智能搜索**: 多关键词组合搜索,快速定位 +- 🚀 **轻量快速** - 支持数十万级别图片流畅浏览,基于 SQLite 本地数据库,毫秒级响应 +- 🛡️ **非侵入式** - 只在素材库目录创建 .flypic 文件夹存储索引和缩略图,不修改任何原始文件 +- 🔄 **实时同步** - 基于 Worker Thread 的文件监控,自动检测新增、删除、修改 +- 🌐 **远程访问** - 支持 FN Connect 远程访问,随时随地浏览管理图片素材库 +- 🎨 **现代界面** - 固定行高瀑布流布局,支持亮色/暗色主题,响应式设计 +- 🔍 **智能搜索** - 多关键词组合搜索,高级筛选(格式/大小/方向) +- 📱 **移动适配** - 响应式设计,手机上也能流畅使用 +- 🆓 **开源免费** - 100% 开源,MIT 协议 ## 🛠️ 技术栈 -- **前端**:React + Vite + TailwindCSS + react-photo-view + zustand -- **后端**:Node.js + Express + Sharp + better-sqlite3 + Socket.IO -- **部署**:飞牛 fnOS +**前端**:React 18 + Vite 5 + TailwindCSS + Zustand + react-window + react-photo-view + +**后端**:Node.js + Express + Sharp + better-sqlite3 + Socket.IO + chokidar ## 🚀 快速开始 @@ -22,28 +27,21 @@ # 安装依赖 npm install -# 启动前端开发服务器(推荐) +# 启动前端开发服务器 npm run dev:frontend # 访问 http://localhost:5173 # 启动后端开发服务器 npm run dev:backend -# API 运行在 http://localhost:5002 +# API 运行在 http://localhost:15002 ``` ### 构建部署 ```bash -# 方法一:使用 Docker 构建(推荐) +# 使用 Docker 构建(推荐) # 包含 Linux 版本的依赖,上传后直接可用 npm run build:fpk:docker - -# 方法二:普通构建 -# 需要在飞牛上手动安装依赖 -npm run build:fpk - -# 本地测试 Linux 版本 -npm run test:docker ``` ## 📦 部署到飞牛 fnOS @@ -56,7 +54,13 @@ npm run test:docker 2. **上传**:将 `flypic/` 目录上传到飞牛 3. **打包**:`fnpack build` 4. **安装**:`appcenter-cli install-fpk flypic.fpk` -5. **访问**:`http://你的飞牛IP:5002` +5. **访问**:`http://你的飞牛IP:15002`(端口可在安装时自定义) + +### 安装提示 + +- **自定义端口**:安装时可自定义应用端口(默认 15002),避免与其他应用冲突 +- **素材库路径**:添加素材库时需输入飞牛文件系统的完整路径,如 `/vol1/1000/图片库` +- **文件夹权限**:请确保应用对素材库文件夹有读取权限,可在飞牛应用设置中配置授权目录 ## 📁 项目结构 @@ -66,35 +70,27 @@ FlyPic/ ├── backend/ # Node.js 后端 ├── flypic/ # 飞牛打包目录(构建生成) ├── scripts/ # 构建脚本 -│ ├── build-fpk.js # 普通构建 -│ ├── build-fpk-docker.js # Docker 构建 -│ └── test-in-docker.js # Docker 测试 -├── dev.bat # Windows 开发启动脚本 -├── start.bat # Windows 生产启动脚本 +├── website/ # 官网静态页面 └── 飞牛打包部署指南.md # 完整部署文档 ``` -## 🎯 支持的图片格式 +## 🎯 支持的文件格式 -jpg, jpeg, png, webp, gif, bmp, tiff +**完整支持**:JPG、PNG、WebP、GIF、BMP、TIFF、SVG -## 📝 开发说明 +**可识别**:视频(MP4/MOV/AVI...)、音频(MP3/WAV...)、文档(PDF/TXT...)、设计文件(PSD/AI...) -### 数据存储 +## 📝 数据存储 ``` 素材库目录/ ├── 用户图片文件... -└── .flypic/ - ├── thumbnails/200/ # WebP 缩略图 - ├── metadata.db # SQLite 数据库 - └── config.json # 配置文件 +└── .flypic/ # FlyPic 数据目录(隐藏) + ├── thumbnails/ # WebP 缩略图 + └── metadata.db # SQLite 数据库 ``` -### 端口配置 - -- 前端开发:5173 -- 后端服务:5002 +删除 `.flypic` 文件夹即可完全清除索引数据,不留任何痕迹。 ## 🐛 故障排查 @@ -106,4 +102,4 @@ MIT License - 详见 [LICENSE](./LICENSE) 文件 --- -**最后更新**:2025-11-29 +**官网**:[FlyPic 介绍页](https://flypic.shikejk.com/) | **最后更新**:2025-12-01 diff --git a/backend/package.json b/backend/package.json index 3359488..76751a2 100644 --- a/backend/package.json +++ b/backend/package.json @@ -4,7 +4,7 @@ "description": "FlyPic backend server", "main": "server.js", "scripts": { - "dev": "nodemon server.js", + "dev": "cross-env PORT=15002 nodemon server.js", "start": "node server.js" }, "dependencies": { @@ -19,6 +19,7 @@ "socket.io": "^4.6.0" }, "devDependencies": { + "cross-env": "^7.0.3", "nodemon": "^3.0.2" } } diff --git a/backend/server.js b/backend/server.js index 6d69cab..11ab316 100644 --- a/backend/server.js +++ b/backend/server.js @@ -9,12 +9,12 @@ const app = express(); const server = http.createServer(app); const io = new Server(server, { cors: { - origin: process.env.FRONTEND_DIST ? false : 'http://localhost:5173', + origin: process.env.FRONTEND_DIST ? false : ['http://localhost:5173', 'http://localhost:3000'], methods: ['GET', 'POST'] } }); -const PORT = process.env.PORT || 3000; +const PORT = process.env.PORT || 15002; // Auto-detect frontend dist path let FRONTEND_DIST = process.env.FRONTEND_DIST; diff --git a/flypic/app/server/database/db.js b/flypic/app/server/database/db.js index b96e5ab..edbeb1a 100644 --- a/flypic/app/server/database/db.js +++ b/flypic/app/server/database/db.js @@ -13,11 +13,11 @@ class LibraryDatabase { fs.mkdirSync(this.flypicDir, { recursive: true }); } - // Create thumbnails directory (优化:不再使用子文件夹) + // Create thumbnails directory (480px 与 Billfish 一致) const thumbDir = path.join(this.flypicDir, 'thumbnails'); - if (!fs.existsSync(thumbDir)) { - fs.mkdirSync(thumbDir, { recursive: true }); - } + const thumbDir480 = path.join(thumbDir, '480'); + if (!fs.existsSync(thumbDir)) fs.mkdirSync(thumbDir, { recursive: true }); + if (!fs.existsSync(thumbDir480)) fs.mkdirSync(thumbDir480, { recursive: true }); this.db = new Database(this.dbPath); @@ -43,6 +43,7 @@ class LibraryDatabase { width INTEGER, height INTEGER, format TEXT, + file_type TEXT DEFAULT 'image', created_at INTEGER, modified_at INTEGER, file_hash TEXT, @@ -51,6 +52,13 @@ class LibraryDatabase { indexed_at INTEGER ) `); + + // 添加 file_type 列(如果不存在) + try { + this.db.exec(`ALTER TABLE images ADD COLUMN file_type TEXT DEFAULT 'image'`); + } catch (e) { + // 列已存在,忽略错误 + } // Folders table this.db.exec(` @@ -72,17 +80,65 @@ class LibraryDatabase { CREATE INDEX IF NOT EXISTS idx_file_hash ON images(file_hash); CREATE INDEX IF NOT EXISTS idx_folder_path ON folders(path); CREATE INDEX IF NOT EXISTS idx_folder_parent ON folders(parent_path); + -- 复合索引:优化文件夹+时间排序查询 + CREATE INDEX IF NOT EXISTS idx_folder_created ON images(folder, created_at DESC); `); + + // Metadata table for tracking database modifications + this.db.exec(` + CREATE TABLE IF NOT EXISTS metadata ( + key TEXT PRIMARY KEY, + value TEXT, + updated_at INTEGER + ) + `); + + // Initialize last_modified if not exists + const lastModified = this.db.prepare('SELECT value FROM metadata WHERE key = ?').get('last_modified'); + if (!lastModified) { + this.db.prepare('INSERT INTO metadata (key, value, updated_at) VALUES (?, ?, ?)').run('last_modified', Date.now().toString(), Date.now()); + } + } + + /** + * 更新数据库最后修改时间 + */ + updateLastModified() { + const now = Date.now(); + this.db.prepare('INSERT OR REPLACE INTO metadata (key, value, updated_at) VALUES (?, ?, ?)').run('last_modified', now.toString(), now); + return now; + } + + /** + * 获取数据库最后修改时间 + */ + getLastModified() { + const row = this.db.prepare('SELECT value FROM metadata WHERE key = ?').get('last_modified'); + return row ? parseInt(row.value, 10) : Date.now(); + } + + /** + * 获取缓存元数据 + */ + getCacheMeta() { + const lastModified = this.getLastModified(); + const imageCount = this.db.prepare('SELECT COUNT(*) as count FROM images').get(); + const folderCount = this.db.prepare('SELECT COUNT(*) as count FROM folders').get(); + return { + dbModifiedAt: lastModified, + totalImages: imageCount.count, + totalFolders: folderCount.count + }; } // Image operations insertImage(imageData) { const stmt = this.db.prepare(` INSERT OR REPLACE INTO images - (path, filename, folder, size, width, height, format, created_at, modified_at, file_hash, thumbnail_path, thumbnail_size, indexed_at) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + (path, filename, folder, size, width, height, format, file_type, created_at, modified_at, file_hash, thumbnail_path, thumbnail_size, indexed_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) `); - return stmt.run( + const result = stmt.run( imageData.path, imageData.filename, imageData.folder, @@ -90,6 +146,7 @@ class LibraryDatabase { imageData.width, imageData.height, imageData.format, + imageData.file_type || 'image', imageData.created_at, imageData.modified_at, imageData.file_hash, @@ -97,6 +154,9 @@ class LibraryDatabase { imageData.thumbnail_size, Date.now() ); + // 更新数据库修改时间 + this.updateLastModified(); + return result; } getImageByPath(imagePath) { @@ -109,61 +169,132 @@ class LibraryDatabase { return stmt.all(); } - searchImages(keywords, filters = {}) { - let query = 'SELECT * FROM images WHERE 1=1'; + searchImages(keywords, filters = {}, pagination = null) { + let baseQuery = 'FROM images WHERE 1=1'; const params = []; // Keyword search (AND logic) if (keywords && keywords.trim()) { const terms = keywords.trim().split(/\s+/); terms.forEach(term => { - query += ' AND filename LIKE ?'; + baseQuery += ' AND filename LIKE ?'; params.push(`%${term}%`); }); } // Folder filter if (filters.folder) { - query += ' AND folder LIKE ?'; - params.push(`${filters.folder}%`); + // 使用 OR 组合精确匹配和前缀匹配,包含子文件夹 + baseQuery += ' AND (folder = ? OR folder LIKE ?)'; + params.push(filters.folder, `${filters.folder}/%`); } // Format filter if (filters.formats && filters.formats.length > 0) { const placeholders = filters.formats.map(() => '?').join(','); - query += ` AND format IN (${placeholders})`; + baseQuery += ` AND format IN (${placeholders})`; params.push(...filters.formats); } // Size filter (in KB) if (filters.minSize) { - query += ' AND size >= ?'; + baseQuery += ' AND size >= ?'; params.push(filters.minSize * 1024); } if (filters.maxSize) { - query += ' AND size <= ?'; + baseQuery += ' AND size <= ?'; params.push(filters.maxSize * 1024); } // Date filter if (filters.startDate) { - query += ' AND created_at >= ?'; + baseQuery += ' AND created_at >= ?'; params.push(filters.startDate); } if (filters.endDate) { - query += ' AND created_at <= ?'; + baseQuery += ' AND created_at <= ?'; params.push(filters.endDate); } - query += ' ORDER BY created_at DESC'; + // 如果需要分页 + if (pagination && typeof pagination.offset === 'number' && typeof pagination.limit === 'number') { + const timings = {}; + + // 先获取数据(快速) + const query = `SELECT * ${baseQuery} ORDER BY created_at DESC LIMIT ? OFFSET ?`; + const paginatedParams = [...params, pagination.limit, pagination.offset]; + + let queryStart = Date.now(); + const stmt = this.db.prepare(query); + const images = stmt.all(...paginatedParams); + timings.dataQuery = Date.now() - queryStart; + // 如果是第一页且结果数量小于 limit,说明没有更多数据,无需 COUNT + if (pagination.offset === 0 && images.length < pagination.limit) { + return { + images, + total: images.length, + offset: pagination.offset, + limit: pagination.limit, + hasMore: false + }; + } + + // 如果是文件夹查询,尝试从 folders 表获取 count(更快) + let total = 0; + queryStart = Date.now(); + if (filters.folder && !keywords && !filters.formats?.length && !filters.minSize && !filters.maxSize && !filters.startDate && !filters.endDate) { + const folderRow = this.db.prepare('SELECT image_count FROM folders WHERE path = ?').get(filters.folder); + if (folderRow) { + total = folderRow.image_count; + timings.countSource = 'folders_table'; + } + } + + // 如果无法从 folders 表获取,才执行 COUNT(较慢) + if (total === 0) { + const countStmt = this.db.prepare(`SELECT COUNT(*) as total ${baseQuery}`); + const countResult = countStmt.get(...params); + total = countResult.total; + timings.countSource = 'count_query'; + } + timings.countQuery = Date.now() - queryStart; + + // 性能日志 + const totalTime = timings.dataQuery + timings.countQuery; + if (totalTime > 50) { + console.log(`[DB] searchImages: data=${timings.dataQuery}ms, count=${timings.countQuery}ms (${timings.countSource}), folder=${filters.folder || 'all'}`); + } + + return { + images, + total, + offset: pagination.offset, + limit: pagination.limit, + hasMore: pagination.offset + images.length < total + }; + } + + // 无分页,返回所有结果(保持向后兼容) + const query = `SELECT * ${baseQuery} ORDER BY created_at DESC`; const stmt = this.db.prepare(query); return stmt.all(...params); } deleteImage(imagePath) { const stmt = this.db.prepare('DELETE FROM images WHERE path = ?'); - return stmt.run(imagePath); + const result = stmt.run(imagePath); + // 更新数据库修改时间 + if (result.changes > 0) { + this.updateLastModified(); + } + return result; + } + + // Update folder field for a specific image (by path) + updateImageFolder(imagePath, folderPath) { + const stmt = this.db.prepare('UPDATE images SET folder = ? WHERE path = ?'); + return stmt.run(folderPath, imagePath); } // Folder operations @@ -197,13 +328,46 @@ class LibraryDatabase { } deleteImagesByFolderPrefix(folderPath) { + // 使用 folderPath/% 确保只匹配真正的子文件夹,避免误删同名前缀文件夹 const stmt = this.db.prepare('DELETE FROM images WHERE folder = ? OR folder LIKE ?'); - return stmt.run(folderPath, `${folderPath}%`); + const result = stmt.run(folderPath, `${folderPath}/%`); + // 更新数据库修改时间 + if (result.changes > 0) { + this.updateLastModified(); + } + return result; } deleteFoldersByPrefix(folderPath) { + // 使用 folderPath/% 确保只匹配真正的子文件夹 const stmt = this.db.prepare('DELETE FROM folders WHERE path = ? OR path LIKE ?'); - return stmt.run(folderPath, `${folderPath}%`); + return stmt.run(folderPath, `${folderPath}/%`); + } + + /** + * 更新文件夹的文件数量(包含所有子文件夹中的图片) + */ + updateFolderImageCount(folderPath) { + // 统计该文件夹及其所有子文件夹中的图片总数 + // folder = ? 匹配直接子文件,folder LIKE ?/% 匹配所有子文件夹 + const countStmt = this.db.prepare( + 'SELECT COUNT(*) as count FROM images WHERE folder = ? OR folder LIKE ?' + ); + const result = countStmt.get(folderPath, `${folderPath}/%`); + + // 更新文件夹记录 + const updateStmt = this.db.prepare('UPDATE folders SET image_count = ? WHERE path = ?'); + return updateStmt.run(result.count, folderPath); + } + + /** + * 批量更新所有文件夹的文件数量 + */ + updateAllFolderCounts() { + const folders = this.getAllFolders(); + for (const folder of folders) { + this.updateFolderImageCount(folder.path); + } } getFolderTree() { @@ -228,15 +392,6 @@ class LibraryDatabase { return tree; } - updateFolderImageCount(folderPath) { - const stmt = this.db.prepare(` - UPDATE folders - SET image_count = (SELECT COUNT(*) FROM images WHERE folder LIKE ?) - WHERE path = ? - `); - return stmt.run(`${folderPath}%`, folderPath); - } - close() { this.db.close(); } diff --git a/flypic/app/server/package-lock.json b/flypic/app/server/package-lock.json index 2eb2073..ea86445 100644 --- a/flypic/app/server/package-lock.json +++ b/flypic/app/server/package-lock.json @@ -14,10 +14,12 @@ "crypto": "^1.0.1", "express": "^4.18.2", "glob": "^10.3.10", + "p-limit": "^7.2.0", "sharp": "^0.33.0", "socket.io": "^4.6.0" }, "devDependencies": { + "cross-env": "^7.0.3", "nodemon": "^3.0.2" } }, @@ -811,6 +813,25 @@ "node": ">= 0.10" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmmirror.com/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -1766,6 +1787,21 @@ "wrappy": "1" } }, + "node_modules/p-limit": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-7.2.0.tgz", + "integrity": "sha512-ATHLtwoTNDloHRFFxFJdHnG6n2WUeFjaR8XQMFdKIv0xkXjrER8/iG9iu265jOM95zXHAfv9oTkqhrfbIzosrQ==", + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.2.1" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/package-json-from-dist": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", @@ -2784,6 +2820,18 @@ "optional": true } } + }, + "node_modules/yocto-queue": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/yocto-queue/-/yocto-queue-1.2.2.tgz", + "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==", + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/flypic/app/server/package.json b/flypic/app/server/package.json index 76a4238..76751a2 100644 --- a/flypic/app/server/package.json +++ b/flypic/app/server/package.json @@ -4,7 +4,7 @@ "description": "FlyPic backend server", "main": "server.js", "scripts": { - "dev": "nodemon server.js", + "dev": "cross-env PORT=15002 nodemon server.js", "start": "node server.js" }, "dependencies": { @@ -14,10 +14,12 @@ "crypto": "^1.0.1", "express": "^4.18.2", "glob": "^10.3.10", + "p-limit": "^7.2.0", "sharp": "^0.33.0", "socket.io": "^4.6.0" }, "devDependencies": { + "cross-env": "^7.0.3", "nodemon": "^3.0.2" } } diff --git a/flypic/app/server/public/assets/index-BQRQ1pO1.js b/flypic/app/server/public/assets/index-BQRQ1pO1.js new file mode 100644 index 0000000..e70311d --- /dev/null +++ b/flypic/app/server/public/assets/index-BQRQ1pO1.js @@ -0,0 +1,226 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Es=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function su(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gd={exports:{}},$o={},yd={exports:{}},Se={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ms=Symbol.for("react.element"),Sm=Symbol.for("react.portal"),bm=Symbol.for("react.fragment"),Em=Symbol.for("react.strict_mode"),Cm=Symbol.for("react.profiler"),Nm=Symbol.for("react.provider"),Rm=Symbol.for("react.context"),Tm=Symbol.for("react.forward_ref"),Om=Symbol.for("react.suspense"),Im=Symbol.for("react.memo"),Am=Symbol.for("react.lazy"),dc=Symbol.iterator;function jm(e){return e===null||typeof e!="object"?null:(e=dc&&e[dc]||e["@@iterator"],typeof e=="function"?e:null)}var vd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wd=Object.assign,xd={};function vi(e,t,r){this.props=e,this.context=t,this.refs=xd,this.updater=r||vd}vi.prototype.isReactComponent={};vi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};vi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _d(){}_d.prototype=vi.prototype;function ou(e,t,r){this.props=e,this.context=t,this.refs=xd,this.updater=r||vd}var au=ou.prototype=new _d;au.constructor=ou;wd(au,vi.prototype);au.isPureReactComponent=!0;var hc=Array.isArray,kd=Object.prototype.hasOwnProperty,lu={current:null},Sd={key:!0,ref:!0,__self:!0,__source:!0};function bd(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)kd.call(t,n)&&!Sd.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1>>1,A=$[I];if(0>>1;Ii(W,H))oei(he,W)?($[I]=he,$[oe]=H,I=oe):($[I]=W,$[M]=H,I=M);else if(oei(he,H))$[I]=he,$[oe]=H,I=oe;else break e}}return D}function i($,D){var H=$.sortIndex-D.sortIndex;return H!==0?H:$.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],f=[],p=1,y=null,x=3,g=!1,m=!1,u=!1,v=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w($){for(var D=r(f);D!==null;){if(D.callback===null)n(f);else if(D.startTime<=$)n(f),D.sortIndex=D.expirationTime,t(l,D);else break;D=r(f)}}function k($){if(u=!1,w($),!m)if(r(l)!==null)m=!0,se(b);else{var D=r(f);D!==null&&Q(k,D.startTime-$)}}function b($,D){m=!1,u&&(u=!1,c(L),L=-1),g=!0;var H=x;try{for(w(D),y=r(l);y!==null&&(!(y.expirationTime>D)||$&&!ee());){var I=y.callback;if(typeof I=="function"){y.callback=null,x=y.priorityLevel;var A=I(y.expirationTime<=D);D=e.unstable_now(),typeof A=="function"?y.callback=A:y===r(l)&&n(l),w(D)}else n(l);y=r(l)}if(y!==null)var V=!0;else{var M=r(f);M!==null&&Q(k,M.startTime-D),V=!1}return V}finally{y=null,x=H,g=!1}}var N=!1,T=null,L=-1,O=5,F=-1;function ee(){return!(e.unstable_now()-F$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function($){switch(x){case 1:case 2:case 3:var D=3;break;default:D=x}var H=x;x=D;try{return $()}finally{x=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,D){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=x;x=$;try{return D()}finally{x=H}},e.unstable_scheduleCallback=function($,D,H){var I=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0I?($.sortIndex=H,t(f,$),r(l)===null&&$===r(f)&&(u?(c(L),L=-1):u=!0,Q(k,H-I))):($.sortIndex=A,t(l,$),m||g||(m=!0,se(b))),$},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function($){var D=x;return function(){var H=x;x=D;try{return $.apply(this,arguments)}finally{x=H}}}})(Td);Rd.exports=Td;var Hm=Rd.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vm=Z,Ct=Hm;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qa=Object.prototype.hasOwnProperty,qm=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,mc={},gc={};function Km(e){return Qa.call(gc,e)?!0:Qa.call(mc,e)?!1:qm.test(e)?gc[e]=!0:(mc[e]=!0,!1)}function Xm(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ym(e,t,r,n){if(t===null||typeof t>"u"||Xm(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ht(e,t,r,n,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var et={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){et[e]=new ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];et[t]=new ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){et[e]=new ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){et[e]=new ht(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){et[e]=new ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){et[e]=new ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){et[e]=new ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){et[e]=new ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){et[e]=new ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var cu=/[\-:]([a-z])/g;function fu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(cu,fu);et[t]=new ht(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(cu,fu);et[t]=new ht(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(cu,fu);et[t]=new ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){et[e]=new ht(e,1,!1,e.toLowerCase(),null,!1,!1)});et.xlinkHref=new ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){et[e]=new ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function du(e,t,r,n){var i=et.hasOwnProperty(t)?et[t]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var l=` +`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{ma=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Pi(e):""}function Zm(e){switch(e.tag){case 5:return Pi(e.type);case 16:return Pi("Lazy");case 13:return Pi("Suspense");case 19:return Pi("SuspenseList");case 0:case 2:case 15:return e=ga(e.type,!1),e;case 11:return e=ga(e.type.render,!1),e;case 1:return e=ga(e.type,!0),e;default:return""}}function tl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hn:return"Fragment";case Wn:return"Portal";case Ga:return"Profiler";case hu:return"StrictMode";case Ja:return"Suspense";case el:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ad:return(e.displayName||"Context")+".Consumer";case Id:return(e._context.displayName||"Context")+".Provider";case pu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mu:return t=e.displayName||null,t!==null?t:tl(e.type)||"Memo";case $r:t=e._payload,e=e._init;try{return tl(e(t))}catch{}}return null}function Qm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return tl(t);case 8:return t===hu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function on(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gm(e){var t=zd(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rs(e){e._valueTracker||(e._valueTracker=Gm(e))}function Ld(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=zd(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function mo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function rl(e,t){var r=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function vc(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=on(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Pd(e,t){t=t.checked,t!=null&&du(e,"checked",t,!1)}function nl(e,t){Pd(e,t);var r=on(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?il(e,t.type,r):t.hasOwnProperty("defaultValue")&&il(e,t.type,on(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function wc(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function il(e,t,r){(t!=="number"||mo(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Fi=Array.isArray;function ri(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ts.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Gi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ui={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Jm=["Webkit","ms","Moz","O"];Object.keys(Ui).forEach(function(e){Jm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ui[t]=Ui[e]})});function Bd(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ui.hasOwnProperty(e)&&Ui[e]?(""+t).trim():t+"px"}function Ud(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Bd(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var e0=Be({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function al(e,t){if(t){if(e0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function ll(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ul=null;function gu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cl=null,ni=null,ii=null;function kc(e){if(e=vs(e)){if(typeof cl!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=Ko(t),cl(e.stateNode,e.type,t))}}function $d(e){ni?ii?ii.push(e):ii=[e]:ni=e}function Wd(){if(ni){var e=ni,t=ii;if(ii=ni=null,kc(e),t)for(e=0;e>>=0,e===0?32:31-(f0(e)/d0|0)|0}var Os=64,Is=4194304;function Di(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wo(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Di(a):(s&=o,s!==0&&(n=Di(s)))}else o=r&~i,o!==0?n=Di(o):s!==0&&(n=Di(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function gs(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yt(t),e[t]=r}function g0(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Wi),Ic=" ",Ac=!1;function uh(e,t){switch(e){case"keyup":return H0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vn=!1;function q0(e,t){switch(e){case"compositionend":return ch(t);case"keypress":return t.which!==32?null:(Ac=!0,Ic);case"textInput":return e=t.data,e===Ic&&Ac?null:e;default:return null}}function K0(e,t){if(Vn)return e==="compositionend"||!bu&&uh(e,t)?(e=ah(),Gs=_u=Kr=null,Vn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Pc(r)}}function ph(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ph(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mh(){for(var e=window,t=mo();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=mo(e.document)}return t}function Eu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rg(e){var t=mh(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ph(r.ownerDocument.documentElement,r)){if(n!==null&&Eu(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=Fc(r,s);var o=Fc(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,qn=null,gl=null,Vi=null,yl=!1;function Dc(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;yl||qn==null||qn!==mo(n)||(n=qn,"selectionStart"in n&&Eu(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Vi&&is(Vi,n)||(Vi=n,n=ko(gl,"onSelect"),0Yn||(e.current=Sl[Yn],Sl[Yn]=null,Yn--)}function Oe(e,t){Yn++,Sl[Yn]=e.current,e.current=t}var an={},ot=un(an),gt=un(!1),En=an;function ci(e,t){var r=e.type.contextTypes;if(!r)return an;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function yt(e){return e=e.childContextTypes,e!=null}function bo(){Le(gt),Le(ot)}function Vc(e,t,r){if(ot.current!==an)throw Error(ie(168));Oe(ot,t),Oe(gt,r)}function bh(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ie(108,Qm(e)||"Unknown",i));return Be({},r,n)}function Eo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||an,En=ot.current,Oe(ot,e),Oe(gt,gt.current),!0}function qc(e,t,r){var n=e.stateNode;if(!n)throw Error(ie(169));r?(e=bh(e,t,En),n.__reactInternalMemoizedMergedChildContext=e,Le(gt),Le(ot),Oe(ot,e)):Le(gt),Oe(gt,r)}var Er=null,Xo=!1,Oa=!1;function Eh(e){Er===null?Er=[e]:Er.push(e)}function pg(e){Xo=!0,Eh(e)}function cn(){if(!Oa&&Er!==null){Oa=!0;var e=0,t=Re;try{var r=Er;for(Re=1;e>=o,i-=o,Nr=1<<32-Yt(t)+i|r<L?(O=T,T=null):O=T.sibling;var F=x(c,T,w[L],k);if(F===null){T===null&&(T=O);break}e&&T&&F.alternate===null&&t(c,T),d=s(F,d,L),N===null?b=F:N.sibling=F,N=F,T=O}if(L===w.length)return r(c,T),Fe&&mn(c,L),b;if(T===null){for(;LL?(O=T,T=null):O=T.sibling;var ee=x(c,T,F.value,k);if(ee===null){T===null&&(T=O);break}e&&T&&ee.alternate===null&&t(c,T),d=s(ee,d,L),N===null?b=ee:N.sibling=ee,N=ee,T=O}if(F.done)return r(c,T),Fe&&mn(c,L),b;if(T===null){for(;!F.done;L++,F=w.next())F=y(c,F.value,k),F!==null&&(d=s(F,d,L),N===null?b=F:N.sibling=F,N=F);return Fe&&mn(c,L),b}for(T=n(c,T);!F.done;L++,F=w.next())F=g(T,c,L,F.value,k),F!==null&&(e&&F.alternate!==null&&T.delete(F.key===null?L:F.key),d=s(F,d,L),N===null?b=F:N.sibling=F,N=F);return e&&T.forEach(function(R){return t(c,R)}),Fe&&mn(c,L),b}function v(c,d,w,k){if(typeof w=="object"&&w!==null&&w.type===Hn&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ns:e:{for(var b=w.key,N=d;N!==null;){if(N.key===b){if(b=w.type,b===Hn){if(N.tag===7){r(c,N.sibling),d=i(N,w.props.children),d.return=c,c=d;break e}}else if(N.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===$r&&Yc(b)===N.type){r(c,N.sibling),d=i(N,w.props),d.ref=Ii(c,N,w),d.return=c,c=d;break e}r(c,N);break}else t(c,N);N=N.sibling}w.type===Hn?(d=Sn(w.props.children,c.mode,k,w.key),d.return=c,c=d):(k=oo(w.type,w.key,w.props,null,c.mode,k),k.ref=Ii(c,d,w),k.return=c,c=k)}return o(c);case Wn:e:{for(N=w.key;d!==null;){if(d.key===N)if(d.tag===4&&d.stateNode.containerInfo===w.containerInfo&&d.stateNode.implementation===w.implementation){r(c,d.sibling),d=i(d,w.children||[]),d.return=c,c=d;break e}else{r(c,d);break}else t(c,d);d=d.sibling}d=Da(w,c.mode,k),d.return=c,c=d}return o(c);case $r:return N=w._init,v(c,d,N(w._payload),k)}if(Fi(w))return m(c,d,w,k);if(Ci(w))return u(c,d,w,k);Ds(c,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,d!==null&&d.tag===6?(r(c,d.sibling),d=i(d,w),d.return=c,c=d):(r(c,d),d=Fa(w,c.mode,k),d.return=c,c=d),o(c)):r(c,d)}return v}var di=Th(!0),Oh=Th(!1),Ro=un(null),To=null,Gn=null,Tu=null;function Ou(){Tu=Gn=To=null}function Iu(e){var t=Ro.current;Le(Ro),e._currentValue=t}function Cl(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function oi(e,t){To=e,Tu=Gn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mt=!0),e.firstContext=null)}function Bt(e){var t=e._currentValue;if(Tu!==e)if(e={context:e,memoizedValue:t,next:null},Gn===null){if(To===null)throw Error(ie(308));Gn=e,To.dependencies={lanes:0,firstContext:e}}else Gn=Gn.next=e;return t}var wn=null;function Au(e){wn===null?wn=[e]:wn.push(e)}function Ih(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Au(t)):(r.next=i.next,i.next=r),t.interleaved=r,Ar(e,n)}function Ar(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Wr=!1;function ju(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ah(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Tr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Jr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ce&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Ar(e,r)}return i=n.interleaved,i===null?(t.next=t,Au(n)):(t.next=i.next,i.next=t),n.interleaved=t,Ar(e,r)}function eo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,vu(e,r)}}function Zc(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Oo(e,t,r,n){var i=e.updateQueue;Wr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,f=l.next;l.next=null,o===null?s=f:o.next=f,o=l;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==o&&(a===null?p.firstBaseUpdate=f:a.next=f,p.lastBaseUpdate=l))}if(s!==null){var y=i.baseState;o=0,p=f=l=null,a=s;do{var x=a.lane,g=a.eventTime;if((n&x)===x){p!==null&&(p=p.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,u=a;switch(x=t,g=r,u.tag){case 1:if(m=u.payload,typeof m=="function"){y=m.call(g,y,x);break e}y=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=u.payload,x=typeof m=="function"?m.call(g,y,x):m,x==null)break e;y=Be({},y,x);break e;case 2:Wr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,x=i.effects,x===null?i.effects=[a]:x.push(a))}else g={eventTime:g,lane:x,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(f=p=g,l=y):p=p.next=g,o|=x;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;x=a,a=x.next,x.next=null,i.lastBaseUpdate=x,i.shared.pending=null}}while(!0);if(p===null&&(l=y),i.baseState=l,i.firstBaseUpdate=f,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Rn|=o,e.lanes=o,e.memoizedState=y}}function Qc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Aa.transition;Aa.transition={};try{e(!1),t()}finally{Re=r,Aa.transition=n}}function Yh(){return Ut().memoizedState}function vg(e,t,r){var n=tn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Zh(e))Qh(t,r);else if(r=Ih(e,t,r,n),r!==null){var i=ft();Zt(r,e,n,i),Gh(r,t,n)}}function wg(e,t,r){var n=tn(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Zh(e))Qh(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Qt(a,o)){var l=t.interleaved;l===null?(i.next=i,Au(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=Ih(e,t,i,n),r!==null&&(i=ft(),Zt(r,e,n,i),Gh(r,t,n))}}function Zh(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function Qh(e,t){qi=Ao=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Gh(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,vu(e,r)}}var jo={readContext:Bt,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useInsertionEffect:rt,useLayoutEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useMutableSource:rt,useSyncExternalStore:rt,useId:rt,unstable_isNewReconciler:!1},xg={readContext:Bt,useCallback:function(e,t){return ar().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:Jc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ro(4194308,4,Hh.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return ro(4,2,e,t)},useMemo:function(e,t){var r=ar();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ar();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=vg.bind(null,Me,e),[n.memoizedState,e]},useRef:function(e){var t=ar();return e={current:e},t.memoizedState=e},useState:Gc,useDebugValue:Uu,useDeferredValue:function(e){return ar().memoizedState=e},useTransition:function(){var e=Gc(!1),t=e[0];return e=yg.bind(null,e[1]),ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Me,i=ar();if(Fe){if(r===void 0)throw Error(ie(407));r=r()}else{if(r=t(),Qe===null)throw Error(ie(349));Nn&30||Ph(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,Jc(Dh.bind(null,n,s,e),[e]),n.flags|=2048,ds(9,Fh.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=ar(),t=Qe.identifierPrefix;if(Fe){var r=Rr,n=Nr;r=(n&~(1<<32-Yt(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=cs++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[lr]=t,e[as]=n,lp(e,t,!1,!1),t.stateNode=e;e:{switch(o=ll(r,n),r){case"dialog":ze("cancel",e),ze("close",e),i=n;break;case"iframe":case"object":case"embed":ze("load",e),i=n;break;case"video":case"audio":for(i=0;imi&&(t.flags|=128,n=!0,Ai(s,!1),t.lanes=4194304)}else{if(!n)if(e=Io(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ai(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Fe)return nt(t),null}else 2*He()-s.renderingStartTime>mi&&r!==1073741824&&(t.flags|=128,n=!0,Ai(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=He(),t.sibling=null,r=De.current,Oe(De,n?r&1|2:r&1),t):(nt(t),null);case 22:case 23:return Ku(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?St&1073741824&&(nt(t),t.subtreeFlags&6&&(t.flags|=8192)):nt(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function Rg(e,t){switch(Nu(t),t.tag){case 1:return yt(t.type)&&bo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hi(),Le(gt),Le(ot),Pu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lu(t),null;case 13:if(Le(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Le(De),null;case 4:return hi(),null;case 10:return Iu(t.type._context),null;case 22:case 23:return Ku(),null;case 24:return null;default:return null}}var Bs=!1,it=!1,Tg=typeof WeakSet=="function"?WeakSet:Set,de=null;function Jn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ue(e,t,n)}else r.current=null}function Ll(e,t,r){try{r()}catch(n){Ue(e,t,n)}}var ff=!1;function Og(e,t){if(vl=xo,e=mh(),Eu(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,f=0,p=0,y=e,x=null;t:for(;;){for(var g;y!==r||i!==0&&y.nodeType!==3||(a=o+i),y!==s||n!==0&&y.nodeType!==3||(l=o+n),y.nodeType===3&&(o+=y.nodeValue.length),(g=y.firstChild)!==null;)x=y,y=g;for(;;){if(y===e)break t;if(x===r&&++f===i&&(a=o),x===s&&++p===n&&(l=o),(g=y.nextSibling)!==null)break;y=x,x=y.parentNode}y=g}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(wl={focusedElem:e,selectionRange:r},xo=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var u=m.memoizedProps,v=m.memoizedState,c=t.stateNode,d=c.getSnapshotBeforeUpdate(t.elementType===t.type?u:Vt(t.type,u),v);c.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(k){Ue(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return m=ff,ff=!1,m}function Ki(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Ll(t,r,s)}i=i.next}while(i!==n)}}function Qo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Pl(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function fp(e){var t=e.alternate;t!==null&&(e.alternate=null,fp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lr],delete t[as],delete t[kl],delete t[dg],delete t[hg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dp(e){return e.tag===5||e.tag===3||e.tag===4}function df(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fl(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=So));else if(n!==4&&(e=e.child,e!==null))for(Fl(e,t,r),e=e.sibling;e!==null;)Fl(e,t,r),e=e.sibling}function Dl(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Dl(e,t,r),e=e.sibling;e!==null;)Dl(e,t,r),e=e.sibling}var Ge=null,qt=!1;function Ur(e,t,r){for(r=r.child;r!==null;)hp(e,t,r),r=r.sibling}function hp(e,t,r){if(ur&&typeof ur.onCommitFiberUnmount=="function")try{ur.onCommitFiberUnmount(Wo,r)}catch{}switch(r.tag){case 5:it||Jn(r,t);case 6:var n=Ge,i=qt;Ge=null,Ur(e,t,r),Ge=n,qt=i,Ge!==null&&(qt?(e=Ge,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ge.removeChild(r.stateNode));break;case 18:Ge!==null&&(qt?(e=Ge,r=r.stateNode,e.nodeType===8?Ta(e.parentNode,r):e.nodeType===1&&Ta(e,r),rs(e)):Ta(Ge,r.stateNode));break;case 4:n=Ge,i=qt,Ge=r.stateNode.containerInfo,qt=!0,Ur(e,t,r),Ge=n,qt=i;break;case 0:case 11:case 14:case 15:if(!it&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Ll(r,t,o),i=i.next}while(i!==n)}Ur(e,t,r);break;case 1:if(!it&&(Jn(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Ue(r,t,a)}Ur(e,t,r);break;case 21:Ur(e,t,r);break;case 22:r.mode&1?(it=(n=it)||r.memoizedState!==null,Ur(e,t,r),it=n):Ur(e,t,r);break;default:Ur(e,t,r)}}function hf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Tg),t.forEach(function(n){var i=Mg.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ht(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=He()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Ag(n/1960))-n,10e?16:e,Xr===null)var n=!1;else{if(e=Xr,Xr=null,Po=0,Ce&6)throw Error(ie(331));var i=Ce;for(Ce|=4,de=e.current;de!==null;){var s=de,o=s.child;if(de.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lHe()-Vu?kn(e,0):Hu|=r),vt(e,t)}function _p(e,t){t===0&&(e.mode&1?(t=Is,Is<<=1,!(Is&130023424)&&(Is=4194304)):t=1);var r=ft();e=Ar(e,t),e!==null&&(gs(e,t,r),vt(e,r))}function Dg(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),_p(e,r)}function Mg(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ie(314))}n!==null&&n.delete(t),_p(e,r)}var kp;kp=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||gt.current)mt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return mt=!1,Cg(e,t,r);mt=!!(e.flags&131072)}else mt=!1,Fe&&t.flags&1048576&&Ch(t,No,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;no(e,t),e=t.pendingProps;var i=ci(t,ot.current);oi(t,r),i=Du(null,t,n,e,i,r);var s=Mu();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,yt(n)?(s=!0,Eo(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ju(t),i.updater=Zo,t.stateNode=i,i._reactInternals=t,Rl(t,n,e,r),t=Il(null,t,n,!0,s,r)):(t.tag=0,Fe&&s&&Cu(t),ct(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(no(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Ug(n),e=Vt(n,e),i){case 0:t=Ol(null,t,n,e,r);break e;case 1:t=lf(null,t,n,e,r);break e;case 11:t=of(null,t,n,e,r);break e;case 14:t=af(null,t,n,Vt(n.type,e),r);break e}throw Error(ie(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Vt(n,i),Ol(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Vt(n,i),lf(e,t,n,i,r);case 3:e:{if(sp(t),e===null)throw Error(ie(387));n=t.pendingProps,s=t.memoizedState,i=s.element,Ah(e,t),Oo(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=pi(Error(ie(423)),t),t=uf(e,t,n,r,i);break e}else if(n!==i){i=pi(Error(ie(424)),t),t=uf(e,t,n,r,i);break e}else for(bt=Gr(t.stateNode.containerInfo.firstChild),Et=t,Fe=!0,Xt=null,r=Oh(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(fi(),n===i){t=jr(e,t,r);break e}ct(e,t,n,r)}t=t.child}return t;case 5:return jh(t),e===null&&El(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,xl(n,i)?o=null:s!==null&&xl(n,s)&&(t.flags|=32),ip(e,t),ct(e,t,o,r),t.child;case 6:return e===null&&El(t),null;case 13:return op(e,t,r);case 4:return zu(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=di(t,null,n,r):ct(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Vt(n,i),of(e,t,n,i,r);case 7:return ct(e,t,t.pendingProps,r),t.child;case 8:return ct(e,t,t.pendingProps.children,r),t.child;case 12:return ct(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Oe(Ro,n._currentValue),n._currentValue=o,s!==null)if(Qt(s.value,o)){if(s.children===i.children&&!gt.current){t=jr(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=Tr(-1,r&-r),l.tag=2;var f=s.updateQueue;if(f!==null){f=f.shared;var p=f.pending;p===null?l.next=l:(l.next=p.next,p.next=l),f.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Cl(s.return,r,t),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(ie(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Cl(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ct(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,oi(t,r),i=Bt(i),n=n(i),t.flags|=1,ct(e,t,n,r),t.child;case 14:return n=t.type,i=Vt(n,t.pendingProps),i=Vt(n.type,i),af(e,t,n,i,r);case 15:return rp(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Vt(n,i),no(e,t),t.tag=1,yt(n)?(e=!0,Eo(t)):e=!1,oi(t,r),Jh(t,n,i),Rl(t,n,i,r),Il(null,t,n,!0,e,r);case 19:return ap(e,t,r);case 22:return np(e,t,r)}throw Error(ie(156,t.tag))};function Sp(e,t){return Zd(e,t)}function Bg(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dt(e,t,r,n){return new Bg(e,t,r,n)}function Yu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ug(e){if(typeof e=="function")return Yu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pu)return 11;if(e===mu)return 14}return 2}function rn(e,t){var r=e.alternate;return r===null?(r=Dt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function oo(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")Yu(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Hn:return Sn(r.children,i,s,t);case hu:o=8,i|=8;break;case Ga:return e=Dt(12,r,t,i|2),e.elementType=Ga,e.lanes=s,e;case Ja:return e=Dt(13,r,t,i),e.elementType=Ja,e.lanes=s,e;case el:return e=Dt(19,r,t,i),e.elementType=el,e.lanes=s,e;case jd:return Jo(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Id:o=10;break e;case Ad:o=9;break e;case pu:o=11;break e;case mu:o=14;break e;case $r:o=16,n=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=Dt(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function Sn(e,t,r,n){return e=Dt(7,e,n,t),e.lanes=r,e}function Jo(e,t,r,n){return e=Dt(22,e,n,t),e.elementType=jd,e.lanes=r,e.stateNode={isHidden:!1},e}function Fa(e,t,r){return e=Dt(6,e,null,t),e.lanes=r,e}function Da(e,t,r){return t=Dt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $g(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=va(0),this.expirationTimes=va(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=va(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Zu(e,t,r,n,i,s,o,a,l){return e=new $g(e,t,r,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Dt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ju(s),e}function Wg(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Np)}catch(e){console.error(e)}}Np(),Nd.exports=Nt;var Rp=Nd.exports,_f=Rp;Za.createRoot=_f.createRoot,Za.hydrateRoot=_f.hydrateRoot;const dr=Object.create(null);dr.open="0";dr.close="1";dr.ping="2";dr.pong="3";dr.message="4";dr.upgrade="5";dr.noop="6";const ao=Object.create(null);Object.keys(dr).forEach(e=>{ao[dr[e]]=e});const Wl={type:"error",data:"parser error"},Tp=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Op=typeof ArrayBuffer=="function",Ip=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ec=({type:e,data:t},r,n)=>Tp&&t instanceof Blob?r?n(t):kf(t,n):Op&&(t instanceof ArrayBuffer||Ip(t))?r?n(t):kf(new Blob([t]),n):n(dr[e]+(t||"")),kf=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function Sf(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ma;function Xg(e,t){if(Tp&&e.data instanceof Blob)return e.data.arrayBuffer().then(Sf).then(t);if(Op&&(e.data instanceof ArrayBuffer||Ip(e.data)))return t(Sf(e.data));ec(e,!1,r=>{Ma||(Ma=new TextEncoder),t(Ma.encode(r))})}const bf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,r=e.length,n,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),p=new Uint8Array(f);for(n=0;n>4,p[i++]=(o&15)<<4|a>>2,p[i++]=(a&3)<<6|l&63;return f},Zg=typeof ArrayBuffer=="function",tc=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ap(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:Qg(e.substring(1),t)}:ao[r]?e.length>1?{type:ao[r],data:e.substring(1)}:{type:ao[r]}:Wl},Qg=(e,t)=>{if(Zg){const r=Yg(e);return Ap(r,t)}else return{base64:!0,data:e}},Ap=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},jp="",Gg=(e,t)=>{const r=e.length,n=new Array(r);let i=0;e.forEach((s,o)=>{ec(s,!1,a=>{n[o]=a,++i===r&&t(n.join(jp))})})},Jg=(e,t)=>{const r=e.split(jp),n=[];for(let i=0;i{const n=r.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(r)})}})}let Ba;function Ws(e){return e.reduce((t,r)=>t+r.length,0)}function Hs(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let i=0;iMath.pow(2,21)-1){a.enqueue(Wl);break}i=p*Math.pow(2,32)+f.getUint32(4),n=3}else{if(Ws(r)e){a.enqueue(Wl);break}}}})}const zp=4;function qe(e){if(e)return ry(e)}function ry(e){for(var t in qe.prototype)e[t]=qe.prototype[t];return e}qe.prototype.on=qe.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};qe.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};qe.prototype.off=qe.prototype.removeListener=qe.prototype.removeAllListeners=qe.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,i=0;iPromise.resolve().then(t):(t,r)=>r(t,0),Pt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ny="arraybuffer";function Lp(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}const iy=Pt.setTimeout,sy=Pt.clearTimeout;function sa(e,t){t.useNativeTimers?(e.setTimeoutFn=iy.bind(Pt),e.clearTimeoutFn=sy.bind(Pt)):(e.setTimeoutFn=Pt.setTimeout.bind(Pt),e.clearTimeoutFn=Pt.clearTimeout.bind(Pt))}const oy=1.33;function ay(e){return typeof e=="string"?ly(e):Math.ceil((e.byteLength||e.size)*oy)}function ly(e){let t=0,r=0;for(let n=0,i=e.length;n=57344?r+=3:(n++,r+=4);return r}function Pp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uy(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function cy(e){let t={},r=e.split("&");for(let n=0,i=r.length;n{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};Jg(t,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Gg(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Pp()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let Fp=!1;try{Fp=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hy=Fp;function py(){}class my extends dy{constructor(t){if(super(t),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,r){const n=this.request({method:"POST",data:t});n.on("success",r),n.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=t}}class fr extends qe{constructor(t,r,n){super(),this.createRequest=t,sa(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const r=Lp(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=fr.requestsCount++,fr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=py,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete fr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}fr.requestsCount=0;fr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ef);else if(typeof addEventListener=="function"){const e="onpagehide"in Pt?"pagehide":"unload";addEventListener(e,Ef,!1)}}function Ef(){for(let e in fr.requests)fr.requests.hasOwnProperty(e)&&fr.requests[e].abort()}const gy=function(){const e=Dp({xdomain:!1});return e&&e.responseType!==null}();class yy extends my{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=gy&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new fr(Dp,this.uri(),t)}}function Dp(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hy))return new XMLHttpRequest}catch{}if(!t)try{return new Pt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Mp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vy extends rc{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,n=Mp?{}:Lp(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,r,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let r=0;r{try{this.doWrite(n,s)}catch{}i&&ia(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Pp()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const Ua=Pt.WebSocket||Pt.MozWebSocket;class wy extends vy{createSocket(t,r,n){return Mp?new Ua(t,r,n):r?new Ua(t,r):new Ua(t)}doWrite(t,r){this.ws.send(r)}}class xy extends rc{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const r=ty(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(r).getReader(),i=ey();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{n.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let r=0;r{i&&ia(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const _y={websocket:wy,webtransport:xy,polling:yy},ky=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Sy=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Hl(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");r!=-1&&n!=-1&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let i=ky.exec(e||""),s={},o=14;for(;o--;)s[Sy[o]]=i[o]||"";return r!=-1&&n!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=by(s,s.path),s.queryKey=Ey(s,s.query),s}function by(e,t){const r=/\/{2,9}/g,n=t.replace(r,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Ey(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,s){i&&(r[i]=s)}),r}const Vl=typeof addEventListener=="function"&&typeof removeEventListener=="function",lo=[];Vl&&addEventListener("offline",()=>{lo.forEach(e=>e())},!1);class nn extends qe{constructor(t,r){if(super(),this.binaryType=ny,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const n=Hl(t);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=Hl(r.host).host);sa(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=cy(this.opts.query)),Vl&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},lo.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=zp,r.transport=t,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&nn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",nn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,ia(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,n){return this._sendPacket("message",t,r,n),this}send(t,r,n){return this._sendPacket("message",t,r,n),this}_sendPacket(t,r,n,i){if(typeof r=="function"&&(i=r,r=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const s={type:t,data:r,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(nn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Vl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=lo.indexOf(this._offlineEventListener);n!==-1&&lo.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}nn.protocol=zp;class Cy extends nn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",y=>{if(!n)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;nn.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(p(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=r.name,this.emitReserved("upgradeError",x)}}))};function s(){n||(n=!0,p(),r.close(),r=null)}const o=y=>{const x=new Error("probe error: "+y);x.transport=r.name,s(),this.emitReserved("upgradeError",x)};function a(){o("transport closed")}function l(){o("socket closed")}function f(y){r&&y.name!==r.name&&s()}const p=()=>{r.removeListener("open",i),r.removeListener("error",o),r.removeListener("close",a),this.off("close",l),this.off("upgrading",f)};r.once("open",i),r.once("error",o),r.once("close",a),this.once("close",l),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const r=[];for(let n=0;n_y[i]).filter(i=>!!i)),super(t,n)}};function Ry(e,t="",r){let n=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),n=Hl(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const s=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+t,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}const Ty=typeof ArrayBuffer=="function",Oy=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Bp=Object.prototype.toString,Iy=typeof Blob=="function"||typeof Blob<"u"&&Bp.call(Blob)==="[object BlobConstructor]",Ay=typeof File=="function"||typeof File<"u"&&Bp.call(File)==="[object FileConstructor]";function nc(e){return Ty&&(e instanceof ArrayBuffer||Oy(e))||Iy&&e instanceof Blob||Ay&&e instanceof File}function uo(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,n=e.length;r=0&&e.num{delete this.acks[t];for(let a=0;a{this.io.clearTimeoutFn(s),r.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...r){return new Promise((n,i)=>{const s=(o,a)=>o?i(o):n(a);s.withError=!0,r.push(s),this.emit(t,...r)})}_addToQueue(t){let r;typeof t[t.length-1]=="function"&&(r=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>n!==this._queue[0]?void 0:(i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(i)):(this._queue.shift(),r&&r(null,...s)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!t||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ee.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(t);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(t);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const r=this;let n=!1;return function(...i){n||(n=!0,r.packet({type:Ee.ACK,id:t,data:i}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(delete this.acks[t.id],r.withError&&t.data.unshift(null),r.apply(this,t.data))}onconnect(t,r){this.id=t,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const r=this._anyListeners;for(let n=0;n0&&e.jitter<=1?e.jitter:0,this.attempts=0}_i.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+r:e-r}return Math.min(e,this.max)|0};_i.prototype.reset=function(){this.attempts=0};_i.prototype.setMin=function(e){this.ms=e};_i.prototype.setMax=function(e){this.max=e};_i.prototype.setJitter=function(e){this.jitter=e};class Xl extends qe{constructor(t,r){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,sa(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new _i({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const i=r.parser||My;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Ny(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=Kt(r,"open",function(){n.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Kt(r,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),r.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Kt(t,"ping",this.onping.bind(this)),Kt(t,"data",this.ondata.bind(this)),Kt(t,"error",this.onerror.bind(this)),Kt(t,"close",this.onclose.bind(this)),Kt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(r){this.onclose("parse error",r)}}ondecoded(t){ia(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,r){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new Up(this,t,r),this.nsps[t]=n),n}_destroy(t){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(t){const r=this.encoder.encode(t);for(let n=0;nt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const zi={};function co(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=Ry(e,t.path||"/socket.io"),n=r.source,i=r.id,s=r.path,o=zi[i]&&s in zi[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Xl(n,t):(zi[i]||(zi[i]=new Xl(n,t)),l=zi[i]),r.query&&!t.query&&(t.query=r.queryKey),l.socket(r.path,t)}Object.assign(co,{Manager:Xl,Socket:Up,io:co,connect:co});const Uy={},Nf=e=>{let t;const r=new Set,n=(p,y)=>{const x=typeof p=="function"?p(t):p;if(!Object.is(x,t)){const g=t;t=y??(typeof x!="object"||x===null)?x:Object.assign({},t,x),r.forEach(m=>m(t,g))}},i=()=>t,l={setState:n,getState:i,getInitialState:()=>f,subscribe:p=>(r.add(p),()=>r.delete(p)),destroy:()=>{(Uy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},f=t=e(n,i,l);return l},$y=e=>e?Nf(e):Nf;var $p={exports:{}},Wp={},Hp={exports:{}},Vp={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var gi=Z;function Wy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Hy=typeof Object.is=="function"?Object.is:Wy,Vy=gi.useState,qy=gi.useEffect,Ky=gi.useLayoutEffect,Xy=gi.useDebugValue;function Yy(e,t){var r=t(),n=Vy({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return Ky(function(){i.value=r,i.getSnapshot=t,$a(i)&&s({inst:i})},[e,r,t]),qy(function(){return $a(i)&&s({inst:i}),e(function(){$a(i)&&s({inst:i})})},[e]),Xy(r),r}function $a(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Hy(e,r)}catch{return!0}}function Zy(e,t){return t()}var Qy=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Zy:Yy;Vp.useSyncExternalStore=gi.useSyncExternalStore!==void 0?gi.useSyncExternalStore:Qy;Hp.exports=Vp;var Gy=Hp.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var oa=Z,Jy=Gy;function ev(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tv=typeof Object.is=="function"?Object.is:ev,rv=Jy.useSyncExternalStore,nv=oa.useRef,iv=oa.useEffect,sv=oa.useMemo,ov=oa.useDebugValue;Wp.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var s=nv(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=sv(function(){function l(g){if(!f){if(f=!0,p=g,g=n(g),i!==void 0&&o.hasValue){var m=o.value;if(i(m,g))return y=m}return y=g}if(m=y,tv(p,g))return m;var u=n(g);return i!==void 0&&i(m,u)?(p=g,m):(p=g,y=u)}var f=!1,p,y,x=r===void 0?null:r;return[function(){return l(t())},x===null?void 0:function(){return l(x())}]},[t,r,n,i]);var a=rv(e,s[0],s[1]);return iv(function(){o.hasValue=!0,o.value=a},[a]),ov(a),a};$p.exports=Wp;var av=$p.exports;const lv=su(av),qp={},{useDebugValue:uv}=ke,{useSyncExternalStoreWithSelector:cv}=lv;let Rf=!1;const fv=e=>e;function dv(e,t=fv,r){(qp?"production":void 0)!=="production"&&r&&!Rf&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Rf=!0);const n=cv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return uv(n),n}const Tf=e=>{(qp?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?$y(e):e,r=(n,i)=>dv(t,n,i);return Object.assign(r,t),r},hv=e=>e?Tf(e):Tf,me=hv((e,t)=>({theme:"light",setTheme:r=>e({theme:r}),toggleTheme:()=>e(r=>({theme:r.theme==="light"?"dark":"light"})),libraries:[],currentLibraryId:null,setLibraries:r=>e({libraries:r}),setCurrentLibrary:r=>e({currentLibraryId:r}),addLibrary:r=>e(n=>({libraries:[...n.libraries,r]})),removeLibrary:r=>e(n=>({libraries:n.libraries.filter(i=>i.id!==r),currentLibraryId:n.currentLibraryId===r?null:n.currentLibraryId})),images:[],filteredImages:[],totalImageCount:0,setImages:r=>e({images:r,filteredImages:r}),setFilteredImages:r=>e({filteredImages:r}),setTotalImageCount:r=>e({totalImageCount:r}),imageLoadingState:{isLoading:!1,loadedCount:0,totalCount:0,hasMore:!1},setImageLoadingState:r=>e(n=>({imageLoadingState:{...n.imageLoadingState,...r}})),appendImages:r=>e(n=>({images:[...n.images,...r],filteredImages:[...n.filteredImages,...r]})),folders:[],selectedFolder:null,setFolders:r=>e({folders:r}),setSelectedFolder:r=>e({selectedFolder:r}),searchKeywords:"",filters:{formats:[],minSize:null,maxSize:null,startDate:null,endDate:null},setSearchKeywords:r=>e({searchKeywords:r}),setFilters:r=>e(n=>({filters:{...n.filters,...r}})),resetFilters:()=>e({searchKeywords:"",filters:{formats:[],minSize:null,maxSize:null,startDate:null,endDate:null}}),selectedImage:null,setSelectedImage:r=>e({selectedImage:r}),selectedImages:[],setSelectedImages:r=>e({selectedImages:r}),toggleImageSelection:r=>e(n=>n.selectedImages.some(s=>s.path===r.path)?{selectedImages:n.selectedImages.filter(s=>s.path!==r.path)}:{selectedImages:[...n.selectedImages,r]}),clearSelection:()=>e({selectedImages:[],selectedImage:null}),scanProgress:null,scanStartTime:null,setScanProgress:r=>e(n=>r&&!n.scanStartTime&&r.current>0?{scanProgress:r,scanStartTime:Date.now()}:r?{scanProgress:r}:{scanProgress:null,scanStartTime:null}),isResizingPanels:!1,setIsResizingPanels:r=>e({isResizingPanels:r}),resizingSide:null,setResizingSide:r=>e({resizingSide:r}),thumbnailHeight:200,setThumbnailHeight:r=>e({thumbnailHeight:r}),mobileView:"main",setMobileView:r=>e({mobileView:r}),getCurrentLibrary:()=>{const r=t();return r.libraries.find(n=>n.id===r.currentLibraryId)}}));function Kp(e,t){return function(){return e.apply(t,arguments)}}const{toString:pv}=Object.prototype,{getPrototypeOf:sc}=Object,{iterator:aa,toStringTag:Xp}=Symbol,la=(e=>t=>{const r=pv.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Gt=e=>(e=e.toLowerCase(),t=>la(t)===e),ua=e=>t=>typeof t===e,{isArray:ki}=Array,yi=ua("undefined");function xs(e){return e!==null&&!yi(e)&&e.constructor!==null&&!yi(e.constructor)&&wt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Yp=Gt("ArrayBuffer");function mv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Yp(e.buffer),t}const gv=ua("string"),wt=ua("function"),Zp=ua("number"),_s=e=>e!==null&&typeof e=="object",yv=e=>e===!0||e===!1,fo=e=>{if(la(e)!=="object")return!1;const t=sc(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Xp in e)&&!(aa in e)},vv=e=>{if(!_s(e)||xs(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},wv=Gt("Date"),xv=Gt("File"),_v=Gt("Blob"),kv=Gt("FileList"),Sv=e=>_s(e)&&wt(e.pipe),bv=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||wt(e.append)&&((t=la(e))==="formdata"||t==="object"&&wt(e.toString)&&e.toString()==="[object FormData]"))},Ev=Gt("URLSearchParams"),[Cv,Nv,Rv,Tv]=["ReadableStream","Request","Response","Headers"].map(Gt),Ov=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ks(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),ki(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const _n=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Gp=e=>!yi(e)&&e!==_n;function Yl(){const{caseless:e,skipUndefined:t}=Gp(this)&&this||{},r={},n=(i,s)=>{const o=e&&Qp(r,s)||s;fo(r[o])&&fo(i)?r[o]=Yl(r[o],i):fo(i)?r[o]=Yl({},i):ki(i)?r[o]=i.slice():(!t||!yi(i))&&(r[o]=i)};for(let i=0,s=arguments.length;i(ks(t,(i,s)=>{r&&wt(i)?e[s]=Kp(i,r):e[s]=i},{allOwnKeys:n}),e),Av=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jv=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},zv=(e,t,r,n)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=r!==!1&&sc(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Lv=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Pv=e=>{if(!e)return null;if(ki(e))return e;let t=e.length;if(!Zp(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Fv=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&sc(Uint8Array)),Dv=(e,t)=>{const n=(e&&e[aa]).call(e);let i;for(;(i=n.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},Mv=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Bv=Gt("HTMLFormElement"),Uv=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Of=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$v=Gt("RegExp"),Jp=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ks(r,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(n[s]=o||i)}),Object.defineProperties(e,n)},Wv=e=>{Jp(e,(t,r)=>{if(wt(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(wt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Hv=(e,t)=>{const r={},n=i=>{i.forEach(s=>{r[s]=!0})};return ki(e)?n(e):n(String(e).split(t)),r},Vv=()=>{},qv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Kv(e){return!!(e&&wt(e.append)&&e[Xp]==="FormData"&&e[aa])}const Xv=e=>{const t=new Array(10),r=(n,i)=>{if(_s(n)){if(t.indexOf(n)>=0)return;if(xs(n))return n;if(!("toJSON"in n)){t[i]=n;const s=ki(n)?[]:{};return ks(n,(o,a)=>{const l=r(o,i+1);!yi(l)&&(s[a]=l)}),t[i]=void 0,s}}return n};return r(e,0)},Yv=Gt("AsyncFunction"),Zv=e=>e&&(_s(e)||wt(e))&&wt(e.then)&&wt(e.catch),em=((e,t)=>e?setImmediate:t?((r,n)=>(_n.addEventListener("message",({source:i,data:s})=>{i===_n&&s===r&&n.length&&n.shift()()},!1),i=>{n.push(i),_n.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",wt(_n.postMessage)),Qv=typeof queueMicrotask<"u"?queueMicrotask.bind(_n):typeof process<"u"&&process.nextTick||em,Gv=e=>e!=null&&wt(e[aa]),K={isArray:ki,isArrayBuffer:Yp,isBuffer:xs,isFormData:bv,isArrayBufferView:mv,isString:gv,isNumber:Zp,isBoolean:yv,isObject:_s,isPlainObject:fo,isEmptyObject:vv,isReadableStream:Cv,isRequest:Nv,isResponse:Rv,isHeaders:Tv,isUndefined:yi,isDate:wv,isFile:xv,isBlob:_v,isRegExp:$v,isFunction:wt,isStream:Sv,isURLSearchParams:Ev,isTypedArray:Fv,isFileList:kv,forEach:ks,merge:Yl,extend:Iv,trim:Ov,stripBOM:Av,inherits:jv,toFlatObject:zv,kindOf:la,kindOfTest:Gt,endsWith:Lv,toArray:Pv,forEachEntry:Dv,matchAll:Mv,isHTMLForm:Bv,hasOwnProperty:Of,hasOwnProp:Of,reduceDescriptors:Jp,freezeMethods:Wv,toObjectSet:Hv,toCamelCase:Uv,noop:Vv,toFiniteNumber:qv,findKey:Qp,global:_n,isContextDefined:Gp,isSpecCompliantForm:Kv,toJSONObject:Xv,isAsyncFn:Yv,isThenable:Zv,setImmediate:em,asap:Qv,isIterable:Gv};function we(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}K.inherits(we,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.status}}});const tm=we.prototype,rm={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{rm[e]={value:e}});Object.defineProperties(we,rm);Object.defineProperty(tm,"isAxiosError",{value:!0});we.from=(e,t,r,n,i,s)=>{const o=Object.create(tm);K.toFlatObject(e,o,function(p){return p!==Error.prototype},f=>f!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return we.call(o,a,l,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",s&&Object.assign(o,s),o};const Jv=null;function Zl(e){return K.isPlainObject(e)||K.isArray(e)}function nm(e){return K.endsWith(e,"[]")?e.slice(0,-2):e}function If(e,t,r){return e?e.concat(t).map(function(i,s){return i=nm(i),!r&&s?"["+i+"]":i}).join(r?".":""):t}function e1(e){return K.isArray(e)&&!e.some(Zl)}const t1=K.toFlatObject(K,{},null,function(t){return/^is[A-Z]/.test(t)});function ca(e,t,r){if(!K.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=K.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(u,v){return!K.isUndefined(v[u])});const n=r.metaTokens,i=r.visitor||p,s=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(i))throw new TypeError("visitor must be a function");function f(m){if(m===null)return"";if(K.isDate(m))return m.toISOString();if(K.isBoolean(m))return m.toString();if(!l&&K.isBlob(m))throw new we("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(m)||K.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function p(m,u,v){let c=m;if(m&&!v&&typeof m=="object"){if(K.endsWith(u,"{}"))u=n?u:u.slice(0,-2),m=JSON.stringify(m);else if(K.isArray(m)&&e1(m)||(K.isFileList(m)||K.endsWith(u,"[]"))&&(c=K.toArray(m)))return u=nm(u),c.forEach(function(w,k){!(K.isUndefined(w)||w===null)&&t.append(o===!0?If([u],k,s):o===null?u:u+"[]",f(w))}),!1}return Zl(m)?!0:(t.append(If(v,u,s),f(m)),!1)}const y=[],x=Object.assign(t1,{defaultVisitor:p,convertValue:f,isVisitable:Zl});function g(m,u){if(!K.isUndefined(m)){if(y.indexOf(m)!==-1)throw Error("Circular reference detected in "+u.join("."));y.push(m),K.forEach(m,function(c,d){(!(K.isUndefined(c)||c===null)&&i.call(t,c,K.isString(d)?d.trim():d,u,x))===!0&&g(c,u?u.concat(d):[d])}),y.pop()}}if(!K.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Af(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function oc(e,t){this._pairs=[],e&&ca(e,this,t)}const im=oc.prototype;im.append=function(t,r){this._pairs.push([t,r])};im.toString=function(t){const r=t?function(n){return t.call(this,n,Af)}:Af;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function r1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function sm(e,t,r){if(!t)return e;const n=r&&r.encode||r1;K.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let s;if(i?s=i(t,r):s=K.isURLSearchParams(t)?t.toString():new oc(t,r).toString(n),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class jf{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){K.forEach(this.handlers,function(n){n!==null&&t(n)})}}const om={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},n1=typeof URLSearchParams<"u"?URLSearchParams:oc,i1=typeof FormData<"u"?FormData:null,s1=typeof Blob<"u"?Blob:null,o1={isBrowser:!0,classes:{URLSearchParams:n1,FormData:i1,Blob:s1},protocols:["http","https","file","blob","url","data"]},ac=typeof window<"u"&&typeof document<"u",Ql=typeof navigator=="object"&&navigator||void 0,a1=ac&&(!Ql||["ReactNative","NativeScript","NS"].indexOf(Ql.product)<0),l1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",u1=ac&&window.location.href||"http://localhost",c1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ac,hasStandardBrowserEnv:a1,hasStandardBrowserWebWorkerEnv:l1,navigator:Ql,origin:u1},Symbol.toStringTag,{value:"Module"})),st={...c1,...o1};function f1(e,t){return ca(e,new st.classes.URLSearchParams,{visitor:function(r,n,i,s){return st.isNode&&K.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function d1(e){return K.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function h1(e){const t={},r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n=r.length;return o=!o&&K.isArray(i)?i.length:o,l?(K.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!K.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],s)&&K.isArray(i[o])&&(i[o]=h1(i[o])),!a)}if(K.isFormData(e)&&K.isFunction(e.entries)){const r={};return K.forEachEntry(e,(n,i)=>{t(d1(n),i,r,0)}),r}return null}function p1(e,t,r){if(K.isString(e))try{return(t||JSON.parse)(e),K.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Ss={transitional:om,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=K.isObject(t);if(s&&K.isHTMLForm(t)&&(t=new FormData(t)),K.isFormData(t))return i?JSON.stringify(am(t)):t;if(K.isArrayBuffer(t)||K.isBuffer(t)||K.isStream(t)||K.isFile(t)||K.isBlob(t)||K.isReadableStream(t))return t;if(K.isArrayBufferView(t))return t.buffer;if(K.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return f1(t,this.formSerializer).toString();if((a=K.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ca(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),p1(t)):t}],transformResponse:[function(t){const r=this.transitional||Ss.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(K.isResponse(t)||K.isReadableStream(t))return t;if(t&&K.isString(t)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?we.from(a,we.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:st.classes.FormData,Blob:st.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],e=>{Ss.headers[e]={}});const m1=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),g1=e=>{const t={};let r,n,i;return e&&e.split(` +`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&m1[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},zf=Symbol("internals");function Li(e){return e&&String(e).trim().toLowerCase()}function ho(e){return e===!1||e==null?e:K.isArray(e)?e.map(ho):String(e)}function y1(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const v1=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wa(e,t,r,n,i){if(K.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!K.isString(t)){if(K.isString(n))return t.indexOf(n)!==-1;if(K.isRegExp(n))return n.test(t)}}function w1(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function x1(e,t){const r=K.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,s,o){return this[n].call(this,t,i,s,o)},configurable:!0})})}let xt=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function s(a,l,f){const p=Li(l);if(!p)throw new Error("header name must be a non-empty string");const y=K.findKey(i,p);(!y||i[y]===void 0||f===!0||f===void 0&&i[y]!==!1)&&(i[y||l]=ho(a))}const o=(a,l)=>K.forEach(a,(f,p)=>s(f,p,l));if(K.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(K.isString(t)&&(t=t.trim())&&!v1(t))o(g1(t),r);else if(K.isObject(t)&&K.isIterable(t)){let a={},l,f;for(const p of t){if(!K.isArray(p))throw TypeError("Object iterator must return a key-value pair");a[f=p[0]]=(l=a[f])?K.isArray(l)?[...l,p[1]]:[l,p[1]]:p[1]}o(a,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=Li(t),t){const n=K.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return y1(i);if(K.isFunction(r))return r.call(this,i,n);if(K.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Li(t),t){const n=K.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Wa(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function s(o){if(o=Li(o),o){const a=K.findKey(n,o);a&&(!r||Wa(n,n[a],a,r))&&(delete n[a],i=!0)}}return K.isArray(t)?t.forEach(s):s(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const s=r[n];(!t||Wa(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const r=this,n={};return K.forEach(this,(i,s)=>{const o=K.findKey(n,s);if(o){r[o]=ho(i),delete r[s];return}const a=t?w1(s):String(s).trim();a!==s&&delete r[s],r[a]=ho(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return K.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&K.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[zf]=this[zf]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Li(o);n[a]||(x1(i,o),n[a]=!0)}return K.isArray(t)?t.forEach(s):s(t),this}};xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);K.reduceDescriptors(xt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});K.freezeMethods(xt);function Ha(e,t){const r=this||Ss,n=t||r,i=xt.from(n.headers);let s=n.data;return K.forEach(e,function(a){s=a.call(r,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function lm(e){return!!(e&&e.__CANCEL__)}function Si(e,t,r){we.call(this,e??"canceled",we.ERR_CANCELED,t,r),this.name="CanceledError"}K.inherits(Si,we,{__CANCEL__:!0});function um(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new we("Request failed with status code "+r.status,[we.ERR_BAD_REQUEST,we.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function _1(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function k1(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const f=Date.now(),p=n[s];o||(o=f),r[i]=l,n[i]=f;let y=s,x=0;for(;y!==i;)x+=r[y++],y=y%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),f-o{r=p,i=null,s&&(clearTimeout(s),s=null),e(...f)};return[(...f)=>{const p=Date.now(),y=p-r;y>=n?o(f,p):(i=f,s||(s=setTimeout(()=>{s=null,o(i)},n-y)))},()=>i&&o(i)]}const Mo=(e,t,r=3)=>{let n=0;const i=k1(50,250);return S1(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-n,f=i(l),p=o<=a;n=o;const y={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:f||void 0,estimated:f&&a&&p?(a-o)/f:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(y)},r)},Lf=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Pf=e=>(...t)=>K.asap(()=>e(...t)),b1=st.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,st.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(st.origin),st.navigator&&/(msie|trident)/i.test(st.navigator.userAgent)):()=>!0,E1=st.hasStandardBrowserEnv?{write(e,t,r,n,i,s,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];K.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),K.isString(n)&&a.push(`path=${n}`),K.isString(i)&&a.push(`domain=${i}`),s===!0&&a.push("secure"),K.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function C1(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function N1(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function cm(e,t,r){let n=!C1(t);return e&&(n||r==!1)?N1(e,t):t}const Ff=e=>e instanceof xt?{...e}:e;function On(e,t){t=t||{};const r={};function n(f,p,y,x){return K.isPlainObject(f)&&K.isPlainObject(p)?K.merge.call({caseless:x},f,p):K.isPlainObject(p)?K.merge({},p):K.isArray(p)?p.slice():p}function i(f,p,y,x){if(K.isUndefined(p)){if(!K.isUndefined(f))return n(void 0,f,y,x)}else return n(f,p,y,x)}function s(f,p){if(!K.isUndefined(p))return n(void 0,p)}function o(f,p){if(K.isUndefined(p)){if(!K.isUndefined(f))return n(void 0,f)}else return n(void 0,p)}function a(f,p,y){if(y in t)return n(f,p);if(y in e)return n(void 0,f)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(f,p,y)=>i(Ff(f),Ff(p),y,!0)};return K.forEach(Object.keys({...e,...t}),function(p){const y=l[p]||i,x=y(e[p],t[p],p);K.isUndefined(x)&&y!==a||(r[p]=x)}),r}const fm=e=>{const t=On({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;if(t.headers=o=xt.from(o),t.url=sm(cm(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),K.isFormData(r)){if(st.hasStandardBrowserEnv||st.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(K.isFunction(r.getHeaders)){const l=r.getHeaders(),f=["content-type","content-length"];Object.entries(l).forEach(([p,y])=>{f.includes(p.toLowerCase())&&o.set(p,y)})}}if(st.hasStandardBrowserEnv&&(n&&K.isFunction(n)&&(n=n(t)),n||n!==!1&&b1(t.url))){const l=i&&s&&E1.read(s);l&&o.set(i,l)}return t},R1=typeof XMLHttpRequest<"u",T1=R1&&function(e){return new Promise(function(r,n){const i=fm(e);let s=i.data;const o=xt.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:f}=i,p,y,x,g,m;function u(){g&&g(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function c(){if(!v)return;const w=xt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:w,config:e,request:v};um(function(T){r(T),u()},function(T){n(T),u()},b),v=null}"onloadend"in v?v.onloadend=c:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(c)},v.onabort=function(){v&&(n(new we("Request aborted",we.ECONNABORTED,e,v)),v=null)},v.onerror=function(k){const b=k&&k.message?k.message:"Network Error",N=new we(b,we.ERR_NETWORK,e,v);N.event=k||null,n(N),v=null},v.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const b=i.transitional||om;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),n(new we(k,b.clarifyTimeoutError?we.ETIMEDOUT:we.ECONNABORTED,e,v)),v=null},s===void 0&&o.setContentType(null),"setRequestHeader"in v&&K.forEach(o.toJSON(),function(k,b){v.setRequestHeader(b,k)}),K.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),a&&a!=="json"&&(v.responseType=i.responseType),f&&([x,m]=Mo(f,!0),v.addEventListener("progress",x)),l&&v.upload&&([y,g]=Mo(l),v.upload.addEventListener("progress",y),v.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(p=w=>{v&&(n(!w||w.type?new Si(null,e,v):w),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const d=_1(i.url);if(d&&st.protocols.indexOf(d)===-1){n(new we("Unsupported protocol "+d+":",we.ERR_BAD_REQUEST,e));return}v.send(s||null)})},O1=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const s=function(f){if(!i){i=!0,a();const p=f instanceof Error?f:this.reason;n.abort(p instanceof we?p:new Si(p instanceof Error?p.message:p))}};let o=t&&setTimeout(()=>{o=null,s(new we(`timeout ${t} of ms exceeded`,we.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(s):f.removeEventListener("abort",s)}),e=null)};e.forEach(f=>f.addEventListener("abort",s));const{signal:l}=n;return l.unsubscribe=()=>K.asap(a),l}},I1=function*(e,t){let r=e.byteLength;if(r{const i=A1(e,t);let s=0,o,a=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:f,value:p}=await i.next();if(f){a(),l.close();return}let y=p.byteLength;if(r){let x=s+=y;r(x)}l.enqueue(new Uint8Array(p))}catch(f){throw a(f),f}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Mf=64*1024,{isFunction:Vs}=K,z1=(({Request:e,Response:t})=>({Request:e,Response:t}))(K.global),{ReadableStream:Bf,TextEncoder:Uf}=K.global,$f=(e,...t)=>{try{return!!e(...t)}catch{return!1}},L1=e=>{e=K.merge.call({skipUndefined:!0},z1,e);const{fetch:t,Request:r,Response:n}=e,i=t?Vs(t):typeof fetch=="function",s=Vs(r),o=Vs(n);if(!i)return!1;const a=i&&Vs(Bf),l=i&&(typeof Uf=="function"?(m=>u=>m.encode(u))(new Uf):async m=>new Uint8Array(await new r(m).arrayBuffer())),f=s&&a&&$f(()=>{let m=!1;const u=new r(st.origin,{body:new Bf,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!u}),p=o&&a&&$f(()=>K.isReadableStream(new n("").body)),y={stream:p&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!y[m]&&(y[m]=(u,v)=>{let c=u&&u[m];if(c)return c.call(u);throw new we(`Response type '${m}' is not supported`,we.ERR_NOT_SUPPORT,v)})});const x=async m=>{if(m==null)return 0;if(K.isBlob(m))return m.size;if(K.isSpecCompliantForm(m))return(await new r(st.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(K.isArrayBufferView(m)||K.isArrayBuffer(m))return m.byteLength;if(K.isURLSearchParams(m)&&(m=m+""),K.isString(m))return(await l(m)).byteLength},g=async(m,u)=>{const v=K.toFiniteNumber(m.getContentLength());return v??x(u)};return async m=>{let{url:u,method:v,data:c,signal:d,cancelToken:w,timeout:k,onDownloadProgress:b,onUploadProgress:N,responseType:T,headers:L,withCredentials:O="same-origin",fetchOptions:F}=fm(m),ee=t||fetch;T=T?(T+"").toLowerCase():"text";let R=O1([d,w&&w.toAbortSignal()],k),U=null;const _=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let q;try{if(N&&f&&v!=="get"&&v!=="head"&&(q=await g(L,c))!==0){let I=new r(u,{method:"POST",body:c,duplex:"half"}),A;if(K.isFormData(c)&&(A=I.headers.get("content-type"))&&L.setContentType(A),I.body){const[V,M]=Lf(q,Mo(Pf(N)));c=Df(I.body,Mf,V,M)}}K.isString(O)||(O=O?"include":"omit");const se=s&&"credentials"in r.prototype,Q={...F,signal:R,method:v.toUpperCase(),headers:L.normalize().toJSON(),body:c,duplex:"half",credentials:se?O:void 0};U=s&&new r(u,Q);let $=await(s?ee(U,F):ee(u,Q));const D=p&&(T==="stream"||T==="response");if(p&&(b||D&&_)){const I={};["status","statusText","headers"].forEach(W=>{I[W]=$[W]});const A=K.toFiniteNumber($.headers.get("content-length")),[V,M]=b&&Lf(A,Mo(Pf(b),!0))||[];$=new n(Df($.body,Mf,V,()=>{M&&M(),_&&_()}),I)}T=T||"text";let H=await y[K.findKey(y,T)||"text"]($,m);return!D&&_&&_(),await new Promise((I,A)=>{um(I,A,{data:H,headers:xt.from($.headers),status:$.status,statusText:$.statusText,config:m,request:U})})}catch(se){throw _&&_(),se&&se.name==="TypeError"&&/Load failed|fetch/i.test(se.message)?Object.assign(new we("Network Error",we.ERR_NETWORK,m,U),{cause:se.cause||se}):we.from(se,se&&se.code,m,U)}}},P1=new Map,dm=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:i}=t,s=[n,i,r];let o=s.length,a=o,l,f,p=P1;for(;a--;)l=s[a],f=p.get(l),f===void 0&&p.set(l,f=a?new Map:L1(t)),p=f;return f};dm();const lc={http:Jv,xhr:T1,fetch:{get:dm}};K.forEach(lc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wf=e=>`- ${e}`,F1=e=>K.isFunction(e)||e===null||e===!1;function D1(e,t){e=K.isArray(e)?e:[e];const{length:r}=e;let n,i;const s={};for(let o=0;o`adapter ${l} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=r?o.length>1?`since : +`+o.map(Wf).join(` +`):" "+Wf(o[0]):"as no adapter specified";throw new we("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i}const hm={getAdapter:D1,adapters:lc};function Va(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Si(null,e)}function Hf(e){return Va(e),e.headers=xt.from(e.headers),e.data=Ha.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),hm.getAdapter(e.adapter||Ss.adapter,e)(e).then(function(n){return Va(e),n.data=Ha.call(e,e.transformResponse,n),n.headers=xt.from(n.headers),n},function(n){return lm(n)||(Va(e),n&&n.response&&(n.response.data=Ha.call(e,e.transformResponse,n.response),n.response.headers=xt.from(n.response.headers))),Promise.reject(n)})}const pm="1.13.2",fa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{fa[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Vf={};fa.transitional=function(t,r,n){function i(s,o){return"[Axios v"+pm+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(t===!1)throw new we(i(o," has been removed"+(r?" in "+r:"")),we.ERR_DEPRECATED);return r&&!Vf[o]&&(Vf[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,o,a):!0}};fa.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function M1(e,t,r){if(typeof e!="object")throw new we("options must be an object",we.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const s=n[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new we("option "+s+" must be "+l,we.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new we("Unknown option "+s,we.ERR_BAD_OPTION)}}const po={assertOptions:M1,validators:fa},or=po.validators;let bn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new jf,response:new jf}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=On(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&po.assertOptions(n,{silentJSONParsing:or.transitional(or.boolean),forcedJSONParsing:or.transitional(or.boolean),clarifyTimeoutError:or.transitional(or.boolean)},!1),i!=null&&(K.isFunction(i)?r.paramsSerializer={serialize:i}:po.assertOptions(i,{encode:or.function,serialize:or.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),po.assertOptions(r,{baseUrl:or.spelling("baseURL"),withXsrfToken:or.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&K.merge(s.common,s[r.method]);s&&K.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),r.headers=xt.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(u){typeof u.runWhen=="function"&&u.runWhen(r)===!1||(l=l&&u.synchronous,a.unshift(u.fulfilled,u.rejected))});const f=[];this.interceptors.response.forEach(function(u){f.push(u.fulfilled,u.rejected)});let p,y=0,x;if(!l){const m=[Hf.bind(this),void 0];for(m.unshift(...a),m.push(...f),x=m.length,p=Promise.resolve(r);y{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},t(function(s,o,a){n.reason||(n.reason=new Si(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new mm(function(i){t=i}),cancel:t}}};function U1(e){return function(r){return e.apply(null,r)}}function $1(e){return K.isObject(e)&&e.isAxiosError===!0}const Gl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Gl).forEach(([e,t])=>{Gl[t]=e});function gm(e){const t=new bn(e),r=Kp(bn.prototype.request,t);return K.extend(r,bn.prototype,t,{allOwnKeys:!0}),K.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return gm(On(e,i))},r}const xe=gm(Ss);xe.Axios=bn;xe.CanceledError=Si;xe.CancelToken=B1;xe.isCancel=lm;xe.VERSION=pm;xe.toFormData=ca;xe.AxiosError=we;xe.Cancel=xe.CanceledError;xe.all=function(t){return Promise.all(t)};xe.spread=U1;xe.isAxiosError=$1;xe.mergeConfig=On;xe.AxiosHeaders=xt;xe.formToJSON=e=>am(K.isHTMLForm(e)?new FormData(e):e);xe.getAdapter=hm.getAdapter;xe.HttpStatusCode=Gl;xe.default=xe;const{Axios:Jw,AxiosError:ex,CanceledError:tx,isCancel:rx,CancelToken:nx,VERSION:ix,all:sx,Cancel:ox,isAxiosError:ax,spread:lx,toFormData:ux,AxiosHeaders:cx,HttpStatusCode:fx,formToJSON:dx,getAdapter:hx,mergeConfig:px}=xe,Pe="/api",Cr={getAll:()=>xe.get(`${Pe}/library`),add:(e,t)=>xe.post(`${Pe}/library`,{name:e,path:t}),update:(e,t)=>xe.put(`${Pe}/library/${e}`,t),delete:e=>xe.delete(`${Pe}/library/${e}`),setCurrent:e=>xe.post(`${Pe}/library/${e}/set-current`),updatePreferences:e=>xe.put(`${Pe}/library/preferences`,e),updateTheme:e=>xe.put(`${Pe}/library/theme`,{theme:e})},$e={search:(e,t={},r={})=>{const n=new URLSearchParams({libraryId:e,...t});return xe.get(`${Pe}/image?${n}`,r)},getCount:e=>xe.get(`${Pe}/image/count?libraryId=${e}`),getFolders:e=>xe.get(`${Pe}/image/folders?libraryId=${e}`),getCacheMeta:e=>xe.get(`${Pe}/image/cache-meta?libraryId=${e}`),getThumbnailUrl:(e,t,r)=>`${Pe}/image/thumbnail/${e}/${t}/${r}`,getOriginalUrl:(e,t)=>`${Pe}/image/original/${e}/${t}`,openInExplorer:(e,t)=>xe.post(`${Pe}/image/${e}/open-file`,{path:t})},sn={fullScan:(e,t=!1)=>xe.post(`${Pe}/scan/full`,{libraryId:e,wait:t}),sync:(e,t=!1)=>xe.post(`${Pe}/scan/sync`,{libraryId:e,wait:t}),stop:e=>xe.post(`${Pe}/scan/stop`,{libraryId:e}),resume:e=>xe.post(`${Pe}/scan/resume`,{libraryId:e}),getStatus:e=>xe.get(`${Pe}/scan/status/${e}`),fixFolders:e=>xe.post(`${Pe}/scan/fix-folders`,{libraryId:e})},qf={start:e=>xe.post(`${Pe}/watch/start/${e}`),stop:e=>xe.post(`${Pe}/watch/stop/${e}`),status:e=>xe.get(`${Pe}/watch/status/${e}`),list:()=>xe.get(`${Pe}/watch/list`)};/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var W1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ie=(e,t)=>{const r=Z.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:l,...f},p)=>Z.createElement("svg",{ref:p,...W1,width:i,height:i,stroke:n,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${H1(e)}`,a].join(" "),...f},[...t.map(([y,x])=>Z.createElement(y,x)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const V1=Ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q1=Ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kf=Ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K1=Ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X1=Ie("ChevronsDown",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y1=Ie("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z1=Ie("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q1=Ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G1=Ie("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J1=Ie("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ew=Ie("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xf=Ie("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tw=Ie("FolderDown",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m15 13-3 3-3-3",key:"6j2sf0"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zi=Ie("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rw=Ie("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yf=Ie("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nw=Ie("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iw=Ie("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",key:"1xcu5"}],["circle",{cx:"17.5",cy:"10.5",r:".5",key:"736e4u"}],["circle",{cx:"8.5",cy:"7.5",r:".5",key:"clrty"}],["circle",{cx:"6.5",cy:"12.5",r:".5",key:"1s4xz9"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sw=Ie("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ym=Ie("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zf=Ie("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bo=Ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qf=Ie("Sliders",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gf=Ie("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ow=Ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.300.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vm=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ps={LIBRARY:"library",FOLDER:"folder",IMAGES:"images"};let Jf=0;const aw=()=>(Jf+=1,`req_${Date.now()}_${Jf}`);class lw{constructor(){this.activeRequests=new Map,this.requestContexts=new Map}createRequest(t){const r=aw(),n=new AbortController,i={id:r,type:t,createdAt:Date.now(),abortController:n,signal:n.signal,status:"pending",isActive:!0,cancel:()=>{if(i.isActive){i.isActive=!1,i.status="cancelled",n.abort(),this.requestContexts.delete(r);const s=this.activeRequests.get(t);s&&s.delete(r)}}};return this.requestContexts.set(r,i),this.activeRequests.has(t)||this.activeRequests.set(t,new Map),this.activeRequests.get(t).set(r,i),i}cancelAll(t){const r=this.activeRequests.get(t);if(r){for(const n of r.values())n.cancel();r.clear()}}cancelAllRequests(){for(const t of Object.values(ps))this.cancelAll(t)}isValid(t){const r=this.requestContexts.get(t);return r?r.isActive:!1}complete(t){const r=this.requestContexts.get(t);if(r&&r.isActive){r.status="completed",r.isActive=!1,this.requestContexts.delete(t);const n=this.activeRequests.get(r.type);n&&n.delete(t)}}error(t){const r=this.requestContexts.get(t);if(r&&r.isActive){r.status="error",r.isActive=!1,this.requestContexts.delete(t);const n=this.activeRequests.get(r.type);n&&n.delete(t)}}getActiveCount(t){const r=this.activeRequests.get(t);return r?r.size:0}hasActiveRequests(t){return this.getActiveCount(t)>0}}const Ft=new lw;function Jl(){Ft.cancelAll(ps.IMAGES)}function uw(e){e&&setTimeout(()=>{},300)}const cw=async e=>{try{return(await sn.getStatus(e)).data}catch{return null}};function ed(){const{libraries:e,currentLibraryId:t,folders:r,selectedFolder:n,totalImageCount:i,setCurrentLibrary:s,setSelectedFolder:o,addLibrary:a,removeLibrary:l}=me(),[f,p]=Z.useState(!1),[y,x]=Z.useState(""),[g,m]=Z.useState(""),[u,v]=Z.useState(""),[c,d]=Z.useState(""),[w,k]=Z.useState(new Set),[b,N]=Z.useState(!1),[T,L]=Z.useState(!1),O=Z.useRef(null),F=V=>{d(V),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{v(V)},300)};Z.useEffect(()=>()=>{O.current&&clearTimeout(O.current)},[]);const ee=async()=>{if(!y.trim()){alert("请输入素材库名称");return}if(!g.trim()){alert("请输入文件夹路径");return}N(!0);try{console.log("📝 添加素材库...");const V=await Cr.add(y.trim(),g.trim()),M=V.data.id,W=V.data.hasExistingIndex;if(a({id:M,name:y.trim(),path:g.trim()}),x(""),m(""),p(!1),N(!1),console.log("🔄 切换到新素材库..."),await Cr.setCurrent(M),s(M),o(null),me.getState().setImages([]),me.getState().setFolders([]),me.getState().setSelectedImage(null),me.getState().setTotalImageCount(0),me.getState().setScanProgress({libraryId:M,current:0,total:0,percent:0,status:"preparing"}),W){console.log("检测到已有索引,先加载现有数据...");try{const[oe,he]=await Promise.all([$e.getFolders(M),$e.getCount(M)]);me.getState().setFolders(oe.data.folders),me.getState().setTotalImageCount(he.data.count),console.log("✅ 已加载现有数据")}catch(oe){console.warn("⚠️ 加载现有数据失败:",oe)}}console.log("🔍 开始异步扫描..."),W?(console.log("执行增量同步,检测变化..."),sn.sync(M,!1)):(console.log("首次添加,执行全量扫描..."),sn.fullScan(M,!1)),console.log("✅ 扫描已启动,请等待进度显示...")}catch(V){console.error("❌ Error adding library:",V),alert("添加素材库失败: "+V.message),me.getState().setScanProgress(null),N(!1)}},R=async V=>{if(V!==t){L(!0);try{Jl(),Ft.cancelAllRequests(),me.getState().setScanProgress(null),me.getState().setSelectedImage(null),me.getState().setImages([]),me.getState().setFolders([]),me.getState().setImageLoadingState({isLoading:!1,loadedCount:0,totalCount:0,hasMore:!1}),o(null),await Cr.setCurrent(V);const[M,W]=await Promise.all([$e.getFolders(V),$e.getCount(V)]);me.getState().setFolders(M.data.folders),me.getState().setTotalImageCount(W.data.count),s(V),cw(V).then(oe=>{var he,ce;oe&&oe.status==="paused"&&(oe.needsRescan?(me.getState().setScanProgress({...oe.progress,libraryId:V,canStop:!0,isPaused:!0,pendingCount:((he=oe.progress)==null?void 0:he.total)-((ce=oe.progress)==null?void 0:ce.current)||0,needsRescan:!0}),console.log("⏸️ 发现中断的扫描,需要继续完成")):oe.pendingCount>0&&(me.getState().setScanProgress({...oe.progress,libraryId:V,canStop:!0,isPaused:!0,pendingCount:oe.pendingCount}),console.log(`⏸️ 发现暂停的扫描,待处理: ${oe.pendingCount} 张`)))}).catch(()=>{})}catch(M){console.error("Error setting current library:",M),alert("切换素材库失败: "+M.message),me.getState().setImageLoadingState({isLoading:!1})}finally{L(!1)}}},U=async()=>{if(!t)return;const V=e.find(W=>W.id===t);if(!(!V||!confirm(`确定要删除素材库"${V.name}"吗? + +路径: ${V.path} + +⚠️ 注意: +• 将删除索引数据并释放数据库连接 +• 不会删除原始图片文件 +• .flypic 文件夹将保留,您可以手动删除`)))try{await Cr.delete(t),l(t),me.getState().setImages([]),me.getState().setFolders([]),me.getState().setSelectedImage(null),me.getState().setSelectedFolder(null);const W=e.filter(oe=>oe.id!==t);if(W.length>0){const oe=W[0];await Cr.setCurrent(oe.id),s(oe.id)}console.log(`✅ 素材库已删除: ${V.name}`),console.log(`数据库连接已释放,可手动删除: ${V.path}\\.flypic`)}catch(W){console.error("Error deleting library:",W),alert("删除素材库失败: "+W.message)}},_=V=>{const M=new Set(w);M.has(V)?M.delete(V):M.add(V),k(M)},q=V=>{const M=[],W=oe=>{oe.forEach(he=>{he.children&&he.children.length>0&&(M.push(he.path),W(he.children))})};return W(V),M},se=()=>{const V=q(D.length>0?D:r);k(new Set(V))},Q=()=>{k(new Set)},$=()=>{const V=q(D.length>0?D:r);return V.length>0&&V.every(M=>w.has(M))},D=Z.useMemo(()=>{if(!u)return r;const V=u.trim().toLowerCase().split(/\s+/).filter(he=>he.length>0);if(V.length===0)return r;const M=[],W=he=>he.reduce((ce,fe)=>{const J=fe.name.toLowerCase(),ae=fe.path.toLowerCase(),Y=V.every(z=>J.includes(z)),le=V.every(z=>ae.includes(z));let h=[];return fe.children&&fe.children.length>0&&(h=W(fe.children)),(Y||le||h.length>0)&&(ce.push({...fe,children:h}),h.length>0&&M.push(fe.path)),ce},[]),oe=W(r);return M.length>0&&setTimeout(()=>{k(he=>{const ce=new Set(he);return M.forEach(fe=>ce.add(fe)),ce})},0),oe},[r,u]),H=(V,M)=>{V.stopPropagation(),_(M)},I=V=>{const M=V.children&&V.children.length>0;n!==V.path?(Jl(),o(V.path)):M&&_(V.path)},A=(V,M=0)=>V.map(W=>{const oe=w.has(W.path),he=W.children&&W.children.length>0,ce=n===W.path;return S.jsxs("div",{children:[S.jsxs("div",{className:`flex items-center px-3 py-2 cursor-pointer rounded-md transition-colors ${ce?"bg-blue-50 dark:bg-blue-900":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,style:{paddingLeft:`${M*16+12}px`},onClick:()=>I(W),children:[he?S.jsx("div",{className:"flex items-center justify-center w-5 h-5 mr-1 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600 rounded",onClick:fe=>H(fe,W.path),children:oe?S.jsx(Kf,{className:"w-4 h-4 text-gray-500"}):S.jsx(K1,{className:"w-4 h-4 text-gray-500"})}):S.jsx("div",{className:"w-5 mr-1"}),S.jsx(Zi,{className:"w-4 h-4 mr-2 text-gray-500 flex-shrink-0"}),S.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate flex-1",children:W.name}),S.jsx("span",{className:"text-xs text-gray-400 ml-2 flex-shrink-0",children:W.image_count})]}),he&&oe&&A(W.children,M+1)]},W.path)});return S.jsxs("div",{className:"w-full h-full border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex flex-col",children:[S.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:[S.jsx("div",{className:"flex items-center justify-between mb-3",children:S.jsx("h2",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"素材库"})}),S.jsxs("div",{className:"flex gap-2",children:[S.jsxs("div",{className:"relative flex-1",children:[S.jsxs("select",{value:t||"",onChange:V=>{const M=V.target.value;M==="__add__"?p(!0):M&&R(M)},disabled:T,className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 appearance-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",style:{paddingRight:"2rem"},children:[e.length===0&&S.jsx("option",{value:"",children:"暂无素材库"}),e.map(V=>S.jsx("option",{value:V.id,children:V.name},V.id)),S.jsx("option",{value:"__add__",style:{borderTop:"1px solid #ccc"},children:"+ 添加新素材库"})]}),S.jsx(Kf,{className:"absolute right-2 top-2.5 w-4 h-4 text-gray-400 pointer-events-none"})]}),t&&e.length>0&&S.jsx("button",{onClick:U,className:"px-3 py-2 border border-red-300 dark:border-red-600 rounded-lg hover:bg-red-50 dark:hover:bg-red-900 text-red-600 dark:text-red-400 transition-colors",title:"删除当前素材库",children:S.jsx(ow,{className:"w-4 h-4"})})]}),f&&S.jsxs("div",{className:"mt-3 p-3 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700",children:[S.jsxs("div",{className:"flex items-center justify-between mb-2",children:[S.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"添加素材库"}),S.jsx("button",{onClick:()=>p(!1),className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600",children:S.jsx(vm,{className:"w-4 h-4 text-gray-500"})})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("input",{type:"text",placeholder:"素材库名称",value:y,onChange:V=>x(V.target.value),onKeyDown:V=>V.key==="Enter"&&ee(),autoFocus:!0,className:"w-full px-2 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"}),S.jsx("input",{type:"text",placeholder:"文件夹路径(例如:C:\\Users\\Pictures)",value:g,onChange:V=>m(V.target.value),onKeyDown:V=>V.key==="Enter"&&ee(),className:"w-full px-2 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{onClick:()=>p(!1),className:"flex-1 px-3 py-1.5 border border-gray-300 dark:border-gray-600 rounded text-sm hover:bg-gray-100 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300",children:"取消"}),S.jsx("button",{onClick:ee,disabled:b,className:"flex-1 px-3 py-1.5 bg-blue-500 text-white rounded text-sm hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed",children:b?"添加中...":"添加"})]})]})]})]}),S.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[S.jsx("div",{className:"mb-3 space-y-2",children:S.jsxs("div",{className:"flex gap-2",children:[S.jsxs("div",{className:"relative flex-1",children:[S.jsx(Bo,{className:"absolute left-2 top-2 w-4 h-4 text-gray-400"}),S.jsx("input",{type:"text",placeholder:"搜索文件夹(支持多关键词)...",value:c,onChange:V=>F(V.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"})]}),S.jsx("button",{onClick:$()?Q:se,className:"px-2 py-1.5 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-600 text-gray-600 dark:text-gray-400 transition-colors",title:$()?"折叠全部":"展开全部",children:$()?S.jsx(Y1,{className:"w-4 h-4"}):S.jsx(X1,{className:"w-4 h-4"})})]})}),S.jsxs("div",{className:"space-y-1",children:[S.jsxs("div",{className:`flex items-center px-3 py-2 cursor-pointer rounded-md transition-colors ${n===null?"bg-blue-50 dark:bg-blue-900":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,onClick:()=>o(null),children:[S.jsx("div",{className:"w-5 mr-1"}),S.jsx(Zi,{className:"w-4 h-4 mr-2 text-blue-500 flex-shrink-0"}),S.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 font-medium flex-1",children:"全部图片"}),S.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:i})]}),(D.length>0||r.length>0)&&S.jsx("div",{className:"h-px bg-gray-200 dark:bg-gray-700 my-2"}),D.length>0?A(D):u?S.jsx("div",{className:"text-center py-8 text-gray-400 dark:text-gray-500 text-sm",children:"未找到匹配的文件夹"}):r.length===0?S.jsx("div",{className:"text-center py-8 text-gray-400 dark:text-gray-500 text-sm",children:"暂无文件夹"}):null]})]})]})}function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?Z.useEffect:Z.useLayoutEffect;function $n(e,t,r){var n=Z.useRef(t);n.current=t,Z.useEffect(function(){function i(s){n.current(s)}return e&&window.addEventListener(e,i,r),function(){e&&window.removeEventListener(e,i)}},[e])}var dw=["container"];function hw(e){var t=e.container,r=t===void 0?document.body:t,n=da(e,dw);return Rp.createPortal(ke.createElement("div",Ze({},n)),r)}function pw(e){return ke.createElement("svg",Ze({width:"44",height:"44",viewBox:"0 0 768 768"},e),ke.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function mw(e){return ke.createElement("svg",Ze({width:"44",height:"44",viewBox:"0 0 768 768"},e),ke.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function gw(e){return ke.createElement("svg",Ze({width:"44",height:"44",viewBox:"0 0 768 768"},e),ke.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function yw(){return Z.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function rd(e){var t=e.touches[0],r=t.clientX,n=t.clientY;if(e.touches.length>=2){var i=e.touches[1],s=i.clientX,o=i.clientY;return[(r+s)/2,(n+o)/2,Math.sqrt(Math.pow(s-r,2)+Math.pow(o-n,2))]}return[r,n,0]}var Hr=function(e,t,r,n){var i,s=r*t,o=(s-n)/2,a=e;return s<=n?(i=1,a=0):e>0&&o-e<=0?(i=2,a=o):e<0&&o+e<=0&&(i=3,a=-o),[i,a]};function qa(e,t,r,n,i,s,o,a,l,f){o===void 0&&(o=innerWidth/2),a===void 0&&(a=innerHeight/2),l===void 0&&(l=0),f===void 0&&(f=0);var p=Hr(e,s,r,innerWidth)[0],y=Hr(t,s,n,innerHeight),x=innerWidth/2,g=innerHeight/2;return{x:o-s/i*(o-(x+e))-x+(n/r>=3&&r*s===innerWidth?0:p?l/2:l),y:a-s/i*(a-(g+t))-g+(y[0]?f/2:f),lastCX:o,lastCY:a}}function ru(e,t,r){var n=e%180!=0;return n?[r,t,n]:[t,r,n]}function Ka(e,t,r){var n=ru(r,innerWidth,innerHeight),i=n[0],s=n[1],o=0,a=i,l=s,f=e/t*s,p=t/e*i;return e=s?a=f:e>=i&&ti/s?l=p:t/e>=3&&!n[2]?o=((l=p)-s)/2:a=f,{width:a,height:l,x:0,y:o,pause:!0}}function Ks(e,t){var r=t.leading,n=r!==void 0&&r,i=t.maxWait,s=t.wait,o=s===void 0?i||0:s,a=Z.useRef(e);a.current=e;var l=Z.useRef(0),f=Z.useRef(),p=function(){return f.current&&clearTimeout(f.current)},y=Z.useCallback(function(){var x=[].slice.call(arguments),g=Date.now();function m(){l.current=g,p(),a.current.apply(null,x)}var u=l.current,v=g-u;if(u===0&&(n&&m(),l.current=g),i!==void 0){if(v>i)return void m()}else v=1&&s&&s())};p()}function p(){l=requestAnimationFrame(f)}}var ww={T:0,L:0,W:0,H:0,FIT:void 0},wm=function(){var e=Z.useRef(!1);return Z.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},xw=["className"];function _w(e){var t=e.className,r=t===void 0?"":t,n=da(e,xw);return ke.createElement("div",Ze({className:"PhotoView__Spinner "+r},n),ke.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ke.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),ke.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var kw=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function Sw(e){var t=e.src,r=e.loaded,n=e.broken,i=e.className,s=e.onPhotoLoad,o=e.loadingElement,a=e.brokenElement,l=da(e,kw),f=wm();return t&&!n?ke.createElement(ke.Fragment,null,ke.createElement("img",Ze({className:"PhotoView__Photo"+(i?" "+i:""),src:t,onLoad:function(p){var y=p.target;f.current&&s({loaded:!0,naturalWidth:y.naturalWidth,naturalHeight:y.naturalHeight})},onError:function(){f.current&&s({broken:!0})},draggable:!1,alt:""},l)),!r&&(o?ke.createElement("span",{className:"PhotoView__icon"},o):ke.createElement(_w,{className:"PhotoView__icon"}))):a?ke.createElement("span",{className:"PhotoView__icon"},typeof a=="function"?a({src:t}):a):null}var bw={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function Ew(e){var t=e.item,r=t.src,n=t.render,i=t.width,s=i===void 0?0:i,o=t.height,a=o===void 0?0:o,l=t.originRef,f=e.visible,p=e.speed,y=e.easing,x=e.wrapClassName,g=e.className,m=e.style,u=e.loadingElement,v=e.brokenElement,c=e.onPhotoTap,d=e.onMaskTap,w=e.onReachMove,k=e.onReachUp,b=e.onPhotoResize,N=e.isActive,T=e.expose,L=Uo(bw),O=L[0],F=L[1],ee=Z.useRef(0),R=wm(),U=O.naturalWidth,_=U===void 0?s:U,q=O.naturalHeight,se=q===void 0?a:q,Q=O.width,$=Q===void 0?s:Q,D=O.height,H=D===void 0?a:D,I=O.loaded,A=I===void 0?!r:I,V=O.broken,M=O.x,W=O.y,oe=O.touched,he=O.stopRaf,ce=O.maskTouched,fe=O.rotate,J=O.scale,ae=O.CX,Y=O.CY,le=O.lastX,h=O.lastY,z=O.lastCX,P=O.lastCY,C=O.lastScale,E=O.touchTime,j=O.touchLength,X=O.pause,G=O.reach,B=li({onScale:function(te){return re(qs(te))},onRotate:function(te){fe!==te&&(T({rotate:te}),F(Ze({rotate:te},Ka(_,se,te))))}});function re(te,ge,Ne){J!==te&&(T({scale:te}),F(Ze({scale:te},qa(M,W,$,H,J,te,ge,Ne),te<=1&&{x:0,y:0})))}var ue=Ks(function(te,ge,Ne){if(Ne===void 0&&(Ne=0),(oe||ce)&&N){var pr=ru(fe,$,H),mr=pr[0],Ot=pr[1];if(Ne===0&&ee.current===0){var _t=Math.abs(te-ae)<=20,kt=Math.abs(ge-Y)<=20;if(_t&&kt)return void F({lastCX:te,lastCY:ge});ee.current=_t?ge>Y?3:2:1}var rr,fn=te-z,Pr=ge-P;if(Ne===0){var dn=Hr(fn+le,J,mr,innerWidth)[0],zn=Hr(Pr+h,J,Ot,innerHeight);rr=function(Fr,yr,vr,nr){return yr&&Fr===1||nr==="x"?"x":vr&&Fr>1||nr==="y"?"y":void 0}(ee.current,dn,zn[0],G),rr!==void 0&&w(rr,te,ge,J)}if(rr==="x"||ce)return void F({reach:"x"});var gr=qs(J+(Ne-j)/100/2*J,_/$,.2);T({scale:gr}),F(Ze({touchLength:Ne,reach:rr,scale:gr},qa(M,W,$,H,J,gr,te,ge,fn,Pr)))}},{maxWait:8});function ne(te){return!he&&!oe&&(R.current&&F(Ze({},te,{pause:f})),R.current)}var pe,ve,ye,We,Jt,at,er,be,hr=(Jt=function(te){return ne({x:te})},at=function(te){return ne({y:te})},er=function(te){return R.current&&(T({scale:te}),F({scale:te})),!oe&&R.current},be=li({X:function(te){return Jt(te)},Y:function(te){return at(te)},S:function(te){return er(te)}}),function(te,ge,Ne,pr,mr,Ot,_t,kt,rr,fn,Pr){var dn=ru(fn,mr,Ot),zn=dn[0],gr=dn[1],Fr=Hr(te,kt,zn,innerWidth),yr=Fr[0],vr=Fr[1],nr=Hr(ge,kt,gr,innerHeight),Ln=nr[0],bs=nr[1],Pn=Date.now()-Pr;if(Pn>=200||kt!==_t||Math.abs(rr-_t)>1){var Dr=qa(te,ge,mr,Ot,_t,kt),wr=Dr.x,hn=Dr.y,It=yr?vr:wr!==te?wr:null,Fn=Ln?bs:hn!==ge?hn:null;return It!==null&&yn(te,It,be.X),Fn!==null&&yn(ge,Fn,be.Y),void(kt!==_t&&yn(_t,kt,be.S))}var pn=(te-Ne)/Pn,Mr=(ge-pr)/Pn,Br=Math.sqrt(Math.pow(pn,2)+Math.pow(Mr,2)),xr=!1,_r=!1;(function($t,lt){var ut,Wt=$t,kr=0,At=0,Dn=function(bi){ut||(ut=bi);var Ei=bi-ut,uc=Math.sign($t),cc=-.001*uc,fc=Math.sign(-Wt)*Math.pow(Wt,2)*2e-4,km=Wt*Ei+(cc+fc)*Math.pow(Ei,2)/2;kr+=km,ut=bi,uc*(Wt+=(cc+fc)*Ei)<=0?jt():lt(kr)?ir():jt()};function ir(){At=requestAnimationFrame(Dn)}function jt(){cancelAnimationFrame(At)}ir()})(Br,function($t){var lt=te+$t*(pn/Br),ut=ge+$t*(Mr/Br),Wt=Hr(lt,_t,zn,innerWidth),kr=Wt[0],At=Wt[1],Dn=Hr(ut,_t,gr,innerHeight),ir=Dn[0],jt=Dn[1];if(kr&&!xr&&(xr=!0,yr?yn(lt,At,be.X):nd(At,lt+(lt-At),be.X)),ir&&!_r&&(_r=!0,Ln?yn(ut,jt,be.Y):nd(jt,ut+(ut-jt),be.Y)),xr&&_r)return!1;var bi=xr||be.X(At),Ei=_r||be.Y(jt);return bi&&Ei})}),tr=(pe=c,ve=function(te,ge){G||re(J!==1?1:Math.max(2,_/$),te,ge)},ye=Z.useRef(0),We=Ks(function(){ye.current=0,pe.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var te=[].slice.call(arguments);ye.current+=1,We.apply(void 0,te),ye.current>=2&&(We.cancel(),ye.current=0,ve.apply(void 0,te))});function tt(te,ge){if(ee.current=0,(oe||ce)&&N){F({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Ne=qs(J,_/$);if(hr(M,W,le,h,$,H,J,Ne,C,fe,E),k(te,ge),ae===te&&Y===ge){if(oe)return void tr(te,ge);ce&&d(te,ge)}}}function Lr(te,ge,Ne){Ne===void 0&&(Ne=0),F({touched:!0,CX:te,CY:ge,lastCX:te,lastCY:ge,lastX:M,lastY:W,lastScale:J,touchLength:Ne,touchTime:Date.now()})}function jn(te){F({maskTouched:!0,CX:te.clientX,CY:te.clientY,lastX:M,lastY:W})}$n(Sr?void 0:"mousemove",function(te){te.preventDefault(),ue(te.clientX,te.clientY)}),$n(Sr?void 0:"mouseup",function(te){tt(te.clientX,te.clientY)}),$n(Sr?"touchmove":void 0,function(te){te.preventDefault();var ge=rd(te);ue.apply(void 0,ge)},{passive:!1}),$n(Sr?"touchend":void 0,function(te){var ge=te.changedTouches[0];tt(ge.clientX,ge.clientY)},{passive:!1}),$n("resize",Ks(function(){A&&!oe&&(F(Ka(_,se,fe)),b())},{maxWait:8})),tu(function(){N&&T(Ze({scale:J,rotate:fe},B))},[N]);var Tt=function(te,ge,Ne,pr,mr,Ot,_t,kt,rr,fn){var Pr=function(wr,hn,It,Fn,pn){var Mr=Z.useRef(!1),Br=Uo({lead:!0,scale:It}),xr=Br[0],_r=xr.lead,$t=xr.scale,lt=Br[1],ut=Ks(function(Wt){try{return pn(!0),lt({lead:!1,scale:Wt}),Promise.resolve()}catch(kr){return Promise.reject(kr)}},{wait:Fn});return tu(function(){Mr.current?(pn(!1),lt({lead:!0}),ut(It)):Mr.current=!0},[It]),_r?[wr*$t,hn*$t,It/$t]:[wr*It,hn*It,1]}(Ot,_t,kt,rr,fn),dn=Pr[0],zn=Pr[1],gr=Pr[2],Fr=function(wr,hn,It,Fn,pn){var Mr=Z.useState(ww),Br=Mr[0],xr=Mr[1],_r=Z.useState(0),$t=_r[0],lt=_r[1],ut=Z.useRef(),Wt=li({OK:function(){return wr&<(4)}});function kr(At){pn(!1),lt(At)}return Z.useEffect(function(){if(ut.current||(ut.current=Date.now()),It){if(function(At,Dn){var ir=At&&At.current;if(ir&&ir.nodeType===1){var jt=ir.getBoundingClientRect();Dn({T:jt.top,L:jt.left,W:jt.width,H:jt.height,FIT:ir.tagName==="IMG"?getComputedStyle(ir).objectFit:void 0})}}(hn,xr),wr)return Date.now()-ut.current<250?(lt(1),requestAnimationFrame(function(){lt(2),requestAnimationFrame(function(){return kr(3)})}),void setTimeout(Wt.OK,Fn)):void lt(4);kr(5)}},[wr,It]),[$t,Br]}(te,ge,Ne,rr,fn),yr=Fr[0],vr=Fr[1],nr=vr.W,Ln=vr.FIT,bs=innerWidth/2,Pn=innerHeight/2,Dr=yr<3||yr>4;return[Dr?nr?vr.L:bs:pr+(bs-Ot*kt/2),Dr?nr?vr.T:Pn:mr+(Pn-_t*kt/2),dn,Dr&&Ln?dn*(vr.H/nr):zn,yr===0?gr:Dr?nr/(Ot*kt)||.01:gr,Dr?Ln?1:0:1,yr,Ln]}(f,l,A,M,W,$,H,J,p,function(te){return F({pause:te})}),_e=Tt[4],Te=Tt[6],Ae="transform "+p+"ms "+y,je={className:g,onMouseDown:Sr?void 0:function(te){te.stopPropagation(),te.button===0&&Lr(te.clientX,te.clientY,0)},onTouchStart:Sr?function(te){te.stopPropagation(),Lr.apply(void 0,rd(te))}:void 0,onWheel:function(te){if(!G){var ge=qs(J-te.deltaY/100/2,_/$);F({stopRaf:!0}),re(ge,te.clientX,te.clientY)}},style:{width:Tt[2]+"px",height:Tt[3]+"px",opacity:Tt[5],objectFit:Te===4?void 0:Tt[7],transform:fe?"rotate("+fe+"deg)":void 0,transition:Te>2?Ae+", opacity "+p+"ms ease, height "+(Te<4?p/2:Te>4?p:0)+"ms "+y:void 0}};return ke.createElement("div",{className:"PhotoView__PhotoWrap"+(x?" "+x:""),style:m,onMouseDown:!Sr&&N?jn:void 0,onTouchStart:Sr&&N?function(te){return jn(te.touches[0])}:void 0},ke.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+_e+", 0, 0, "+_e+", "+Tt[0]+", "+Tt[1]+")",transition:oe||X?void 0:Ae,willChange:N?"transform":void 0}},r?ke.createElement(Sw,Ze({src:r,loaded:A,broken:V},je,{onPhotoLoad:function(te){F(Ze({},te,te.loaded&&Ka(te.naturalWidth||0,te.naturalHeight||0,fe)))},loadingElement:u,brokenElement:v})):n&&n({attrs:je,scale:_e,rotate:fe})))}var id={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function Cw(e){var t=e.loop,r=t===void 0?3:t,n=e.speed,i=e.easing,s=e.photoClosable,o=e.maskClosable,a=o===void 0||o,l=e.maskOpacity,f=l===void 0?1:l,p=e.pullClosable,y=p===void 0||p,x=e.bannerVisible,g=x===void 0||x,m=e.overlayRender,u=e.toolbarRender,v=e.className,c=e.maskClassName,d=e.photoClassName,w=e.photoWrapClassName,k=e.loadingElement,b=e.brokenElement,N=e.images,T=e.index,L=T===void 0?0:T,O=e.onIndexChange,F=e.visible,ee=e.onClose,R=e.afterClose,U=e.portalContainer,_=Uo(id),q=_[0],se=_[1],Q=Z.useState(0),$=Q[0],D=Q[1],H=q.x,I=q.touched,A=q.pause,V=q.lastCX,M=q.lastCY,W=q.bg,oe=W===void 0?f:W,he=q.lastBg,ce=q.overlay,fe=q.minimal,J=q.scale,ae=q.rotate,Y=q.onScale,le=q.onRotate,h=e.hasOwnProperty("index"),z=h?L:$,P=h?O:D,C=Z.useRef(z),E=N.length,j=N[z],X=typeof r=="boolean"?r:E>r,G=function(_e,Te){var Ae=Z.useReducer(function(Ne){return!Ne},!1)[1],je=Z.useRef(0),te=function(Ne){var pr=Z.useRef(Ne);function mr(Ot){pr.current=Ot}return Z.useMemo(function(){(function(Ot){_e?(Ot(_e),je.current=1):je.current=2})(mr)},[Ne]),[pr.current,mr]}(_e),ge=te[1];return[te[0],je.current,function(){Ae(),je.current===2&&(ge(!1),Te&&Te()),je.current=0}]}(F,R),B=G[0],re=G[1],ue=G[2];tu(function(){if(B)return se({pause:!0,x:z*-(innerWidth+Bn)}),void(C.current=z);se(id)},[B]);var ne=li({close:function(_e){le&&le(0),se({overlay:!0,lastBg:oe}),ee(_e)},changeIndex:function(_e,Te){Te===void 0&&(Te=!1);var Ae=X?C.current+(_e-z):_e,je=E-1,te=eu(Ae,0,je),ge=X?Ae:te,Ne=innerWidth+Bn;se({touched:!1,lastCX:void 0,lastCY:void 0,x:-Ne*ge,pause:Te}),C.current=ge,P&&P(X?_e<0?je:_e>je?0:_e:te)}}),pe=ne.close,ve=ne.changeIndex;function ye(_e){return _e?pe():se({overlay:!ce})}function We(){se({x:-(innerWidth+Bn)*z,lastCX:void 0,lastCY:void 0,pause:!0}),C.current=z}function Jt(_e,Te,Ae,je){_e==="x"?function(te){if(V!==void 0){var ge=te-V,Ne=ge;!X&&(z===0&&ge>0||z===E-1&&ge<0)&&(Ne=ge/2),se({touched:!0,lastCX:V,x:-(innerWidth+Bn)*C.current+Ne,pause:!1})}else se({touched:!0,lastCX:te,x:H,pause:!1})}(Te):_e==="y"&&function(te,ge){if(M!==void 0){var Ne=f===null?null:eu(f,.01,f-Math.abs(te-M)/100/4);se({touched:!0,lastCY:M,bg:ge===1?Ne:f,minimal:ge===1})}else se({touched:!0,lastCY:te,bg:oe,minimal:!0})}(Ae,je)}function at(_e,Te){var Ae=_e-(V??_e),je=Te-(M??Te),te=!1;if(Ae<-40)ve(z+1);else if(Ae>40)ve(z-1);else{var ge=-(innerWidth+Bn)*C.current;Math.abs(je)>100&&fe&&y&&(te=!0,pe()),se({touched:!1,x:ge,lastCX:void 0,lastCY:void 0,bg:f,overlay:!!te||ce})}}$n("keydown",function(_e){if(F)switch(_e.key){case"ArrowLeft":ve(z-1,!0);break;case"ArrowRight":ve(z+1,!0);break;case"Escape":pe()}});var er=function(_e,Te,Ae){return Z.useMemo(function(){var je=_e.length;return Ae?_e.concat(_e).concat(_e).slice(je+Te-1,je+Te+2):_e.slice(Math.max(Te-1,0),Math.min(Te+2,je+1))},[_e,Te,Ae])}(N,z,X);if(!B)return null;var be=ce&&!re,hr=F?oe:he,tr=Y&&le&&{images:N,index:z,visible:F,onClose:pe,onIndexChange:ve,overlayVisible:be,overlay:j&&j.overlay,scale:J,rotate:ae,onScale:Y,onRotate:le},tt=n?n(re):400,Lr=i?i(re):td,jn=n?n(3):600,Tt=i?i(3):td;return ke.createElement(hw,{className:"PhotoView-Portal"+(be?"":" PhotoView-Slider__clean")+(F?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(_e){return _e.stopPropagation()},container:U},F&&ke.createElement(yw,null),ke.createElement("div",{className:"PhotoView-Slider__Backdrop"+(c?" "+c:"")+(re===1?" PhotoView-Slider__fadeIn":re===2?" PhotoView-Slider__fadeOut":""),style:{background:hr?"rgba(0, 0, 0, "+hr+")":void 0,transitionTimingFunction:Lr,transitionDuration:(I?0:tt)+"ms",animationDuration:tt+"ms"},onAnimationEnd:ue}),g&&ke.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ke.createElement("div",{className:"PhotoView-Slider__Counter"},z+1," / ",E),ke.createElement("div",{className:"PhotoView-Slider__BannerRight"},u&&tr&&u(tr),ke.createElement(pw,{className:"PhotoView-Slider__toolbarIcon",onClick:pe}))),er.map(function(_e,Te){var Ae=X||z!==0?C.current-1+Te:z+Te;return ke.createElement(Ew,{key:X?_e.key+"/"+_e.src+"/"+Ae:_e.key,item:_e,speed:tt,easing:Lr,visible:F,onReachMove:Jt,onReachUp:at,onPhotoTap:function(){return ye(s)},onMaskTap:function(){return ye(a)},wrapClassName:w,className:d,style:{left:(innerWidth+Bn)*Ae+"px",transform:"translate3d("+H+"px, 0px, 0)",transition:I||A?void 0:"transform "+jn+"ms "+Tt},loadingElement:k,brokenElement:b,onPhotoResize:We,isActive:C.current===Ae,expose:se})}),!Sr&&g&&ke.createElement(ke.Fragment,null,(X||z!==0)&&ke.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ve(z-1,!0)}},ke.createElement(mw,null)),(X||z+1-1){var c=f.slice();return c.splice(v,1,u),void a({images:c})}a(function(d){return{images:d.images.concat(u)}})},remove:function(u){a(function(v){var c=v.images.filter(function(d){return d.key!==u});return{images:c,index:Math.min(c.length-1,y)}})},show:function(u){var v=f.findIndex(function(c){return c.key===u});a({visible:!0,index:v}),n&&n(!0,v,o)}}),g=li({close:function(){a({visible:!1}),n&&n(!1,y,o)},changeIndex:function(u){a({index:u}),r&&r(u,o)}}),m=Z.useMemo(function(){return Ze({},o,x)},[o,x]);return ke.createElement(fw.Provider,{value:m},t,ke.createElement(Cw,Ze({images:f,visible:p,index:y,onIndexChange:g.changeIndex,onClose:g.close},i)))}function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t=t?e.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var Ya=-1;function ud(e){if(e===void 0&&(e=!1),Ya===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Ya=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ya}var Un=null;function cd(e){if(e===void 0&&(e=!1),Un===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Un="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Un="negative":Un="positive-ascending"),document.body.removeChild(t),Un}return Un}var Lw=150,Pw=function(t,r){return t};function Fw(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,i=e.getItemSize,s=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,l=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,p=e.validateProps;return t=function(y){Ow(x,y);function x(m){var u;return u=y.call(this,m)||this,u._instanceProps=l(u.props,sd(u)),u._outerRef=void 0,u._resetIsScrollingTimeoutId=null,u.state={instance:sd(u),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof u.props.initialScrollOffset=="number"?u.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},u._callOnItemsRendered=void 0,u._callOnItemsRendered=Xa(function(v,c,d,w){return u.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:c,visibleStartIndex:d,visibleStopIndex:w})}),u._callOnScroll=void 0,u._callOnScroll=Xa(function(v,c,d){return u.props.onScroll({scrollDirection:v,scrollOffset:c,scrollUpdateWasRequested:d})}),u._getItemStyle=void 0,u._getItemStyle=function(v){var c=u.props,d=c.direction,w=c.itemSize,k=c.layout,b=u._getItemStyleCache(f&&w,f&&k,f&&d),N;if(b.hasOwnProperty(v))N=b[v];else{var T=r(u.props,v,u._instanceProps),L=i(u.props,v,u._instanceProps),O=d==="horizontal"||k==="horizontal",F=d==="rtl",ee=O?T:0;b[v]=N={position:"absolute",left:F?void 0:ee,right:F?ee:void 0,top:O?0:T,height:O?"100%":L,width:O?L:"100%"}}return N},u._getItemStyleCache=void 0,u._getItemStyleCache=Xa(function(v,c,d){return{}}),u._onScrollHorizontal=function(v){var c=v.currentTarget,d=c.clientWidth,w=c.scrollLeft,k=c.scrollWidth;u.setState(function(b){if(b.scrollOffset===w)return null;var N=u.props.direction,T=w;if(N==="rtl")switch(cd()){case"negative":T=-w;break;case"positive-descending":T=k-d-w;break}return T=Math.max(0,Math.min(T,k-d)),{isScrolling:!0,scrollDirection:b.scrollOffsetN.clientWidth?ud():0:b=N.scrollHeight>N.clientHeight?ud():0}this.scrollTo(s(this.props,u,v,k,this._instanceProps,b))},g.componentDidMount=function(){var u=this.props,v=u.direction,c=u.initialScrollOffset,d=u.layout;if(typeof c=="number"&&this._outerRef!=null){var w=this._outerRef;v==="horizontal"||d==="horizontal"?w.scrollLeft=c:w.scrollTop=c}this._callPropsCallbacks()},g.componentDidUpdate=function(){var u=this.props,v=u.direction,c=u.layout,d=this.state,w=d.scrollOffset,k=d.scrollUpdateWasRequested;if(k&&this._outerRef!=null){var b=this._outerRef;if(v==="horizontal"||c==="horizontal")if(v==="rtl")switch(cd()){case"negative":b.scrollLeft=-w;break;case"positive-ascending":b.scrollLeft=w;break;default:var N=b.clientWidth,T=b.scrollWidth;b.scrollLeft=T-N-w;break}else b.scrollLeft=w;else b.scrollTop=w}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ld(this._resetIsScrollingTimeoutId)},g.render=function(){var u=this.props,v=u.children,c=u.className,d=u.direction,w=u.height,k=u.innerRef,b=u.innerElementType,N=u.innerTagName,T=u.itemCount,L=u.itemData,O=u.itemKey,F=O===void 0?Pw:O,ee=u.layout,R=u.outerElementType,U=u.outerTagName,_=u.style,q=u.useIsScrolling,se=u.width,Q=this.state.isScrolling,$=d==="horizontal"||ee==="horizontal",D=$?this._onScrollHorizontal:this._onScrollVertical,H=this._getRangeToRender(),I=H[0],A=H[1],V=[];if(T>0)for(var M=I;M<=A;M++)V.push(Z.createElement(v,{data:L,key:F(M,L),index:M,isScrolling:q?Q:void 0,style:this._getItemStyle(M)}));var W=n(this.props,this._instanceProps);return Z.createElement(R||U||"div",{className:c,onScroll:D,ref:this._outerRefSetter,style:nu({position:"relative",height:w,width:se,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:d},_)},Z.createElement(b||N||"div",{children:V,ref:k,style:{height:$?"100%":W,pointerEvents:Q?"none":void 0,width:$?W:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var u=this.props.itemCount;if(u>0){var v=this._getRangeToRender(),c=v[0],d=v[1],w=v[2],k=v[3];this._callOnItemsRendered(c,d,w,k)}}if(typeof this.props.onScroll=="function"){var b=this.state,N=b.scrollDirection,T=b.scrollOffset,L=b.scrollUpdateWasRequested;this._callOnScroll(N,T,L)}},g._getRangeToRender=function(){var u=this.props,v=u.itemCount,c=u.overscanCount,d=this.state,w=d.isScrolling,k=d.scrollDirection,b=d.scrollOffset;if(v===0)return[0,0,0,0];var N=o(this.props,b,this._instanceProps),T=a(this.props,N,b,this._instanceProps),L=!w||k==="backward"?Math.max(1,c):1,O=!w||k==="forward"?Math.max(1,c):1;return[Math.max(0,N-L),Math.max(0,Math.min(v-1,T+O)),N,T]},x}(Z.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Dw=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},Mw=50,ti=function(t,r,n){var i=t,s=i.itemSize,o=n.itemMetadataMap,a=n.lastMeasuredIndex;if(r>a){var l=0;if(a>=0){var f=o[a];l=f.offset+f.size}for(var p=a+1;p<=r;p++){var y=s(p);o[p]={offset:l,size:y},l+=y}n.lastMeasuredIndex=r}return o[r]},Bw=function(t,r,n){var i=r.itemMetadataMap,s=r.lastMeasuredIndex,o=s>0?i[s].offset:0;return o>=n?xm(t,r,s,0,n):Uw(t,r,Math.max(0,s),n)},xm=function(t,r,n,i,s){for(;i<=n;){var o=i+Math.floor((n-i)/2),a=ti(t,o,r).offset;if(a===s)return o;as&&(n=o-1)}return i>0?i-1:0},Uw=function(t,r,n,i){for(var s=t.itemCount,o=1;n=n&&(o=n-1),o>=0){var l=i[o];a=l.offset+l.size}var f=n-o-1,p=f*s;return a+p},$w=Fw({getItemOffset:function(t,r,n){return ti(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:fd,getOffsetForIndexAndAlignment:function(t,r,n,i,s,o){var a=t.direction,l=t.height,f=t.layout,p=t.width,y=a==="horizontal"||f==="horizontal",x=y?p:l,g=ti(t,r,s),m=fd(t,s),u=Math.max(0,Math.min(m-x,g.offset)),v=Math.max(0,g.offset-x+g.size+o);switch(n==="smart"&&(i>=v-x&&i<=u+x?n="auto":n="center"),n){case"start":return u;case"end":return v;case"center":return Math.round(v+(u-v)/2);case"auto":default:return i>=v&&i<=u?i:i{try{await $e.openInExplorer(t,e.path)}catch(o){console.error("Failed to open file:",o)}};return S.jsxs("div",{className:"fixed inset-0 z-50 bg-black bg-opacity-90 flex items-center justify-center",children:[S.jsxs("div",{className:"absolute top-0 left-0 right-0 h-16 bg-black bg-opacity-50 flex items-center justify-between px-4 z-10",children:[S.jsx("div",{className:"text-white text-sm truncate max-w-md",children:e.filename}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:s,className:"p-2 text-white hover:bg-white hover:bg-opacity-20 rounded transition-colors",title:"在系统默认应用中打开",children:S.jsx(G1,{className:"w-5 h-5"})}),S.jsx("button",{onClick:r,className:"p-2 text-white hover:bg-white hover:bg-opacity-20 rounded transition-colors",children:S.jsx(vm,{className:"w-6 h-6"})})]})]}),S.jsxs("div",{className:"w-full h-full flex items-center justify-center p-20",children:[n==="video"&&S.jsx("video",{src:i,controls:!0,autoPlay:!0,className:"max-w-full max-h-full rounded shadow-2xl",onError:o=>{console.error("Video load error:",o),alert("视频加载失败,请尝试在系统默认应用中打开")},children:"您的浏览器不支持视频播放"}),n==="audio"&&S.jsxs("div",{className:"flex flex-col items-center justify-center",children:[S.jsx("div",{className:"text-white text-6xl mb-8",children:"🎵"}),S.jsx("audio",{src:i,controls:!0,autoPlay:!0,className:"w-96 rounded shadow-2xl",onError:o=>{console.error("Audio load error:",o),alert("音频加载失败,请尝试在系统默认应用中打开")},children:"您的浏览器不支持音频播放"}),S.jsx("p",{className:"text-white mt-4 text-sm opacity-70",children:e.filename})]}),n==="document"&&S.jsx("div",{className:"w-full h-full bg-white rounded shadow-2xl overflow-hidden",children:e.format==="pdf"?S.jsx("iframe",{src:i,className:"w-full h-full",title:e.filename}):S.jsx("iframe",{src:i,className:"w-full h-full",title:e.filename,sandbox:"allow-same-origin"})}),(n==="design"||n==="other"||!n)&&S.jsxs("div",{className:"text-center text-white",children:[S.jsx("p",{className:"mb-4",children:"此文件类型需要在专业软件中打开"}),S.jsx("button",{onClick:s,className:"px-6 py-3 bg-blue-500 hover:bg-blue-600 rounded-lg transition-colors",children:"在系统默认应用中打开"})]})]}),S.jsx("div",{className:"absolute inset-0 -z-10",onClick:r})]})}const Hw=100,Vw=500;function qw(){const{filteredImages:e,currentLibraryId:t,thumbnailHeight:r,selectedImage:n,setSelectedImage:i,selectedImages:s,setSelectedImages:o,toggleImageSelection:a,clearSelection:l,isResizingPanels:f,imageLoadingState:p,selectedFolder:y,searchKeywords:x,filters:g,appendImages:m,setImageLoadingState:u}=me(),v=Z.useRef(null),c=Z.useRef(null),d=Z.useRef(null),w=Z.useRef(0),[k,b]=Z.useState(0),[N,T]=Z.useState(0),[L,O]=Z.useState(-1),[F,ee]=Z.useState(null),[R,U]=Z.useState(null),[_,q]=Z.useState([]),se=Z.useCallback(async()=>{var le;if(!t||!p.hasMore||p.isLoading)return;const Y=Ft.createRequest(ps.IMAGES);u({isLoading:!0});try{const h={offset:p.loadedCount,limit:200};y&&(h.folder=y),x&&(h.keywords=x),((le=g.formats)==null?void 0:le.length)>0&&(h.formats=g.formats.join(","));const z=await $e.search(t,h,{signal:Y.signal});if(!Ft.isValid(Y.id))return;const{images:P,total:C,hasMore:E}=z.data;Ft.complete(Y.id),m(P),u({isLoading:!1,loadedCount:p.loadedCount+P.length,totalCount:C,hasMore:E||!1})}catch(h){if(h.name==="CanceledError"||h.name==="AbortError")return;console.error("Error loading more images:",h),Ft.error(Y.id),u({isLoading:!1})}},[t,p,y,x,g,m,u]);Z.useEffect(()=>{let Y=null,le=0;const h=10,z={current:0};let P=null;const C=(X,G)=>(Math.abs(X-z.current)<12||(z.current=X,P&&clearTimeout(P),P=setTimeout(()=>{b(X),T(G)},50)),!0),E=()=>{if(v.current){const X=v.current.offsetWidth-32,G=v.current.offsetHeight;if(X>0)return C(X,G)}return!1},j=()=>{E()?v.current&&(Y=new ResizeObserver(()=>{me.getState().isResizingPanels||E()}),Y.observe(v.current)):le{Y&&Y.disconnect(),P&&clearTimeout(P)}},[]),Z.useEffect(()=>{if(f||!v.current)return;const Y=v.current.offsetWidth-32,le=v.current.offsetHeight;Y>0&&(b(Y),T(le),c.current&&c.current.resetAfterIndex(0))},[f]);const Q=e.length>Vw,$=Z.useRef({length:0,firstId:null,libraryId:null}),D=Z.useRef(!1);Z.useEffect(()=>{var E;const Y=$.current.length,le=e.length,h=$.current.firstId,z=(E=e[0])==null?void 0:E.id,P=$.current.libraryId;Y>0&&le===0||z!==h||t!==P?(q([]),w.current=0,D.current=!1,d.current&&d.current.postMessage({reset:!0,requestId:0})):le>Y&&(D.current=!0),$.current={length:le,firstId:z,libraryId:t}},[e,t]),Z.useEffect(()=>(typeof Worker<"u"&&(d.current=new Worker(new URL("/assets/layoutWorker-D6X91dDa.js",import.meta.url),{type:"module"}),d.current.onmessage=Y=>{const{rows:le,requestId:h}=Y.data;h===w.current&&q(le)}),()=>{d.current&&(d.current.terminate(),d.current=null)}),[]),Z.useEffect(()=>{if(!Q||!d.current||!e.length||!k)return;const Y=++w.current,le=e.map(h=>({id:h.id,width:h.width,height:h.height,filename:h.filename,thumbnail_path:h.thumbnail_path,path:h.path,file_type:h.file_type,format:h.format}));d.current.postMessage({images:le,containerWidth:k,targetHeight:r,requestId:Y,incremental:D.current})},[e,k,r,Q]);const H=Z.useMemo(()=>{if(Q)return[];if(!e.length||!k)return[];const Y=16,le=r,h=[];let z=[],P=0;return e.forEach((C,E)=>{const j=C.width/C.height,X=le*j;z.push({...C,originalWidth:X,aspectRatio:j}),P+=X;const G=(z.length-1)*Y,B=P+G,re=E===e.length-1;let ue=!1;if(re)ue=!0;else if(B>=k*.95)ue=!0;else{const ne=e[E+1];if(ne){const pe=ne.width/ne.height,ve=le*pe;P+ve+z.length*Y>k*1.2&&(ue=!0)}}if(ue){const ne=(z.length-1)*Y;let ve=(k-ne)/P;re&&z.length<3&&(ve=Math.min(ve,1.2));const ye=le*ve;z=z.map(We=>({...We,calculatedWidth:We.originalWidth*ve,calculatedHeight:ye})),h.push(z),z=[],P=0}}),h},[e,r,k,Q]),I=Q?_:H,A=Y=>{if(!t||!Y.thumbnail_path)return"";const le=Y.thumbnail_path.replace(/\\/g,"/").split("/").pop();return $e.getThumbnailUrl(t,"480",le)},V=Y=>t?$e.getOriginalUrl(t,Y.path):"",M=Z.useMemo(()=>e.map(Y=>({src:V(Y),key:Y.id})),[e,t]),W=e.length>Hw,oe=Z.useCallback(Y=>!I[Y]||I[Y].length===0?r+40:I[Y][0].calculatedHeight+28+32,[I,r]),he=Z.useRef(0);Z.useEffect(()=>{if(c.current&&W){const Y=he.current,le=I.length;le>Y&&Y>0?c.current.resetAfterIndex(Math.max(0,Y-1)):c.current.resetAfterIndex(0),he.current=le}},[I,W]);const ce=Z.useMemo(()=>I.flat(),[I]),fe=Z.useCallback((Y,le,h)=>{if(le.ctrlKey||le.metaKey)le.preventDefault(),a(Y),ee(h);else if(le.shiftKey&&F!==null){le.preventDefault();const z=Math.min(F,h),P=Math.max(F,h),C=ce.slice(z,P+1);o(C)}else l(),i(Y),ee(h)},[ce,F,a,o,l,i]),J=(Y,le)=>{const h=(n==null?void 0:n.id)===Y.id,z=s.some(C=>C.id===Y.id),P=h||z;return S.jsxs("div",{className:"flex-shrink-0",style:{width:`${Y.calculatedWidth}px`},children:[S.jsxs("div",{className:"relative group cursor-pointer overflow-hidden rounded-lg transition-all hover:shadow-lg",style:{height:`${Y.calculatedHeight}px`,backgroundColor:"#2a2a2a",border:P?"3px solid #3b82f6":"3px solid transparent"},onClick:C=>fe(Y,C,le),onDoubleClick:()=>{(Y.file_type||"image")==="image"?O(le):U(Y)},children:[S.jsx("img",{src:A(Y),alt:Y.filename,className:"w-full h-full object-cover",loading:"lazy",onError:C=>{C.target.style.display="none"}}),Y.file_type&&Y.file_type!=="image"&&S.jsxs("div",{className:`absolute top-2 right-2 rounded-md px-2 py-1 flex items-center gap-1 shadow-lg ${Y.file_type==="video"?"bg-blue-500 bg-opacity-90":Y.file_type==="audio"?"bg-pink-500 bg-opacity-90":Y.file_type==="document"?"bg-green-500 bg-opacity-90":Y.file_type==="design"?"bg-purple-500 bg-opacity-90":"bg-gray-500 bg-opacity-90"}`,children:[Y.file_type==="video"&&S.jsx(ym,{className:"w-4 h-4 text-white fill-white"}),Y.file_type==="audio"&&S.jsx(nw,{className:"w-4 h-4 text-white"}),Y.file_type==="document"&&S.jsx(J1,{className:"w-4 h-4 text-white"}),Y.file_type==="design"&&S.jsx(iw,{className:"w-4 h-4 text-white"}),Y.file_type==="other"&&S.jsx(ew,{className:"w-4 h-4 text-white"}),S.jsx("span",{className:"text-white text-xs font-semibold uppercase",children:Y.format||Y.filename.split(".").pop()})]}),S.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-20 transition-all pointer-events-none"})]}),S.jsx("div",{className:"mt-1 px-1",children:S.jsx("p",{className:"text-xs truncate text-center transition-colors",style:{color:P?"#3b82f6":"#909090",fontWeight:P?"600":"400"},children:Y.filename})})]},Y.id)},ae=({index:Y,style:le})=>{var P;const h=I[Y];if(!h)return null;let z=0;for(let C=0;CJ(C,z+E))})};return e.length?Q&&I.length===0&&e.length>0&&k>0?S.jsx("div",{ref:v,className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:S.jsxs("div",{className:"text-center",children:[S.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full mx-auto mb-2"}),S.jsx("p",{className:"text-sm",children:"正在计算布局..."})]})}):!k&&e.length>0?S.jsx("div",{ref:v,className:"h-full overflow-hidden"}):S.jsxs("div",{ref:v,className:"h-full overflow-hidden",children:[S.jsx(Tw,{images:M,visible:L>=0,onClose:()=>O(-1),index:L,onIndexChange:O,children:W?S.jsx($w,{ref:c,height:N||600,width:k+32,itemCount:I.length,itemSize:oe,className:"p-4",overscanCount:3,onScroll:({scrollOffset:Y,scrollDirection:le})=>{if(le==="forward"&&p.hasMore&&!p.isLoading){const h=I.reduce((P,C,E)=>P+oe(E),0),z=Y+(N||600);h-z<500&&se()}},children:ae}):S.jsx("div",{className:"h-full overflow-y-auto p-4",onScroll:Y=>{if(p.hasMore&&!p.isLoading){const{scrollTop:le,scrollHeight:h,clientHeight:z}=Y.target;h-le-z<500&&se()}},children:S.jsx("div",{className:"space-y-8",children:I.map((Y,le)=>{var z;let h=0;for(let P=0;PJ(P,h+C))},le)})})})}),R&&S.jsx(Ww,{file:R,libraryId:t,onClose:()=>U(null)})]}):S.jsx("div",{ref:v,className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:S.jsxs("div",{className:"text-center",children:[S.jsx("p",{className:"text-lg mb-2",children:"暂无图片"}),S.jsx("p",{className:"text-sm",children:"请添加素材库或调整搜索条件"})]})})}function Kw(){const{totalImageCount:e,folders:t,currentLibraryId:r,getCurrentLibrary:n}=me(),i=n(),s=t.length,o=t.filter(a=>!a.parent_path||a.parent_path==="."||a.parent_path==="");return S.jsx("div",{className:"flex-1 h-full overflow-y-auto bg-gray-50 dark:bg-gray-900 p-8",children:S.jsxs("div",{className:"max-w-4xl mx-auto",children:[S.jsxs("div",{className:"mb-8",children:[S.jsx("h1",{className:"text-3xl font-bold text-gray-900 dark:text-white mb-2",children:(i==null?void 0:i.name)||"素材库"}),S.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:i==null?void 0:i.path})]}),S.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:[S.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-100 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"p-3 bg-blue-100 dark:bg-blue-900/30 rounded-lg text-blue-600 dark:text-blue-400",children:S.jsx(rw,{className:"w-6 h-6"})}),S.jsxs("div",{children:[S.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:e.toLocaleString()}),S.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"总图片数"})]})]})}),S.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-100 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"p-3 bg-indigo-100 dark:bg-indigo-900/30 rounded-lg text-indigo-600 dark:text-indigo-400",children:S.jsx(Zi,{className:"w-6 h-6"})}),S.jsxs("div",{children:[S.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:s.toLocaleString()}),S.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"文件夹"})]})]})}),S.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl p-6 shadow-sm border border-gray-100 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx("div",{className:"p-3 bg-purple-100 dark:bg-purple-900/30 rounded-lg text-purple-600 dark:text-purple-400",children:S.jsx(Bo,{className:"w-6 h-6"})}),S.jsxs("div",{children:[S.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white mb-1",children:"快速开始"}),S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:"使用左侧目录树浏览或顶部搜索栏查找图片"})]})]})})]}),o.length>0&&S.jsxs("div",{children:[S.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-4",children:"根目录文件夹"}),S.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(a=>S.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-4 shadow-sm border border-gray-100 dark:border-gray-700 hover:shadow-md transition-shadow cursor-pointer group",onClick:()=>me.getState().setSelectedFolder(a.path),children:[S.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[S.jsx(Zi,{className:"w-8 h-8 text-yellow-500 group-hover:text-yellow-400 transition-colors"}),S.jsx("div",{className:"flex-1 min-w-0",children:S.jsx("div",{className:"font-medium text-gray-900 dark:text-white truncate",title:a.name,children:a.name})})]}),S.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:[a.image_count||0," 张图片"]})]},a.path))})]}),o.length===0&&S.jsxs("div",{className:"text-center py-12 bg-white dark:bg-gray-800 rounded-xl border border-dashed border-gray-300 dark:border-gray-700",children:[S.jsx(Zi,{className:"w-12 h-12 text-gray-300 dark:text-gray-600 mx-auto mb-4"}),S.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"暂无文件夹"}),S.jsx("p",{className:"text-gray-500 dark:text-gray-400 max-w-sm mx-auto",children:"您的素材库似乎是空的。请将图片添加到素材库目录中,系统会自动扫描。"})]})]})})}function dd(){const{currentLibraryId:e,searchKeywords:t,filters:r,selectedFolder:n,setImages:i,scanProgress:s,imageLoadingState:o}=me(),a=Z.useRef(null),l=Z.useRef(null),[f,p]=Z.useState(!1),[y,x]=Z.useState(!1),g=()=>{if(!s||s.current===0)return null;if(s.estimatedTimeLeft!==void 0){const d=s.estimatedTimeLeft;return d<1?"即将完成":d<60?`剩余约 ${d} 秒`:`剩余约 ${Math.floor(d/60)} 分钟`}return null},m=Z.useCallback(()=>{Ft.cancelAll(ps.IMAGES),a.current=null},[]),u=Z.useCallback(async()=>{var w;if(!e)return;if(!n&&!t&&r.formats.length===0){i([]),me.getState().setImageLoadingState({isLoading:!1,loadedCount:0,totalCount:0,hasMore:!1});return}Jl(),m();const d=Ft.createRequest(ps.IMAGES);a.current=d,me.getState().setImageLoadingState({isLoading:!0,loadedCount:0,totalCount:0,hasMore:!1});try{const k={offset:0,limit:200};n&&(k.folder=n),t&&(k.keywords=t),((w=r.formats)==null?void 0:w.length)>0&&(k.formats=r.formats.join(","));const b=await $e.search(e,k,{signal:d.signal});if(!Ft.isValid(d.id))return;const{images:N,total:T,hasMore:L}=b.data;Ft.complete(d.id),i(N),me.getState().setImageLoadingState({isLoading:!1,loadedCount:N.length,totalCount:T||N.length,hasMore:L||!1}),L&&uw(L)}catch(k){if(k.name==="CanceledError"||k.name==="AbortError")return;console.error("Error loading images:",k),Ft.error(d.id)}finally{(Ft.isValid(d.id)||d.status==="completed")&&(a.current=null)}},[e,t,r,n,i,m]);Z.useEffect(()=>{if(e)return l.current&&clearTimeout(l.current),m(),i([]),l.current=setTimeout(()=>{u()},50),()=>{l.current&&clearTimeout(l.current)}},[e,t,r,n,u,m,i]),Z.useEffect(()=>()=>{m(),l.current&&clearTimeout(l.current)},[m]);const v=async()=>{if(!(!e||y)){x(!0);try{await sn.stop(e),p(!0)}catch(d){console.error("Error stopping scan:",d)}finally{x(!1)}}},c=async()=>{if(!(!e||y)){x(!0);try{s!=null&&s.needsRescan?await sn.sync(e):await sn.resume(e),p(!1)}catch(d){console.error("Error resuming scan:",d)}finally{x(!1)}}};return Z.useEffect(()=>{s?s.isPaused?p(!0):s.percent===100&&p(!1):p(!1)},[s]),S.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-900",children:[s&&S.jsxs("div",{className:`p-4 border-b ${f?"bg-yellow-50 dark:bg-yellow-900 border-yellow-200 dark:border-yellow-700":"bg-blue-50 dark:bg-blue-900 border-blue-200 dark:border-blue-700"}`,children:[S.jsxs("div",{className:"flex items-center justify-between mb-2",children:[S.jsx("div",{className:`text-sm font-medium ${f?"text-yellow-700 dark:text-yellow-300":"text-blue-700 dark:text-blue-300"}`,children:f?"扫描已暂停":(s==null?void 0:s.status)==="preparing"?"正在准备扫描...":"正在扫描素材库,期间建议勿操作,否则会影响扫描速度"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("span",{className:`text-sm ${f?"text-yellow-600":"text-blue-600"}`,children:[(s==null?void 0:s.percent)||0,"%"]}),((s==null?void 0:s.canStop)||f)&&S.jsx("button",{onClick:f?c:v,disabled:y,className:`p-1.5 rounded-md ${f?"bg-green-500 hover:bg-green-600":"bg-yellow-500 hover:bg-yellow-600"} text-white`,children:f?S.jsx(ym,{className:"w-4 h-4"}):S.jsx(sw,{className:"w-4 h-4"})})]})]}),S.jsx("div",{className:`w-full rounded-full h-2 mb-2 ${f?"bg-yellow-200":"bg-blue-200"}`,children:S.jsx("div",{className:`h-2 rounded-full transition-all ${f?"bg-yellow-500":"bg-blue-500"}`,style:{width:`${(s==null?void 0:s.percent)||0}%`}})}),S.jsxs("div",{className:`text-xs ${f?"text-yellow-600":"text-blue-600"}`,children:["已处理 ",(s==null?void 0:s.current)||0," / ",(s==null?void 0:s.total)||0," 张图片",g()&&` · ${g()}`]})]}),o.hasMore&&o.loadedCount>0&&S.jsx("div",{className:"px-4 py-2 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:S.jsxs("div",{className:"flex items-center justify-between text-sm",children:[S.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:["已加载 ",o.loadedCount," / ",o.totalCount," 张"]}),S.jsx("div",{className:"w-32 h-1.5 bg-gray-200 rounded-full overflow-hidden",children:S.jsx("div",{className:"h-full bg-blue-500",style:{width:`${o.loadedCount/o.totalCount*100}%`}})})]})}),S.jsx("div",{className:"flex-1 overflow-hidden",children:!n&&!t&&r.formats.length===0?S.jsx(Kw,{}):S.jsx(qw,{})})]})}function Xs(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var _m={exports:{}};/*! + +JSZip v3.10.1 - A JavaScript class for generating and reading zip files + + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/main/LICENSE +*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,s){function o(f,p){if(!i[f]){if(!n[f]){var y=typeof Xs=="function"&&Xs;if(!p&&y)return y(f,!0);if(a)return a(f,!0);var x=new Error("Cannot find module '"+f+"'");throw x.code="MODULE_NOT_FOUND",x}var g=i[f]={exports:{}};n[f][0].call(g.exports,function(m){var u=n[f][1][m];return o(u||m)},g,g.exports,r,n,i,s)}return i[f].exports}for(var a=typeof Xs=="function"&&Xs,l=0;l>2,g=(3&f)<<4|p>>4,m=1>6:64,u=2>4,p=(15&x)<<4|(g=a.indexOf(l.charAt(u++)))>>2,y=(3&g)<<6|(m=a.indexOf(l.charAt(u++))),d[v++]=f,g!==64&&(d[v++]=p),m!==64&&(d[v++]=y);return d}},{"./support":30,"./utils":32}],2:[function(r,n,i){var s=r("./external"),o=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function f(p,y,x,g,m){this.compressedSize=p,this.uncompressedSize=y,this.crc32=x,this.compression=g,this.compressedContent=m}f.prototype={getContentWorker:function(){var p=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),y=this;return p.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),p},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(p,y,x){return p.pipe(new a).pipe(new l("uncompressedSize")).pipe(y.compressWorker(x)).pipe(new l("compressedSize")).withStreamInfo("compression",y)},n.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,i){var s=r("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,i){var s=r("./utils"),o=function(){for(var a,l=[],f=0;f<256;f++){a=f;for(var p=0;p<8;p++)a=1&a?3988292384^a>>>1:a>>>1;l[f]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(f,p,y,x){var g=o,m=x+y;f^=-1;for(var u=x;u>>8^g[255&(f^p[u])];return-1^f}(0|l,a,a.length,0):function(f,p,y,x){var g=o,m=x+y;f^=-1;for(var u=x;u>>8^g[255&(f^p.charCodeAt(u))];return-1^f}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(r,n,i){var s=null;s=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:s}},{lie:37}],7:[function(r,n,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),f=s?"uint8array":"array";function p(y,x){l.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=x,this.meta={}}i.magic="\b\0",a.inherits(p,l),p.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(f,y.data),!1)},p.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},p.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},p.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(x){y.push({data:x,meta:y.meta})}},i.compressWorker=function(y){return new p("Deflate",y)},i.uncompressWorker=function(){return new p("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,i){function s(g,m){var u,v="";for(u=0;u>>=8;return v}function o(g,m,u,v,c,d){var w,k,b=g.file,N=g.compression,T=d!==f.utf8encode,L=a.transformTo("string",d(b.name)),O=a.transformTo("string",f.utf8encode(b.name)),F=b.comment,ee=a.transformTo("string",d(F)),R=a.transformTo("string",f.utf8encode(F)),U=O.length!==b.name.length,_=R.length!==F.length,q="",se="",Q="",$=b.dir,D=b.date,H={crc32:0,compressedSize:0,uncompressedSize:0};m&&!u||(H.crc32=g.crc32,H.compressedSize=g.compressedSize,H.uncompressedSize=g.uncompressedSize);var I=0;m&&(I|=8),T||!U&&!_||(I|=2048);var A=0,V=0;$&&(A|=16),c==="UNIX"?(V=798,A|=function(W,oe){var he=W;return W||(he=oe?16893:33204),(65535&he)<<16}(b.unixPermissions,$)):(V=20,A|=function(W){return 63&(W||0)}(b.dosPermissions)),w=D.getUTCHours(),w<<=6,w|=D.getUTCMinutes(),w<<=5,w|=D.getUTCSeconds()/2,k=D.getUTCFullYear()-1980,k<<=4,k|=D.getUTCMonth()+1,k<<=5,k|=D.getUTCDate(),U&&(se=s(1,1)+s(p(L),4)+O,q+="up"+s(se.length,2)+se),_&&(Q=s(1,1)+s(p(ee),4)+R,q+="uc"+s(Q.length,2)+Q);var M="";return M+=` +\0`,M+=s(I,2),M+=N.magic,M+=s(w,2),M+=s(k,2),M+=s(H.crc32,4),M+=s(H.compressedSize,4),M+=s(H.uncompressedSize,4),M+=s(L.length,2),M+=s(q.length,2),{fileRecord:y.LOCAL_FILE_HEADER+M+L+q,dirRecord:y.CENTRAL_FILE_HEADER+s(V,2)+M+s(ee.length,2)+"\0\0\0\0"+s(A,4)+s(v,4)+L+q+ee}}var a=r("../utils"),l=r("../stream/GenericWorker"),f=r("../utf8"),p=r("../crc32"),y=r("../signature");function x(g,m,u,v){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=u,this.encodeFileName=v,this.streamFiles=g,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(x,l),x.prototype.push=function(g){var m=g.meta.percent||0,u=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(g):(this.bytesWritten+=g.data.length,l.prototype.push.call(this,{data:g.data,meta:{currentFile:this.currentFile,percent:u?(m+100*(u-v-1))/u:100}}))},x.prototype.openedSource=function(g){this.currentSourceOffset=this.bytesWritten,this.currentFile=g.file.name;var m=this.streamFiles&&!g.file.dir;if(m){var u=o(g,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:u.fileRecord,meta:{percent:0}})}else this.accumulate=!0},x.prototype.closedSource=function(g){this.accumulate=!1;var m=this.streamFiles&&!g.file.dir,u=o(g,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(u.dirRecord),m)this.push({data:function(v){return y.DATA_DESCRIPTOR+s(v.crc32,4)+s(v.compressedSize,4)+s(v.uncompressedSize,4)}(g),meta:{percent:100}});else for(this.push({data:u.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},x.prototype.flush=function(){for(var g=this.bytesWritten,m=0;m=this.index;l--)f=(f<<8)+this.byteAt(l);return this.index+=a,f},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=o},{"../utils":32}],19:[function(r,n,i){var s=r("./Uint8ArrayReader");function o(a){s.call(this,a)}r("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,i){var s=r("./DataReader");function o(a){s.call(this,a)}r("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(r,n,i){var s=r("./ArrayReader");function o(a){s.call(this,a)}r("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,i){var s=r("../utils"),o=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),f=r("./NodeBufferReader"),p=r("./Uint8ArrayReader");n.exports=function(y){var x=s.getTypeOf(y);return s.checkSupport(x),x!=="string"||o.uint8array?x==="nodebuffer"?new f(y):o.uint8array?new p(s.transformTo("uint8array",y)):new a(s.transformTo("array",y)):new l(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,i){var s=r("./GenericWorker"),o=r("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,i){var s=r("./GenericWorker"),o=r("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,i){var s=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+l.data.length}o.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,i){var s=r("../utils"),o=r("./GenericWorker");function a(l){o.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(p){f.dataIsReady=!0,f.data=p,f.max=p&&p.length||0,f.type=s.getTypeOf(p),f.isPaused||f._tickAndRepeat()},function(p){f.error(p)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,f);break;case"uint8array":l=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":l=this.data.slice(this.index,f)}return this.index=f,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,i){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},n.exports=s},{}],29:[function(r,n,i){var s=r("../utils"),o=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),f=r("../support"),p=r("../external"),y=null;if(f.nodestream)try{y=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function x(m,u){return new p.Promise(function(v,c){var d=[],w=m._internalType,k=m._outputType,b=m._mimeType;m.on("data",function(N,T){d.push(N),u&&u(T)}).on("error",function(N){d=[],c(N)}).on("end",function(){try{var N=function(T,L,O){switch(T){case"blob":return s.newBlob(s.transformTo("arraybuffer",L),O);case"base64":return l.encode(L);default:return s.transformTo(T,L)}}(k,function(T,L){var O,F=0,ee=null,R=0;for(O=0;O"u")i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!r("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,i){for(var s=r("./utils"),o=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),f=new Array(256),p=0;p<256;p++)f[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;f[254]=f[254]=1;function y(){l.call(this,"utf-8 decode"),this.leftOver=null}function x(){l.call(this,"utf-8 encode")}i.utf8encode=function(g){return o.nodebuffer?a.newBufferFrom(g,"utf-8"):function(m){var u,v,c,d,w,k=m.length,b=0;for(d=0;d>>6:(v<65536?u[w++]=224|v>>>12:(u[w++]=240|v>>>18,u[w++]=128|v>>>12&63),u[w++]=128|v>>>6&63),u[w++]=128|63&v);return u}(g)},i.utf8decode=function(g){return o.nodebuffer?s.transformTo("nodebuffer",g).toString("utf-8"):function(m){var u,v,c,d,w=m.length,k=new Array(2*w);for(u=v=0;u>10&1023,k[v++]=56320|1023&c)}return k.length!==v&&(k.subarray?k=k.subarray(0,v):k.length=v),s.applyFromCharCode(k)}(g=s.transformTo(o.uint8array?"uint8array":"array",g))},s.inherits(y,l),y.prototype.processChunk=function(g){var m=s.transformTo(o.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var u=m;(m=new Uint8Array(u.length+this.leftOver.length)).set(this.leftOver,0),m.set(u,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var v=function(d,w){var k;for((w=w||d.length)>d.length&&(w=d.length),k=w-1;0<=k&&(192&d[k])==128;)k--;return k<0||k===0?w:k+f[d[k]]>w?k:w}(m),c=m;v!==m.length&&(o.uint8array?(c=m.subarray(0,v),this.leftOver=m.subarray(v,m.length)):(c=m.slice(0,v),this.leftOver=m.slice(v,m.length))),this.push({data:i.utf8decode(c),meta:g.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=y,s.inherits(x,l),x.prototype.processChunk=function(g){this.push({data:i.utf8encode(g.data),meta:g.meta})},i.Utf8EncodeWorker=x},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,i){var s=r("./support"),o=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function f(u){return u}function p(u,v){for(var c=0;c>8;this.dir=!!(16&this.externalFileAttributes),g==0&&(this.dosPermissions=63&this.externalFileAttributes),g==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var g=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=g.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=g.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=g.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=g.readInt(4))}},readExtraFields:function(g){var m,u,v,c=g.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});g.index+4>>6:(g<65536?x[v++]=224|g>>>12:(x[v++]=240|g>>>18,x[v++]=128|g>>>12&63),x[v++]=128|g>>>6&63),x[v++]=128|63&g);return x},i.buf2binstring=function(y){return p(y,y.length)},i.binstring2buf=function(y){for(var x=new s.Buf8(y.length),g=0,m=x.length;g>10&1023,d[m++]=56320|1023&u)}return p(d,m)},i.utf8border=function(y,x){var g;for((x=x||y.length)>y.length&&(x=y.length),g=x-1;0<=g&&(192&y[g])==128;)g--;return g<0||g===0?x:g+l[y[g]]>x?g:x}},{"./common":41}],43:[function(r,n,i){n.exports=function(s,o,a,l){for(var f=65535&s|0,p=s>>>16&65535|0,y=0;a!==0;){for(a-=y=2e3>>1:o>>>1;a[l]=o}return a}();n.exports=function(o,a,l,f){var p=s,y=f+l;o^=-1;for(var x=f;x>>8^p[255&(o^a[x])];return-1^o}},{}],46:[function(r,n,i){var s,o=r("../utils/common"),a=r("./trees"),l=r("./adler32"),f=r("./crc32"),p=r("./messages"),y=0,x=4,g=0,m=-2,u=-1,v=4,c=2,d=8,w=9,k=286,b=30,N=19,T=2*k+1,L=15,O=3,F=258,ee=F+O+1,R=42,U=113,_=1,q=2,se=3,Q=4;function $(h,z){return h.msg=p[z],z}function D(h){return(h<<1)-(4h.avail_out&&(P=h.avail_out),P!==0&&(o.arraySet(h.output,z.pending_buf,z.pending_out,P,h.next_out),h.next_out+=P,z.pending_out+=P,h.total_out+=P,h.avail_out-=P,z.pending-=P,z.pending===0&&(z.pending_out=0))}function A(h,z){a._tr_flush_block(h,0<=h.block_start?h.block_start:-1,h.strstart-h.block_start,z),h.block_start=h.strstart,I(h.strm)}function V(h,z){h.pending_buf[h.pending++]=z}function M(h,z){h.pending_buf[h.pending++]=z>>>8&255,h.pending_buf[h.pending++]=255&z}function W(h,z){var P,C,E=h.max_chain_length,j=h.strstart,X=h.prev_length,G=h.nice_match,B=h.strstart>h.w_size-ee?h.strstart-(h.w_size-ee):0,re=h.window,ue=h.w_mask,ne=h.prev,pe=h.strstart+F,ve=re[j+X-1],ye=re[j+X];h.prev_length>=h.good_match&&(E>>=2),G>h.lookahead&&(G=h.lookahead);do if(re[(P=z)+X]===ye&&re[P+X-1]===ve&&re[P]===re[j]&&re[++P]===re[j+1]){j+=2,P++;do;while(re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&re[++j]===re[++P]&&jB&&--E!=0);return X<=h.lookahead?X:h.lookahead}function oe(h){var z,P,C,E,j,X,G,B,re,ue,ne=h.w_size;do{if(E=h.window_size-h.lookahead-h.strstart,h.strstart>=ne+(ne-ee)){for(o.arraySet(h.window,h.window,ne,ne,0),h.match_start-=ne,h.strstart-=ne,h.block_start-=ne,z=P=h.hash_size;C=h.head[--z],h.head[z]=ne<=C?C-ne:0,--P;);for(z=P=ne;C=h.prev[--z],h.prev[z]=ne<=C?C-ne:0,--P;);E+=ne}if(h.strm.avail_in===0)break;if(X=h.strm,G=h.window,B=h.strstart+h.lookahead,re=E,ue=void 0,ue=X.avail_in,re=O)for(j=h.strstart-h.insert,h.ins_h=h.window[j],h.ins_h=(h.ins_h<=O&&(h.ins_h=(h.ins_h<=O)if(C=a._tr_tally(h,h.strstart-h.match_start,h.match_length-O),h.lookahead-=h.match_length,h.match_length<=h.max_lazy_match&&h.lookahead>=O){for(h.match_length--;h.strstart++,h.ins_h=(h.ins_h<=O&&(h.ins_h=(h.ins_h<=O&&h.match_length<=h.prev_length){for(E=h.strstart+h.lookahead-O,C=a._tr_tally(h,h.strstart-1-h.prev_match,h.prev_length-O),h.lookahead-=h.prev_length-1,h.prev_length-=2;++h.strstart<=E&&(h.ins_h=(h.ins_h<h.pending_buf_size-5&&(P=h.pending_buf_size-5);;){if(h.lookahead<=1){if(oe(h),h.lookahead===0&&z===y)return _;if(h.lookahead===0)break}h.strstart+=h.lookahead,h.lookahead=0;var C=h.block_start+P;if((h.strstart===0||h.strstart>=C)&&(h.lookahead=h.strstart-C,h.strstart=C,A(h,!1),h.strm.avail_out===0)||h.strstart-h.block_start>=h.w_size-ee&&(A(h,!1),h.strm.avail_out===0))return _}return h.insert=0,z===x?(A(h,!0),h.strm.avail_out===0?se:Q):(h.strstart>h.block_start&&(A(h,!1),h.strm.avail_out),_)}),new fe(4,4,8,4,he),new fe(4,5,16,8,he),new fe(4,6,32,32,he),new fe(4,4,16,16,ce),new fe(8,16,32,32,ce),new fe(8,16,128,128,ce),new fe(8,32,128,256,ce),new fe(32,128,258,1024,ce),new fe(32,258,258,4096,ce)],i.deflateInit=function(h,z){return le(h,z,d,15,8,0)},i.deflateInit2=le,i.deflateReset=Y,i.deflateResetKeep=ae,i.deflateSetHeader=function(h,z){return h&&h.state?h.state.wrap!==2?m:(h.state.gzhead=z,g):m},i.deflate=function(h,z){var P,C,E,j;if(!h||!h.state||5>8&255),V(C,C.gzhead.time>>16&255),V(C,C.gzhead.time>>24&255),V(C,C.level===9?2:2<=C.strategy||C.level<2?4:0),V(C,255&C.gzhead.os),C.gzhead.extra&&C.gzhead.extra.length&&(V(C,255&C.gzhead.extra.length),V(C,C.gzhead.extra.length>>8&255)),C.gzhead.hcrc&&(h.adler=f(h.adler,C.pending_buf,C.pending,0)),C.gzindex=0,C.status=69):(V(C,0),V(C,0),V(C,0),V(C,0),V(C,0),V(C,C.level===9?2:2<=C.strategy||C.level<2?4:0),V(C,3),C.status=U);else{var X=d+(C.w_bits-8<<4)<<8;X|=(2<=C.strategy||C.level<2?0:C.level<6?1:C.level===6?2:3)<<6,C.strstart!==0&&(X|=32),X+=31-X%31,C.status=U,M(C,X),C.strstart!==0&&(M(C,h.adler>>>16),M(C,65535&h.adler)),h.adler=1}if(C.status===69)if(C.gzhead.extra){for(E=C.pending;C.gzindex<(65535&C.gzhead.extra.length)&&(C.pending!==C.pending_buf_size||(C.gzhead.hcrc&&C.pending>E&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),I(h),E=C.pending,C.pending!==C.pending_buf_size));)V(C,255&C.gzhead.extra[C.gzindex]),C.gzindex++;C.gzhead.hcrc&&C.pending>E&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),C.gzindex===C.gzhead.extra.length&&(C.gzindex=0,C.status=73)}else C.status=73;if(C.status===73)if(C.gzhead.name){E=C.pending;do{if(C.pending===C.pending_buf_size&&(C.gzhead.hcrc&&C.pending>E&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),I(h),E=C.pending,C.pending===C.pending_buf_size)){j=1;break}j=C.gzindexE&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),j===0&&(C.gzindex=0,C.status=91)}else C.status=91;if(C.status===91)if(C.gzhead.comment){E=C.pending;do{if(C.pending===C.pending_buf_size&&(C.gzhead.hcrc&&C.pending>E&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),I(h),E=C.pending,C.pending===C.pending_buf_size)){j=1;break}j=C.gzindexE&&(h.adler=f(h.adler,C.pending_buf,C.pending-E,E)),j===0&&(C.status=103)}else C.status=103;if(C.status===103&&(C.gzhead.hcrc?(C.pending+2>C.pending_buf_size&&I(h),C.pending+2<=C.pending_buf_size&&(V(C,255&h.adler),V(C,h.adler>>8&255),h.adler=0,C.status=U)):C.status=U),C.pending!==0){if(I(h),h.avail_out===0)return C.last_flush=-1,g}else if(h.avail_in===0&&D(z)<=D(P)&&z!==x)return $(h,-5);if(C.status===666&&h.avail_in!==0)return $(h,-5);if(h.avail_in!==0||C.lookahead!==0||z!==y&&C.status!==666){var G=C.strategy===2?function(B,re){for(var ue;;){if(B.lookahead===0&&(oe(B),B.lookahead===0)){if(re===y)return _;break}if(B.match_length=0,ue=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++,ue&&(A(B,!1),B.strm.avail_out===0))return _}return B.insert=0,re===x?(A(B,!0),B.strm.avail_out===0?se:Q):B.last_lit&&(A(B,!1),B.strm.avail_out===0)?_:q}(C,z):C.strategy===3?function(B,re){for(var ue,ne,pe,ve,ye=B.window;;){if(B.lookahead<=F){if(oe(B),B.lookahead<=F&&re===y)return _;if(B.lookahead===0)break}if(B.match_length=0,B.lookahead>=O&&0B.lookahead&&(B.match_length=B.lookahead)}if(B.match_length>=O?(ue=a._tr_tally(B,1,B.match_length-O),B.lookahead-=B.match_length,B.strstart+=B.match_length,B.match_length=0):(ue=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++),ue&&(A(B,!1),B.strm.avail_out===0))return _}return B.insert=0,re===x?(A(B,!0),B.strm.avail_out===0?se:Q):B.last_lit&&(A(B,!1),B.strm.avail_out===0)?_:q}(C,z):s[C.level].func(C,z);if(G!==se&&G!==Q||(C.status=666),G===_||G===se)return h.avail_out===0&&(C.last_flush=-1),g;if(G===q&&(z===1?a._tr_align(C):z!==5&&(a._tr_stored_block(C,0,0,!1),z===3&&(H(C.head),C.lookahead===0&&(C.strstart=0,C.block_start=0,C.insert=0))),I(h),h.avail_out===0))return C.last_flush=-1,g}return z!==x?g:C.wrap<=0?1:(C.wrap===2?(V(C,255&h.adler),V(C,h.adler>>8&255),V(C,h.adler>>16&255),V(C,h.adler>>24&255),V(C,255&h.total_in),V(C,h.total_in>>8&255),V(C,h.total_in>>16&255),V(C,h.total_in>>24&255)):(M(C,h.adler>>>16),M(C,65535&h.adler)),I(h),0=P.w_size&&(j===0&&(H(P.head),P.strstart=0,P.block_start=0,P.insert=0),re=new o.Buf8(P.w_size),o.arraySet(re,z,ue-P.w_size,P.w_size,0),z=re,ue=P.w_size),X=h.avail_in,G=h.next_in,B=h.input,h.avail_in=ue,h.next_in=0,h.input=z,oe(P);P.lookahead>=O;){for(C=P.strstart,E=P.lookahead-(O-1);P.ins_h=(P.ins_h<>>=O=L>>>24,w-=O,(O=L>>>16&255)===0)q[p++]=65535&L;else{if(!(16&O)){if(!(64&O)){L=k[(65535&L)+(d&(1<>>=O,w-=O),w<15&&(d+=_[l++]<>>=O=L>>>24,w-=O,!(16&(O=L>>>16&255))){if(!(64&O)){L=b[(65535&L)+(d&(1<>>=O,w-=O,(O=p-y)>3,d&=(1<<(w-=F<<3))-1,s.next_in=l,s.next_out=p,s.avail_in=l>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(R){var U;return R&&R.state?(U=R.state,R.total_in=R.total_out=U.total=0,R.msg="",U.wrap&&(R.adler=1&U.wrap),U.mode=m,U.last=0,U.havedict=0,U.dmax=32768,U.head=null,U.hold=0,U.bits=0,U.lencode=U.lendyn=new s.Buf32(u),U.distcode=U.distdyn=new s.Buf32(v),U.sane=1,U.back=-1,x):g}function k(R){var U;return R&&R.state?((U=R.state).wsize=0,U.whave=0,U.wnext=0,w(R)):g}function b(R,U){var _,q;return R&&R.state?(q=R.state,U<0?(_=0,U=-U):(_=1+(U>>4),U<48&&(U&=15)),U&&(U<8||15=Q.wsize?(s.arraySet(Q.window,U,_-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize):(q<(se=Q.wsize-Q.wnext)&&(se=q),s.arraySet(Q.window,U,_-q,se,Q.wnext),(q-=se)?(s.arraySet(Q.window,U,_-q,q,0),Q.wnext=q,Q.whave=Q.wsize):(Q.wnext+=se,Q.wnext===Q.wsize&&(Q.wnext=0),Q.whave>>8&255,_.check=a(_.check,j,2,0),A=I=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&I)<<8)+(I>>8))%31){R.msg="incorrect header check",_.mode=30;break}if((15&I)!=8){R.msg="unknown compression method",_.mode=30;break}if(A-=4,h=8+(15&(I>>>=4)),_.wbits===0)_.wbits=h;else if(h>_.wbits){R.msg="invalid window size",_.mode=30;break}_.dmax=1<>8&1),512&_.flags&&(j[0]=255&I,j[1]=I>>>8&255,_.check=a(_.check,j,2,0)),A=I=0,_.mode=3;case 3:for(;A<32;){if(D===0)break e;D--,I+=q[Q++]<>>8&255,j[2]=I>>>16&255,j[3]=I>>>24&255,_.check=a(_.check,j,4,0)),A=I=0,_.mode=4;case 4:for(;A<16;){if(D===0)break e;D--,I+=q[Q++]<>8),512&_.flags&&(j[0]=255&I,j[1]=I>>>8&255,_.check=a(_.check,j,2,0)),A=I=0,_.mode=5;case 5:if(1024&_.flags){for(;A<16;){if(D===0)break e;D--,I+=q[Q++]<>>8&255,_.check=a(_.check,j,2,0)),A=I=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(D<(W=_.length)&&(W=D),W&&(_.head&&(h=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),s.arraySet(_.head.extra,q,Q,W,h)),512&_.flags&&(_.check=a(_.check,q,W,Q)),D-=W,Q+=W,_.length-=W),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(D===0)break e;for(W=0;h=q[Q+W++],_.head&&h&&_.length<65536&&(_.head.name+=String.fromCharCode(h)),h&&W>9&1,_.head.done=!0),R.adler=_.check=0,_.mode=12;break;case 10:for(;A<32;){if(D===0)break e;D--,I+=q[Q++]<>>=7&A,A-=7&A,_.mode=27;break}for(;A<3;){if(D===0)break e;D--,I+=q[Q++]<>>=1)){case 0:_.mode=14;break;case 1:if(F(_),_.mode=20,U!==6)break;I>>>=2,A-=2;break e;case 2:_.mode=17;break;case 3:R.msg="invalid block type",_.mode=30}I>>>=2,A-=2;break;case 14:for(I>>>=7&A,A-=7&A;A<32;){if(D===0)break e;D--,I+=q[Q++]<>>16^65535)){R.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&I,A=I=0,_.mode=15,U===6)break e;case 15:_.mode=16;case 16:if(W=_.length){if(D>>=5,A-=5,_.ndist=1+(31&I),I>>>=5,A-=5,_.ncode=4+(15&I),I>>>=4,A-=4,286<_.nlen||30<_.ndist){R.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;A<3;){if(D===0)break e;D--,I+=q[Q++]<>>=3,A-=3}for(;_.have<19;)_.lens[X[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,P={bits:_.lenbits},z=f(0,_.lens,0,19,_.lencode,0,_.work,P),_.lenbits=P.bits,z){R.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;fe=(E=_.lencode[I&(1<<_.lenbits)-1])>>>16&255,J=65535&E,!((ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>>=ce,A-=ce,_.lens[_.have++]=J;else{if(J===16){for(C=ce+2;A>>=ce,A-=ce,_.have===0){R.msg="invalid bit length repeat",_.mode=30;break}h=_.lens[_.have-1],W=3+(3&I),I>>>=2,A-=2}else if(J===17){for(C=ce+3;A>>=ce)),I>>>=3,A-=3}else{for(C=ce+7;A>>=ce)),I>>>=7,A-=7}if(_.have+W>_.nlen+_.ndist){R.msg="invalid bit length repeat",_.mode=30;break}for(;W--;)_.lens[_.have++]=h}}if(_.mode===30)break;if(_.lens[256]===0){R.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,P={bits:_.lenbits},z=f(p,_.lens,0,_.nlen,_.lencode,0,_.work,P),_.lenbits=P.bits,z){R.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,P={bits:_.distbits},z=f(y,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,P),_.distbits=P.bits,z){R.msg="invalid distances set",_.mode=30;break}if(_.mode=20,U===6)break e;case 20:_.mode=21;case 21:if(6<=D&&258<=H){R.next_out=$,R.avail_out=H,R.next_in=Q,R.avail_in=D,_.hold=I,_.bits=A,l(R,M),$=R.next_out,se=R.output,H=R.avail_out,Q=R.next_in,q=R.input,D=R.avail_in,I=_.hold,A=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;fe=(E=_.lencode[I&(1<<_.lenbits)-1])>>>16&255,J=65535&E,!((ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>ae)])>>>16&255,J=65535&E,!(ae+(ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>>=ae,A-=ae,_.back+=ae}if(I>>>=ce,A-=ce,_.back+=ce,_.length=J,fe===0){_.mode=26;break}if(32&fe){_.back=-1,_.mode=12;break}if(64&fe){R.msg="invalid literal/length code",_.mode=30;break}_.extra=15&fe,_.mode=22;case 22:if(_.extra){for(C=_.extra;A>>=_.extra,A-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;fe=(E=_.distcode[I&(1<<_.distbits)-1])>>>16&255,J=65535&E,!((ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>ae)])>>>16&255,J=65535&E,!(ae+(ce=E>>>24)<=A);){if(D===0)break e;D--,I+=q[Q++]<>>=ae,A-=ae,_.back+=ae}if(I>>>=ce,A-=ce,_.back+=ce,64&fe){R.msg="invalid distance code",_.mode=30;break}_.offset=J,_.extra=15&fe,_.mode=24;case 24:if(_.extra){for(C=_.extra;A>>=_.extra,A-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){R.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(H===0)break e;if(W=M-H,_.offset>W){if((W=_.offset-W)>_.whave&&_.sane){R.msg="invalid distance too far back",_.mode=30;break}oe=W>_.wnext?(W-=_.wnext,_.wsize-W):_.wnext-W,W>_.length&&(W=_.length),he=_.window}else he=se,oe=$-_.offset,W=_.length;for(HT?(O=oe[he+v[U]],A[V+v[U]]):(O=96,0),d=1<>$)+(w-=d)]=L<<24|O<<16|F|0,w!==0;);for(d=1<>=1;if(d!==0?(I&=d-1,I+=d):I=0,U++,--M[R]==0){if(R===q)break;R=y[x+v[U]]}if(se>>7)]}function V(E,j){E.pending_buf[E.pending++]=255&j,E.pending_buf[E.pending++]=j>>>8&255}function M(E,j,X){E.bi_valid>c-X?(E.bi_buf|=j<>c-E.bi_valid,E.bi_valid+=X-c):(E.bi_buf|=j<>>=1,X<<=1,0<--j;);return X>>>1}function he(E,j,X){var G,B,re=new Array(v+1),ue=0;for(G=1;G<=v;G++)re[G]=ue=ue+X[G-1]<<1;for(B=0;B<=j;B++){var ne=E[2*B+1];ne!==0&&(E[2*B]=oe(re[ne]++,ne))}}function ce(E){var j;for(j=0;j>1;1<=X;X--)ae(E,re,X);for(B=pe;X=E.heap[1],E.heap[1]=E.heap[E.heap_len--],ae(E,re,1),G=E.heap[1],E.heap[--E.heap_max]=X,E.heap[--E.heap_max]=G,re[2*B]=re[2*X]+re[2*G],E.depth[B]=(E.depth[X]>=E.depth[G]?E.depth[X]:E.depth[G])+1,re[2*X+1]=re[2*G+1]=B,E.heap[1]=B++,ae(E,re,1),2<=E.heap_len;);E.heap[--E.heap_max]=E.heap[1],function(ye,We){var Jt,at,er,be,hr,tr,tt=We.dyn_tree,Lr=We.max_code,jn=We.stat_desc.static_tree,Tt=We.stat_desc.has_stree,_e=We.stat_desc.extra_bits,Te=We.stat_desc.extra_base,Ae=We.stat_desc.max_length,je=0;for(be=0;be<=v;be++)ye.bl_count[be]=0;for(tt[2*ye.heap[ye.heap_max]+1]=0,Jt=ye.heap_max+1;Jt>=7;B>>=1)if(1&ve&&ne.dyn_ltree[2*pe]!==0)return o;if(ne.dyn_ltree[18]!==0||ne.dyn_ltree[20]!==0||ne.dyn_ltree[26]!==0)return a;for(pe=32;pe>>3,(re=E.static_len+3+7>>>3)<=B&&(B=re)):B=re=X+5,X+4<=B&&j!==-1?C(E,j,X,G):E.strategy===4||re===B?(M(E,2+(G?1:0),3),Y(E,ee,R)):(M(E,4+(G?1:0),3),function(ne,pe,ve,ye){var We;for(M(ne,pe-257,5),M(ne,ve-1,5),M(ne,ye-4,4),We=0;We>>8&255,E.pending_buf[E.d_buf+2*E.last_lit+1]=255&j,E.pending_buf[E.l_buf+E.last_lit]=255&X,E.last_lit++,j===0?E.dyn_ltree[2*X]++:(E.matches++,j--,E.dyn_ltree[2*(_[X]+y+1)]++,E.dyn_dtree[2*A(j)]++),E.last_lit===E.lit_bufsize-1},i._tr_align=function(E){M(E,2,3),W(E,w,ee),function(j){j.bi_valid===16?(V(j,j.bi_buf),j.bi_buf=0,j.bi_valid=0):8<=j.bi_valid&&(j.pending_buf[j.pending++]=255&j.bi_buf,j.bi_buf>>=8,j.bi_valid-=8)}(E)}},{"../utils/common":41}],53:[function(r,n,i){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,i){(function(s){(function(o,a){if(!o.setImmediate){var l,f,p,y,x=1,g={},m=!1,u=o.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(o);v=v&&v.setTimeout?v:o,l={}.toString.call(o.process)==="[object process]"?function(k){process.nextTick(function(){d(k)})}:function(){if(o.postMessage&&!o.importScripts){var k=!0,b=o.onmessage;return o.onmessage=function(){k=!1},o.postMessage("","*"),o.onmessage=b,k}}()?(y="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",w,!1):o.attachEvent("onmessage",w),function(k){o.postMessage(y+k,"*")}):o.MessageChannel?((p=new MessageChannel).port1.onmessage=function(k){d(k.data)},function(k){p.port2.postMessage(k)}):u&&"onreadystatechange"in u.createElement("script")?(f=u.documentElement,function(k){var b=u.createElement("script");b.onreadystatechange=function(){d(k),b.onreadystatechange=null,f.removeChild(b),b=null},f.appendChild(b)}):function(k){setTimeout(d,0,k)},v.setImmediate=function(k){typeof k!="function"&&(k=new Function(""+k));for(var b=new Array(arguments.length-1),N=0;N"u"?s===void 0?this:s:self)}).call(this,typeof Es<"u"?Es:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(_m);var Xw=_m.exports;const hd=su(Xw);function pd(){const{selectedImage:e,selectedImages:t,currentLibraryId:r,selectedFolder:n,images:i,setMobileView:s,isResizingPanels:o,resizingSide:a}=me(),[l,f]=Z.useState(!1),[p,y]=Z.useState(""),[x,g]=Z.useState(!1),[m,u]=Z.useState(!1),[v,c]=Z.useState(!1),[d,w]=Z.useState(!1),[k,b]=Z.useState(0),[N,T]=Z.useState(!1),[L,O]=Z.useState(0),F=t.length>0,ee=F?t[0]:e;if(Z.useEffect(()=>{const H=()=>{f(window.innerWidth<768)};return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]),Z.useEffect(()=>{if(!e||!r){y("");return}const H=R();if(y(H),g(!0),o){g(!1);return}const I=U(),A=new Image;return A.onload=()=>{y(I),g(!1)},A.onerror=()=>{console.error("Failed to load original image"),g(!1)},A.src=I,()=>{A.onload=null,A.onerror=null}},[e,r,o,a]),!e&&t.length===0)return S.jsx("div",{className:"w-full border-l border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex items-center justify-center",children:S.jsx("p",{className:"text-gray-400 dark:text-gray-500 text-sm",children:"选择图片查看详情"})});const R=()=>{if(!r||!e.thumbnail_path)return"";const H=e.thumbnail_path.replace(/\\/g,"/").split("/").pop();return $e.getThumbnailUrl(r,"200",H)},U=()=>!r||!e.path?"":$e.getOriginalUrl(r,e.path),_=async()=>{try{const H=$e.getOriginalUrl(r,e.path),A=await(await fetch(H)).blob(),V=new Image,M=new Promise((he,ce)=>{V.onload=he,V.onerror=ce});V.src=URL.createObjectURL(A),await M;const W=document.createElement("canvas");W.width=V.width,W.height=V.height,W.getContext("2d").drawImage(V,0,0),W.toBlob(async he=>{try{const ce=new ClipboardItem({"image/png":he,"text/html":new Blob([`${e.filename}`],{type:"text/html"}),"text/plain":new Blob([H],{type:"text/plain"})});await navigator.clipboard.write([ce]),c(!0),setTimeout(()=>c(!1),2e3)}catch(ce){console.error("写入剪贴板失败:",ce);try{await navigator.clipboard.write([new ClipboardItem({"image/png":he})]),c(!0),setTimeout(()=>c(!1),2e3)}catch(fe){console.error("备用方案也失败:",fe),alert("复制失败,请重试")}}},"image/png"),URL.revokeObjectURL(V.src)}catch(H){console.error("复制图片失败:",H),alert("复制图片失败,请重试")}},q=async()=>{try{const H=F?t:[e];if(H.length===1){await _();return}const A=(await Promise.all(H.map(async M=>{const W=$e.getOriginalUrl(r,M.path),he=await(await fetch(W)).blob();return new Promise(ce=>{const fe=new FileReader;fe.onloadend=()=>{ce({dataUrl:fe.result,filename:M.filename})},fe.readAsDataURL(he)})}))).map(({dataUrl:M,filename:W})=>`${W}`).join(` +`),V=H.map(M=>M.filename).join(` +`);try{await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([A],{type:"text/html"}),"text/plain":new Blob([V],{type:"text/plain"})})]),c(!0),setTimeout(()=>c(!1),2e3)}catch(M){console.error("写入剪贴板失败:",M),alert(`复制失败。 + +提示:浏览器限制,多张图片会以 HTML 格式复制。 +可粘贴到 Word、富文本编辑器等。 + +如需单独使用,请使用"导出"功能。`)}}catch(H){console.error("复制图片失败:",H),alert("复制图片失败,请重试")}},se=async()=>{w(!0);try{const H=F?t:[e];if(H.length===1){const I=$e.getOriginalUrl(r,H[0].path),A=document.createElement("a");A.href=I,A.download=H[0].filename,A.target="_blank",document.body.appendChild(A),A.click(),document.body.removeChild(A)}else{const I=new hd,A=I.folder("images");b(0);for(let W=0;W{if(!n){alert("请先选择一个文件夹");return}T(!0),O(0);try{const H=i.filter(oe=>oe.folder&&oe.folder.startsWith(n));if(H.length===0){alert("当前文件夹没有图片");return}const I=new hd,A=n.split("/").pop()||"images",V=I.folder(A);for(let oe=0;oeH<1024?H+" B":H<1024*1024?(H/1024).toFixed(2)+" KB":(H/(1024*1024)).toFixed(2)+" MB",D=H=>new Date(H).toLocaleString("zh-CN");return S.jsxs("div",{className:"w-full border-l border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex flex-col h-full",children:[l&&S.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex items-center",children:S.jsxs("button",{onClick:()=>s("main"),className:"flex items-center gap-2 text-gray-700 dark:text-gray-300 hover:text-blue-500",children:[S.jsx(V1,{className:"w-5 h-5"}),S.jsx("span",{className:"text-sm font-medium",children:"返回"})]})}),S.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:S.jsxs("div",{className:"w-full aspect-square bg-gray-100 dark:bg-gray-700 rounded-lg overflow-hidden relative",children:[S.jsx("img",{src:p,alt:ee.filename,decoding:"async",className:`w-full h-full object-contain transition-opacity duration-300 ${x?"opacity-75":"opacity-100"}`}),x&&S.jsx("div",{className:"absolute top-2 right-2 bg-blue-500 text-white text-xs px-2 py-1 rounded",children:"加载原图中..."})]})}),S.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 min-h-0",children:S.jsxs("div",{children:[S.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2",children:"基本信息"}),S.jsxs("div",{className:"space-y-2 text-sm",children:[S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"文件名:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100 break-all",children:e.filename})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"尺寸:"}),S.jsxs("p",{className:"text-gray-900 dark:text-gray-100",children:[e.width," × ",e.height]})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"大小:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:$(e.size)})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"格式:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100 uppercase",children:e.format})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"创建时间:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:D(e.created_at)})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"修改时间:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:D(e.modified_at)})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"路径:"}),S.jsx("p",{className:"text-gray-900 dark:text-gray-100 text-xs break-all",children:e.path})]})]})]})}),!l&&S.jsxs("div",{className:"p-4 border-t border-gray-200 dark:border-gray-700 space-y-2 flex-shrink-0",children:[S.jsx("button",{onClick:q,className:`w-full flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all ${v?"bg-green-500 text-white":"bg-blue-500 text-white hover:bg-blue-600"}`,children:v?S.jsxs(S.Fragment,{children:[S.jsx(q1,{className:"w-4 h-4"}),S.jsxs("span",{children:["已复制",F?` ${t.length} 张`:""]})]}):S.jsxs(S.Fragment,{children:[S.jsx(Z1,{className:"w-4 h-4"}),S.jsxs("span",{children:["复制图片",F?` (${t.length})`:""]})]})}),S.jsxs("button",{onClick:se,disabled:d,className:"w-full flex flex-col items-center justify-center gap-2 px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Q1,{className:"w-4 h-4"}),S.jsx("span",{children:d?`打包中... ${k}%`:`导出图片${F?` (${t.length})`:""}`})]}),d&&F&&S.jsx("div",{className:"w-full bg-gray-300 dark:bg-gray-600 rounded-full h-1.5 mt-1",children:S.jsx("div",{className:"bg-blue-500 h-1.5 rounded-full transition-all duration-300",style:{width:`${k}%`}})})]}),n&&S.jsxs("button",{onClick:Q,disabled:N,className:"w-full flex flex-col items-center justify-center gap-2 px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(tw,{className:"w-4 h-4"}),S.jsx("span",{children:N?`打包文件夹... ${L}%`:"导出当前文件夹"})]}),N&&S.jsx("div",{className:"w-full bg-purple-300 rounded-full h-1.5 mt-1",children:S.jsx("div",{className:"bg-white h-1.5 rounded-full transition-all duration-300",style:{width:`${L}%`}})})]})]})]})}function md(){const{theme:e,toggleTheme:t,searchKeywords:r,thumbnailHeight:n,images:i,filteredImages:s,selectedFolder:o,currentLibraryId:a,setSearchKeywords:l,setThumbnailHeight:f,setFilteredImages:p,mobileView:y}=me(),[x,g]=Z.useState(!1),[m,u]=Z.useState([]),[v,c]=Z.useState([]),[d,w]=Z.useState(""),[k,b]=Z.useState(!1),[N,T]=Z.useState(!1),[L,O]=Z.useState(!1),[F,ee]=Z.useState(r),R=Z.useRef(null);Z.useEffect(()=>{const J=()=>{T(window.innerWidth<768)};return J(),window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]),Z.useEffect(()=>{u([]),c([]),w("")},[o]),Z.useEffect(()=>{if(a)return qf.start(a).catch(J=>{console.error("启动文件监控失败:",J)}),()=>{qf.stop(a).catch(J=>console.error("Stop watch error:",J))}},[a]);const U=J=>{ee(J),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{l(J)},300)};Z.useEffect(()=>{ee(r)},[r]),Z.useEffect(()=>()=>{R.current&&clearTimeout(R.current)},[]);const _=J=>{if(J.length===0)return[];const ae=[...J].sort((j,X)=>j-X),Y=ae[0],le=ae[ae.length-1];if(le-Y<10)return[q(Y,le)];const h=5,z=[],P=Math.log10(Y||1),E=(Math.log10(le)-P)/h;for(let j=0;jre>=X&&rej)},q=(J,ae,Y=!1)=>{const le=h=>{const z=P=>P<10?Math.round(P):P<100?Math.round(P/5)*5:P<1e3?Math.round(P/10)*10:Math.round(P/50)*50;return h<1?`${z(h*1024)}B`:h<1024?`${z(h)}KB`:h<1048576?`${z(h/1024)}MB`:`${z(h/1048576)}GB`};return Y?`> ${le(J)}`:`${le(J)} - ${le(ae)}`},se=J=>{const ae=J.match(/^(\d+(?:\.\d+)?)(B|KB|MB|GB)$/);if(!ae)return 0;const Y=parseFloat(ae[1]);switch(ae[2]){case"B":return Y/1024;case"KB":return Y;case"MB":return Y*1024;case"GB":return Y*1024*1024;default:return 0}},Q=(J,ae)=>{if(ae.startsWith(">")){const Y=ae.substring(1).trim(),le=se(Y);return J>=le}else if(ae.includes(" - ")){const[Y,le]=ae.split(" - ").map(P=>P.trim()),h=se(Y),z=se(le);return J>=h&&J{if(i.length===0)return{formats:[],sizes:[],hasHorizontal:!1,hasVertical:!1};const J=new Set,ae=[];let Y=!1,le=!1;i.forEach(z=>{z.format&&J.add(z.format.toLowerCase()),ae.push(z.size/1024),z.width>z.height&&(Y=!0),z.height>z.width&&(le=!0)});const h=_(ae);return{formats:Array.from(J).sort(),sizes:h,hasHorizontal:Y,hasVertical:le}},[i]),D=Z.useMemo(()=>{if(m.length===0&&v.length===0&&!d)return i;const J=new Set(m),ae=new Set(v);return i.filter(Y=>{var le;if(J.size>0&&!J.has((le=Y.format)==null?void 0:le.toLowerCase()))return!1;if(ae.size>0){const h=Y.size/1024;let z=!1;for(const P of ae)if(Q(h,P)){z=!0;break}if(!z)return!1}if(d==="horizontal"){if(Y.width<=Y.height)return!1}else if(d==="vertical"&&Y.height<=Y.width)return!1;return!0})},[i,m,v,d]);Z.useEffect(()=>{p(D)},[D,p]);const H=J=>{u(ae=>ae.includes(J)?ae.filter(Y=>Y!==J):[...ae,J])},I=J=>{c(ae=>ae.includes(J)?ae.filter(Y=>Y!==J):[...ae,J])},A=J=>{w(ae=>ae===J?"":J)},V=()=>{u([]),c([]),w("")},M=async()=>{t();try{await Cr.updateTheme(e==="light"?"dark":"light")}catch(J){console.error("Error saving theme:",J)}},W=async J=>{f(J);try{await Cr.updatePreferences({thumbnailHeight:J})}catch(ae){console.error("Error saving preferences:",ae)}},oe=async()=>{if(!(!a||k)){b(!0);try{await sn.sync(a)}catch(J){console.error("Error refreshing:",J),alert("刷新失败: "+J.message)}finally{b(!1)}}},he=$.formats,ce=$.sizes.map(J=>({label:J})),fe=[{value:"horizontal",label:"横图"},{value:"vertical",label:"竖图"}].filter(J=>J.value==="horizontal"&&$.hasHorizontal||J.value==="vertical"&&$.hasVertical);if(N){const J=y!=="sidebar";return S.jsxs("header",{className:"border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[S.jsxs("div",{className:"h-14 flex items-center justify-between px-4",children:[S.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"FlyPic"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{onClick:oe,disabled:!a||k,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50",children:S.jsx(Zf,{className:`w-5 h-5 text-gray-700 dark:text-gray-300 ${k?"animate-spin":""}`})}),S.jsx("button",{onClick:()=>O(!L),className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:S.jsx(Qf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})}),S.jsx("button",{onClick:M,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:e==="light"?S.jsx(Yf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}):S.jsx(Gf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})})]})]}),J&&S.jsx("div",{className:"px-4 pb-3",children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("div",{className:"flex-1 relative",children:[S.jsx(Bo,{className:"absolute left-3 top-2.5 w-5 h-5 text-gray-400"}),S.jsx("input",{type:"text",placeholder:"搜索图片...",value:r,onChange:ae=>U(ae.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm"})]}),S.jsx("button",{onClick:()=>g(!x),className:`p-2 border rounded-lg ${m.length>0||v.length>0||d?"border-blue-500 bg-blue-50 dark:bg-blue-500/20":"border-gray-300 dark:border-gray-600"}`,children:S.jsx(Xf,{className:`w-5 h-5 ${m.length>0||v.length>0||d?"text-blue-600 dark:text-blue-300":"text-gray-600 dark:text-gray-400"}`})})]})}),L&&S.jsx("div",{className:"px-4 pb-3 border-t border-gray-200 dark:border-gray-700 pt-3",children:S.jsxs("div",{className:"flex flex-col gap-3",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"缩略图大小"}),S.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[n,"px"]})]}),S.jsx("input",{type:"range",min:"150",max:"300",value:n,onChange:ae=>W(parseInt(ae.target.value)),className:"w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #3b82f6 0%, #3b82f6 ${(n-150)/150*100}%, #e5e7eb ${(n-150)/150*100}%, #e5e7eb 100%)`}})]})}),J&&x&&S.jsxs("div",{className:"px-4 pb-3 border-t border-gray-200 dark:border-gray-700 pt-3",children:[S.jsxs("div",{className:"flex items-center justify-between mb-3",children:[S.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"筛选条件"}),S.jsx("button",{onClick:V,className:"text-xs text-blue-500",children:"清除全部"})]}),S.jsxs("div",{className:"mb-3",children:[S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"格式"}),S.jsx("div",{className:"flex flex-wrap gap-2",children:he.map(ae=>S.jsx("button",{onClick:()=>H(ae),className:`px-3 py-1 text-xs rounded-full ${m.includes(ae)?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:ae.toUpperCase()},ae))})]}),S.jsxs("div",{className:"mb-3",children:[S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"尺寸"}),S.jsx("div",{className:"flex flex-wrap gap-2",children:ce.map(ae=>S.jsx("button",{onClick:()=>I(ae.label),className:`px-3 py-1 text-xs rounded-full ${v.includes(ae.label)?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:ae.label},ae.label))})]}),S.jsxs("div",{children:[S.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"方向"}),S.jsx("div",{className:"flex flex-wrap gap-2",children:fe.map(ae=>S.jsx("button",{onClick:()=>A(ae.value),className:`px-3 py-1 text-xs rounded-full ${d===ae.value?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:ae.label},ae.value))})]})]})]})}return S.jsxs("header",{className:"border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[S.jsxs("div",{className:"h-14 flex items-center justify-between px-6",children:[S.jsxs("div",{className:"flex-shrink-0",children:[S.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"FlyPic"}),S.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"轻量快速的图片素材库管理"})]}),S.jsxs("div",{className:"flex-1 max-w-2xl mx-6 flex items-center gap-3",children:[S.jsxs("div",{className:"flex-1 relative",children:[S.jsx(Bo,{className:"absolute left-3 top-2.5 w-5 h-5 text-gray-400"}),S.jsx("input",{type:"text",placeholder:"搜索图片... (多个关键词用空格分隔,即时搜索)",value:F,onChange:J=>U(J.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),S.jsxs("button",{onClick:()=>g(!x),className:`relative p-2 border rounded-lg transition-colors ${m.length>0||v.length>0||d?"border-blue-500 dark:border-blue-400 bg-blue-50 dark:bg-blue-500/20 hover:bg-blue-100 dark:hover:bg-blue-500/30":"border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"}`,title:m.length>0||v.length>0||d?"筛选(已启用)":"筛选",children:[S.jsx(Xf,{className:`w-5 h-5 ${m.length>0||v.length>0||d?"text-blue-600 dark:text-blue-300":"text-gray-600 dark:text-gray-400"}`}),(m.length>0||v.length>0||d)&&S.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full",style:{backgroundColor:"#3b82f6"}})]})]}),S.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[S.jsx(Qf,{className:"w-4 h-4 text-gray-500"}),S.jsx("input",{type:"range",min:"150",max:"300",value:n,onChange:J=>W(parseInt(J.target.value)),className:"w-32"}),S.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 w-12",children:[n,"px"]}),S.jsx("button",{onClick:oe,disabled:!a||k,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed ml-2",title:"手动刷新素材库(文件监控已自动启用)",children:S.jsx(Zf,{className:`w-5 h-5 text-gray-700 dark:text-gray-300 ${k?"animate-spin":""}`})}),S.jsx("button",{onClick:M,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:e==="light"?"切换到暗色模式":"切换到亮色模式",children:e==="light"?S.jsx(Yf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}):S.jsx(Gf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})})]})]}),x&&S.jsx("div",{className:"px-6 pb-3",children:S.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[S.jsxs("div",{className:"flex items-center justify-between mb-3",children:[S.jsx("div",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"筛选条件(实时生效)"}),S.jsx("button",{onClick:V,className:"text-xs text-blue-500 hover:text-blue-600 dark:hover:text-blue-400",children:"清除全部"})]}),S.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"格式"}),S.jsx("div",{className:"flex flex-col gap-1.5",children:$.formats.length>0?$.formats.map(J=>S.jsx("button",{onClick:()=>H(J),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${m.includes(J)?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:J.toUpperCase()},J)):S.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无格式数据"})})]}),S.jsxs("div",{children:[S.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"文件大小"}),S.jsx("div",{className:"flex flex-col gap-1.5",children:$.sizes.length>0?$.sizes.map(J=>S.jsx("button",{onClick:()=>I(J),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${v.includes(J)?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:J},J)):S.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无大小数据"})})]}),S.jsxs("div",{children:[S.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"图片方向"}),S.jsxs("div",{className:"flex flex-col gap-1.5",children:[$.hasHorizontal&&S.jsx("button",{onClick:()=>A("horizontal"),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${d==="horizontal"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:"横图"}),$.hasVertical&&S.jsx("button",{onClick:()=>A("vertical"),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${d==="vertical"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:"竖图"}),!$.hasHorizontal&&!$.hasVertical&&S.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无方向数据"})]})]})]})]})})]})}function Yw(){const{theme:e,setLibraries:t,setCurrentLibrary:r,setScanProgress:n,mobileView:i,setMobileView:s,selectedImage:o}=me(),[a,l]=Z.useState(256),[f,p]=Z.useState(320),[y,x]=Z.useState(!1),[g,m]=Z.useState(!1),[u,v]=Z.useState(!1),c=Z.useRef(null);Z.useEffect(()=>{e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),Z.useEffect(()=>{const k=()=>{const b=window.innerWidth<768;v(b)};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]),Z.useEffect(()=>{u&&o&&s("detail")},[o,u,s]),Z.useEffect(()=>{const k=window.location.origin;console.log("🔌 Connecting to Socket.IO:",k);const b=co(k,{transports:["websocket","polling"],reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:5});return b.on("connect",()=>{console.log("✅ Socket.IO connected:",b.id)}),b.on("disconnect",()=>{console.log("❌ Socket.IO disconnected")}),b.on("connect_error",N=>{console.error("❌ Socket.IO connection error:",N)}),b.on("scanProgress",N=>{const T=me.getState().currentLibraryId;N.libraryId===T&&n(N)}),b.on("scanComplete",({libraryId:N,results:T})=>{console.log("📊 Scan complete:",{libraryId:N,results:T});const L=me.getState().currentLibraryId;if(console.log("🔍 Current library:",L,"Scan library:",N,"Match:",N===L),N===L){console.log("🔄 Reloading folders and images...");const O=me.getState(),F={keywords:O.searchKeywords,...O.filters};O.selectedFolder&&(F.folder=O.selectedFolder),Promise.all([$e.getFolders(N),O.selectedFolder||O.searchKeywords||O.filters.formats.length>0?$e.search(N,F):Promise.resolve({data:{images:[]}}),$e.getCount(N)]).then(([ee,R,U])=>{me.getState().setFolders(ee.data.folders),me.getState().setImages(R.data.images),me.getState().setTotalImageCount(U.data.count),console.log(`✅ Data reloaded, total: ${U.data.count}`)}).catch(ee=>{console.error("❌ Error reloading data:",ee)}).finally(()=>{n(null),console.log("✅ Scan progress cleared")})}else console.log("⚠️ Library mismatch, skipping reload"),n(null)}),b.on("scanError",({libraryId:N,error:T})=>{n(null),console.error("Scan error:",T)}),b.on("scanPaused",({libraryId:N,results:T})=>{console.log("⏸️ Scan paused:",{libraryId:N,results:T})}),d(),()=>{b.disconnect()}},[]);const d=async()=>{try{const k=await Cr.getAll(),{libraries:b,currentLibraryId:N,theme:T,preferences:L}=k.data;if(t(b),r(N),T&&me.getState().setTheme(T),L){const{thumbnailHeight:O,leftPanelWidth:F,rightPanelWidth:ee}=L;O&&me.getState().setThumbnailHeight(O),F&&l(F),ee&&p(ee)}if(N){const[O]=await Promise.all([$e.getFolders(N)]);me.getState().setFolders(O.data.folders);try{const F=await $e.getCount(N);me.getState().setTotalImageCount(F.data.count)}catch(F){console.error("Failed to get image count:",F)}console.log("📂 数据加载完成,文件监控器将自动检测变化"),sn.getStatus(N).then(F=>{const{status:ee,progress:R,pendingCount:U}=F.data;(ee==="scanning"||ee==="paused")&&(console.log(`🔄 恢复扫描状态: ${ee}, 进度: ${(R==null?void 0:R.percent)||0}%`),n({...R,canStop:!0,isPaused:ee==="paused",pendingCount:U}))}).catch(()=>{})}}catch(k){console.error("Error loading libraries:",k)}},w=async(k,b)=>{try{await Cr.updatePreferences({leftPanelWidth:k,rightPanelWidth:b})}catch(N){console.error("Error saving panel widths:",N)}};return Z.useEffect(()=>{if(!y&&!g)return;const k=document.getElementById("left-panel"),b=document.getElementById("right-panel");let N=a,T=f;const L=c.current.getBoundingClientRect(),O=L.left,F=L.right;let ee=null,R=null,U=null;const _=()=>{k&&R!=null&&(k.style.width=`${R}px`,N=R),b&&U!=null&&(b.style.width=`${U}px`,T=U),ee=null,R=null,U=null},q=Q=>{let $=!1;if(y&&k){const D=Q.clientX-O;D>=200&&D<=400&&(R=D,$=!0)}if(g&&b){const D=F-Q.clientX;D>=280&&D<=500&&(U=D,$=!0)}$&&ee==null&&(ee=requestAnimationFrame(_))},se=()=>{ee&&(cancelAnimationFrame(ee),_()),l(N),p(T),w(N,T),x(!1),m(!1),me.getState().setIsResizingPanels(!1),me.getState().setResizingSide(null)};return document.addEventListener("mousemove",q,{passive:!0}),document.addEventListener("mouseup",se),document.body.style.userSelect="none",document.body.style.cursor="col-resize",k&&(k.style.transition="none"),b&&(b.style.transition="none"),()=>{ee&&(cancelAnimationFrame(ee),ee=null),document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",se),document.body.style.userSelect="",document.body.style.cursor="",k&&(k.style.transition=""),b&&(b.style.transition="")}},[y,g]),u?S.jsxs("div",{className:"flex flex-col h-screen bg-gray-50 dark:bg-gray-900",children:[S.jsx(md,{}),S.jsxs("div",{className:"flex-1 overflow-hidden relative",children:[S.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="sidebar"?"translate-x-0":"-translate-x-full"}`,children:S.jsx(ed,{})}),S.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="main"?"translate-x-0":i==="sidebar"?"translate-x-full":"-translate-x-full"}`,children:S.jsx(dd,{})}),S.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="detail"?"translate-x-0":"translate-x-full"}`,children:S.jsx(pd,{})})]}),S.jsxs("div",{className:"flex border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[S.jsxs("button",{onClick:()=>s("sidebar"),className:`flex-1 flex flex-col items-center py-2 ${i==="sidebar"?"text-blue-500":"text-gray-500"}`,children:[S.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),S.jsx("span",{className:"text-xs mt-1",children:"文件夹"})]}),S.jsxs("button",{onClick:()=>s("main"),className:`flex-1 flex flex-col items-center py-2 ${i==="main"?"text-blue-500":"text-gray-500"}`,children:[S.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),S.jsx("span",{className:"text-xs mt-1",children:"图片"})]}),S.jsxs("button",{onClick:()=>s("detail"),disabled:!o,className:`flex-1 flex flex-col items-center py-2 ${i==="detail"?"text-blue-500":"text-gray-500"} disabled:opacity-30`,children:[S.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),S.jsx("span",{className:"text-xs mt-1",children:"详情"})]})]})]}):S.jsxs("div",{className:"flex flex-col h-screen bg-gray-50 dark:bg-gray-900",children:[S.jsx(md,{}),S.jsxs("div",{ref:c,className:"flex flex-1 overflow-hidden",children:[S.jsx("div",{id:"left-panel",style:{width:`${a}px`},className:"flex-shrink-0 h-full",children:S.jsx(ed,{})}),S.jsx("div",{className:`group relative w-1 h-full cursor-col-resize flex-shrink-0 transition-colors ${y?"bg-blue-500":"bg-gray-200 dark:bg-gray-700 hover:bg-blue-400"}`,onMouseDown:k=>{k.preventDefault(),me.getState().setIsResizingPanels(!0),me.getState().setResizingSide("left"),x(!0)},children:S.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 w-5"})}),S.jsx("div",{className:"flex-1 min-w-0 h-full",children:S.jsx(dd,{})}),S.jsx("div",{className:`group relative w-1 h-full cursor-col-resize flex-shrink-0 transition-colors ${g?"bg-blue-500":"bg-gray-200 dark:bg-gray-700 hover:bg-blue-400"}`,onMouseDown:k=>{k.preventDefault(),me.getState().setIsResizingPanels(!0),me.getState().setResizingSide("right"),m(!0)},children:S.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 w-5"})}),S.jsx("div",{id:"right-panel",style:{width:`${f}px`},className:"flex-shrink-0 h-full",children:S.jsx(pd,{})})]})]})}Za.createRoot(document.getElementById("root")).render(S.jsx(ke.StrictMode,{children:S.jsx(Yw,{})})); diff --git a/flypic/app/server/public/assets/index-Ct4ORqFz.js b/flypic/app/server/public/assets/index-Ct4ORqFz.js deleted file mode 100644 index 573ea8d..0000000 --- a/flypic/app/server/public/assets/index-Ct4ORqFz.js +++ /dev/null @@ -1,186 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var ws=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jf={exports:{}},jo={},ed={exports:{}},_e={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var us=Symbol.for("react.element"),rm=Symbol.for("react.portal"),im=Symbol.for("react.fragment"),sm=Symbol.for("react.strict_mode"),om=Symbol.for("react.profiler"),am=Symbol.for("react.provider"),lm=Symbol.for("react.context"),um=Symbol.for("react.forward_ref"),cm=Symbol.for("react.suspense"),fm=Symbol.for("react.memo"),dm=Symbol.for("react.lazy"),nc=Symbol.iterator;function hm(e){return e===null||typeof e!="object"?null:(e=nc&&e[nc]||e["@@iterator"],typeof e=="function"?e:null)}var td={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nd=Object.assign,rd={};function pi(e,t,n){this.props=e,this.context=t,this.refs=rd,this.updater=n||td}pi.prototype.isReactComponent={};pi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};pi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function id(){}id.prototype=pi.prototype;function Zl(e,t,n){this.props=e,this.context=t,this.refs=rd,this.updater=n||td}var Ql=Zl.prototype=new id;Ql.constructor=Zl;nd(Ql,pi.prototype);Ql.isPureReactComponent=!0;var rc=Array.isArray,sd=Object.prototype.hasOwnProperty,Gl={current:null},od={key:!0,ref:!0,__self:!0,__source:!0};function ad(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)sd.call(t,r)&&!od.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,A=H[O];if(0>>1;Oi(V,j))cei(Y,V)?(H[O]=Y,H[ce]=j,O=ce):(H[O]=V,H[q]=j,O=q);else if(cei(Y,j))H[O]=Y,H[ce]=j,O=ce;else break e}}return z}function i(H,z){var j=H.sortIndex-z.sortIndex;return j!==0?j:H.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,y=null,w=3,p=!1,g=!1,d=!1,_=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(H){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=H)r(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=n(u)}}function k(H){if(d=!1,x(H),!g)if(n(l)!==null)g=!0,se(R);else{var z=n(u);z!==null&&X(k,z.startTime-H)}}function R(H,z){g=!1,d&&(d=!1,c(L),L=-1),p=!0;var j=w;try{for(x(z),y=n(l);y!==null&&(!(y.expirationTime>z)||H&&!re());){var O=y.callback;if(typeof O=="function"){y.callback=null,w=y.priorityLevel;var A=O(y.expirationTime<=z);z=e.unstable_now(),typeof A=="function"?y.callback=A:y===n(l)&&r(l),x(z)}else r(l);y=n(l)}if(y!==null)var J=!0;else{var q=n(u);q!==null&&X(k,q.startTime-z),J=!1}return J}finally{y=null,w=j,p=!1}}var E=!1,N=null,L=-1,P=5,I=-1;function re(){return!(e.unstable_now()-IH||125O?(H.sortIndex=j,t(u,H),n(l)===null&&H===n(u)&&(d?(c(L),L=-1):d=!0,X(k,j-O))):(H.sortIndex=A,t(l,H),g||p||(g=!0,se(R))),H},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(H){var z=w;return function(){var j=w;w=z;try{return H.apply(this,arguments)}finally{w=j}}}})(dd);fd.exports=dd;var bm=fd.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Em=ne,Ct=bm;function te(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$a=Object.prototype.hasOwnProperty,Cm=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,sc={},oc={};function Nm(e){return $a.call(oc,e)?!0:$a.call(sc,e)?!1:Cm.test(e)?oc[e]=!0:(sc[e]=!0,!1)}function Rm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Tm(e,t,n,r){if(t===null||typeof t>"u"||Rm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ht(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Je[e]=new ht(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Je[t]=new ht(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Je[e]=new ht(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Je[e]=new ht(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Je[e]=new ht(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Je[e]=new ht(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Je[e]=new ht(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Je[e]=new ht(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Je[e]=new ht(e,5,!1,e.toLowerCase(),null,!1,!1)});var eu=/[\-:]([a-z])/g;function tu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(eu,tu);Je[t]=new ht(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(eu,tu);Je[t]=new ht(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(eu,tu);Je[t]=new ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Je[e]=new ht(e,1,!1,e.toLowerCase(),null,!1,!1)});Je.xlinkHref=new ht("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Je[e]=new ht(e,1,!1,e.toLowerCase(),null,!0,!0)});function nu(e,t,n,r){var i=Je.hasOwnProperty(t)?Je[t]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{la=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Pi(e):""}function Om(e){switch(e.tag){case 5:return Pi(e.type);case 16:return Pi("Lazy");case 13:return Pi("Suspense");case 19:return Pi("SuspenseList");case 0:case 2:case 15:return e=ua(e.type,!1),e;case 11:return e=ua(e.type.render,!1),e;case 1:return e=ua(e.type,!0),e;default:return""}}function qa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ur:return"Fragment";case Mr:return"Portal";case Wa:return"Profiler";case ru:return"StrictMode";case Ha:return"Suspense";case Va:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case md:return(e.displayName||"Context")+".Consumer";case pd:return(e._context.displayName||"Context")+".Provider";case iu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case su:return t=e.displayName||null,t!==null?t:qa(e.type)||"Memo";case $n:t=e._payload,e=e._init;try{return qa(e(t))}catch{}}return null}function Am(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return qa(t);case 8:return t===ru?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ir(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Pm(e){var t=yd(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ks(e){e._valueTracker||(e._valueTracker=Pm(e))}function vd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=yd(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function lo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ka(e,t){var n=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function lc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ir(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function wd(e,t){t=t.checked,t!=null&&nu(e,"checked",t,!1)}function Xa(e,t){wd(e,t);var n=ir(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ya(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ya(e,t.type,ir(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ya(e,t,n){(t!=="number"||lo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zi=Array.isArray;function Gr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ss.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ki(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zm=["Webkit","ms","Moz","O"];Object.keys(Fi).forEach(function(e){zm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fi[t]=Fi[e]})});function Sd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Fi.hasOwnProperty(e)&&Fi[e]?(""+t).trim():t+"px"}function bd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Sd(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Lm=Be({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ga(e,t){if(t){if(Lm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function Ja(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var el=null;function ou(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tl=null,Jr=null,ei=null;function dc(e){if(e=ds(e)){if(typeof tl!="function")throw Error(te(280));var t=e.stateNode;t&&(t=Mo(t),tl(e.stateNode,e.type,t))}}function Ed(e){Jr?ei?ei.push(e):ei=[e]:Jr=e}function Cd(){if(Jr){var e=Jr,t=ei;if(ei=Jr=null,dc(e),t)for(e=0;e>>=0,e===0?32:31-(Vm(e)/qm|0)|0}var bs=64,Es=4194304;function Li(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ho(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Li(a):(s&=o,s!==0&&(r=Li(s)))}else o=n&~i,o!==0?r=Li(o):s!==0&&(r=Li(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function cs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xt(t),e[t]=n}function Zm(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Di),_c=" ",kc=!1;function qd(e,t){switch(e){case"keyup":return b0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $r=!1;function C0(e,t){switch(e){case"compositionend":return Kd(t);case"keypress":return t.which!==32?null:(kc=!0,_c);case"textInput":return e=t.data,e===_c&&kc?null:e;default:return null}}function N0(e,t){if($r)return e==="compositionend"||!pu&&qd(e,t)?(e=Hd(),qs=fu=Kn=null,$r=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cc(n)}}function Qd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gd(){for(var e=window,t=lo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=lo(e.document)}return t}function mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function I0(e){var t=Gd(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Qd(n.ownerDocument.documentElement,n)){if(r!==null&&mu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Nc(n,s);var o=Nc(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Wr=null,al=null,Ui=null,ll=!1;function Rc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ll||Wr==null||Wr!==lo(r)||(r=Wr,"selectionStart"in r&&mu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ui&&Ji(Ui,r)||(Ui=r,r=go(al,"onSelect"),0qr||(e.current=pl[qr],pl[qr]=null,qr--)}function Oe(e,t){qr++,pl[qr]=e.current,e.current=t}var sr={},st=ar(sr),gt=ar(!1),Sr=sr;function oi(e,t){var n=e.type.contextTypes;if(!n)return sr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function yt(e){return e=e.childContextTypes,e!=null}function vo(){Le(gt),Le(st)}function jc(e,t,n){if(st.current!==sr)throw Error(te(168));Oe(st,t),Oe(gt,n)}function ah(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(te(108,Am(e)||"Unknown",i));return Be({},n,r)}function wo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sr,Sr=st.current,Oe(st,e),Oe(gt,gt.current),!0}function Ic(e,t,n){var r=e.stateNode;if(!r)throw Error(te(169));n?(e=ah(e,t,Sr),r.__reactInternalMemoizedMergedChildContext=e,Le(gt),Le(st),Oe(st,e)):Le(gt),Oe(gt,n)}var En=null,Uo=!1,Sa=!1;function lh(e){En===null?En=[e]:En.push(e)}function X0(e){Uo=!0,lh(e)}function lr(){if(!Sa&&En!==null){Sa=!0;var e=0,t=Ne;try{var n=En;for(Ne=1;e>=o,i-=o,Nn=1<<32-Xt(t)+i|n<L?(P=N,N=null):P=N.sibling;var I=w(c,N,x[L],k);if(I===null){N===null&&(N=P);break}e&&N&&I.alternate===null&&t(c,N),f=s(I,f,L),E===null?R=I:E.sibling=I,E=I,N=P}if(L===x.length)return n(c,N),je&&hr(c,L),R;if(N===null){for(;LL?(P=N,N=null):P=N.sibling;var re=w(c,N,I.value,k);if(re===null){N===null&&(N=P);break}e&&N&&re.alternate===null&&t(c,N),f=s(re,f,L),E===null?R=re:E.sibling=re,E=re,N=P}if(I.done)return n(c,N),je&&hr(c,L),R;if(N===null){for(;!I.done;L++,I=x.next())I=y(c,I.value,k),I!==null&&(f=s(I,f,L),E===null?R=I:E.sibling=I,E=I);return je&&hr(c,L),R}for(N=r(c,N);!I.done;L++,I=x.next())I=p(N,c,L,I.value,k),I!==null&&(e&&I.alternate!==null&&N.delete(I.key===null?L:I.key),f=s(I,f,L),E===null?R=I:E.sibling=I,E=I);return e&&N.forEach(function(T){return t(c,T)}),je&&hr(c,L),R}function _(c,f,x,k){if(typeof x=="object"&&x!==null&&x.type===Ur&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case _s:e:{for(var R=x.key,E=f;E!==null;){if(E.key===R){if(R=x.type,R===Ur){if(E.tag===7){n(c,E.sibling),f=i(E,x.props.children),f.return=c,c=f;break e}}else if(E.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===$n&&Dc(R)===E.type){n(c,E.sibling),f=i(E,x.props),f.ref=Ni(c,E,x),f.return=c,c=f;break e}n(c,E);break}else t(c,E);E=E.sibling}x.type===Ur?(f=_r(x.props.children,c.mode,k,x.key),f.return=c,c=f):(k=eo(x.type,x.key,x.props,null,c.mode,k),k.ref=Ni(c,f,x),k.return=c,c=k)}return o(c);case Mr:e:{for(E=x.key;f!==null;){if(f.key===E)if(f.tag===4&&f.stateNode.containerInfo===x.containerInfo&&f.stateNode.implementation===x.implementation){n(c,f.sibling),f=i(f,x.children||[]),f.return=c,c=f;break e}else{n(c,f);break}else t(c,f);f=f.sibling}f=Aa(x,c.mode,k),f.return=c,c=f}return o(c);case $n:return E=x._init,_(c,f,E(x._payload),k)}if(zi(x))return g(c,f,x,k);if(ki(x))return d(c,f,x,k);Ps(c,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,f!==null&&f.tag===6?(n(c,f.sibling),f=i(f,x),f.return=c,c=f):(n(c,f),f=Oa(x,c.mode,k),f.return=c,c=f),o(c)):n(c,f)}return _}var li=dh(!0),hh=dh(!1),ko=ar(null),So=null,Yr=null,wu=null;function xu(){wu=Yr=So=null}function _u(e){var t=ko.current;Le(ko),e._currentValue=t}function yl(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ni(e,t){So=e,wu=Yr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mt=!0),e.firstContext=null)}function Dt(e){var t=e._currentValue;if(wu!==e)if(e={context:e,memoizedValue:t,next:null},Yr===null){if(So===null)throw Error(te(308));Yr=e,So.dependencies={lanes:0,firstContext:e}}else Yr=Yr.next=e;return t}var yr=null;function ku(e){yr===null?yr=[e]:yr.push(e)}function ph(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,ku(t)):(n.next=i.next,i.next=n),t.interleaved=n,Pn(e,r)}function Pn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Wn=!1;function Su(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Tn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Jn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ee&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Pn(e,n)}return i=r.interleaved,i===null?(t.next=t,ku(r)):(t.next=i.next,i.next=t),r.interleaved=t,Pn(e,n)}function Xs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lu(e,n)}}function Mc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function bo(e,t,n,r){var i=e.updateQueue;Wn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=u:a.next=u,h.lastBaseUpdate=l))}if(s!==null){var y=i.baseState;o=0,h=u=l=null,a=s;do{var w=a.lane,p=a.eventTime;if((r&w)===w){h!==null&&(h=h.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,d=a;switch(w=t,p=n,d.tag){case 1:if(g=d.payload,typeof g=="function"){y=g.call(p,y,w);break e}y=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=d.payload,w=typeof g=="function"?g.call(p,y,w):g,w==null)break e;y=Be({},y,w);break e;case 2:Wn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,w=i.effects,w===null?i.effects=[a]:w.push(a))}else p={eventTime:p,lane:w,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(u=h=p,l=y):h=h.next=p,o|=w;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;w=a,a=w.next,w.next=null,i.lastBaseUpdate=w,i.shared.pending=null}}while(!0);if(h===null&&(l=y),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Cr|=o,e.lanes=o,e.memoizedState=y}}function Uc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ea.transition;Ea.transition={};try{e(!1),t()}finally{Ne=n,Ea.transition=r}}function Ph(){return Mt().memoizedState}function G0(e,t,n){var r=tr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},zh(e))Lh(t,n);else if(n=ph(e,t,n,r),n!==null){var i=ft();Yt(n,e,r,i),jh(n,t,r)}}function J0(e,t,n){var r=tr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(zh(e))Lh(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Zt(a,o)){var l=t.interleaved;l===null?(i.next=i,ku(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=ph(e,t,i,r),n!==null&&(i=ft(),Yt(n,e,r,i),jh(n,t,r))}}function zh(e){var t=e.alternate;return e===Fe||t!==null&&t===Fe}function Lh(e,t){$i=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lu(e,n)}}var No={readContext:Dt,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useInsertionEffect:tt,useLayoutEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useMutableSource:tt,useSyncExternalStore:tt,useId:tt,unstable_isNewReconciler:!1},eg={readContext:Dt,useCallback:function(e,t){return an().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Wc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zs(4194308,4,Nh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zs(4,2,e,t)},useMemo:function(e,t){var n=an();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=an();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=G0.bind(null,Fe,e),[r.memoizedState,e]},useRef:function(e){var t=an();return e={current:e},t.memoizedState=e},useState:$c,useDebugValue:Au,useDeferredValue:function(e){return an().memoizedState=e},useTransition:function(){var e=$c(!1),t=e[0];return e=Q0.bind(null,e[1]),an().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Fe,i=an();if(je){if(n===void 0)throw Error(te(407));n=n()}else{if(n=t(),Xe===null)throw Error(te(349));Er&30||wh(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Wc(_h.bind(null,r,s,e),[e]),r.flags|=2048,as(9,xh.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=an(),t=Xe.identifierPrefix;if(je){var n=Rn,r=Nn;n=(r&~(1<<32-Xt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ss++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ln]=t,e[ns]=r,Vh(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ja(n,r),n){case"dialog":ze("cancel",e),ze("close",e),i=r;break;case"iframe":case"object":case"embed":ze("load",e),i=r;break;case"video":case"audio":for(i=0;ifi&&(t.flags|=128,r=!0,Ri(s,!1),t.lanes=4194304)}else{if(!r)if(e=Eo(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ri(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!je)return nt(t),null}else 2*Me()-s.renderingStartTime>fi&&n!==1073741824&&(t.flags|=128,r=!0,Ri(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Me(),t.sibling=null,n=Ie.current,Oe(Ie,r?n&1|2:n&1),t):(nt(t),null);case 22:case 23:return Fu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?St&1073741824&&(nt(t),t.subtreeFlags&6&&(t.flags|=8192)):nt(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function lg(e,t){switch(yu(t),t.tag){case 1:return yt(t.type)&&vo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ui(),Le(gt),Le(st),Cu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Eu(t),null;case 13:if(Le(Ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));ai()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Le(Ie),null;case 4:return ui(),null;case 10:return _u(t.type._context),null;case 22:case 23:return Fu(),null;case 24:return null;default:return null}}var Ls=!1,rt=!1,ug=typeof WeakSet=="function"?WeakSet:Set,le=null;function Zr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){De(e,t,r)}else n.current=null}function Cl(e,t,n){try{n()}catch(r){De(e,t,r)}}var ef=!1;function cg(e,t){if(ul=po,e=Gd(),mu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,h=0,y=e,w=null;t:for(;;){for(var p;y!==n||i!==0&&y.nodeType!==3||(a=o+i),y!==s||r!==0&&y.nodeType!==3||(l=o+r),y.nodeType===3&&(o+=y.nodeValue.length),(p=y.firstChild)!==null;)w=y,y=p;for(;;){if(y===e)break t;if(w===n&&++u===i&&(a=o),w===s&&++h===r&&(l=o),(p=y.nextSibling)!==null)break;y=w,w=y.parentNode}y=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(cl={focusedElem:e,selectionRange:n},po=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var d=g.memoizedProps,_=g.memoizedState,c=t.stateNode,f=c.getSnapshotBeforeUpdate(t.elementType===t.type?d:Ht(t.type,d),_);c.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(k){De(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return g=ef,ef=!1,g}function Wi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Cl(t,n,s)}i=i.next}while(i!==r)}}function Ho(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Nl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Xh(e){var t=e.alternate;t!==null&&(e.alternate=null,Xh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ln],delete t[ns],delete t[hl],delete t[q0],delete t[K0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Yh(e){return e.tag===5||e.tag===3||e.tag===4}function tf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yo));else if(r!==4&&(e=e.child,e!==null))for(Rl(e,t,n),e=e.sibling;e!==null;)Rl(e,t,n),e=e.sibling}function Tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Tl(e,t,n),e=e.sibling;e!==null;)Tl(e,t,n),e=e.sibling}var Ze=null,Vt=!1;function Un(e,t,n){for(n=n.child;n!==null;)Zh(e,t,n),n=n.sibling}function Zh(e,t,n){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(Io,n)}catch{}switch(n.tag){case 5:rt||Zr(n,t);case 6:var r=Ze,i=Vt;Ze=null,Un(e,t,n),Ze=r,Vt=i,Ze!==null&&(Vt?(e=Ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ze.removeChild(n.stateNode));break;case 18:Ze!==null&&(Vt?(e=Ze,n=n.stateNode,e.nodeType===8?ka(e.parentNode,n):e.nodeType===1&&ka(e,n),Qi(e)):ka(Ze,n.stateNode));break;case 4:r=Ze,i=Vt,Ze=n.stateNode.containerInfo,Vt=!0,Un(e,t,n),Ze=r,Vt=i;break;case 0:case 11:case 14:case 15:if(!rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Cl(n,t,o),i=i.next}while(i!==r)}Un(e,t,n);break;case 1:if(!rt&&(Zr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){De(n,t,a)}Un(e,t,n);break;case 21:Un(e,t,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,Un(e,t,n),rt=r):Un(e,t,n);break;default:Un(e,t,n)}}function nf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ug),t.forEach(function(r){var i=wg.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Wt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dg(r/1960))-r,10e?16:e,Xn===null)var r=!1;else{if(e=Xn,Xn=null,Oo=0,Ee&6)throw Error(te(331));var i=Ee;for(Ee|=4,le=e.current;le!==null;){var s=le,o=s.child;if(le.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lMe()-ju?xr(e,0):Lu|=n),vt(e,t)}function ip(e,t){t===0&&(e.mode&1?(t=Es,Es<<=1,!(Es&130023424)&&(Es=4194304)):t=1);var n=ft();e=Pn(e,t),e!==null&&(cs(e,t,n),vt(e,n))}function vg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ip(e,n)}function wg(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(t),ip(e,n)}var sp;sp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||gt.current)mt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return mt=!1,og(e,t,n);mt=!!(e.flags&131072)}else mt=!1,je&&t.flags&1048576&&uh(t,_o,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Qs(e,t),e=t.pendingProps;var i=oi(t,st.current);ni(t,n),i=Ru(null,t,r,e,i,n);var s=Tu();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,yt(r)?(s=!0,wo(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Su(t),i.updater=Wo,t.stateNode=i,i._reactInternals=t,wl(t,r,e,n),t=kl(null,t,r,!0,s,n)):(t.tag=0,je&&s&&gu(t),ut(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Qs(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=_g(r),e=Ht(r,e),i){case 0:t=_l(null,t,r,e,n);break e;case 1:t=Qc(null,t,r,e,n);break e;case 11:t=Yc(null,t,r,e,n);break e;case 14:t=Zc(null,t,r,Ht(r.type,e),n);break e}throw Error(te(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ht(r,i),_l(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ht(r,i),Qc(e,t,r,i,n);case 3:e:{if($h(t),e===null)throw Error(te(387));r=t.pendingProps,s=t.memoizedState,i=s.element,mh(e,t),bo(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=ci(Error(te(423)),t),t=Gc(e,t,r,n,i);break e}else if(r!==i){i=ci(Error(te(424)),t),t=Gc(e,t,r,n,i);break e}else for(bt=Gn(t.stateNode.containerInfo.firstChild),Et=t,je=!0,Kt=null,n=hh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ai(),r===i){t=zn(e,t,n);break e}ut(e,t,r,n)}t=t.child}return t;case 5:return gh(t),e===null&&gl(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,fl(r,i)?o=null:s!==null&&fl(r,s)&&(t.flags|=32),Uh(e,t),ut(e,t,o,n),t.child;case 6:return e===null&&gl(t),null;case 13:return Wh(e,t,n);case 4:return bu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=li(t,null,r,n):ut(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ht(r,i),Yc(e,t,r,i,n);case 7:return ut(e,t,t.pendingProps,n),t.child;case 8:return ut(e,t,t.pendingProps.children,n),t.child;case 12:return ut(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Oe(ko,r._currentValue),r._currentValue=o,s!==null)if(Zt(s.value,o)){if(s.children===i.children&&!gt.current){t=zn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Tn(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?l.next=l:(l.next=h.next,h.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),yl(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(te(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),yl(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ut(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ni(t,n),i=Dt(i),r=r(i),t.flags|=1,ut(e,t,r,n),t.child;case 14:return r=t.type,i=Ht(r,t.pendingProps),i=Ht(r.type,i),Zc(e,t,r,i,n);case 15:return Dh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ht(r,i),Qs(e,t),t.tag=1,yt(r)?(e=!0,wo(t)):e=!1,ni(t,n),Ih(t,r,i),wl(t,r,i,n),kl(null,t,r,!0,e,n);case 19:return Hh(e,t,n);case 22:return Mh(e,t,n)}throw Error(te(156,t.tag))};function op(e,t){return zd(e,t)}function xg(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(e,t,n,r){return new xg(e,t,n,r)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _g(e){if(typeof e=="function")return Du(e)?1:0;if(e!=null){if(e=e.$$typeof,e===iu)return 11;if(e===su)return 14}return 2}function nr(e,t){var n=e.alternate;return n===null?(n=Ft(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function eo(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Du(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ur:return _r(n.children,i,s,t);case ru:o=8,i|=8;break;case Wa:return e=Ft(12,n,t,i|2),e.elementType=Wa,e.lanes=s,e;case Ha:return e=Ft(13,n,t,i),e.elementType=Ha,e.lanes=s,e;case Va:return e=Ft(19,n,t,i),e.elementType=Va,e.lanes=s,e;case gd:return qo(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pd:o=10;break e;case md:o=9;break e;case iu:o=11;break e;case su:o=14;break e;case $n:o=16,r=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=Ft(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function _r(e,t,n,r){return e=Ft(7,e,r,t),e.lanes=n,e}function qo(e,t,n,r){return e=Ft(22,e,r,t),e.elementType=gd,e.lanes=n,e.stateNode={isHidden:!1},e}function Oa(e,t,n){return e=Ft(6,e,null,t),e.lanes=n,e}function Aa(e,t,n){return t=Ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kg(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fa(0),this.expirationTimes=fa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fa(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Mu(e,t,n,r,i,s,o,a,l){return e=new kg(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ft(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Su(s),e}function Sg(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cp)}catch(e){console.error(e)}}cp(),cd.exports=Nt;var fp=cd.exports,ff=fp;Ua.createRoot=ff.createRoot,Ua.hydrateRoot=ff.hydrateRoot;const dn=Object.create(null);dn.open="0";dn.close="1";dn.ping="2";dn.pong="3";dn.message="4";dn.upgrade="5";dn.noop="6";const to=Object.create(null);Object.keys(dn).forEach(e=>{to[dn[e]]=e});const Ll={type:"error",data:"parser error"},dp=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",hp=typeof ArrayBuffer=="function",pp=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Hu=({type:e,data:t},n,r)=>dp&&t instanceof Blob?n?r(t):df(t,r):hp&&(t instanceof ArrayBuffer||pp(t))?n?r(t):df(new Blob([t]),r):r(dn[e]+(t||"")),df=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function hf(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Pa;function Rg(e,t){if(dp&&e.data instanceof Blob)return e.data.arrayBuffer().then(hf).then(t);if(hp&&(e.data instanceof ArrayBuffer||pp(e.data)))return t(hf(e.data));Hu(e,!1,n=>{Pa||(Pa=new TextEncoder),t(Pa.encode(n))})}const pf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ii=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),h=new Uint8Array(u);for(r=0;r>4,h[i++]=(o&15)<<4|a>>2,h[i++]=(a&3)<<6|l&63;return u},Og=typeof ArrayBuffer=="function",Vu=(e,t)=>{if(typeof e!="string")return{type:"message",data:mp(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Ag(e.substring(1),t)}:to[n]?e.length>1?{type:to[n],data:e.substring(1)}:{type:to[n]}:Ll},Ag=(e,t)=>{if(Og){const n=Tg(e);return mp(n,t)}else return{base64:!0,data:e}},mp=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},gp="",Pg=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Hu(s,!1,a=>{r[o]=a,++i===n&&t(r.join(gp))})})},zg=(e,t)=>{const n=e.split(gp),r=[];for(let i=0;i{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let za;function Fs(e){return e.reduce((t,n)=>t+n.length,0)}function Bs(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;iMath.pow(2,21)-1){a.enqueue(Ll);break}i=h*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Fs(n)e){a.enqueue(Ll);break}}}})}const yp=4;function $e(e){if(e)return Ig(e)}function Ig(e){for(var t in $e.prototype)e[t]=$e.prototype[t];return e}$e.prototype.on=$e.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};$e.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};$e.prototype.off=$e.prototype.removeListener=$e.prototype.removeAllListeners=$e.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;iPromise.resolve().then(t):(t,n)=>n(t,0),It=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Fg="arraybuffer";function vp(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Bg=It.setTimeout,Dg=It.clearTimeout;function Go(e,t){t.useNativeTimers?(e.setTimeoutFn=Bg.bind(It),e.clearTimeoutFn=Dg.bind(It)):(e.setTimeoutFn=It.setTimeout.bind(It),e.clearTimeoutFn=It.clearTimeout.bind(It))}const Mg=1.33;function Ug(e){return typeof e=="string"?$g(e):Math.ceil((e.byteLength||e.size)*Mg)}function $g(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}function wp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Wg(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Hg(e){let t={},n=e.split("&");for(let r=0,i=n.length;r{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};zg(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Pg(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=wp()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let xp=!1;try{xp=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Kg=xp;function Xg(){}class Yg extends qg{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class fn extends $e{constructor(t,n,r){super(),this.createRequest=t,Go(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=vp(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=fn.requestsCount++,fn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Xg,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete fn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}fn.requestsCount=0;fn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",mf);else if(typeof addEventListener=="function"){const e="onpagehide"in It?"pagehide":"unload";addEventListener(e,mf,!1)}}function mf(){for(let e in fn.requests)fn.requests.hasOwnProperty(e)&&fn.requests[e].abort()}const Zg=function(){const e=_p({xdomain:!1});return e&&e.responseType!==null}();class Qg extends Yg{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Zg&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new fn(_p,this.uri(),t)}}function _p(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Kg))return new XMLHttpRequest}catch{}if(!t)try{return new It[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const kp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Gg extends qu{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=kp?{}:vp(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{try{this.doWrite(r,s)}catch{}i&&Qo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=wp()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const La=It.WebSocket||It.MozWebSocket;class Jg extends Gg{createSocket(t,n,r){return kp?new La(t,n,r):n?new La(t,n):new La(t)}doWrite(t,n){this.ws.send(n)}}class ey extends qu{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=jg(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=Lg();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n{i&&Qo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const ty={websocket:Jg,webtransport:ey,polling:Qg},ny=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ry=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function jl(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=ny.exec(e||""),s={},o=14;for(;o--;)s[ry[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=iy(s,s.path),s.queryKey=sy(s,s.query),s}function iy(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function sy(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Il=typeof addEventListener=="function"&&typeof removeEventListener=="function",no=[];Il&&addEventListener("offline",()=>{no.forEach(e=>e())},!1);class rr extends $e{constructor(t,n){if(super(),this.binaryType=Fg,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=jl(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=jl(n.host).host);Go(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Hg(this.opts.query)),Il&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},no.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=yp,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&rr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",rr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Qo(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(rr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Il&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=no.indexOf(this._offlineEventListener);r!==-1&&no.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}rr.protocol=yp;class oy extends rr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",y=>{if(!r)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;rr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=n.name,this.emitReserved("upgradeError",w)}}))};function s(){r||(r=!0,h(),n.close(),n=null)}const o=y=>{const w=new Error("probe error: "+y);w.transport=n.name,s(),this.emitReserved("upgradeError",w)};function a(){o("transport closed")}function l(){o("socket closed")}function u(y){n&&y.name!==n.name&&s()}const h=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;rty[i]).filter(i=>!!i)),super(t,r)}};function ly(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=jl(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const uy=typeof ArrayBuffer=="function",cy=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Sp=Object.prototype.toString,fy=typeof Blob=="function"||typeof Blob<"u"&&Sp.call(Blob)==="[object BlobConstructor]",dy=typeof File=="function"||typeof File<"u"&&Sp.call(File)==="[object FileConstructor]";function Ku(e){return uy&&(e instanceof ArrayBuffer||cy(e))||fy&&e instanceof Blob||dy&&e instanceof File}function ro(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num{delete this.acks[t];for(let a=0;a{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Se.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Se.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Se.EVENT:case Se.BINARY_EVENT:this.onevent(t);break;case Se.ACK:case Se.BINARY_ACK:this.onack(t);break;case Se.DISCONNECT:this.ondisconnect();break;case Se.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Se.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Se.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}yi.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};yi.prototype.reset=function(){this.attempts=0};yi.prototype.setMin=function(e){this.ms=e};yi.prototype.setMax=function(e){this.max=e};yi.prototype.setJitter=function(e){this.jitter=e};class Dl extends $e{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Go(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new yi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||wy;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new ay(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=qt(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=qt(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(qt(t,"ping",this.onping.bind(this)),qt(t,"data",this.ondata.bind(this)),qt(t,"error",this.onerror.bind(this)),qt(t,"close",this.onclose.bind(this)),qt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Qo(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new bp(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Oi={};function io(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=ly(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Oi[i]&&s in Oi[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Dl(r,t):(Oi[i]||(Oi[i]=new Dl(r,t)),l=Oi[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(io,{Manager:Dl,Socket:bp,io,connect:io});const _y={},yf=e=>{let t;const n=new Set,r=(h,y)=>{const w=typeof h=="function"?h(t):h;if(!Object.is(w,t)){const p=t;t=y??(typeof w!="object"||w===null)?w:Object.assign({},t,w),n.forEach(g=>g(t,p))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(_y?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,i,l);return l},ky=e=>e?yf(e):yf;var Ep={exports:{}},Cp={},Np={exports:{}},Rp={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var di=ne;function Sy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var by=typeof Object.is=="function"?Object.is:Sy,Ey=di.useState,Cy=di.useEffect,Ny=di.useLayoutEffect,Ry=di.useDebugValue;function Ty(e,t){var n=t(),r=Ey({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return Ny(function(){i.value=n,i.getSnapshot=t,ja(i)&&s({inst:i})},[e,n,t]),Cy(function(){return ja(i)&&s({inst:i}),e(function(){ja(i)&&s({inst:i})})},[e]),Ry(n),n}function ja(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!by(e,n)}catch{return!0}}function Oy(e,t){return t()}var Ay=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Oy:Ty;Rp.useSyncExternalStore=di.useSyncExternalStore!==void 0?di.useSyncExternalStore:Ay;Np.exports=Rp;var Py=Np.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jo=ne,zy=Py;function Ly(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jy=typeof Object.is=="function"?Object.is:Ly,Iy=zy.useSyncExternalStore,Fy=Jo.useRef,By=Jo.useEffect,Dy=Jo.useMemo,My=Jo.useDebugValue;Cp.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=Fy(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=Dy(function(){function l(p){if(!u){if(u=!0,h=p,p=r(p),i!==void 0&&o.hasValue){var g=o.value;if(i(g,p))return y=g}return y=p}if(g=y,jy(h,p))return g;var d=r(p);return i!==void 0&&i(g,d)?(h=p,g):(h=p,y=d)}var u=!1,h,y,w=n===void 0?null:n;return[function(){return l(t())},w===null?void 0:function(){return l(w())}]},[t,n,r,i]);var a=Iy(e,s[0],s[1]);return By(function(){o.hasValue=!0,o.value=a},[a]),My(a),a};Ep.exports=Cp;var Uy=Ep.exports;const $y=Yl(Uy),Tp={},{useDebugValue:Wy}=ve,{useSyncExternalStoreWithSelector:Hy}=$y;let vf=!1;const Vy=e=>e;function qy(e,t=Vy,n){(Tp?"production":void 0)!=="production"&&n&&!vf&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),vf=!0);const r=Hy(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Wy(r),r}const wf=e=>{(Tp?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?ky(e):e,n=(r,i)=>qy(t,r,i);return Object.assign(n,t),n},Ky=e=>e?wf(e):wf,Te=Ky((e,t)=>({theme:"light",setTheme:n=>e({theme:n}),toggleTheme:()=>e(n=>({theme:n.theme==="light"?"dark":"light"})),libraries:[],currentLibraryId:null,setLibraries:n=>e({libraries:n}),setCurrentLibrary:n=>e({currentLibraryId:n}),addLibrary:n=>e(r=>({libraries:[...r.libraries,n]})),removeLibrary:n=>e(r=>({libraries:r.libraries.filter(i=>i.id!==n),currentLibraryId:r.currentLibraryId===n?null:r.currentLibraryId})),images:[],filteredImages:[],totalImageCount:0,setImages:n=>e({images:n,filteredImages:n}),setFilteredImages:n=>e({filteredImages:n}),setTotalImageCount:n=>e({totalImageCount:n}),folders:[],selectedFolder:null,setFolders:n=>e({folders:n}),setSelectedFolder:n=>e({selectedFolder:n}),searchKeywords:"",filters:{formats:[],minSize:null,maxSize:null,startDate:null,endDate:null},setSearchKeywords:n=>e({searchKeywords:n}),setFilters:n=>e(r=>({filters:{...r.filters,...n}})),resetFilters:()=>e({searchKeywords:"",filters:{formats:[],minSize:null,maxSize:null,startDate:null,endDate:null}}),selectedImage:null,setSelectedImage:n=>e({selectedImage:n}),selectedImages:[],setSelectedImages:n=>e({selectedImages:n}),toggleImageSelection:n=>e(r=>r.selectedImages.some(s=>s.path===n.path)?{selectedImages:r.selectedImages.filter(s=>s.path!==n.path)}:{selectedImages:[...r.selectedImages,n]}),clearSelection:()=>e({selectedImages:[],selectedImage:null}),scanProgress:null,scanStartTime:null,setScanProgress:n=>e(r=>n&&!r.scanStartTime&&n.current>0?{scanProgress:n,scanStartTime:Date.now()}:n?{scanProgress:n}:{scanProgress:null,scanStartTime:null}),isResizingPanels:!1,setIsResizingPanels:n=>e({isResizingPanels:n}),resizingSide:null,setResizingSide:n=>e({resizingSide:n}),thumbnailHeight:200,setThumbnailHeight:n=>e({thumbnailHeight:n}),mobileView:"main",setMobileView:n=>e({mobileView:n}),getCurrentLibrary:()=>{const n=t();return n.libraries.find(r=>r.id===n.currentLibraryId)}}));function Op(e,t){return function(){return e.apply(t,arguments)}}const{toString:Xy}=Object.prototype,{getPrototypeOf:Yu}=Object,{iterator:ea,toStringTag:Ap}=Symbol,ta=(e=>t=>{const n=Xy.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Qt=e=>(e=e.toLowerCase(),t=>ta(t)===e),na=e=>t=>typeof t===e,{isArray:vi}=Array,hi=na("undefined");function ps(e){return e!==null&&!hi(e)&&e.constructor!==null&&!hi(e.constructor)&&wt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Pp=Qt("ArrayBuffer");function Yy(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Pp(e.buffer),t}const Zy=na("string"),wt=na("function"),zp=na("number"),ms=e=>e!==null&&typeof e=="object",Qy=e=>e===!0||e===!1,so=e=>{if(ta(e)!=="object")return!1;const t=Yu(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ap in e)&&!(ea in e)},Gy=e=>{if(!ms(e)||ps(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Jy=Qt("Date"),ev=Qt("File"),tv=Qt("Blob"),nv=Qt("FileList"),rv=e=>ms(e)&&wt(e.pipe),iv=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||wt(e.append)&&((t=ta(e))==="formdata"||t==="object"&&wt(e.toString)&&e.toString()==="[object FormData]"))},sv=Qt("URLSearchParams"),[ov,av,lv,uv]=["ReadableStream","Request","Response","Headers"].map(Qt),cv=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function gs(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),vi(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const wr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,jp=e=>!hi(e)&&e!==wr;function Ml(){const{caseless:e,skipUndefined:t}=jp(this)&&this||{},n={},r=(i,s)=>{const o=e&&Lp(n,s)||s;so(n[o])&&so(i)?n[o]=Ml(n[o],i):so(i)?n[o]=Ml({},i):vi(i)?n[o]=i.slice():(!t||!hi(i))&&(n[o]=i)};for(let i=0,s=arguments.length;i(gs(t,(i,s)=>{n&&wt(i)?e[s]=Op(i,n):e[s]=i},{allOwnKeys:r}),e),dv=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),hv=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},pv=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Yu(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},mv=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},gv=e=>{if(!e)return null;if(vi(e))return e;let t=e.length;if(!zp(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},yv=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Yu(Uint8Array)),vv=(e,t)=>{const r=(e&&e[ea]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},wv=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},xv=Qt("HTMLFormElement"),_v=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),xf=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),kv=Qt("RegExp"),Ip=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};gs(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},Sv=e=>{Ip(e,(t,n)=>{if(wt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(wt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},bv=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return vi(e)?r(e):r(String(e).split(t)),n},Ev=()=>{},Cv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Nv(e){return!!(e&&wt(e.append)&&e[Ap]==="FormData"&&e[ea])}const Rv=e=>{const t=new Array(10),n=(r,i)=>{if(ms(r)){if(t.indexOf(r)>=0)return;if(ps(r))return r;if(!("toJSON"in r)){t[i]=r;const s=vi(r)?[]:{};return gs(r,(o,a)=>{const l=n(o,i+1);!hi(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},Tv=Qt("AsyncFunction"),Ov=e=>e&&(ms(e)||wt(e))&&wt(e.then)&&wt(e.catch),Fp=((e,t)=>e?setImmediate:t?((n,r)=>(wr.addEventListener("message",({source:i,data:s})=>{i===wr&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),wr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wt(wr.postMessage)),Av=typeof queueMicrotask<"u"?queueMicrotask.bind(wr):typeof process<"u"&&process.nextTick||Fp,Pv=e=>e!=null&&wt(e[ea]),$={isArray:vi,isArrayBuffer:Pp,isBuffer:ps,isFormData:iv,isArrayBufferView:Yy,isString:Zy,isNumber:zp,isBoolean:Qy,isObject:ms,isPlainObject:so,isEmptyObject:Gy,isReadableStream:ov,isRequest:av,isResponse:lv,isHeaders:uv,isUndefined:hi,isDate:Jy,isFile:ev,isBlob:tv,isRegExp:kv,isFunction:wt,isStream:rv,isURLSearchParams:sv,isTypedArray:yv,isFileList:nv,forEach:gs,merge:Ml,extend:fv,trim:cv,stripBOM:dv,inherits:hv,toFlatObject:pv,kindOf:ta,kindOfTest:Qt,endsWith:mv,toArray:gv,forEachEntry:vv,matchAll:wv,isHTMLForm:xv,hasOwnProperty:xf,hasOwnProp:xf,reduceDescriptors:Ip,freezeMethods:Sv,toObjectSet:bv,toCamelCase:_v,noop:Ev,toFiniteNumber:Cv,findKey:Lp,global:wr,isContextDefined:jp,isSpecCompliantForm:Nv,toJSONObject:Rv,isAsyncFn:Tv,isThenable:Ov,setImmediate:Fp,asap:Av,isIterable:Pv};function me(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}$.inherits(me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:$.toJSONObject(this.config),code:this.code,status:this.status}}});const Bp=me.prototype,Dp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Dp[e]={value:e}});Object.defineProperties(me,Dp);Object.defineProperty(Bp,"isAxiosError",{value:!0});me.from=(e,t,n,r,i,s)=>{const o=Object.create(Bp);$.toFlatObject(e,o,function(h){return h!==Error.prototype},u=>u!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return me.call(o,a,l,n,r,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",s&&Object.assign(o,s),o};const zv=null;function Ul(e){return $.isPlainObject(e)||$.isArray(e)}function Mp(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function _f(e,t,n){return e?e.concat(t).map(function(i,s){return i=Mp(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function Lv(e){return $.isArray(e)&&!e.some(Ul)}const jv=$.toFlatObject($,{},null,function(t){return/^is[A-Z]/.test(t)});function ra(e,t,n){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,_){return!$.isUndefined(_[d])});const r=n.metaTokens,i=n.visitor||h,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(i))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if($.isDate(g))return g.toISOString();if($.isBoolean(g))return g.toString();if(!l&&$.isBlob(g))throw new me("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(g)||$.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function h(g,d,_){let c=g;if(g&&!_&&typeof g=="object"){if($.endsWith(d,"{}"))d=r?d:d.slice(0,-2),g=JSON.stringify(g);else if($.isArray(g)&&Lv(g)||($.isFileList(g)||$.endsWith(d,"[]"))&&(c=$.toArray(g)))return d=Mp(d),c.forEach(function(x,k){!($.isUndefined(x)||x===null)&&t.append(o===!0?_f([d],k,s):o===null?d:d+"[]",u(x))}),!1}return Ul(g)?!0:(t.append(_f(_,d,s),u(g)),!1)}const y=[],w=Object.assign(jv,{defaultVisitor:h,convertValue:u,isVisitable:Ul});function p(g,d){if(!$.isUndefined(g)){if(y.indexOf(g)!==-1)throw Error("Circular reference detected in "+d.join("."));y.push(g),$.forEach(g,function(c,f){(!($.isUndefined(c)||c===null)&&i.call(t,c,$.isString(f)?f.trim():f,d,w))===!0&&p(c,d?d.concat(f):[f])}),y.pop()}}if(!$.isObject(e))throw new TypeError("data must be an object");return p(e),t}function kf(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Zu(e,t){this._pairs=[],e&&ra(e,this,t)}const Up=Zu.prototype;Up.append=function(t,n){this._pairs.push([t,n])};Up.toString=function(t){const n=t?function(r){return t.call(this,r,kf)}:kf;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Iv(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $p(e,t,n){if(!t)return e;const r=n&&n.encode||Iv;$.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(i?s=i(t,n):s=$.isURLSearchParams(t)?t.toString():new Zu(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class Sf{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){$.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Wp={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Fv=typeof URLSearchParams<"u"?URLSearchParams:Zu,Bv=typeof FormData<"u"?FormData:null,Dv=typeof Blob<"u"?Blob:null,Mv={isBrowser:!0,classes:{URLSearchParams:Fv,FormData:Bv,Blob:Dv},protocols:["http","https","file","blob","url","data"]},Qu=typeof window<"u"&&typeof document<"u",$l=typeof navigator=="object"&&navigator||void 0,Uv=Qu&&(!$l||["ReactNative","NativeScript","NS"].indexOf($l.product)<0),$v=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wv=Qu&&window.location.href||"http://localhost",Hv=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Qu,hasStandardBrowserEnv:Uv,hasStandardBrowserWebWorkerEnv:$v,navigator:$l,origin:Wv},Symbol.toStringTag,{value:"Module"})),it={...Hv,...Mv};function Vv(e,t){return ra(e,new it.classes.URLSearchParams,{visitor:function(n,r,i,s){return it.isNode&&$.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function qv(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Kv(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r=n.length;return o=!o&&$.isArray(i)?i.length:o,l?($.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!$.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&$.isArray(i[o])&&(i[o]=Kv(i[o])),!a)}if($.isFormData(e)&&$.isFunction(e.entries)){const n={};return $.forEachEntry(e,(r,i)=>{t(qv(r),i,n,0)}),n}return null}function Xv(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ys={transitional:Wp,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=$.isObject(t);if(s&&$.isHTMLForm(t)&&(t=new FormData(t)),$.isFormData(t))return i?JSON.stringify(Hp(t)):t;if($.isArrayBuffer(t)||$.isBuffer(t)||$.isStream(t)||$.isFile(t)||$.isBlob(t)||$.isReadableStream(t))return t;if($.isArrayBufferView(t))return t.buffer;if($.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Vv(t,this.formSerializer).toString();if((a=$.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return ra(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),Xv(t)):t}],transformResponse:[function(t){const n=this.transitional||ys.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if($.isResponse(t)||$.isReadableStream(t))return t;if(t&&$.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?me.from(a,me.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:it.classes.FormData,Blob:it.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],e=>{ys.headers[e]={}});const Yv=$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Zv=e=>{const t={};let n,r,i;return e&&e.split(` -`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&Yv[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},bf=Symbol("internals");function Ai(e){return e&&String(e).trim().toLowerCase()}function oo(e){return e===!1||e==null?e:$.isArray(e)?e.map(oo):String(e)}function Qv(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Gv=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ia(e,t,n,r,i){if($.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!$.isString(t)){if($.isString(r))return t.indexOf(r)!==-1;if($.isRegExp(r))return r.test(t)}}function Jv(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function e1(e,t){const n=$.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let xt=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,u){const h=Ai(l);if(!h)throw new Error("header name must be a non-empty string");const y=$.findKey(i,h);(!y||i[y]===void 0||u===!0||u===void 0&&i[y]!==!1)&&(i[y||l]=oo(a))}const o=(a,l)=>$.forEach(a,(u,h)=>s(u,h,l));if($.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if($.isString(t)&&(t=t.trim())&&!Gv(t))o(Zv(t),n);else if($.isObject(t)&&$.isIterable(t)){let a={},l,u;for(const h of t){if(!$.isArray(h))throw TypeError("Object iterator must return a key-value pair");a[u=h[0]]=(l=a[u])?$.isArray(l)?[...l,h[1]]:[l,h[1]]:h[1]}o(a,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=Ai(t),t){const r=$.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Qv(i);if($.isFunction(n))return n.call(this,i,r);if($.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ai(t),t){const r=$.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ia(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=Ai(o),o){const a=$.findKey(r,o);a&&(!n||Ia(r,r[a],a,n))&&(delete r[a],i=!0)}}return $.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||Ia(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return $.forEach(this,(i,s)=>{const o=$.findKey(r,s);if(o){n[o]=oo(i),delete n[s];return}const a=t?Jv(s):String(s).trim();a!==s&&delete n[s],n[a]=oo(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return $.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&$.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[bf]=this[bf]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Ai(o);r[a]||(e1(i,o),r[a]=!0)}return $.isArray(t)?t.forEach(s):s(t),this}};xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);$.reduceDescriptors(xt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});$.freezeMethods(xt);function Fa(e,t){const n=this||ys,r=t||n,i=xt.from(r.headers);let s=r.data;return $.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Vp(e){return!!(e&&e.__CANCEL__)}function wi(e,t,n){me.call(this,e??"canceled",me.ERR_CANCELED,t,n),this.name="CanceledError"}$.inherits(wi,me,{__CANCEL__:!0});function qp(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new me("Request failed with status code "+n.status,[me.ERR_BAD_REQUEST,me.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function t1(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function n1(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),h=r[s];o||(o=u),n[i]=l,r[i]=u;let y=s,w=0;for(;y!==i;)w+=n[y++],y=y%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),u-o{n=h,i=null,s&&(clearTimeout(s),s=null),e(...u)};return[(...u)=>{const h=Date.now(),y=h-n;y>=r?o(u,h):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},r-y)))},()=>i&&o(i)]}const zo=(e,t,n=3)=>{let r=0;const i=n1(50,250);return r1(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,u=i(l),h=o<=a;r=o;const y={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&h?(a-o)/u:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(y)},n)},Ef=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Cf=e=>(...t)=>$.asap(()=>e(...t)),i1=it.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,it.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(it.origin),it.navigator&&/(msie|trident)/i.test(it.navigator.userAgent)):()=>!0,s1=it.hasStandardBrowserEnv?{write(e,t,n,r,i,s,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];$.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),$.isString(r)&&a.push(`path=${r}`),$.isString(i)&&a.push(`domain=${i}`),s===!0&&a.push("secure"),$.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function o1(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function a1(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Kp(e,t,n){let r=!o1(t);return e&&(r||n==!1)?a1(e,t):t}const Nf=e=>e instanceof xt?{...e}:e;function Rr(e,t){t=t||{};const n={};function r(u,h,y,w){return $.isPlainObject(u)&&$.isPlainObject(h)?$.merge.call({caseless:w},u,h):$.isPlainObject(h)?$.merge({},h):$.isArray(h)?h.slice():h}function i(u,h,y,w){if($.isUndefined(h)){if(!$.isUndefined(u))return r(void 0,u,y,w)}else return r(u,h,y,w)}function s(u,h){if(!$.isUndefined(h))return r(void 0,h)}function o(u,h){if($.isUndefined(h)){if(!$.isUndefined(u))return r(void 0,u)}else return r(void 0,h)}function a(u,h,y){if(y in t)return r(u,h);if(y in e)return r(void 0,u)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,h,y)=>i(Nf(u),Nf(h),y,!0)};return $.forEach(Object.keys({...e,...t}),function(h){const y=l[h]||i,w=y(e[h],t[h],h);$.isUndefined(w)&&y!==a||(n[h]=w)}),n}const Xp=e=>{const t=Rr({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;if(t.headers=o=xt.from(o),t.url=$p(Kp(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),$.isFormData(n)){if(it.hasStandardBrowserEnv||it.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if($.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([h,y])=>{u.includes(h.toLowerCase())&&o.set(h,y)})}}if(it.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||r!==!1&&i1(t.url))){const l=i&&s&&s1.read(s);l&&o.set(i,l)}return t},l1=typeof XMLHttpRequest<"u",u1=l1&&function(e){return new Promise(function(n,r){const i=Xp(e);let s=i.data;const o=xt.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=i,h,y,w,p,g;function d(){p&&p(),g&&g(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let _=new XMLHttpRequest;_.open(i.method.toUpperCase(),i.url,!0),_.timeout=i.timeout;function c(){if(!_)return;const x=xt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),R={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:x,config:e,request:_};qp(function(N){n(N),d()},function(N){r(N),d()},R),_=null}"onloadend"in _?_.onloadend=c:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(c)},_.onabort=function(){_&&(r(new me("Request aborted",me.ECONNABORTED,e,_)),_=null)},_.onerror=function(k){const R=k&&k.message?k.message:"Network Error",E=new me(R,me.ERR_NETWORK,e,_);E.event=k||null,r(E),_=null},_.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const R=i.transitional||Wp;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),r(new me(k,R.clarifyTimeoutError?me.ETIMEDOUT:me.ECONNABORTED,e,_)),_=null},s===void 0&&o.setContentType(null),"setRequestHeader"in _&&$.forEach(o.toJSON(),function(k,R){_.setRequestHeader(R,k)}),$.isUndefined(i.withCredentials)||(_.withCredentials=!!i.withCredentials),a&&a!=="json"&&(_.responseType=i.responseType),u&&([w,g]=zo(u,!0),_.addEventListener("progress",w)),l&&_.upload&&([y,p]=zo(l),_.upload.addEventListener("progress",y),_.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(h=x=>{_&&(r(!x||x.type?new wi(null,e,_):x),_.abort(),_=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const f=t1(i.url);if(f&&it.protocols.indexOf(f)===-1){r(new me("Unsupported protocol "+f+":",me.ERR_BAD_REQUEST,e));return}_.send(s||null)})},c1=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(u){if(!i){i=!0,a();const h=u instanceof Error?u:this.reason;r.abort(h instanceof me?h:new wi(h instanceof Error?h.message:h))}};let o=t&&setTimeout(()=>{o=null,s(new me(`timeout ${t} of ms exceeded`,me.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>u.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>$.asap(a),l}},f1=function*(e,t){let n=e.byteLength;if(n{const i=d1(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:h}=await i.next();if(u){a(),l.close();return}let y=h.byteLength;if(n){let w=s+=y;n(w)}l.enqueue(new Uint8Array(h))}catch(u){throw a(u),u}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},Tf=64*1024,{isFunction:Ds}=$,p1=(({Request:e,Response:t})=>({Request:e,Response:t}))($.global),{ReadableStream:Of,TextEncoder:Af}=$.global,Pf=(e,...t)=>{try{return!!e(...t)}catch{return!1}},m1=e=>{e=$.merge.call({skipUndefined:!0},p1,e);const{fetch:t,Request:n,Response:r}=e,i=t?Ds(t):typeof fetch=="function",s=Ds(n),o=Ds(r);if(!i)return!1;const a=i&&Ds(Of),l=i&&(typeof Af=="function"?(g=>d=>g.encode(d))(new Af):async g=>new Uint8Array(await new n(g).arrayBuffer())),u=s&&a&&Pf(()=>{let g=!1;const d=new n(it.origin,{body:new Of,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!d}),h=o&&a&&Pf(()=>$.isReadableStream(new r("").body)),y={stream:h&&(g=>g.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!y[g]&&(y[g]=(d,_)=>{let c=d&&d[g];if(c)return c.call(d);throw new me(`Response type '${g}' is not supported`,me.ERR_NOT_SUPPORT,_)})});const w=async g=>{if(g==null)return 0;if($.isBlob(g))return g.size;if($.isSpecCompliantForm(g))return(await new n(it.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if($.isArrayBufferView(g)||$.isArrayBuffer(g))return g.byteLength;if($.isURLSearchParams(g)&&(g=g+""),$.isString(g))return(await l(g)).byteLength},p=async(g,d)=>{const _=$.toFiniteNumber(g.getContentLength());return _??w(d)};return async g=>{let{url:d,method:_,data:c,signal:f,cancelToken:x,timeout:k,onDownloadProgress:R,onUploadProgress:E,responseType:N,headers:L,withCredentials:P="same-origin",fetchOptions:I}=Xp(g),re=t||fetch;N=N?(N+"").toLowerCase():"text";let T=c1([f,x&&x.toAbortSignal()],k),D=null;const v=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let B;try{if(E&&u&&_!=="get"&&_!=="head"&&(B=await p(L,c))!==0){let O=new n(d,{method:"POST",body:c,duplex:"half"}),A;if($.isFormData(c)&&(A=O.headers.get("content-type"))&&L.setContentType(A),O.body){const[J,q]=Ef(B,zo(Cf(E)));c=Rf(O.body,Tf,J,q)}}$.isString(P)||(P=P?"include":"omit");const se=s&&"credentials"in n.prototype,X={...I,signal:T,method:_.toUpperCase(),headers:L.normalize().toJSON(),body:c,duplex:"half",credentials:se?P:void 0};D=s&&new n(d,X);let H=await(s?re(D,I):re(d,X));const z=h&&(N==="stream"||N==="response");if(h&&(R||z&&v)){const O={};["status","statusText","headers"].forEach(V=>{O[V]=H[V]});const A=$.toFiniteNumber(H.headers.get("content-length")),[J,q]=R&&Ef(A,zo(Cf(R),!0))||[];H=new r(Rf(H.body,Tf,J,()=>{q&&q(),v&&v()}),O)}N=N||"text";let j=await y[$.findKey(y,N)||"text"](H,g);return!z&&v&&v(),await new Promise((O,A)=>{qp(O,A,{data:j,headers:xt.from(H.headers),status:H.status,statusText:H.statusText,config:g,request:D})})}catch(se){throw v&&v(),se&&se.name==="TypeError"&&/Load failed|fetch/i.test(se.message)?Object.assign(new me("Network Error",me.ERR_NETWORK,g,D),{cause:se.cause||se}):me.from(se,se&&se.code,g,D)}}},g1=new Map,Yp=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,s=[r,i,n];let o=s.length,a=o,l,u,h=g1;for(;a--;)l=s[a],u=h.get(l),u===void 0&&h.set(l,u=a?new Map:m1(t)),h=u;return u};Yp();const Gu={http:zv,xhr:u1,fetch:{get:Yp}};$.forEach(Gu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const zf=e=>`- ${e}`,y1=e=>$.isFunction(e)||e===null||e===!1;function v1(e,t){e=$.isArray(e)?e:[e];const{length:n}=e;let r,i;const s={};for(let o=0;o`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since : -`+o.map(zf).join(` -`):" "+zf(o[0]):"as no adapter specified";throw new me("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i}const Zp={getAdapter:v1,adapters:Gu};function Ba(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new wi(null,e)}function Lf(e){return Ba(e),e.headers=xt.from(e.headers),e.data=Fa.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Zp.getAdapter(e.adapter||ys.adapter,e)(e).then(function(r){return Ba(e),r.data=Fa.call(e,e.transformResponse,r),r.headers=xt.from(r.headers),r},function(r){return Vp(r)||(Ba(e),r&&r.response&&(r.response.data=Fa.call(e,e.transformResponse,r.response),r.response.headers=xt.from(r.response.headers))),Promise.reject(r)})}const Qp="1.13.2",ia={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ia[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const jf={};ia.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Qp+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new me(i(o," has been removed"+(n?" in "+n:"")),me.ERR_DEPRECATED);return n&&!jf[o]&&(jf[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};ia.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function w1(e,t,n){if(typeof e!="object")throw new me("options must be an object",me.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new me("option "+s+" must be "+l,me.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new me("Unknown option "+s,me.ERR_BAD_OPTION)}}const ao={assertOptions:w1,validators:ia},on=ao.validators;let kr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Sf,response:new Sf}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Rr(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&ao.assertOptions(r,{silentJSONParsing:on.transitional(on.boolean),forcedJSONParsing:on.transitional(on.boolean),clarifyTimeoutError:on.transitional(on.boolean)},!1),i!=null&&($.isFunction(i)?n.paramsSerializer={serialize:i}:ao.assertOptions(i,{encode:on.function,serialize:on.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ao.assertOptions(n,{baseUrl:on.spelling("baseURL"),withXsrfToken:on.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&$.merge(s.common,s[n.method]);s&&$.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=xt.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(l=l&&d.synchronous,a.unshift(d.fulfilled,d.rejected))});const u=[];this.interceptors.response.forEach(function(d){u.push(d.fulfilled,d.rejected)});let h,y=0,w;if(!l){const g=[Lf.bind(this),void 0];for(g.unshift(...a),g.push(...u),w=g.length,h=Promise.resolve(n);y{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new wi(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Gp(function(i){t=i}),cancel:t}}};function _1(e){return function(n){return e.apply(null,n)}}function k1(e){return $.isObject(e)&&e.isAxiosError===!0}const Wl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Wl).forEach(([e,t])=>{Wl[t]=e});function Jp(e){const t=new kr(e),n=Op(kr.prototype.request,t);return $.extend(n,kr.prototype,t,{allOwnKeys:!0}),$.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Jp(Rr(e,i))},n}const be=Jp(ys);be.Axios=kr;be.CanceledError=wi;be.CancelToken=x1;be.isCancel=Vp;be.VERSION=Qp;be.toFormData=ra;be.AxiosError=me;be.Cancel=be.CanceledError;be.all=function(t){return Promise.all(t)};be.spread=_1;be.isAxiosError=k1;be.mergeConfig=Rr;be.AxiosHeaders=xt;be.formToJSON=e=>Hp($.isHTMLForm(e)?new FormData(e):e);be.getAdapter=Zp.getAdapter;be.HttpStatusCode=Wl;be.default=be;const{Axios:ow,AxiosError:aw,CanceledError:lw,isCancel:uw,CancelToken:cw,VERSION:fw,all:dw,Cancel:hw,isAxiosError:pw,spread:mw,toFormData:gw,AxiosHeaders:yw,HttpStatusCode:vw,formToJSON:ww,getAdapter:xw,mergeConfig:_w}=be,Qe="/api",Cn={getAll:()=>be.get(`${Qe}/library`),add:(e,t)=>be.post(`${Qe}/library`,{name:e,path:t}),update:(e,t)=>be.put(`${Qe}/library/${e}`,t),delete:e=>be.delete(`${Qe}/library/${e}`),setCurrent:e=>be.post(`${Qe}/library/${e}/set-current`),updatePreferences:e=>be.put(`${Qe}/library/preferences`,e),updateTheme:e=>be.put(`${Qe}/library/theme`,{theme:e})},ct={search:(e,t={})=>{const n=new URLSearchParams({libraryId:e,...t});return be.get(`${Qe}/image?${n}`)},getFolders:e=>be.get(`${Qe}/image/folders?libraryId=${e}`),getThumbnailUrl:(e,t,n)=>`${Qe}/image/thumbnail/${e}/${t}/${n}`,getOriginalUrl:(e,t)=>`${Qe}/image/original/${e}/${t}`},Hl={fullScan:(e,t=!1)=>be.post(`${Qe}/scan/full`,{libraryId:e,wait:t}),sync:(e,t=!1)=>be.post(`${Qe}/scan/sync`,{libraryId:e,wait:t})},If={start:e=>be.post(`${Qe}/watch/start/${e}`),stop:e=>be.post(`${Qe}/watch/stop/${e}`),status:e=>be.get(`${Qe}/watch/status/${e}`),list:()=>be.get(`${Qe}/watch/list`)};/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var S1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const b1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ye=(e,t)=>{const n=ne.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:l,...u},h)=>ne.createElement("svg",{ref:h,...S1,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${b1(e)}`,a].join(" "),...u},[...t.map(([y,w])=>ne.createElement(y,w)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const E1=Ye("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const C1=Ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ff=Ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const N1=Ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const R1=Ye("ChevronsDown",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const T1=Ye("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const O1=Ye("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const A1=Ye("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bf=Ye("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const P1=Ye("FolderDown",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m15 13-3 3-3-3",key:"6j2sf0"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Df=Ye("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mf=Ye("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uf=Ye("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vl=Ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $f=Ye("Sliders",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wf=Ye("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const z1=Ye("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.300.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const L1=Ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Hf(){const{libraries:e,currentLibraryId:t,folders:n,selectedFolder:r,totalImageCount:i,setCurrentLibrary:s,setSelectedFolder:o,addLibrary:a,removeLibrary:l}=Te(),[u,h]=ne.useState(!1),[y,w]=ne.useState(""),[p,g]=ne.useState(""),[d,_]=ne.useState(""),[c,f]=ne.useState(new Set),[x,k]=ne.useState(!1),[R,E]=ne.useState(!1),N=async()=>{if(!y.trim()){alert("请输入素材库名称");return}if(!p.trim()){alert("请输入文件夹路径");return}k(!0),Te.getState().setScanProgress({current:0,total:0,percent:0,status:"preparing"});try{const z=await Cn.add(y.trim(),p.trim()),j=z.data.id,O=z.data.hasExistingIndex;a({id:j,name:y.trim(),path:p.trim()}),w(""),g(""),h(!1),await Cn.setCurrent(j),s(j),o(null),Te.getState().setImages([]),Te.getState().setFolders([]),O?(console.log("检测到已有索引,执行增量同步..."),Hl.sync(j,!1)):(console.log("首次添加,执行全量扫描..."),Hl.fullScan(j,!1))}catch(z){console.error("Error adding library:",z),alert("添加素材库失败: "+z.message)}finally{k(!1)}},L=async z=>{if(z!==t){E(!0);try{await Cn.setCurrent(z),s(z),o(null)}catch(j){console.error("Error setting current library:",j),alert("切换素材库失败: "+j.message)}finally{E(!1)}}},P=async()=>{if(!t)return;const z=e.find(O=>O.id===t);if(!(!z||!confirm(`确定要删除素材库"${z.name}"吗? - -路径: ${z.path} - -⚠️ 注意: -• 将删除索引数据并释放数据库连接 -• 不会删除原始图片文件 -• .flypic 文件夹将保留,您可以手动删除`)))try{await Cn.delete(t),l(t),Te.getState().setImages([]),Te.getState().setFolders([]),Te.getState().setSelectedImage(null),Te.getState().setSelectedFolder(null);const O=e.filter(A=>A.id!==t);if(O.length>0){const A=O[0];await Cn.setCurrent(A.id),s(A.id)}console.log(`✅ 素材库已删除: ${z.name}`),console.log(`数据库连接已释放,可手动删除: ${z.path}\\.flypic`)}catch(O){console.error("Error deleting library:",O),alert("删除素材库失败: "+O.message)}},I=z=>{const j=new Set(c);j.has(z)?j.delete(z):j.add(z),f(j)},re=z=>{const j=[],O=A=>{A.forEach(J=>{J.children&&J.children.length>0&&(j.push(J.path),O(J.children))})};return O(z),j},T=()=>{const z=re(B.length>0?B:n);f(new Set(z))},D=()=>{f(new Set)},v=()=>{const z=re(B.length>0?B:n);return z.length>0&&z.every(j=>c.has(j))},B=ne.useMemo(()=>{if(!d)return n;const z=d.trim().toLowerCase().split(/\s+/).filter(J=>J.length>0);if(z.length===0)return n;const j=[],O=J=>J.reduce((q,V)=>{const ce=V.name.toLowerCase(),Y=V.path.toLowerCase(),Z=z.every(de=>ce.includes(de)),oe=z.every(de=>Y.includes(de));let ue=[];return V.children&&V.children.length>0&&(ue=O(V.children)),(Z||oe||ue.length>0)&&(q.push({...V,children:ue}),ue.length>0&&j.push(V.path)),q},[]),A=O(n);return j.length>0&&setTimeout(()=>{f(J=>{const q=new Set(J);return j.forEach(V=>q.add(V)),q})},0),A},[n,d]),se=(z,j)=>{z.stopPropagation(),I(j)},X=z=>{const j=z.children&&z.children.length>0;r!==z.path?o(z.path):j&&I(z.path)},H=(z,j=0)=>z.map(O=>{const A=c.has(O.path),J=O.children&&O.children.length>0,q=r===O.path;return C.jsxs("div",{children:[C.jsxs("div",{className:`flex items-center px-3 py-2 cursor-pointer rounded-md transition-colors ${q?"bg-blue-50 dark:bg-blue-900":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,style:{paddingLeft:`${j*16+12}px`},onClick:()=>X(O),children:[J?C.jsx("div",{className:"flex items-center justify-center w-5 h-5 mr-1 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600 rounded",onClick:V=>se(V,O.path),children:A?C.jsx(Ff,{className:"w-4 h-4 text-gray-500"}):C.jsx(N1,{className:"w-4 h-4 text-gray-500"})}):C.jsx("div",{className:"w-5 mr-1"}),C.jsx(Df,{className:"w-4 h-4 mr-2 text-gray-500 flex-shrink-0"}),C.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate flex-1",children:O.name}),C.jsx("span",{className:"text-xs text-gray-400 ml-2 flex-shrink-0",children:O.image_count})]}),J&&A&&H(O.children,j+1)]},O.path)});return C.jsxs("div",{className:"w-full h-full border-r border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex flex-col",children:[C.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:[C.jsx("div",{className:"flex items-center justify-between mb-3",children:C.jsx("h2",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"素材库"})}),C.jsxs("div",{className:"flex gap-2",children:[C.jsxs("div",{className:"relative flex-1",children:[C.jsxs("select",{value:t||"",onChange:z=>{const j=z.target.value;j==="__add__"?h(!0):j&&L(j)},disabled:R,className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 appearance-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",style:{paddingRight:"2rem"},children:[e.length===0&&C.jsx("option",{value:"",children:"暂无素材库"}),e.map(z=>C.jsx("option",{value:z.id,children:z.name},z.id)),C.jsx("option",{value:"__add__",style:{borderTop:"1px solid #ccc"},children:"+ 添加新素材库"})]}),C.jsx(Ff,{className:"absolute right-2 top-2.5 w-4 h-4 text-gray-400 pointer-events-none"})]}),t&&e.length>0&&C.jsx("button",{onClick:P,className:"px-3 py-2 border border-red-300 dark:border-red-600 rounded-lg hover:bg-red-50 dark:hover:bg-red-900 text-red-600 dark:text-red-400 transition-colors",title:"删除当前素材库",children:C.jsx(z1,{className:"w-4 h-4"})})]}),u&&C.jsxs("div",{className:"mt-3 p-3 border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"添加素材库"}),C.jsx("button",{onClick:()=>h(!1),className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600",children:C.jsx(L1,{className:"w-4 h-4 text-gray-500"})})]}),C.jsxs("div",{className:"space-y-2",children:[C.jsx("input",{type:"text",placeholder:"素材库名称",value:y,onChange:z=>w(z.target.value),onKeyDown:z=>z.key==="Enter"&&N(),autoFocus:!0,className:"w-full px-2 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"}),C.jsx("input",{type:"text",placeholder:"文件夹路径(例如:C:\\Users\\Pictures)",value:p,onChange:z=>g(z.target.value),onKeyDown:z=>z.key==="Enter"&&N(),className:"w-full px-2 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100"}),C.jsxs("div",{className:"flex gap-2",children:[C.jsx("button",{onClick:()=>h(!1),className:"flex-1 px-3 py-1.5 border border-gray-300 dark:border-gray-600 rounded text-sm hover:bg-gray-100 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300",children:"取消"}),C.jsx("button",{onClick:N,disabled:x,className:"flex-1 px-3 py-1.5 bg-blue-500 text-white rounded text-sm hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed",children:x?"添加中...":"添加"})]})]})]})]}),C.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[C.jsx("div",{className:"mb-3 space-y-2",children:C.jsxs("div",{className:"flex gap-2",children:[C.jsxs("div",{className:"relative flex-1",children:[C.jsx(Vl,{className:"absolute left-2 top-2 w-4 h-4 text-gray-400"}),C.jsx("input",{type:"text",placeholder:"搜索文件夹(支持多关键词)...",value:d,onChange:z=>_(z.target.value),className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"})]}),C.jsx("button",{onClick:v()?D:T,className:"px-2 py-1.5 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-600 text-gray-600 dark:text-gray-400 transition-colors",title:v()?"折叠全部":"展开全部",children:v()?C.jsx(T1,{className:"w-4 h-4"}):C.jsx(R1,{className:"w-4 h-4"})})]})}),C.jsxs("div",{className:"space-y-1",children:[C.jsxs("div",{className:`flex items-center px-3 py-2 cursor-pointer rounded-md transition-colors ${r===null?"bg-blue-50 dark:bg-blue-900":"hover:bg-gray-100 dark:hover:bg-gray-700"}`,onClick:()=>o(null),children:[C.jsx("div",{className:"w-5 mr-1"}),C.jsx(Df,{className:"w-4 h-4 mr-2 text-blue-500 flex-shrink-0"}),C.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 font-medium flex-1",children:"全部图片"}),C.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 ml-2",children:i})]}),(B.length>0||n.length>0)&&C.jsx("div",{className:"h-px bg-gray-200 dark:bg-gray-700 my-2"}),B.length>0?H(B):d?C.jsx("div",{className:"text-center py-8 text-gray-400 dark:text-gray-500 text-sm",children:"未找到匹配的文件夹"}):n.length===0?C.jsx("div",{className:"text-center py-8 text-gray-400 dark:text-gray-500 text-sm",children:"暂无文件夹"}):null]})]})]})}function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?ne.useEffect:ne.useLayoutEffect;function Dr(e,t,n){var r=ne.useRef(t);r.current=t,ne.useEffect(function(){function i(s){r.current(s)}return e&&window.addEventListener(e,i,n),function(){e&&window.removeEventListener(e,i)}},[e])}var I1=["container"];function F1(e){var t=e.container,n=t===void 0?document.body:t,r=sa(e,I1);return fp.createPortal(ve.createElement("div",Ke({},r)),n)}function B1(e){return ve.createElement("svg",Ke({width:"44",height:"44",viewBox:"0 0 768 768"},e),ve.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function D1(e){return ve.createElement("svg",Ke({width:"44",height:"44",viewBox:"0 0 768 768"},e),ve.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function M1(e){return ve.createElement("svg",Ke({width:"44",height:"44",viewBox:"0 0 768 768"},e),ve.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function U1(){return ne.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function qf(e){var t=e.touches[0],n=t.clientX,r=t.clientY;if(e.touches.length>=2){var i=e.touches[1],s=i.clientX,o=i.clientY;return[(n+s)/2,(r+o)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(o-r,2))]}return[n,r,0]}var Hn=function(e,t,n,r){var i,s=n*t,o=(s-r)/2,a=e;return s<=r?(i=1,a=0):e>0&&o-e<=0?(i=2,a=o):e<0&&o+e<=0&&(i=3,a=-o),[i,a]};function Da(e,t,n,r,i,s,o,a,l,u){o===void 0&&(o=innerWidth/2),a===void 0&&(a=innerHeight/2),l===void 0&&(l=0),u===void 0&&(u=0);var h=Hn(e,s,n,innerWidth)[0],y=Hn(t,s,r,innerHeight),w=innerWidth/2,p=innerHeight/2;return{x:o-s/i*(o-(w+e))-w+(r/n>=3&&n*s===innerWidth?0:h?l/2:l),y:a-s/i*(a-(p+t))-p+(y[0]?u/2:u),lastCX:o,lastCY:a}}function Xl(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function Ma(e,t,n){var r=Xl(n,innerWidth,innerHeight),i=r[0],s=r[1],o=0,a=i,l=s,u=e/t*s,h=t/e*i;return e=s?a=u:e>=i&&ti/s?l=h:t/e>=3&&!r[2]?o=((l=h)-s)/2:a=u,{width:a,height:l,x:0,y:o,pause:!0}}function Us(e,t){var n=t.leading,r=n!==void 0&&n,i=t.maxWait,s=t.wait,o=s===void 0?i||0:s,a=ne.useRef(e);a.current=e;var l=ne.useRef(0),u=ne.useRef(),h=function(){return u.current&&clearTimeout(u.current)},y=ne.useCallback(function(){var w=[].slice.call(arguments),p=Date.now();function g(){l.current=p,h(),a.current.apply(null,w)}var d=l.current,_=p-d;if(d===0&&(r&&g(),l.current=p),i!==void 0){if(_>i)return void g()}else _=1&&s&&s())};h()}function h(){l=requestAnimationFrame(u)}}var W1={T:0,L:0,W:0,H:0,FIT:void 0},em=function(){var e=ne.useRef(!1);return ne.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},H1=["className"];function V1(e){var t=e.className,n=t===void 0?"":t,r=sa(e,H1);return ve.createElement("div",Ke({className:"PhotoView__Spinner "+n},r),ve.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},ve.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),ve.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var q1=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function K1(e){var t=e.src,n=e.loaded,r=e.broken,i=e.className,s=e.onPhotoLoad,o=e.loadingElement,a=e.brokenElement,l=sa(e,q1),u=em();return t&&!r?ve.createElement(ve.Fragment,null,ve.createElement("img",Ke({className:"PhotoView__Photo"+(i?" "+i:""),src:t,onLoad:function(h){var y=h.target;u.current&&s({loaded:!0,naturalWidth:y.naturalWidth,naturalHeight:y.naturalHeight})},onError:function(){u.current&&s({broken:!0})},draggable:!1,alt:""},l)),!n&&(o?ve.createElement("span",{className:"PhotoView__icon"},o):ve.createElement(V1,{className:"PhotoView__icon"}))):a?ve.createElement("span",{className:"PhotoView__icon"},typeof a=="function"?a({src:t}):a):null}var X1={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function Y1(e){var t=e.item,n=t.src,r=t.render,i=t.width,s=i===void 0?0:i,o=t.height,a=o===void 0?0:o,l=t.originRef,u=e.visible,h=e.speed,y=e.easing,w=e.wrapClassName,p=e.className,g=e.style,d=e.loadingElement,_=e.brokenElement,c=e.onPhotoTap,f=e.onMaskTap,x=e.onReachMove,k=e.onReachUp,R=e.onPhotoResize,E=e.isActive,N=e.expose,L=Lo(X1),P=L[0],I=L[1],re=ne.useRef(0),T=em(),D=P.naturalWidth,v=D===void 0?s:D,B=P.naturalHeight,se=B===void 0?a:B,X=P.width,H=X===void 0?s:X,z=P.height,j=z===void 0?a:z,O=P.loaded,A=O===void 0?!n:O,J=P.broken,q=P.x,V=P.y,ce=P.touched,Y=P.stopRaf,Z=P.maskTouched,oe=P.rotate,ue=P.scale,de=P.CX,ge=P.CY,we=P.lastX,m=P.lastY,W=P.lastCX,U=P.lastCY,b=P.lastScale,S=P.touchTime,F=P.touchLength,K=P.pause,Q=P.reach,M=ii({onScale:function(G){return ee(Ms(G))},onRotate:function(G){oe!==G&&(N({rotate:G}),I(Ke({rotate:G},Ma(v,se,G))))}});function ee(G,he,Ce){ue!==G&&(N({scale:G}),I(Ke({scale:G},Da(q,V,H,j,ue,G,he,Ce),G<=1&&{x:0,y:0})))}var ae=Us(function(G,he,Ce){if(Ce===void 0&&(Ce=0),(ce||Z)&&E){var pn=Xl(oe,H,j),mn=pn[0],Ot=pn[1];if(Ce===0&&re.current===0){var _t=Math.abs(G-de)<=20,kt=Math.abs(he-ge)<=20;if(_t&&kt)return void I({lastCX:G,lastCY:he});re.current=_t?he>ge?3:2:1}var tn,ur=G-W,In=he-U;if(Ce===0){var cr=Hn(ur+we,ue,mn,innerWidth)[0],Pr=Hn(In+m,ue,Ot,innerHeight);tn=function(Fn,yn,vn,nn){return yn&&Fn===1||nn==="x"?"x":vn&&Fn>1||nn==="y"?"y":void 0}(re.current,cr,Pr[0],Q),tn!==void 0&&x(tn,G,he,ue)}if(tn==="x"||Z)return void I({reach:"x"});var gn=Ms(ue+(Ce-F)/100/2*ue,v/H,.2);N({scale:gn}),I(Ke({touchLength:Ce,reach:tn,scale:gn},Da(q,V,H,j,ue,gn,G,he,ur,In)))}},{maxWait:8});function ie(G){return!Y&&!ce&&(T.current&&I(Ke({},G,{pause:u})),T.current)}var fe,xe,pe,Ve,Gt,ot,Jt,ke,hn=(Gt=function(G){return ie({x:G})},ot=function(G){return ie({y:G})},Jt=function(G){return T.current&&(N({scale:G}),I({scale:G})),!ce&&T.current},ke=ii({X:function(G){return Gt(G)},Y:function(G){return ot(G)},S:function(G){return Jt(G)}}),function(G,he,Ce,pn,mn,Ot,_t,kt,tn,ur,In){var cr=Xl(ur,mn,Ot),Pr=cr[0],gn=cr[1],Fn=Hn(G,kt,Pr,innerWidth),yn=Fn[0],vn=Fn[1],nn=Hn(he,kt,gn,innerHeight),zr=nn[0],vs=nn[1],Lr=Date.now()-In;if(Lr>=200||kt!==_t||Math.abs(tn-_t)>1){var Bn=Da(G,he,mn,Ot,_t,kt),wn=Bn.x,fr=Bn.y,At=yn?vn:wn!==G?wn:null,jr=zr?vs:fr!==he?fr:null;return At!==null&&mr(G,At,ke.X),jr!==null&&mr(he,jr,ke.Y),void(kt!==_t&&mr(_t,kt,ke.S))}var dr=(G-Ce)/Lr,Dn=(he-pn)/Lr,Mn=Math.sqrt(Math.pow(dr,2)+Math.pow(Dn,2)),xn=!1,_n=!1;(function(Ut,at){var lt,$t=Ut,kn=0,Pt=0,Ir=function(xi){lt||(lt=xi);var _i=xi-lt,Ju=Math.sign(Ut),ec=-.001*Ju,tc=Math.sign(-$t)*Math.pow($t,2)*2e-4,nm=$t*_i+(ec+tc)*Math.pow(_i,2)/2;kn+=nm,lt=xi,Ju*($t+=(ec+tc)*_i)<=0?zt():at(kn)?rn():zt()};function rn(){Pt=requestAnimationFrame(Ir)}function zt(){cancelAnimationFrame(Pt)}rn()})(Mn,function(Ut){var at=G+Ut*(dr/Mn),lt=he+Ut*(Dn/Mn),$t=Hn(at,_t,Pr,innerWidth),kn=$t[0],Pt=$t[1],Ir=Hn(lt,_t,gn,innerHeight),rn=Ir[0],zt=Ir[1];if(kn&&!xn&&(xn=!0,yn?mr(at,Pt,ke.X):Kf(Pt,at+(at-Pt),ke.X)),rn&&!_n&&(_n=!0,zr?mr(lt,zt,ke.Y):Kf(zt,lt+(lt-zt),ke.Y)),xn&&_n)return!1;var xi=xn||ke.X(Pt),_i=_n||ke.Y(zt);return xi&&_i})}),en=(fe=c,xe=function(G,he){Q||ee(ue!==1?1:Math.max(2,v/H),G,he)},pe=ne.useRef(0),Ve=Us(function(){pe.current=0,fe.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var G=[].slice.call(arguments);pe.current+=1,Ve.apply(void 0,G),pe.current>=2&&(Ve.cancel(),pe.current=0,xe.apply(void 0,G))});function et(G,he){if(re.current=0,(ce||Z)&&E){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Ce=Ms(ue,v/H);if(hn(q,V,we,m,H,j,ue,Ce,b,oe,S),k(G,he),de===G&&ge===he){if(ce)return void en(G,he);Z&&f(G,he)}}}function jn(G,he,Ce){Ce===void 0&&(Ce=0),I({touched:!0,CX:G,CY:he,lastCX:G,lastCY:he,lastX:q,lastY:V,lastScale:ue,touchLength:Ce,touchTime:Date.now()})}function Ar(G){I({maskTouched:!0,CX:G.clientX,CY:G.clientY,lastX:q,lastY:V})}Dr(Sn?void 0:"mousemove",function(G){G.preventDefault(),ae(G.clientX,G.clientY)}),Dr(Sn?void 0:"mouseup",function(G){et(G.clientX,G.clientY)}),Dr(Sn?"touchmove":void 0,function(G){G.preventDefault();var he=qf(G);ae.apply(void 0,he)},{passive:!1}),Dr(Sn?"touchend":void 0,function(G){var he=G.changedTouches[0];et(he.clientX,he.clientY)},{passive:!1}),Dr("resize",Us(function(){A&&!ce&&(I(Ma(v,se,oe)),R())},{maxWait:8})),Kl(function(){E&&N(Ke({scale:ue,rotate:oe},M))},[E]);var Tt=function(G,he,Ce,pn,mn,Ot,_t,kt,tn,ur){var In=function(wn,fr,At,jr,dr){var Dn=ne.useRef(!1),Mn=Lo({lead:!0,scale:At}),xn=Mn[0],_n=xn.lead,Ut=xn.scale,at=Mn[1],lt=Us(function($t){try{return dr(!0),at({lead:!1,scale:$t}),Promise.resolve()}catch(kn){return Promise.reject(kn)}},{wait:jr});return Kl(function(){Dn.current?(dr(!1),at({lead:!0}),lt(At)):Dn.current=!0},[At]),_n?[wn*Ut,fr*Ut,At/Ut]:[wn*At,fr*At,1]}(Ot,_t,kt,tn,ur),cr=In[0],Pr=In[1],gn=In[2],Fn=function(wn,fr,At,jr,dr){var Dn=ne.useState(W1),Mn=Dn[0],xn=Dn[1],_n=ne.useState(0),Ut=_n[0],at=_n[1],lt=ne.useRef(),$t=ii({OK:function(){return wn&&at(4)}});function kn(Pt){dr(!1),at(Pt)}return ne.useEffect(function(){if(lt.current||(lt.current=Date.now()),At){if(function(Pt,Ir){var rn=Pt&&Pt.current;if(rn&&rn.nodeType===1){var zt=rn.getBoundingClientRect();Ir({T:zt.top,L:zt.left,W:zt.width,H:zt.height,FIT:rn.tagName==="IMG"?getComputedStyle(rn).objectFit:void 0})}}(fr,xn),wn)return Date.now()-lt.current<250?(at(1),requestAnimationFrame(function(){at(2),requestAnimationFrame(function(){return kn(3)})}),void setTimeout($t.OK,jr)):void at(4);kn(5)}},[wn,At]),[Ut,Mn]}(G,he,Ce,tn,ur),yn=Fn[0],vn=Fn[1],nn=vn.W,zr=vn.FIT,vs=innerWidth/2,Lr=innerHeight/2,Bn=yn<3||yn>4;return[Bn?nn?vn.L:vs:pn+(vs-Ot*kt/2),Bn?nn?vn.T:Lr:mn+(Lr-_t*kt/2),cr,Bn&&zr?cr*(vn.H/nn):Pr,yn===0?gn:Bn?nn/(Ot*kt)||.01:gn,Bn?zr?1:0:1,yn,zr]}(u,l,A,q,V,H,j,ue,h,function(G){return I({pause:G})}),ye=Tt[4],Re=Tt[6],Ae="transform "+h+"ms "+y,Pe={className:p,onMouseDown:Sn?void 0:function(G){G.stopPropagation(),G.button===0&&jn(G.clientX,G.clientY,0)},onTouchStart:Sn?function(G){G.stopPropagation(),jn.apply(void 0,qf(G))}:void 0,onWheel:function(G){if(!Q){var he=Ms(ue-G.deltaY/100/2,v/H);I({stopRaf:!0}),ee(he,G.clientX,G.clientY)}},style:{width:Tt[2]+"px",height:Tt[3]+"px",opacity:Tt[5],objectFit:Re===4?void 0:Tt[7],transform:oe?"rotate("+oe+"deg)":void 0,transition:Re>2?Ae+", opacity "+h+"ms ease, height "+(Re<4?h/2:Re>4?h:0)+"ms "+y:void 0}};return ve.createElement("div",{className:"PhotoView__PhotoWrap"+(w?" "+w:""),style:g,onMouseDown:!Sn&&E?Ar:void 0,onTouchStart:Sn&&E?function(G){return Ar(G.touches[0])}:void 0},ve.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+ye+", 0, 0, "+ye+", "+Tt[0]+", "+Tt[1]+")",transition:ce||K?void 0:Ae,willChange:E?"transform":void 0}},n?ve.createElement(K1,Ke({src:n,loaded:A,broken:J},Pe,{onPhotoLoad:function(G){I(Ke({},G,G.loaded&&Ma(G.naturalWidth||0,G.naturalHeight||0,oe)))},loadingElement:d,brokenElement:_})):r&&r({attrs:Pe,scale:ye,rotate:oe})))}var Xf={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function Z1(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,i=e.easing,s=e.photoClosable,o=e.maskClosable,a=o===void 0||o,l=e.maskOpacity,u=l===void 0?1:l,h=e.pullClosable,y=h===void 0||h,w=e.bannerVisible,p=w===void 0||w,g=e.overlayRender,d=e.toolbarRender,_=e.className,c=e.maskClassName,f=e.photoClassName,x=e.photoWrapClassName,k=e.loadingElement,R=e.brokenElement,E=e.images,N=e.index,L=N===void 0?0:N,P=e.onIndexChange,I=e.visible,re=e.onClose,T=e.afterClose,D=e.portalContainer,v=Lo(Xf),B=v[0],se=v[1],X=ne.useState(0),H=X[0],z=X[1],j=B.x,O=B.touched,A=B.pause,J=B.lastCX,q=B.lastCY,V=B.bg,ce=V===void 0?u:V,Y=B.lastBg,Z=B.overlay,oe=B.minimal,ue=B.scale,de=B.rotate,ge=B.onScale,we=B.onRotate,m=e.hasOwnProperty("index"),W=m?L:H,U=m?P:z,b=ne.useRef(W),S=E.length,F=E[W],K=typeof n=="boolean"?n:S>n,Q=function(ye,Re){var Ae=ne.useReducer(function(Ce){return!Ce},!1)[1],Pe=ne.useRef(0),G=function(Ce){var pn=ne.useRef(Ce);function mn(Ot){pn.current=Ot}return ne.useMemo(function(){(function(Ot){ye?(Ot(ye),Pe.current=1):Pe.current=2})(mn)},[Ce]),[pn.current,mn]}(ye),he=G[1];return[G[0],Pe.current,function(){Ae(),Pe.current===2&&(he(!1),Re&&Re()),Pe.current=0}]}(I,T),M=Q[0],ee=Q[1],ae=Q[2];Kl(function(){if(M)return se({pause:!0,x:W*-(innerWidth+Br)}),void(b.current=W);se(Xf)},[M]);var ie=ii({close:function(ye){we&&we(0),se({overlay:!0,lastBg:ce}),re(ye)},changeIndex:function(ye,Re){Re===void 0&&(Re=!1);var Ae=K?b.current+(ye-W):ye,Pe=S-1,G=ql(Ae,0,Pe),he=K?Ae:G,Ce=innerWidth+Br;se({touched:!1,lastCX:void 0,lastCY:void 0,x:-Ce*he,pause:Re}),b.current=he,U&&U(K?ye<0?Pe:ye>Pe?0:ye:G)}}),fe=ie.close,xe=ie.changeIndex;function pe(ye){return ye?fe():se({overlay:!Z})}function Ve(){se({x:-(innerWidth+Br)*W,lastCX:void 0,lastCY:void 0,pause:!0}),b.current=W}function Gt(ye,Re,Ae,Pe){ye==="x"?function(G){if(J!==void 0){var he=G-J,Ce=he;!K&&(W===0&&he>0||W===S-1&&he<0)&&(Ce=he/2),se({touched:!0,lastCX:J,x:-(innerWidth+Br)*b.current+Ce,pause:!1})}else se({touched:!0,lastCX:G,x:j,pause:!1})}(Re):ye==="y"&&function(G,he){if(q!==void 0){var Ce=u===null?null:ql(u,.01,u-Math.abs(G-q)/100/4);se({touched:!0,lastCY:q,bg:he===1?Ce:u,minimal:he===1})}else se({touched:!0,lastCY:G,bg:ce,minimal:!0})}(Ae,Pe)}function ot(ye,Re){var Ae=ye-(J??ye),Pe=Re-(q??Re),G=!1;if(Ae<-40)xe(W+1);else if(Ae>40)xe(W-1);else{var he=-(innerWidth+Br)*b.current;Math.abs(Pe)>100&&oe&&y&&(G=!0,fe()),se({touched:!1,x:he,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!G||Z})}}Dr("keydown",function(ye){if(I)switch(ye.key){case"ArrowLeft":xe(W-1,!0);break;case"ArrowRight":xe(W+1,!0);break;case"Escape":fe()}});var Jt=function(ye,Re,Ae){return ne.useMemo(function(){var Pe=ye.length;return Ae?ye.concat(ye).concat(ye).slice(Pe+Re-1,Pe+Re+2):ye.slice(Math.max(Re-1,0),Math.min(Re+2,Pe+1))},[ye,Re,Ae])}(E,W,K);if(!M)return null;var ke=Z&&!ee,hn=I?ce:Y,en=ge&&we&&{images:E,index:W,visible:I,onClose:fe,onIndexChange:xe,overlayVisible:ke,overlay:F&&F.overlay,scale:ue,rotate:de,onScale:ge,onRotate:we},et=r?r(ee):400,jn=i?i(ee):Vf,Ar=r?r(3):600,Tt=i?i(3):Vf;return ve.createElement(F1,{className:"PhotoView-Portal"+(ke?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(_?" "+_:""),role:"dialog",onClick:function(ye){return ye.stopPropagation()},container:D},I&&ve.createElement(U1,null),ve.createElement("div",{className:"PhotoView-Slider__Backdrop"+(c?" "+c:"")+(ee===1?" PhotoView-Slider__fadeIn":ee===2?" PhotoView-Slider__fadeOut":""),style:{background:hn?"rgba(0, 0, 0, "+hn+")":void 0,transitionTimingFunction:jn,transitionDuration:(O?0:et)+"ms",animationDuration:et+"ms"},onAnimationEnd:ae}),p&&ve.createElement("div",{className:"PhotoView-Slider__BannerWrap"},ve.createElement("div",{className:"PhotoView-Slider__Counter"},W+1," / ",S),ve.createElement("div",{className:"PhotoView-Slider__BannerRight"},d&&en&&d(en),ve.createElement(B1,{className:"PhotoView-Slider__toolbarIcon",onClick:fe}))),Jt.map(function(ye,Re){var Ae=K||W!==0?b.current-1+Re:W+Re;return ve.createElement(Y1,{key:K?ye.key+"/"+ye.src+"/"+Ae:ye.key,item:ye,speed:et,easing:jn,visible:I,onReachMove:Gt,onReachUp:ot,onPhotoTap:function(){return pe(s)},onMaskTap:function(){return pe(a)},wrapClassName:x,className:f,style:{left:(innerWidth+Br)*Ae+"px",transform:"translate3d("+j+"px, 0px, 0)",transition:O||A?void 0:"transform "+Ar+"ms "+Tt},loadingElement:k,brokenElement:R,onPhotoResize:Ve,isActive:b.current===Ae,expose:se})}),!Sn&&p&&ve.createElement(ve.Fragment,null,(K||W!==0)&&ve.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return xe(W-1,!0)}},ve.createElement(D1,null)),(K||W+1-1){var c=u.slice();return c.splice(_,1,d),void a({images:c})}a(function(f){return{images:f.images.concat(d)}})},remove:function(d){a(function(_){var c=_.images.filter(function(f){return f.key!==d});return{images:c,index:Math.min(c.length-1,y)}})},show:function(d){var _=u.findIndex(function(c){return c.key===d});a({visible:!0,index:_}),r&&r(!0,_,o)}}),p=ii({close:function(){a({visible:!1}),r&&r(!1,y,o)},changeIndex:function(d){a({index:d}),n&&n(d,o)}}),g=ne.useMemo(function(){return Ke({},o,w)},[o,w]);return ve.createElement(j1.Provider,{value:g},t,ve.createElement(Z1,Ke({images:u,visible:h,index:y,onIndexChange:p.changeIndex,onClose:p.close},i)))}function ew(){const{filteredImages:e,currentLibraryId:t,thumbnailHeight:n,selectedImage:r,setSelectedImage:i,selectedImages:s,setSelectedImages:o,toggleImageSelection:a,clearSelection:l,isResizingPanels:u}=Te(),h=ne.useRef(null),[y,w]=ne.useState(0),[p,g]=ne.useState(-1),[d,_]=ne.useState(null);ne.useEffect(()=>{let E=null,N=0;const L=10,P={current:0};let I=null;const re=v=>(Math.abs(v-P.current)<12||(P.current=v,I&&clearTimeout(I),I=setTimeout(()=>{w(v)},50)),!0),T=()=>{if(h.current){const v=h.current.offsetWidth-32;if(v>0)return re(v)}return!1},D=()=>{T()?h.current&&(E=new ResizeObserver(()=>{Te.getState().isResizingPanels||T()}),E.observe(h.current)):N{E&&E.disconnect(),I&&clearTimeout(I)}},[]),ne.useEffect(()=>{if(u||!h.current)return;const E=h.current.offsetWidth-32;E>0&&w(E)},[u]);const c=ne.useMemo(()=>{if(!e.length||!y)return[];const E=16,N=n,L=[];let P=[],I=0;return e.forEach((re,T)=>{const D=re.width/re.height,v=N*D;P.push({...re,originalWidth:v,aspectRatio:D}),I+=v;const B=(P.length-1)*E,se=I+B,X=T===e.length-1;let H=!1;if(X)H=!0;else if(se>=y*.95)H=!0;else{const z=e[T+1];if(z){const j=z.width/z.height,O=N*j;I+O+P.length*E>y*1.2&&(H=!0)}}if(H){const z=(P.length-1)*E;let O=(y-z)/I;X&&P.length<3&&(O=Math.min(O,1.2));const A=N*O;P=P.map(J=>({...J,calculatedWidth:J.originalWidth*O,calculatedHeight:A})),L.push(P),P=[],I=0}}),L},[e,n,y]),f=E=>{if(!t||!E.thumbnail_path)return"";const N=E.thumbnail_path.replace(/\\/g,"/").split("/").pop();return ct.getThumbnailUrl(t,"200",N)},x=E=>t?ct.getOriginalUrl(t,E.path):"",k=ne.useMemo(()=>e.map(E=>({src:x(E),key:E.id})),[e,t]),R=(E,N,L)=>{if(N.ctrlKey||N.metaKey)N.preventDefault(),a(E),_(L);else if(N.shiftKey&&d!==null){N.preventDefault();const P=Math.min(d,L),I=Math.max(d,L),T=c.flat().slice(P,I+1);o(T)}else l(),i(E),_(L)};return e.length?(c.flat(),C.jsx("div",{ref:h,className:"h-full overflow-y-auto p-4",children:C.jsx(J1,{images:k,visible:p>=0,onClose:()=>g(-1),index:p,onIndexChange:g,children:C.jsx("div",{className:"space-y-8",children:c.map((E,N)=>C.jsx("div",{className:"flex gap-4",children:E.map((L,P)=>{const I=c.slice(0,N).flat().length+P,re=(r==null?void 0:r.id)===L.id,T=s.some(v=>v.id===L.id),D=re||T;return C.jsxs("div",{className:"flex-shrink-0",style:{width:`${L.calculatedWidth}px`},children:[C.jsxs("div",{className:"relative group cursor-pointer overflow-hidden rounded-lg transition-all hover:shadow-lg",style:{height:`${L.calculatedHeight}px`,backgroundColor:"#2a2a2a",border:D?"3px solid #3b82f6":"3px solid transparent"},onClick:v=>R(L,v,I),onDoubleClick:()=>g(I),children:[C.jsx("img",{src:f(L),alt:L.filename,className:"w-full h-full object-cover",loading:"lazy",onError:v=>{console.error("Image load error:",L.filename,f(L)),v.target.style.display="none"}}),C.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-20 transition-all pointer-events-none"})]}),C.jsx("div",{className:"mt-1 px-1",children:C.jsx("p",{className:"text-xs truncate text-center transition-colors",style:{color:D?"#3b82f6":"#909090",fontWeight:D?"600":"400"},children:L.filename})})]},L.id)})},N))})})})):C.jsx("div",{className:"flex items-center justify-center h-full text-gray-500 dark:text-gray-400",children:C.jsxs("div",{className:"text-center",children:[C.jsx("p",{className:"text-lg mb-2",children:"暂无图片"}),C.jsx("p",{className:"text-sm",children:"请添加素材库或调整搜索条件"})]})})}function Yf(){const{currentLibraryId:e,searchKeywords:t,filters:n,selectedFolder:r,setImages:i,setTotalImageCount:s,scanProgress:o,scanStartTime:a}=Te(),l=ne.useRef(0),u=()=>{if(!o||!a||o.current===0)return null;const p=Date.now()-a,g=o.current/o.total;if(g===0)return null;const d=p/g-p,_=Math.ceil(d/1e3);if(_<60)return`剩余约 ${_} 秒`;if(_<3600){const x=Math.floor(_/60),k=_%60;return k>0?`剩余约 ${x} 分 ${k} 秒`:`剩余约 ${x} 分钟`}const c=Math.floor(_/3600),f=Math.floor(_%3600/60);return f>0?`剩余约 ${c} 小时 ${f} 分钟`:`剩余约 ${c} 小时`};ne.useEffect(()=>{e&&(y(),w(),!r&&!t&&Object.values(n).every(p=>!p||Array.isArray(p)&&p.length===0)&&h())},[e,t,n,r]);const h=async()=>{if(e)try{const p=await ct.search(e,{});s(p.data.images.length)}catch(p){console.error("Error loading total count:",p)}},y=async()=>{if(!e)return;const p=++l.current;try{const g={keywords:t,...n};r&&(g.folder=r);const d=await ct.search(e,g);p===l.current&&i(d.data.images)}catch(g){p===l.current&&console.error("Error loading images:",g)}},w=async()=>{if(e)try{const p=await ct.getFolders(e);Te.getState().setFolders(p.data.folders)}catch(p){console.error("Error loading folders:",p)}};return C.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-900",children:[o&&C.jsxs("div",{className:"p-4 bg-blue-50 dark:bg-blue-900 border-b border-blue-200 dark:border-blue-700",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("div",{className:"text-sm font-medium text-blue-700 dark:text-blue-300",children:o.status==="preparing"?"正在准备扫描...":"正在扫描素材库..."}),C.jsxs("div",{className:"text-sm text-blue-600 dark:text-blue-400",children:[o.percent,"%"]})]}),C.jsx("div",{className:"w-full bg-blue-200 dark:bg-blue-800 rounded-full h-2 mb-2",children:C.jsx("div",{className:`h-2 rounded-full transition-all duration-300 ${o.status==="preparing"?"bg-blue-400 animate-pulse":"bg-blue-500"}`,style:{width:`${o.percent}%`}})}),C.jsxs("div",{className:"flex items-center justify-between text-xs text-blue-600 dark:text-blue-400",children:[C.jsx("span",{children:o.status==="preparing"?"正在初始化...":`已处理 ${o.current} / ${o.total} 张图片`}),C.jsx("span",{children:u()||"扫描完成后将自动显示"})]})]}),C.jsx("div",{className:"flex-1 overflow-hidden",children:C.jsx(ew,{})})]})}function $s(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var tm={exports:{}};/*! - -JSZip v3.10.1 - A JavaScript class for generating and reading zip files - - -(c) 2009-2016 Stuart Knightley -Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. - -JSZip uses the library pako released under the MIT license : -https://github.com/nodeca/pako/blob/main/LICENSE -*/(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,i,s){function o(u,h){if(!i[u]){if(!r[u]){var y=typeof $s=="function"&&$s;if(!h&&y)return y(u,!0);if(a)return a(u,!0);var w=new Error("Cannot find module '"+u+"'");throw w.code="MODULE_NOT_FOUND",w}var p=i[u]={exports:{}};r[u][0].call(p.exports,function(g){var d=r[u][1][g];return o(d||g)},p,p.exports,n,r,i,s)}return i[u].exports}for(var a=typeof $s=="function"&&$s,l=0;l>2,p=(3&u)<<4|h>>4,g=1>6:64,d=2>4,h=(15&w)<<4|(p=a.indexOf(l.charAt(d++)))>>2,y=(3&p)<<6|(g=a.indexOf(l.charAt(d++))),f[_++]=u,p!==64&&(f[_++]=h),g!==64&&(f[_++]=y);return f}},{"./support":30,"./utils":32}],2:[function(n,r,i){var s=n("./external"),o=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function u(h,y,w,p,g){this.compressedSize=h,this.uncompressedSize=y,this.crc32=w,this.compression=p,this.compressedContent=g}u.prototype={getContentWorker:function(){var h=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),y=this;return h.on("end",function(){if(this.streamInfo.data_length!==y.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(h,y,w){return h.pipe(new a).pipe(new l("uncompressedSize")).pipe(y.compressWorker(w)).pipe(new l("compressedSize")).withStreamInfo("compression",y)},r.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var s=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var s=n("./utils"),o=function(){for(var a,l=[],u=0;u<256;u++){a=u;for(var h=0;h<8;h++)a=1&a?3988292384^a>>>1:a>>>1;l[u]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(u,h,y,w){var p=o,g=w+y;u^=-1;for(var d=w;d>>8^p[255&(u^h[d])];return-1^u}(0|l,a,a.length,0):function(u,h,y,w){var p=o,g=w+y;u^=-1;for(var d=w;d>>8^p[255&(u^h.charCodeAt(d))];return-1^u}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var s=null;s=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:s}},{lie:37}],7:[function(n,r,i){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),u=s?"uint8array":"array";function h(y,w){l.call(this,"FlateWorker/"+y),this._pako=null,this._pakoAction=y,this._pakoOptions=w,this.meta={}}i.magic="\b\0",a.inherits(h,l),h.prototype.processChunk=function(y){this.meta=y.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,y.data),!1)},h.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var y=this;this._pako.onData=function(w){y.push({data:w,meta:y.meta})}},i.compressWorker=function(y){return new h("Deflate",y)},i.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function s(p,g){var d,_="";for(d=0;d>>=8;return _}function o(p,g,d,_,c,f){var x,k,R=p.file,E=p.compression,N=f!==u.utf8encode,L=a.transformTo("string",f(R.name)),P=a.transformTo("string",u.utf8encode(R.name)),I=R.comment,re=a.transformTo("string",f(I)),T=a.transformTo("string",u.utf8encode(I)),D=P.length!==R.name.length,v=T.length!==I.length,B="",se="",X="",H=R.dir,z=R.date,j={crc32:0,compressedSize:0,uncompressedSize:0};g&&!d||(j.crc32=p.crc32,j.compressedSize=p.compressedSize,j.uncompressedSize=p.uncompressedSize);var O=0;g&&(O|=8),N||!D&&!v||(O|=2048);var A=0,J=0;H&&(A|=16),c==="UNIX"?(J=798,A|=function(V,ce){var Y=V;return V||(Y=ce?16893:33204),(65535&Y)<<16}(R.unixPermissions,H)):(J=20,A|=function(V){return 63&(V||0)}(R.dosPermissions)),x=z.getUTCHours(),x<<=6,x|=z.getUTCMinutes(),x<<=5,x|=z.getUTCSeconds()/2,k=z.getUTCFullYear()-1980,k<<=4,k|=z.getUTCMonth()+1,k<<=5,k|=z.getUTCDate(),D&&(se=s(1,1)+s(h(L),4)+P,B+="up"+s(se.length,2)+se),v&&(X=s(1,1)+s(h(re),4)+T,B+="uc"+s(X.length,2)+X);var q="";return q+=` -\0`,q+=s(O,2),q+=E.magic,q+=s(x,2),q+=s(k,2),q+=s(j.crc32,4),q+=s(j.compressedSize,4),q+=s(j.uncompressedSize,4),q+=s(L.length,2),q+=s(B.length,2),{fileRecord:y.LOCAL_FILE_HEADER+q+L+B,dirRecord:y.CENTRAL_FILE_HEADER+s(J,2)+q+s(re.length,2)+"\0\0\0\0"+s(A,4)+s(_,4)+L+B+re}}var a=n("../utils"),l=n("../stream/GenericWorker"),u=n("../utf8"),h=n("../crc32"),y=n("../signature");function w(p,g,d,_){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=d,this.encodeFileName=_,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(w,l),w.prototype.push=function(p){var g=p.meta.percent||0,d=this.entriesCount,_=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,l.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:d?(g+100*(d-_-1))/d:100}}))},w.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var g=this.streamFiles&&!p.file.dir;if(g){var d=o(p,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:d.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(p){this.accumulate=!1;var g=this.streamFiles&&!p.file.dir,d=o(p,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(d.dirRecord),g)this.push({data:function(_){return y.DATA_DESCRIPTOR+s(_.crc32,4)+s(_.compressedSize,4)+s(_.uncompressedSize,4)}(p),meta:{percent:100}});else for(this.push({data:d.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var p=this.bytesWritten,g=0;g=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=o},{"../utils":32}],19:[function(n,r,i){var s=n("./Uint8ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var s=n("./DataReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=o},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var s=n("./ArrayReader");function o(a){s.call(this,a)}n("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var s=n("../utils"),o=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),u=n("./NodeBufferReader"),h=n("./Uint8ArrayReader");r.exports=function(y){var w=s.getTypeOf(y);return s.checkSupport(w),w!=="string"||o.uint8array?w==="nodebuffer"?new u(y):o.uint8array?new h(s.transformTo("uint8array",y)):new a(s.transformTo("array",y)):new l(y)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var s=n("./GenericWorker"),o=n("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var s=n("./GenericWorker"),o=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var s=n("../utils"),o=n("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(h){u.dataIsReady=!0,u.data=h,u.max=h&&h.length||0,u.type=s.getTypeOf(h),u.isPaused||u._tickAndRepeat()},function(h){u.error(h)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},r.exports=s},{}],29:[function(n,r,i){var s=n("../utils"),o=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),u=n("../support"),h=n("../external"),y=null;if(u.nodestream)try{y=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(g,d){return new h.Promise(function(_,c){var f=[],x=g._internalType,k=g._outputType,R=g._mimeType;g.on("data",function(E,N){f.push(E),d&&d(N)}).on("error",function(E){f=[],c(E)}).on("end",function(){try{var E=function(N,L,P){switch(N){case"blob":return s.newBlob(s.transformTo("arraybuffer",L),P);case"base64":return l.encode(L);default:return s.transformTo(N,L)}}(k,function(N,L){var P,I=0,re=null,T=0;for(P=0;P"u")i.blob=!1;else{var s=new ArrayBuffer(0);try{i.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var s=n("./utils"),o=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),u=new Array(256),h=0;h<256;h++)u[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;u[254]=u[254]=1;function y(){l.call(this,"utf-8 decode"),this.leftOver=null}function w(){l.call(this,"utf-8 encode")}i.utf8encode=function(p){return o.nodebuffer?a.newBufferFrom(p,"utf-8"):function(g){var d,_,c,f,x,k=g.length,R=0;for(f=0;f>>6:(_<65536?d[x++]=224|_>>>12:(d[x++]=240|_>>>18,d[x++]=128|_>>>12&63),d[x++]=128|_>>>6&63),d[x++]=128|63&_);return d}(p)},i.utf8decode=function(p){return o.nodebuffer?s.transformTo("nodebuffer",p).toString("utf-8"):function(g){var d,_,c,f,x=g.length,k=new Array(2*x);for(d=_=0;d>10&1023,k[_++]=56320|1023&c)}return k.length!==_&&(k.subarray?k=k.subarray(0,_):k.length=_),s.applyFromCharCode(k)}(p=s.transformTo(o.uint8array?"uint8array":"array",p))},s.inherits(y,l),y.prototype.processChunk=function(p){var g=s.transformTo(o.uint8array?"uint8array":"array",p.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var d=g;(g=new Uint8Array(d.length+this.leftOver.length)).set(this.leftOver,0),g.set(d,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var _=function(f,x){var k;for((x=x||f.length)>f.length&&(x=f.length),k=x-1;0<=k&&(192&f[k])==128;)k--;return k<0||k===0?x:k+u[f[k]]>x?k:x}(g),c=g;_!==g.length&&(o.uint8array?(c=g.subarray(0,_),this.leftOver=g.subarray(_,g.length)):(c=g.slice(0,_),this.leftOver=g.slice(_,g.length))),this.push({data:i.utf8decode(c),meta:p.meta})},y.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=y,s.inherits(w,l),w.prototype.processChunk=function(p){this.push({data:i.utf8encode(p.data),meta:p.meta})},i.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var s=n("./support"),o=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function u(d){return d}function h(d,_){for(var c=0;c>8;this.dir=!!(16&this.externalFileAttributes),p==0&&(this.dosPermissions=63&this.externalFileAttributes),p==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var p=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(p){var g,d,_,c=p.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});p.index+4>>6:(p<65536?w[_++]=224|p>>>12:(w[_++]=240|p>>>18,w[_++]=128|p>>>12&63),w[_++]=128|p>>>6&63),w[_++]=128|63&p);return w},i.buf2binstring=function(y){return h(y,y.length)},i.binstring2buf=function(y){for(var w=new s.Buf8(y.length),p=0,g=w.length;p>10&1023,f[g++]=56320|1023&d)}return h(f,g)},i.utf8border=function(y,w){var p;for((w=w||y.length)>y.length&&(w=y.length),p=w-1;0<=p&&(192&y[p])==128;)p--;return p<0||p===0?w:p+l[y[p]]>w?p:w}},{"./common":41}],43:[function(n,r,i){r.exports=function(s,o,a,l){for(var u=65535&s|0,h=s>>>16&65535|0,y=0;a!==0;){for(a-=y=2e3>>1:o>>>1;a[l]=o}return a}();r.exports=function(o,a,l,u){var h=s,y=u+l;o^=-1;for(var w=u;w>>8^h[255&(o^a[w])];return-1^o}},{}],46:[function(n,r,i){var s,o=n("../utils/common"),a=n("./trees"),l=n("./adler32"),u=n("./crc32"),h=n("./messages"),y=0,w=4,p=0,g=-2,d=-1,_=4,c=2,f=8,x=9,k=286,R=30,E=19,N=2*k+1,L=15,P=3,I=258,re=I+P+1,T=42,D=113,v=1,B=2,se=3,X=4;function H(m,W){return m.msg=h[W],W}function z(m){return(m<<1)-(4m.avail_out&&(U=m.avail_out),U!==0&&(o.arraySet(m.output,W.pending_buf,W.pending_out,U,m.next_out),m.next_out+=U,W.pending_out+=U,m.total_out+=U,m.avail_out-=U,W.pending-=U,W.pending===0&&(W.pending_out=0))}function A(m,W){a._tr_flush_block(m,0<=m.block_start?m.block_start:-1,m.strstart-m.block_start,W),m.block_start=m.strstart,O(m.strm)}function J(m,W){m.pending_buf[m.pending++]=W}function q(m,W){m.pending_buf[m.pending++]=W>>>8&255,m.pending_buf[m.pending++]=255&W}function V(m,W){var U,b,S=m.max_chain_length,F=m.strstart,K=m.prev_length,Q=m.nice_match,M=m.strstart>m.w_size-re?m.strstart-(m.w_size-re):0,ee=m.window,ae=m.w_mask,ie=m.prev,fe=m.strstart+I,xe=ee[F+K-1],pe=ee[F+K];m.prev_length>=m.good_match&&(S>>=2),Q>m.lookahead&&(Q=m.lookahead);do if(ee[(U=W)+K]===pe&&ee[U+K-1]===xe&&ee[U]===ee[F]&&ee[++U]===ee[F+1]){F+=2,U++;do;while(ee[++F]===ee[++U]&&ee[++F]===ee[++U]&&ee[++F]===ee[++U]&&ee[++F]===ee[++U]&&ee[++F]===ee[++U]&&ee[++F]===ee[++U]&&ee[++F]===ee[++U]&&ee[++F]===ee[++U]&&FM&&--S!=0);return K<=m.lookahead?K:m.lookahead}function ce(m){var W,U,b,S,F,K,Q,M,ee,ae,ie=m.w_size;do{if(S=m.window_size-m.lookahead-m.strstart,m.strstart>=ie+(ie-re)){for(o.arraySet(m.window,m.window,ie,ie,0),m.match_start-=ie,m.strstart-=ie,m.block_start-=ie,W=U=m.hash_size;b=m.head[--W],m.head[W]=ie<=b?b-ie:0,--U;);for(W=U=ie;b=m.prev[--W],m.prev[W]=ie<=b?b-ie:0,--U;);S+=ie}if(m.strm.avail_in===0)break;if(K=m.strm,Q=m.window,M=m.strstart+m.lookahead,ee=S,ae=void 0,ae=K.avail_in,ee=P)for(F=m.strstart-m.insert,m.ins_h=m.window[F],m.ins_h=(m.ins_h<=P&&(m.ins_h=(m.ins_h<=P)if(b=a._tr_tally(m,m.strstart-m.match_start,m.match_length-P),m.lookahead-=m.match_length,m.match_length<=m.max_lazy_match&&m.lookahead>=P){for(m.match_length--;m.strstart++,m.ins_h=(m.ins_h<=P&&(m.ins_h=(m.ins_h<=P&&m.match_length<=m.prev_length){for(S=m.strstart+m.lookahead-P,b=a._tr_tally(m,m.strstart-1-m.prev_match,m.prev_length-P),m.lookahead-=m.prev_length-1,m.prev_length-=2;++m.strstart<=S&&(m.ins_h=(m.ins_h<m.pending_buf_size-5&&(U=m.pending_buf_size-5);;){if(m.lookahead<=1){if(ce(m),m.lookahead===0&&W===y)return v;if(m.lookahead===0)break}m.strstart+=m.lookahead,m.lookahead=0;var b=m.block_start+U;if((m.strstart===0||m.strstart>=b)&&(m.lookahead=m.strstart-b,m.strstart=b,A(m,!1),m.strm.avail_out===0)||m.strstart-m.block_start>=m.w_size-re&&(A(m,!1),m.strm.avail_out===0))return v}return m.insert=0,W===w?(A(m,!0),m.strm.avail_out===0?se:X):(m.strstart>m.block_start&&(A(m,!1),m.strm.avail_out),v)}),new oe(4,4,8,4,Y),new oe(4,5,16,8,Y),new oe(4,6,32,32,Y),new oe(4,4,16,16,Z),new oe(8,16,32,32,Z),new oe(8,16,128,128,Z),new oe(8,32,128,256,Z),new oe(32,128,258,1024,Z),new oe(32,258,258,4096,Z)],i.deflateInit=function(m,W){return we(m,W,f,15,8,0)},i.deflateInit2=we,i.deflateReset=ge,i.deflateResetKeep=de,i.deflateSetHeader=function(m,W){return m&&m.state?m.state.wrap!==2?g:(m.state.gzhead=W,p):g},i.deflate=function(m,W){var U,b,S,F;if(!m||!m.state||5>8&255),J(b,b.gzhead.time>>16&255),J(b,b.gzhead.time>>24&255),J(b,b.level===9?2:2<=b.strategy||b.level<2?4:0),J(b,255&b.gzhead.os),b.gzhead.extra&&b.gzhead.extra.length&&(J(b,255&b.gzhead.extra.length),J(b,b.gzhead.extra.length>>8&255)),b.gzhead.hcrc&&(m.adler=u(m.adler,b.pending_buf,b.pending,0)),b.gzindex=0,b.status=69):(J(b,0),J(b,0),J(b,0),J(b,0),J(b,0),J(b,b.level===9?2:2<=b.strategy||b.level<2?4:0),J(b,3),b.status=D);else{var K=f+(b.w_bits-8<<4)<<8;K|=(2<=b.strategy||b.level<2?0:b.level<6?1:b.level===6?2:3)<<6,b.strstart!==0&&(K|=32),K+=31-K%31,b.status=D,q(b,K),b.strstart!==0&&(q(b,m.adler>>>16),q(b,65535&m.adler)),m.adler=1}if(b.status===69)if(b.gzhead.extra){for(S=b.pending;b.gzindex<(65535&b.gzhead.extra.length)&&(b.pending!==b.pending_buf_size||(b.gzhead.hcrc&&b.pending>S&&(m.adler=u(m.adler,b.pending_buf,b.pending-S,S)),O(m),S=b.pending,b.pending!==b.pending_buf_size));)J(b,255&b.gzhead.extra[b.gzindex]),b.gzindex++;b.gzhead.hcrc&&b.pending>S&&(m.adler=u(m.adler,b.pending_buf,b.pending-S,S)),b.gzindex===b.gzhead.extra.length&&(b.gzindex=0,b.status=73)}else b.status=73;if(b.status===73)if(b.gzhead.name){S=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>S&&(m.adler=u(m.adler,b.pending_buf,b.pending-S,S)),O(m),S=b.pending,b.pending===b.pending_buf_size)){F=1;break}F=b.gzindexS&&(m.adler=u(m.adler,b.pending_buf,b.pending-S,S)),F===0&&(b.gzindex=0,b.status=91)}else b.status=91;if(b.status===91)if(b.gzhead.comment){S=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>S&&(m.adler=u(m.adler,b.pending_buf,b.pending-S,S)),O(m),S=b.pending,b.pending===b.pending_buf_size)){F=1;break}F=b.gzindexS&&(m.adler=u(m.adler,b.pending_buf,b.pending-S,S)),F===0&&(b.status=103)}else b.status=103;if(b.status===103&&(b.gzhead.hcrc?(b.pending+2>b.pending_buf_size&&O(m),b.pending+2<=b.pending_buf_size&&(J(b,255&m.adler),J(b,m.adler>>8&255),m.adler=0,b.status=D)):b.status=D),b.pending!==0){if(O(m),m.avail_out===0)return b.last_flush=-1,p}else if(m.avail_in===0&&z(W)<=z(U)&&W!==w)return H(m,-5);if(b.status===666&&m.avail_in!==0)return H(m,-5);if(m.avail_in!==0||b.lookahead!==0||W!==y&&b.status!==666){var Q=b.strategy===2?function(M,ee){for(var ae;;){if(M.lookahead===0&&(ce(M),M.lookahead===0)){if(ee===y)return v;break}if(M.match_length=0,ae=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++,ae&&(A(M,!1),M.strm.avail_out===0))return v}return M.insert=0,ee===w?(A(M,!0),M.strm.avail_out===0?se:X):M.last_lit&&(A(M,!1),M.strm.avail_out===0)?v:B}(b,W):b.strategy===3?function(M,ee){for(var ae,ie,fe,xe,pe=M.window;;){if(M.lookahead<=I){if(ce(M),M.lookahead<=I&&ee===y)return v;if(M.lookahead===0)break}if(M.match_length=0,M.lookahead>=P&&0M.lookahead&&(M.match_length=M.lookahead)}if(M.match_length>=P?(ae=a._tr_tally(M,1,M.match_length-P),M.lookahead-=M.match_length,M.strstart+=M.match_length,M.match_length=0):(ae=a._tr_tally(M,0,M.window[M.strstart]),M.lookahead--,M.strstart++),ae&&(A(M,!1),M.strm.avail_out===0))return v}return M.insert=0,ee===w?(A(M,!0),M.strm.avail_out===0?se:X):M.last_lit&&(A(M,!1),M.strm.avail_out===0)?v:B}(b,W):s[b.level].func(b,W);if(Q!==se&&Q!==X||(b.status=666),Q===v||Q===se)return m.avail_out===0&&(b.last_flush=-1),p;if(Q===B&&(W===1?a._tr_align(b):W!==5&&(a._tr_stored_block(b,0,0,!1),W===3&&(j(b.head),b.lookahead===0&&(b.strstart=0,b.block_start=0,b.insert=0))),O(m),m.avail_out===0))return b.last_flush=-1,p}return W!==w?p:b.wrap<=0?1:(b.wrap===2?(J(b,255&m.adler),J(b,m.adler>>8&255),J(b,m.adler>>16&255),J(b,m.adler>>24&255),J(b,255&m.total_in),J(b,m.total_in>>8&255),J(b,m.total_in>>16&255),J(b,m.total_in>>24&255)):(q(b,m.adler>>>16),q(b,65535&m.adler)),O(m),0=U.w_size&&(F===0&&(j(U.head),U.strstart=0,U.block_start=0,U.insert=0),ee=new o.Buf8(U.w_size),o.arraySet(ee,W,ae-U.w_size,U.w_size,0),W=ee,ae=U.w_size),K=m.avail_in,Q=m.next_in,M=m.input,m.avail_in=ae,m.next_in=0,m.input=W,ce(U);U.lookahead>=P;){for(b=U.strstart,S=U.lookahead-(P-1);U.ins_h=(U.ins_h<>>=P=L>>>24,x-=P,(P=L>>>16&255)===0)B[h++]=65535&L;else{if(!(16&P)){if(!(64&P)){L=k[(65535&L)+(f&(1<>>=P,x-=P),x<15&&(f+=v[l++]<>>=P=L>>>24,x-=P,!(16&(P=L>>>16&255))){if(!(64&P)){L=R[(65535&L)+(f&(1<>>=P,x-=P,(P=h-y)>3,f&=(1<<(x-=I<<3))-1,s.next_in=l,s.next_out=h,s.avail_in=l>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(T){var D;return T&&T.state?(D=T.state,T.total_in=T.total_out=D.total=0,T.msg="",D.wrap&&(T.adler=1&D.wrap),D.mode=g,D.last=0,D.havedict=0,D.dmax=32768,D.head=null,D.hold=0,D.bits=0,D.lencode=D.lendyn=new s.Buf32(d),D.distcode=D.distdyn=new s.Buf32(_),D.sane=1,D.back=-1,w):p}function k(T){var D;return T&&T.state?((D=T.state).wsize=0,D.whave=0,D.wnext=0,x(T)):p}function R(T,D){var v,B;return T&&T.state?(B=T.state,D<0?(v=0,D=-D):(v=1+(D>>4),D<48&&(D&=15)),D&&(D<8||15=X.wsize?(s.arraySet(X.window,D,v-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize):(B<(se=X.wsize-X.wnext)&&(se=B),s.arraySet(X.window,D,v-B,se,X.wnext),(B-=se)?(s.arraySet(X.window,D,v-B,B,0),X.wnext=B,X.whave=X.wsize):(X.wnext+=se,X.wnext===X.wsize&&(X.wnext=0),X.whave>>8&255,v.check=a(v.check,F,2,0),A=O=0,v.mode=2;break}if(v.flags=0,v.head&&(v.head.done=!1),!(1&v.wrap)||(((255&O)<<8)+(O>>8))%31){T.msg="incorrect header check",v.mode=30;break}if((15&O)!=8){T.msg="unknown compression method",v.mode=30;break}if(A-=4,m=8+(15&(O>>>=4)),v.wbits===0)v.wbits=m;else if(m>v.wbits){T.msg="invalid window size",v.mode=30;break}v.dmax=1<>8&1),512&v.flags&&(F[0]=255&O,F[1]=O>>>8&255,v.check=a(v.check,F,2,0)),A=O=0,v.mode=3;case 3:for(;A<32;){if(z===0)break e;z--,O+=B[X++]<>>8&255,F[2]=O>>>16&255,F[3]=O>>>24&255,v.check=a(v.check,F,4,0)),A=O=0,v.mode=4;case 4:for(;A<16;){if(z===0)break e;z--,O+=B[X++]<>8),512&v.flags&&(F[0]=255&O,F[1]=O>>>8&255,v.check=a(v.check,F,2,0)),A=O=0,v.mode=5;case 5:if(1024&v.flags){for(;A<16;){if(z===0)break e;z--,O+=B[X++]<>>8&255,v.check=a(v.check,F,2,0)),A=O=0}else v.head&&(v.head.extra=null);v.mode=6;case 6:if(1024&v.flags&&(z<(V=v.length)&&(V=z),V&&(v.head&&(m=v.head.extra_len-v.length,v.head.extra||(v.head.extra=new Array(v.head.extra_len)),s.arraySet(v.head.extra,B,X,V,m)),512&v.flags&&(v.check=a(v.check,B,V,X)),z-=V,X+=V,v.length-=V),v.length))break e;v.length=0,v.mode=7;case 7:if(2048&v.flags){if(z===0)break e;for(V=0;m=B[X+V++],v.head&&m&&v.length<65536&&(v.head.name+=String.fromCharCode(m)),m&&V>9&1,v.head.done=!0),T.adler=v.check=0,v.mode=12;break;case 10:for(;A<32;){if(z===0)break e;z--,O+=B[X++]<>>=7&A,A-=7&A,v.mode=27;break}for(;A<3;){if(z===0)break e;z--,O+=B[X++]<>>=1)){case 0:v.mode=14;break;case 1:if(I(v),v.mode=20,D!==6)break;O>>>=2,A-=2;break e;case 2:v.mode=17;break;case 3:T.msg="invalid block type",v.mode=30}O>>>=2,A-=2;break;case 14:for(O>>>=7&A,A-=7&A;A<32;){if(z===0)break e;z--,O+=B[X++]<>>16^65535)){T.msg="invalid stored block lengths",v.mode=30;break}if(v.length=65535&O,A=O=0,v.mode=15,D===6)break e;case 15:v.mode=16;case 16:if(V=v.length){if(z>>=5,A-=5,v.ndist=1+(31&O),O>>>=5,A-=5,v.ncode=4+(15&O),O>>>=4,A-=4,286>>=3,A-=3}for(;v.have<19;)v.lens[K[v.have++]]=0;if(v.lencode=v.lendyn,v.lenbits=7,U={bits:v.lenbits},W=u(0,v.lens,0,19,v.lencode,0,v.work,U),v.lenbits=U.bits,W){T.msg="invalid code lengths set",v.mode=30;break}v.have=0,v.mode=19;case 19:for(;v.have>>16&255,ue=65535&S,!((Z=S>>>24)<=A);){if(z===0)break e;z--,O+=B[X++]<>>=Z,A-=Z,v.lens[v.have++]=ue;else{if(ue===16){for(b=Z+2;A>>=Z,A-=Z,v.have===0){T.msg="invalid bit length repeat",v.mode=30;break}m=v.lens[v.have-1],V=3+(3&O),O>>>=2,A-=2}else if(ue===17){for(b=Z+3;A>>=Z)),O>>>=3,A-=3}else{for(b=Z+7;A>>=Z)),O>>>=7,A-=7}if(v.have+V>v.nlen+v.ndist){T.msg="invalid bit length repeat",v.mode=30;break}for(;V--;)v.lens[v.have++]=m}}if(v.mode===30)break;if(v.lens[256]===0){T.msg="invalid code -- missing end-of-block",v.mode=30;break}if(v.lenbits=9,U={bits:v.lenbits},W=u(h,v.lens,0,v.nlen,v.lencode,0,v.work,U),v.lenbits=U.bits,W){T.msg="invalid literal/lengths set",v.mode=30;break}if(v.distbits=6,v.distcode=v.distdyn,U={bits:v.distbits},W=u(y,v.lens,v.nlen,v.ndist,v.distcode,0,v.work,U),v.distbits=U.bits,W){T.msg="invalid distances set",v.mode=30;break}if(v.mode=20,D===6)break e;case 20:v.mode=21;case 21:if(6<=z&&258<=j){T.next_out=H,T.avail_out=j,T.next_in=X,T.avail_in=z,v.hold=O,v.bits=A,l(T,q),H=T.next_out,se=T.output,j=T.avail_out,X=T.next_in,B=T.input,z=T.avail_in,O=v.hold,A=v.bits,v.mode===12&&(v.back=-1);break}for(v.back=0;oe=(S=v.lencode[O&(1<>>16&255,ue=65535&S,!((Z=S>>>24)<=A);){if(z===0)break e;z--,O+=B[X++]<>de)])>>>16&255,ue=65535&S,!(de+(Z=S>>>24)<=A);){if(z===0)break e;z--,O+=B[X++]<>>=de,A-=de,v.back+=de}if(O>>>=Z,A-=Z,v.back+=Z,v.length=ue,oe===0){v.mode=26;break}if(32&oe){v.back=-1,v.mode=12;break}if(64&oe){T.msg="invalid literal/length code",v.mode=30;break}v.extra=15&oe,v.mode=22;case 22:if(v.extra){for(b=v.extra;A>>=v.extra,A-=v.extra,v.back+=v.extra}v.was=v.length,v.mode=23;case 23:for(;oe=(S=v.distcode[O&(1<>>16&255,ue=65535&S,!((Z=S>>>24)<=A);){if(z===0)break e;z--,O+=B[X++]<>de)])>>>16&255,ue=65535&S,!(de+(Z=S>>>24)<=A);){if(z===0)break e;z--,O+=B[X++]<>>=de,A-=de,v.back+=de}if(O>>>=Z,A-=Z,v.back+=Z,64&oe){T.msg="invalid distance code",v.mode=30;break}v.offset=ue,v.extra=15&oe,v.mode=24;case 24:if(v.extra){for(b=v.extra;A>>=v.extra,A-=v.extra,v.back+=v.extra}if(v.offset>v.dmax){T.msg="invalid distance too far back",v.mode=30;break}v.mode=25;case 25:if(j===0)break e;if(V=q-j,v.offset>V){if((V=v.offset-V)>v.whave&&v.sane){T.msg="invalid distance too far back",v.mode=30;break}ce=V>v.wnext?(V-=v.wnext,v.wsize-V):v.wnext-V,V>v.length&&(V=v.length),Y=v.window}else Y=se,ce=H-v.offset,V=v.length;for(jN?(P=ce[Y+_[D]],A[J+_[D]]):(P=96,0),f=1<>H)+(x-=f)]=L<<24|P<<16|I|0,x!==0;);for(f=1<>=1;if(f!==0?(O&=f-1,O+=f):O=0,D++,--q[T]==0){if(T===B)break;T=y[w+_[D]]}if(se>>7)]}function J(S,F){S.pending_buf[S.pending++]=255&F,S.pending_buf[S.pending++]=F>>>8&255}function q(S,F,K){S.bi_valid>c-K?(S.bi_buf|=F<>c-S.bi_valid,S.bi_valid+=K-c):(S.bi_buf|=F<>>=1,K<<=1,0<--F;);return K>>>1}function Y(S,F,K){var Q,M,ee=new Array(_+1),ae=0;for(Q=1;Q<=_;Q++)ee[Q]=ae=ae+K[Q-1]<<1;for(M=0;M<=F;M++){var ie=S[2*M+1];ie!==0&&(S[2*M]=ce(ee[ie]++,ie))}}function Z(S){var F;for(F=0;F>1;1<=K;K--)de(S,ee,K);for(M=fe;K=S.heap[1],S.heap[1]=S.heap[S.heap_len--],de(S,ee,1),Q=S.heap[1],S.heap[--S.heap_max]=K,S.heap[--S.heap_max]=Q,ee[2*M]=ee[2*K]+ee[2*Q],S.depth[M]=(S.depth[K]>=S.depth[Q]?S.depth[K]:S.depth[Q])+1,ee[2*K+1]=ee[2*Q+1]=M,S.heap[1]=M++,de(S,ee,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(pe,Ve){var Gt,ot,Jt,ke,hn,en,et=Ve.dyn_tree,jn=Ve.max_code,Ar=Ve.stat_desc.static_tree,Tt=Ve.stat_desc.has_stree,ye=Ve.stat_desc.extra_bits,Re=Ve.stat_desc.extra_base,Ae=Ve.stat_desc.max_length,Pe=0;for(ke=0;ke<=_;ke++)pe.bl_count[ke]=0;for(et[2*pe.heap[pe.heap_max]+1]=0,Gt=pe.heap_max+1;Gt>=7;M>>=1)if(1&xe&&ie.dyn_ltree[2*fe]!==0)return o;if(ie.dyn_ltree[18]!==0||ie.dyn_ltree[20]!==0||ie.dyn_ltree[26]!==0)return a;for(fe=32;fe>>3,(ee=S.static_len+3+7>>>3)<=M&&(M=ee)):M=ee=K+5,K+4<=M&&F!==-1?b(S,F,K,Q):S.strategy===4||ee===M?(q(S,2+(Q?1:0),3),ge(S,re,T)):(q(S,4+(Q?1:0),3),function(ie,fe,xe,pe){var Ve;for(q(ie,fe-257,5),q(ie,xe-1,5),q(ie,pe-4,4),Ve=0;Ve>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&F,S.pending_buf[S.l_buf+S.last_lit]=255&K,S.last_lit++,F===0?S.dyn_ltree[2*K]++:(S.matches++,F--,S.dyn_ltree[2*(v[K]+y+1)]++,S.dyn_dtree[2*A(F)]++),S.last_lit===S.lit_bufsize-1},i._tr_align=function(S){q(S,2,3),V(S,x,re),function(F){F.bi_valid===16?(J(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(s){(function(o,a){if(!o.setImmediate){var l,u,h,y,w=1,p={},g=!1,d=o.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(o);_=_&&_.setTimeout?_:o,l={}.toString.call(o.process)==="[object process]"?function(k){process.nextTick(function(){f(k)})}:function(){if(o.postMessage&&!o.importScripts){var k=!0,R=o.onmessage;return o.onmessage=function(){k=!1},o.postMessage("","*"),o.onmessage=R,k}}()?(y="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",x,!1):o.attachEvent("onmessage",x),function(k){o.postMessage(y+k,"*")}):o.MessageChannel?((h=new MessageChannel).port1.onmessage=function(k){f(k.data)},function(k){h.port2.postMessage(k)}):d&&"onreadystatechange"in d.createElement("script")?(u=d.documentElement,function(k){var R=d.createElement("script");R.onreadystatechange=function(){f(k),R.onreadystatechange=null,u.removeChild(R),R=null},u.appendChild(R)}):function(k){setTimeout(f,0,k)},_.setImmediate=function(k){typeof k!="function"&&(k=new Function(""+k));for(var R=new Array(arguments.length-1),E=0;E"u"?s===void 0?this:s:self)}).call(this,typeof ws<"u"?ws:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(tm);var tw=tm.exports;const Zf=Yl(tw);function Qf(){const{selectedImage:e,selectedImages:t,currentLibraryId:n,selectedFolder:r,images:i,setMobileView:s,isResizingPanels:o,resizingSide:a}=Te(),[l,u]=ne.useState(!1),[h,y]=ne.useState(""),[w,p]=ne.useState(!1),[g,d]=ne.useState(!1),[_,c]=ne.useState(!1),[f,x]=ne.useState(!1),[k,R]=ne.useState(0),[E,N]=ne.useState(!1),[L,P]=ne.useState(0),I=t.length>0,re=I?t[0]:e;if(ne.useEffect(()=>{const j=()=>{u(window.innerWidth<768)};return j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]),ne.useEffect(()=>{if(!e||!n){y("");return}const j=T();if(y(j),p(!0),o){p(!1);return}const O=D(),A=new Image;return A.onload=()=>{y(O),p(!1)},A.onerror=()=>{console.error("Failed to load original image"),p(!1)},A.src=O,()=>{A.onload=null,A.onerror=null}},[e,n,o,a]),!e&&t.length===0)return C.jsx("div",{className:"w-full border-l border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex items-center justify-center",children:C.jsx("p",{className:"text-gray-400 dark:text-gray-500 text-sm",children:"选择图片查看详情"})});const T=()=>{if(!n||!e.thumbnail_path)return"";const j=e.thumbnail_path.replace(/\\/g,"/").split("/").pop();return ct.getThumbnailUrl(n,"200",j)},D=()=>!n||!e.path?"":ct.getOriginalUrl(n,e.path),v=async()=>{try{const j=ct.getOriginalUrl(n,e.path),A=await(await fetch(j)).blob(),J=new Image,q=new Promise((Y,Z)=>{J.onload=Y,J.onerror=Z});J.src=URL.createObjectURL(A),await q;const V=document.createElement("canvas");V.width=J.width,V.height=J.height,V.getContext("2d").drawImage(J,0,0),V.toBlob(async Y=>{try{const Z=new ClipboardItem({"image/png":Y,"text/html":new Blob([`${e.filename}`],{type:"text/html"}),"text/plain":new Blob([j],{type:"text/plain"})});await navigator.clipboard.write([Z]),c(!0),setTimeout(()=>c(!1),2e3)}catch(Z){console.error("写入剪贴板失败:",Z);try{await navigator.clipboard.write([new ClipboardItem({"image/png":Y})]),c(!0),setTimeout(()=>c(!1),2e3)}catch(oe){console.error("备用方案也失败:",oe),alert("复制失败,请重试")}}},"image/png"),URL.revokeObjectURL(J.src)}catch(j){console.error("复制图片失败:",j),alert("复制图片失败,请重试")}},B=async()=>{try{const j=I?t:[e];if(j.length===1){await v();return}const A=(await Promise.all(j.map(async q=>{const V=ct.getOriginalUrl(n,q.path),Y=await(await fetch(V)).blob();return new Promise(Z=>{const oe=new FileReader;oe.onloadend=()=>{Z({dataUrl:oe.result,filename:q.filename})},oe.readAsDataURL(Y)})}))).map(({dataUrl:q,filename:V})=>`${V}`).join(` -`),J=j.map(q=>q.filename).join(` -`);try{await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([A],{type:"text/html"}),"text/plain":new Blob([J],{type:"text/plain"})})]),c(!0),setTimeout(()=>c(!1),2e3)}catch(q){console.error("写入剪贴板失败:",q),alert(`复制失败。 - -提示:浏览器限制,多张图片会以 HTML 格式复制。 -可粘贴到 Word、富文本编辑器等。 - -如需单独使用,请使用"导出"功能。`)}}catch(j){console.error("复制图片失败:",j),alert("复制图片失败,请重试")}},se=async()=>{x(!0);try{const j=I?t:[e];if(j.length===1){const O=ct.getOriginalUrl(n,j[0].path),A=document.createElement("a");A.href=O,A.download=j[0].filename,A.target="_blank",document.body.appendChild(A),A.click(),document.body.removeChild(A)}else{const O=new Zf,A=O.folder("images");R(0);for(let V=0;V{if(!r){alert("请先选择一个文件夹");return}N(!0),P(0);try{const j=i.filter(ce=>ce.folder&&ce.folder.startsWith(r));if(j.length===0){alert("当前文件夹没有图片");return}const O=new Zf,A=r.split("/").pop()||"images",J=O.folder(A);for(let ce=0;cej<1024?j+" B":j<1024*1024?(j/1024).toFixed(2)+" KB":(j/(1024*1024)).toFixed(2)+" MB",z=j=>new Date(j).toLocaleString("zh-CN");return C.jsxs("div",{className:"w-full border-l border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex flex-col h-full",children:[l&&C.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex items-center",children:C.jsxs("button",{onClick:()=>s("main"),className:"flex items-center gap-2 text-gray-700 dark:text-gray-300 hover:text-blue-500",children:[C.jsx(E1,{className:"w-5 h-5"}),C.jsx("span",{className:"text-sm font-medium",children:"返回"})]})}),C.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:C.jsxs("div",{className:"w-full aspect-square bg-gray-100 dark:bg-gray-700 rounded-lg overflow-hidden relative",children:[C.jsx("img",{src:h,alt:re.filename,decoding:"async",className:`w-full h-full object-contain transition-opacity duration-300 ${w?"opacity-75":"opacity-100"}`}),w&&C.jsx("div",{className:"absolute top-2 right-2 bg-blue-500 text-white text-xs px-2 py-1 rounded",children:"加载原图中..."})]})}),C.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 min-h-0",children:C.jsxs("div",{children:[C.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2",children:"基本信息"}),C.jsxs("div",{className:"space-y-2 text-sm",children:[C.jsxs("div",{children:[C.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"文件名:"}),C.jsx("p",{className:"text-gray-900 dark:text-gray-100 break-all",children:e.filename})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"尺寸:"}),C.jsxs("p",{className:"text-gray-900 dark:text-gray-100",children:[e.width," × ",e.height]})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"大小:"}),C.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:H(e.size)})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"格式:"}),C.jsx("p",{className:"text-gray-900 dark:text-gray-100 uppercase",children:e.format})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"创建时间:"}),C.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:z(e.created_at)})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"修改时间:"}),C.jsx("p",{className:"text-gray-900 dark:text-gray-100",children:z(e.modified_at)})]}),C.jsxs("div",{children:[C.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"路径:"}),C.jsx("p",{className:"text-gray-900 dark:text-gray-100 text-xs break-all",children:e.path})]})]})]})}),C.jsxs("div",{className:"p-4 border-t border-gray-200 dark:border-gray-700 space-y-2 flex-shrink-0",children:[C.jsx("button",{onClick:B,className:`w-full flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-all ${_?"bg-green-500 text-white":"bg-blue-500 text-white hover:bg-blue-600"}`,children:_?C.jsxs(C.Fragment,{children:[C.jsx(C1,{className:"w-4 h-4"}),C.jsxs("span",{children:["已复制",I?` ${t.length} 张`:""]})]}):C.jsxs(C.Fragment,{children:[C.jsx(O1,{className:"w-4 h-4"}),C.jsxs("span",{children:["复制图片",I?` (${t.length})`:""]})]})}),!l&&C.jsxs(C.Fragment,{children:[C.jsxs("button",{onClick:se,disabled:f,className:"w-full flex flex-col items-center justify-center gap-2 px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(A1,{className:"w-4 h-4"}),C.jsx("span",{children:f?`打包中... ${k}%`:`导出图片${I?` (${t.length})`:""}`})]}),f&&I&&C.jsx("div",{className:"w-full bg-gray-300 dark:bg-gray-600 rounded-full h-1.5 mt-1",children:C.jsx("div",{className:"bg-blue-500 h-1.5 rounded-full transition-all duration-300",style:{width:`${k}%`}})})]}),r&&C.jsxs("button",{onClick:X,disabled:E,className:"w-full flex flex-col items-center justify-center gap-2 px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(P1,{className:"w-4 h-4"}),C.jsx("span",{children:E?`打包文件夹... ${L}%`:"导出当前文件夹"})]}),E&&C.jsx("div",{className:"w-full bg-purple-300 rounded-full h-1.5 mt-1",children:C.jsx("div",{className:"bg-white h-1.5 rounded-full transition-all duration-300",style:{width:`${L}%`}})})]})]})]})]})}function Gf(){const{theme:e,toggleTheme:t,searchKeywords:n,thumbnailHeight:r,images:i,filteredImages:s,selectedFolder:o,currentLibraryId:a,setSearchKeywords:l,setThumbnailHeight:u,setFilteredImages:h,mobileView:y}=Te(),[w,p]=ne.useState(!1),[g,d]=ne.useState([]),[_,c]=ne.useState([]),[f,x]=ne.useState(""),[k,R]=ne.useState(!1),[E,N]=ne.useState(!1),[L,P]=ne.useState(!1);ne.useEffect(()=>{const Y=()=>{N(window.innerWidth<768)};return Y(),window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)},[]),ne.useEffect(()=>{d([]),c([]),x("")},[o]),ne.useEffect(()=>{if(a)return If.start(a).then(()=>{console.log("✅ 文件监控已启动(实时检测文件变化)")}).catch(Y=>{console.error("启动文件监控失败:",Y),console.error("提示:在飞牛 fnOS 上,请确保在应用设置中授予了文件夹访问权限")}),()=>{If.stop(a).catch(Y=>console.error("Stop watch error:",Y))}},[a]);const I=Y=>{l(Y)},re=Y=>{if(Y.length===0)return[];const Z=[...Y].sort((U,b)=>U-b),oe=Z[0],ue=Z[Z.length-1];if(ue-oe<10)return[T(oe,ue)];const de=5,ge=[],we=Math.log10(oe||1),W=(Math.log10(ue)-we)/de;for(let U=0;UK>=b&&KU)},T=(Y,Z,oe=!1)=>{const ue=de=>{const ge=we=>we<10?Math.round(we):we<100?Math.round(we/5)*5:we<1e3?Math.round(we/10)*10:Math.round(we/50)*50;return de<1?`${ge(de*1024)}B`:de<1024?`${ge(de)}KB`:de<1048576?`${ge(de/1024)}MB`:`${ge(de/1048576)}GB`};return oe?`> ${ue(Y)}`:`${ue(Y)} - ${ue(Z)}`},D=Y=>{const Z=Y.match(/^(\d+(?:\.\d+)?)(B|KB|MB|GB)$/);if(!Z)return 0;const oe=parseFloat(Z[1]);switch(Z[2]){case"B":return oe/1024;case"KB":return oe;case"MB":return oe*1024;case"GB":return oe*1024*1024;default:return 0}},v=(Y,Z)=>{if(Z.startsWith(">")){const oe=Z.substring(1).trim(),ue=D(oe);return Y>=ue}else if(Z.includes(" - ")){const[oe,ue]=Z.split(" - ").map(we=>we.trim()),de=D(oe),ge=D(ue);return Y>=de&&Y{if(i.length===0)return{formats:[],sizes:[],hasHorizontal:!1,hasVertical:!1};const Y=new Set,Z=[];let oe=!1,ue=!1;i.forEach(ge=>{ge.format&&Y.add(ge.format.toLowerCase()),Z.push(ge.size/1024),ge.width>ge.height&&(oe=!0),ge.height>ge.width&&(ue=!0)});const de=re(Z);return{formats:Array.from(Y).sort(),sizes:de,hasHorizontal:oe,hasVertical:ue}},[i]),se=ne.useMemo(()=>{if(g.length===0&&_.length===0&&!f)return i;const Y=new Set(g),Z=new Set(_);return i.filter(oe=>{var ue;if(Y.size>0&&!Y.has((ue=oe.format)==null?void 0:ue.toLowerCase()))return!1;if(Z.size>0){const de=oe.size/1024;let ge=!1;for(const we of Z)if(v(de,we)){ge=!0;break}if(!ge)return!1}if(f==="horizontal"){if(oe.width<=oe.height)return!1}else if(f==="vertical"&&oe.height<=oe.width)return!1;return!0})},[i,g,_,f]);ne.useEffect(()=>{h(se)},[se,h]);const X=Y=>{d(Z=>Z.includes(Y)?Z.filter(oe=>oe!==Y):[...Z,Y])},H=Y=>{c(Z=>Z.includes(Y)?Z.filter(oe=>oe!==Y):[...Z,Y])},z=Y=>{x(Z=>Z===Y?"":Y)},j=()=>{d([]),c([]),x("")},O=async()=>{t();try{await Cn.updateTheme(e==="light"?"dark":"light")}catch(Y){console.error("Error saving theme:",Y)}},A=async Y=>{u(Y);try{await Cn.updatePreferences({thumbnailHeight:Y})}catch(Z){console.error("Error saving preferences:",Z)}},J=async()=>{if(!(!a||k)){R(!0);try{await Hl.sync(a)}catch(Y){console.error("Error refreshing:",Y),alert("刷新失败: "+Y.message)}finally{R(!1)}}},q=B.formats,V=B.sizes.map(Y=>({label:Y})),ce=[{value:"horizontal",label:"横图"},{value:"vertical",label:"竖图"}].filter(Y=>Y.value==="horizontal"&&B.hasHorizontal||Y.value==="vertical"&&B.hasVertical);if(E){const Y=y!=="sidebar";return C.jsxs("header",{className:"border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[C.jsxs("div",{className:"h-14 flex items-center justify-between px-4",children:[C.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"FlyPic"}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("button",{onClick:J,disabled:!a||k,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50",children:C.jsx(Uf,{className:`w-5 h-5 text-gray-700 dark:text-gray-300 ${k?"animate-spin":""}`})}),C.jsx("button",{onClick:()=>P(!L),className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:C.jsx($f,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})}),C.jsx("button",{onClick:O,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:e==="light"?C.jsx(Mf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}):C.jsx(Wf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})})]})]}),Y&&C.jsx("div",{className:"px-4 pb-3",children:C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("div",{className:"flex-1 relative",children:[C.jsx(Vl,{className:"absolute left-3 top-2.5 w-5 h-5 text-gray-400"}),C.jsx("input",{type:"text",placeholder:"搜索图片...",value:n,onChange:Z=>I(Z.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm"})]}),C.jsx("button",{onClick:()=>p(!w),className:`p-2 border rounded-lg ${g.length>0||_.length>0||f?"border-blue-500 bg-blue-50 dark:bg-blue-500/20":"border-gray-300 dark:border-gray-600"}`,children:C.jsx(Bf,{className:`w-5 h-5 ${g.length>0||_.length>0||f?"text-blue-600 dark:text-blue-300":"text-gray-600 dark:text-gray-400"}`})})]})}),L&&C.jsx("div",{className:"px-4 pb-3 border-t border-gray-200 dark:border-gray-700 pt-3",children:C.jsxs("div",{className:"flex flex-col gap-3",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"缩略图大小"}),C.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[r,"px"]})]}),C.jsx("input",{type:"range",min:"150",max:"300",value:r,onChange:Z=>A(parseInt(Z.target.value)),className:"w-full h-2 bg-gray-200 dark:bg-gray-700 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #3b82f6 0%, #3b82f6 ${(r-150)/150*100}%, #e5e7eb ${(r-150)/150*100}%, #e5e7eb 100%)`}})]})}),Y&&w&&C.jsxs("div",{className:"px-4 pb-3 border-t border-gray-200 dark:border-gray-700 pt-3",children:[C.jsxs("div",{className:"flex items-center justify-between mb-3",children:[C.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"筛选条件"}),C.jsx("button",{onClick:j,className:"text-xs text-blue-500",children:"清除全部"})]}),C.jsxs("div",{className:"mb-3",children:[C.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"格式"}),C.jsx("div",{className:"flex flex-wrap gap-2",children:q.map(Z=>C.jsx("button",{onClick:()=>X(Z),className:`px-3 py-1 text-xs rounded-full ${g.includes(Z)?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:Z.toUpperCase()},Z))})]}),C.jsxs("div",{className:"mb-3",children:[C.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"尺寸"}),C.jsx("div",{className:"flex flex-wrap gap-2",children:V.map(Z=>C.jsx("button",{onClick:()=>H(Z.label),className:`px-3 py-1 text-xs rounded-full ${_.includes(Z.label)?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:Z.label},Z.label))})]}),C.jsxs("div",{children:[C.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"方向"}),C.jsx("div",{className:"flex flex-wrap gap-2",children:ce.map(Z=>C.jsx("button",{onClick:()=>z(Z.value),className:`px-3 py-1 text-xs rounded-full ${f===Z.value?"bg-blue-500 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:Z.label},Z.value))})]})]})]})}return C.jsxs("header",{className:"border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[C.jsxs("div",{className:"h-14 flex items-center justify-between px-6",children:[C.jsxs("div",{className:"flex-shrink-0",children:[C.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"FlyPic"}),C.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"轻量快速的图片素材库管理"})]}),C.jsxs("div",{className:"flex-1 max-w-2xl mx-6 flex items-center gap-3",children:[C.jsxs("div",{className:"flex-1 relative",children:[C.jsx(Vl,{className:"absolute left-3 top-2.5 w-5 h-5 text-gray-400"}),C.jsx("input",{type:"text",placeholder:"搜索图片... (多个关键词用空格分隔,即时搜索)",value:n,onChange:Y=>I(Y.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),C.jsxs("button",{onClick:()=>p(!w),className:`relative p-2 border rounded-lg transition-colors ${g.length>0||_.length>0||f?"border-blue-500 dark:border-blue-400 bg-blue-50 dark:bg-blue-500/20 hover:bg-blue-100 dark:hover:bg-blue-500/30":"border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"}`,title:g.length>0||_.length>0||f?"筛选(已启用)":"筛选",children:[C.jsx(Bf,{className:`w-5 h-5 ${g.length>0||_.length>0||f?"text-blue-600 dark:text-blue-300":"text-gray-600 dark:text-gray-400"}`}),(g.length>0||_.length>0||f)&&C.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full",style:{backgroundColor:"#3b82f6"}})]})]}),C.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[C.jsx($f,{className:"w-4 h-4 text-gray-500"}),C.jsx("input",{type:"range",min:"150",max:"300",value:r,onChange:Y=>A(parseInt(Y.target.value)),className:"w-32"}),C.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400 w-12",children:[r,"px"]}),C.jsx("button",{onClick:J,disabled:!a||k,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed ml-2",title:"手动刷新素材库(文件监控已自动启用)",children:C.jsx(Uf,{className:`w-5 h-5 text-gray-700 dark:text-gray-300 ${k?"animate-spin":""}`})}),C.jsx("button",{onClick:O,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",title:e==="light"?"切换到暗色模式":"切换到亮色模式",children:e==="light"?C.jsx(Mf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"}):C.jsx(Wf,{className:"w-5 h-5 text-gray-700 dark:text-gray-300"})})]})]}),w&&C.jsx("div",{className:"px-6 pb-3",children:C.jsxs("div",{className:"p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[C.jsxs("div",{className:"flex items-center justify-between mb-3",children:[C.jsx("div",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"筛选条件(实时生效)"}),C.jsx("button",{onClick:j,className:"text-xs text-blue-500 hover:text-blue-600 dark:hover:text-blue-400",children:"清除全部"})]}),C.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"格式"}),C.jsx("div",{className:"flex flex-col gap-1.5",children:B.formats.length>0?B.formats.map(Y=>C.jsx("button",{onClick:()=>X(Y),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${g.includes(Y)?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:Y.toUpperCase()},Y)):C.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无格式数据"})})]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"文件大小"}),C.jsx("div",{className:"flex flex-col gap-1.5",children:B.sizes.length>0?B.sizes.map(Y=>C.jsx("button",{onClick:()=>H(Y),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${_.includes(Y)?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:Y},Y)):C.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无大小数据"})})]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-2",children:"图片方向"}),C.jsxs("div",{className:"flex flex-col gap-1.5",children:[B.hasHorizontal&&C.jsx("button",{onClick:()=>z("horizontal"),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${f==="horizontal"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:"横图"}),B.hasVertical&&C.jsx("button",{onClick:()=>z("vertical"),className:`px-3 py-1.5 text-xs rounded transition-colors text-left ${f==="vertical"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-500"}`,children:"竖图"}),!B.hasHorizontal&&!B.hasVertical&&C.jsx("span",{className:"text-xs text-gray-400 py-2",children:"暂无方向数据"})]})]})]})]})})]})}function nw(){const{theme:e,setLibraries:t,setCurrentLibrary:n,setScanProgress:r,mobileView:i,setMobileView:s,selectedImage:o}=Te(),[a,l]=ne.useState(256),[u,h]=ne.useState(320),[y,w]=ne.useState(!1),[p,g]=ne.useState(!1),[d,_]=ne.useState(!1),c=ne.useRef(null);ne.useEffect(()=>{e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),ne.useEffect(()=>{const E=()=>{const N=window.innerWidth<768;_(N)};return E(),window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]),ne.useEffect(()=>{d&&o&&s("detail")},[o,d,s]),ne.useEffect(()=>{f();const E=io("http://localhost:5002");return E.on("scanProgress",N=>{r(N)}),E.on("scanComplete",({libraryId:N,results:L})=>{console.log("📊 Scan complete:",L);const P=Te.getState().currentLibraryId;N===P?(console.log("🔄 Reloading folders and images..."),Promise.all([k(N),x(N)]).then(()=>{console.log("✅ Folders and images reloaded"),ct.search(N,{}).then(I=>{Te.getState().setTotalImageCount(I.data.images.length),console.log(`✅ Total count updated: ${I.data.images.length}`)})}).finally(()=>{r(null)})):r(null)}),E.on("scanError",({libraryId:N,error:L})=>{r(null),console.error("Scan error:",L)}),()=>{E.disconnect()}},[]);const f=async()=>{try{const E=await Cn.getAll();if(t(E.data.libraries),n(E.data.currentLibraryId),E.data.theme&&Te.getState().setTheme(E.data.theme),E.data.preferences){const{thumbnailHeight:N,leftPanelWidth:L,rightPanelWidth:P}=E.data.preferences;N&&Te.getState().setThumbnailHeight(N),L&&l(L),P&&h(P)}E.data.currentLibraryId&&(x(E.data.currentLibraryId),k(E.data.currentLibraryId))}catch(E){console.error("Error loading libraries:",E)}},x=async E=>{try{const N={},L=Te.getState().selectedFolder;L&&(N.folder=L);const P=await ct.search(E,N);Te.getState().setImages(P.data.images)}catch(N){console.error("Error loading images:",N)}},k=async E=>{try{const N=await ct.getFolders(E);Te.getState().setFolders(N.data.folders)}catch(N){console.error("Error loading folders:",N)}},R=async(E,N)=>{try{await Cn.updatePreferences({leftPanelWidth:E,rightPanelWidth:N})}catch(L){console.error("Error saving panel widths:",L)}};return ne.useEffect(()=>{if(!y&&!p)return;const E=document.getElementById("left-panel"),N=document.getElementById("right-panel");let L=a,P=u;const I=c.current.getBoundingClientRect(),re=I.left,T=I.right;let D=null,v=null,B=null;const se=()=>{E&&v!=null&&(E.style.width=`${v}px`,L=v),N&&B!=null&&(N.style.width=`${B}px`,P=B),D=null,v=null,B=null},X=z=>{let j=!1;if(y&&E){const O=z.clientX-re;O>=200&&O<=400&&(v=O,j=!0)}if(p&&N){const O=T-z.clientX;O>=280&&O<=500&&(B=O,j=!0)}j&&D==null&&(D=requestAnimationFrame(se))},H=()=>{D&&(cancelAnimationFrame(D),se()),l(L),h(P),R(L,P),w(!1),g(!1),Te.getState().setIsResizingPanels(!1),Te.getState().setResizingSide(null)};return document.addEventListener("mousemove",X,{passive:!0}),document.addEventListener("mouseup",H),document.body.style.userSelect="none",document.body.style.cursor="col-resize",E&&(E.style.transition="none"),N&&(N.style.transition="none"),()=>{D&&(cancelAnimationFrame(D),D=null),document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",H),document.body.style.userSelect="",document.body.style.cursor="",E&&(E.style.transition=""),N&&(N.style.transition="")}},[y,p]),d?C.jsxs("div",{className:"flex flex-col h-screen bg-gray-50 dark:bg-gray-900",children:[C.jsx(Gf,{}),C.jsxs("div",{className:"flex-1 overflow-hidden relative",children:[C.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="sidebar"?"translate-x-0":"-translate-x-full"}`,children:C.jsx(Hf,{})}),C.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="main"?"translate-x-0":i==="sidebar"?"translate-x-full":"-translate-x-full"}`,children:C.jsx(Yf,{})}),C.jsx("div",{className:`absolute inset-0 transition-transform duration-300 ${i==="detail"?"translate-x-0":"translate-x-full"}`,children:C.jsx(Qf,{})})]}),C.jsxs("div",{className:"flex border-t border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800",children:[C.jsxs("button",{onClick:()=>s("sidebar"),className:`flex-1 flex flex-col items-center py-2 ${i==="sidebar"?"text-blue-500":"text-gray-500"}`,children:[C.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),C.jsx("span",{className:"text-xs mt-1",children:"文件夹"})]}),C.jsxs("button",{onClick:()=>s("main"),className:`flex-1 flex flex-col items-center py-2 ${i==="main"?"text-blue-500":"text-gray-500"}`,children:[C.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),C.jsx("span",{className:"text-xs mt-1",children:"图片"})]}),C.jsxs("button",{onClick:()=>s("detail"),disabled:!o,className:`flex-1 flex flex-col items-center py-2 ${i==="detail"?"text-blue-500":"text-gray-500"} disabled:opacity-30`,children:[C.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),C.jsx("span",{className:"text-xs mt-1",children:"详情"})]})]})]}):C.jsxs("div",{className:"flex flex-col h-screen bg-gray-50 dark:bg-gray-900",children:[C.jsx(Gf,{}),C.jsxs("div",{ref:c,className:"flex flex-1 overflow-hidden",children:[C.jsx("div",{id:"left-panel",style:{width:`${a}px`},className:"flex-shrink-0 h-full",children:C.jsx(Hf,{})}),C.jsx("div",{className:`group relative w-1 h-full cursor-col-resize flex-shrink-0 transition-colors ${y?"bg-blue-500":"bg-gray-200 dark:bg-gray-700 hover:bg-blue-400"}`,onMouseDown:E=>{E.preventDefault(),Te.getState().setIsResizingPanels(!0),Te.getState().setResizingSide("left"),w(!0)},children:C.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 w-5"})}),C.jsx("div",{className:"flex-1 min-w-0 h-full",children:C.jsx(Yf,{})}),C.jsx("div",{className:`group relative w-1 h-full cursor-col-resize flex-shrink-0 transition-colors ${p?"bg-blue-500":"bg-gray-200 dark:bg-gray-700 hover:bg-blue-400"}`,onMouseDown:E=>{E.preventDefault(),Te.getState().setIsResizingPanels(!0),Te.getState().setResizingSide("right"),g(!0)},children:C.jsx("div",{className:"absolute inset-y-0 -left-2 -right-2 w-5"})}),C.jsx("div",{id:"right-panel",style:{width:`${u}px`},className:"flex-shrink-0 h-full",children:C.jsx(Qf,{})})]})]})}Ua.createRoot(document.getElementById("root")).render(C.jsx(ve.StrictMode,{children:C.jsx(nw,{})})); diff --git a/flypic/app/server/public/assets/index-DYf0hRmn.css b/flypic/app/server/public/assets/index-DYf0hRmn.css deleted file mode 100644 index acdcdea..0000000 --- a/flypic/app/server/public/assets/index-DYf0hRmn.css +++ /dev/null @@ -1 +0,0 @@ -.PhotoView-Portal{direction:ltr;height:100%;left:0;overflow:hidden;position:fixed;top:0;touch-action:none;width:100%;z-index:2000}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes PhotoView__delayIn{0%,50%{opacity:0}to{opacity:1}}.PhotoView__Spinner{animation:PhotoView__delayIn .4s linear both}.PhotoView__Spinner svg{animation:PhotoView__rotate .6s linear infinite}.PhotoView__Photo{cursor:grab;max-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.PhotoView__Photo:active{cursor:grabbing}.PhotoView__icon{display:inline-block;left:0;position:absolute;top:0;transform:translate(-50%,-50%)}.PhotoView__PhotoBox,.PhotoView__PhotoWrap{bottom:0;direction:ltr;left:0;position:absolute;right:0;top:0;touch-action:none;width:100%}.PhotoView__PhotoWrap{overflow:hidden;z-index:10}.PhotoView__PhotoBox{transform-origin:left top}@keyframes PhotoView__fade{0%{opacity:0}to{opacity:1}}.PhotoView-Slider__clean .PhotoView-Slider__ArrowLeft,.PhotoView-Slider__clean .PhotoView-Slider__ArrowRight,.PhotoView-Slider__clean .PhotoView-Slider__BannerWrap,.PhotoView-Slider__clean .PhotoView-Slider__Overlay,.PhotoView-Slider__willClose .PhotoView-Slider__BannerWrap:hover{opacity:0}.PhotoView-Slider__Backdrop{background:#000;height:100%;left:0;position:absolute;top:0;transition-property:background-color;width:100%;z-index:-1}.PhotoView-Slider__fadeIn{animation:PhotoView__fade linear both;opacity:0}.PhotoView-Slider__fadeOut{animation:PhotoView__fade linear reverse both;opacity:0}.PhotoView-Slider__BannerWrap{align-items:center;background-color:#00000080;color:#fff;display:flex;height:44px;justify-content:space-between;left:0;position:absolute;top:0;transition:opacity .2s ease-out;width:100%;z-index:20}.PhotoView-Slider__BannerWrap:hover{opacity:1}.PhotoView-Slider__Counter{font-size:14px;opacity:.75;padding:0 10px}.PhotoView-Slider__BannerRight{align-items:center;display:flex;height:100%}.PhotoView-Slider__toolbarIcon{fill:#fff;box-sizing:border-box;cursor:pointer;opacity:.75;padding:10px;transition:opacity .2s linear}.PhotoView-Slider__toolbarIcon:hover{opacity:1}.PhotoView-Slider__ArrowLeft,.PhotoView-Slider__ArrowRight{align-items:center;bottom:0;cursor:pointer;display:flex;height:100px;justify-content:center;margin:auto;opacity:.75;position:absolute;top:0;transition:opacity .2s linear;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;z-index:20}.PhotoView-Slider__ArrowLeft:hover,.PhotoView-Slider__ArrowRight:hover{opacity:1}.PhotoView-Slider__ArrowLeft svg,.PhotoView-Slider__ArrowRight svg{fill:#fff;background:#0000004d;box-sizing:content-box;height:24px;padding:10px;width:24px}.PhotoView-Slider__ArrowLeft{left:0}.PhotoView-Slider__ArrowRight{right:0}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-bottom-0\.5{bottom:-.125rem}.-left-2{left:-.5rem}.-right-0\.5{right:-.125rem}.-right-2{right:-.5rem}.left-2{left:.5rem}.left-3{left:.75rem}.right-2{right:.5rem}.top-2{top:.5rem}.top-2\.5{top:.625rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.ml-2{margin-left:.5rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.block{display:block}.flex{display:flex}.grid{display:grid}.aspect-square{aspect-ratio:1 / 1}.h-1\.5{height:.375rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.min-h-0{min-height:0px}.w-1{width:.25rem}.w-12{width:3rem}.w-3{width:.75rem}.w-32{width:8rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-200{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-purple-300{--tw-bg-opacity: 1;background-color:rgb(216 180 254 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-opacity-0{--tw-bg-opacity: 0}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-8{padding-left:2rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-100{opacity:1}.opacity-75{opacity:.75}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{width:100vw;height:100vh;overflow:hidden}.dark{--tw-bg-opacity: 1}.dark .bg-gray-900{background-color:#0a0a0a!important}.dark .bg-gray-800{background-color:#252525!important}.dark .bg-gray-700{background-color:#2a2a2a!important}.dark .bg-gray-600,.dark .bg-gray-500{background-color:#3a3a3a!important}.dark .bg-gray-400{background-color:#4a4a4a!important}.dark .bg-gray-300{background-color:#2a2a2a!important}.dark .bg-gray-200:not(img):not(.image-container){background-color:#2a2a2a!important}.dark .bg-gray-100,.dark .bg-gray-50,.dark .bg-white{background-color:#1a1a1a!important}.dark .border-gray-700{border-color:#333!important}.dark .border-gray-600{border-color:#444!important}.dark .border-gray-300{border-color:#333!important}.dark .border-gray-200,.dark .border-gray-100{border-color:#2a2a2a!important}.dark .text-gray-900{color:#f5f5f5!important}.dark .text-gray-700{color:#e0e0e0!important}.dark .text-gray-600{color:#b0b0b0!important}.dark .text-gray-500{color:#909090!important}.dark .text-gray-400{color:#707070!important}.dark .text-gray-300{color:#d0d0d0!important}.dark .text-white{color:#fff!important}.dark .text-gray-800{color:#e0e0e0!important}.dark .text-gray-200{color:#d0d0d0!important}.dark .text-gray-100{color:#e0e0e0!important}.dark .bg-opacity-0{--tw-bg-opacity: 0 !important}.dark .bg-opacity-10{--tw-bg-opacity: .1 !important}.dark .bg-opacity-20{--tw-bg-opacity: .2 !important}.dark .bg-opacity-30{--tw-bg-opacity: .3 !important}.dark .bg-opacity-50{--tw-bg-opacity: .5 !important}.dark .hover\:bg-gray-100:hover{background-color:#2a2a2a!important}.dark .hover\:bg-gray-700:hover{background-color:#333!important}.dark .hover\:bg-gray-600:hover{background-color:#3a3a3a!important}.dark .hover\:bg-gray-200:hover,.dark .hover\:bg-gray-50:hover{background-color:#2a2a2a!important}.dark .bg-black:not(.bg-opacity-0):not(.bg-opacity-10):not(.bg-opacity-20):not(.bg-opacity-30){background-color:#0a0a0a!important}.dark .text-black{color:#fff!important}.dark .border-black{border-color:#2a2a2a!important}.dark .bg-blue-50,.dark .bg-blue-100{background-color:#2a2a2a!important}.dark .bg-blue-200{background-color:#3a3a3a!important}.dark .bg-blue-600{background-color:#3a3a3a!important}.dark .bg-blue-800{background-color:#2a2a2a!important}.dark .bg-blue-900{background-color:#1a1a1a!important}.dark .text-blue-300{color:#d0d0d0!important}.dark .text-blue-400{color:#e0e0e0!important}.dark .text-blue-500,.dark .text-blue-600{color:#f0f0f0!important}.dark .text-blue-700{color:#e0e0e0!important}.dark .border-blue-200{border-color:#2a2a2a!important}.dark .border-blue-500{border-color:#4a4a4a!important}.dark .border-blue-700{border-color:#333!important}.dark .hover\:bg-blue-600:hover{background-color:#4a4a4a!important}.dark .hover\:bg-blue-50:hover{background-color:#333!important}.dark .bg-green-50{background-color:#2a2a2a!important}.dark .text-green-600{color:#e0e0e0!important}.dark .bg-red-50{background-color:#2a2a2a!important}.dark .text-red-600{color:#f0a0a0!important}.dark .bg-yellow-50{background-color:#2a2a2a!important}.dark .text-yellow-600{color:#e0e0a0!important}.dark img{background-color:transparent!important}.dark input,.dark select,.dark textarea{background-color:#1a1a1a!important;border-color:#333!important;color:#e0e0e0!important}.dark input:focus,.dark select:focus,.dark textarea:focus{border-color:#4a4a4a!important;outline:none!important;--tw-ring-color: #4a4a4a !important}.dark input::-moz-placeholder{color:#707070!important}.dark input::placeholder{color:#707070!important}.dark button{color:#e0e0e0!important}.dark .bg-blue-500{background-color:#4a4a4a!important}.dark .hover\:bg-blue-600:hover{background-color:#5a5a5a!important}.dark .shadow-lg{box-shadow:0 10px 15px -3px #00000080,0 4px 6px -2px #0000004d!important}.dark .shadow-xl{box-shadow:0 20px 25px -5px #00000080,0 10px 10px -5px #0000004d!important}.dark .hover\:shadow-lg:hover{box-shadow:0 10px 15px -3px #00000080,0 4px 6px -2px #0000004d!important}.dark .ring-blue-500{--tw-ring-color: #4a4a4a !important}.dark .focus\:ring-blue-500:focus{--tw-ring-color: #4a4a4a !important}.dark .focus\:ring-2:focus{--tw-ring-offset-shadow: 0 0 0 0px #000 !important;--tw-ring-shadow: 0 0 0 2px #4a4a4a !important}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#0003;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#0000004d}.dark ::-webkit-scrollbar-track{background:#ffffff0d}.dark ::-webkit-scrollbar-thumb{background:#fff3;border-radius:4px}.dark ::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-400:hover{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:bg-opacity-20{--tw-bg-opacity: .2}.dark\:border-blue-400:is(.dark *){--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-red-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1))}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-blue-500\/30:hover:is(.dark *){background-color:#3b82f64d}.dark\:hover\:bg-gray-500:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-blue-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))} diff --git a/flypic/app/server/public/assets/index-lXh_CTLb.css b/flypic/app/server/public/assets/index-lXh_CTLb.css new file mode 100644 index 0000000..4b9494f --- /dev/null +++ b/flypic/app/server/public/assets/index-lXh_CTLb.css @@ -0,0 +1 @@ +.PhotoView-Portal{direction:ltr;height:100%;left:0;overflow:hidden;position:fixed;top:0;touch-action:none;width:100%;z-index:2000}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes PhotoView__delayIn{0%,50%{opacity:0}to{opacity:1}}.PhotoView__Spinner{animation:PhotoView__delayIn .4s linear both}.PhotoView__Spinner svg{animation:PhotoView__rotate .6s linear infinite}.PhotoView__Photo{cursor:grab;max-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.PhotoView__Photo:active{cursor:grabbing}.PhotoView__icon{display:inline-block;left:0;position:absolute;top:0;transform:translate(-50%,-50%)}.PhotoView__PhotoBox,.PhotoView__PhotoWrap{bottom:0;direction:ltr;left:0;position:absolute;right:0;top:0;touch-action:none;width:100%}.PhotoView__PhotoWrap{overflow:hidden;z-index:10}.PhotoView__PhotoBox{transform-origin:left top}@keyframes PhotoView__fade{0%{opacity:0}to{opacity:1}}.PhotoView-Slider__clean .PhotoView-Slider__ArrowLeft,.PhotoView-Slider__clean .PhotoView-Slider__ArrowRight,.PhotoView-Slider__clean .PhotoView-Slider__BannerWrap,.PhotoView-Slider__clean .PhotoView-Slider__Overlay,.PhotoView-Slider__willClose .PhotoView-Slider__BannerWrap:hover{opacity:0}.PhotoView-Slider__Backdrop{background:#000;height:100%;left:0;position:absolute;top:0;transition-property:background-color;width:100%;z-index:-1}.PhotoView-Slider__fadeIn{animation:PhotoView__fade linear both;opacity:0}.PhotoView-Slider__fadeOut{animation:PhotoView__fade linear reverse both;opacity:0}.PhotoView-Slider__BannerWrap{align-items:center;background-color:#00000080;color:#fff;display:flex;height:44px;justify-content:space-between;left:0;position:absolute;top:0;transition:opacity .2s ease-out;width:100%;z-index:20}.PhotoView-Slider__BannerWrap:hover{opacity:1}.PhotoView-Slider__Counter{font-size:14px;opacity:.75;padding:0 10px}.PhotoView-Slider__BannerRight{align-items:center;display:flex;height:100%}.PhotoView-Slider__toolbarIcon{fill:#fff;box-sizing:border-box;cursor:pointer;opacity:.75;padding:10px;transition:opacity .2s linear}.PhotoView-Slider__toolbarIcon:hover{opacity:1}.PhotoView-Slider__ArrowLeft,.PhotoView-Slider__ArrowRight{align-items:center;bottom:0;cursor:pointer;display:flex;height:100px;justify-content:center;margin:auto;opacity:.75;position:absolute;top:0;transition:opacity .2s linear;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;z-index:20}.PhotoView-Slider__ArrowLeft:hover,.PhotoView-Slider__ArrowRight:hover{opacity:1}.PhotoView-Slider__ArrowLeft svg,.PhotoView-Slider__ArrowRight svg{fill:#fff;background:#0000004d;box-sizing:content-box;height:24px;padding:10px;width:24px}.PhotoView-Slider__ArrowLeft{left:0}.PhotoView-Slider__ArrowRight{right:0}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.-bottom-0\.5{bottom:-.125rem}.-left-2{left:-.5rem}.-right-0\.5{right:-.125rem}.-right-2{right:-.5rem}.left-0{left:0}.left-2{left:.5rem}.left-3{left:.75rem}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-2{top:.5rem}.top-2\.5{top:.625rem}.-z-10{z-index:-10}.z-10{z-index:10}.z-50{z-index:50}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.grid{display:grid}.aspect-square{aspect-ratio:1 / 1}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.w-1{width:.25rem}.w-12{width:3rem}.w-3{width:.75rem}.w-32{width:8rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-8{width:2rem}.w-80{width:20rem}.w-96{width:24rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-200{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-indigo-100{--tw-bg-opacity: 1;background-color:rgb(224 231 255 / var(--tw-bg-opacity, 1))}.bg-pink-500{--tw-bg-opacity: 1;background-color:rgb(236 72 153 / var(--tw-bg-opacity, 1))}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-300{--tw-bg-opacity: 1;background-color:rgb(216 180 254 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-200{--tw-bg-opacity: 1;background-color:rgb(254 240 138 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-opacity-0{--tw-bg-opacity: 0}.bg-opacity-50{--tw-bg-opacity: .5}.bg-opacity-90{--tw-bg-opacity: .9}.fill-white{fill:#fff}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-20{padding:5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-3{padding-bottom:.75rem}.pl-10{padding-left:2.5rem}.pl-8{padding-left:2rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.opacity-100{opacity:1}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{width:100vw;height:100vh;overflow:hidden}.dark{--tw-bg-opacity: 1}.dark .bg-gray-900{background-color:#0a0a0a!important}.dark .bg-gray-800{background-color:#252525!important}.dark .bg-gray-700{background-color:#2a2a2a!important}.dark .bg-gray-600,.dark .bg-gray-500{background-color:#3a3a3a!important}.dark .bg-gray-400{background-color:#4a4a4a!important}.dark .bg-gray-300{background-color:#2a2a2a!important}.dark .bg-gray-200:not(img):not(.image-container){background-color:#2a2a2a!important}.dark .bg-gray-100,.dark .bg-gray-50,.dark .bg-white{background-color:#1a1a1a!important}.dark .border-gray-700{border-color:#333!important}.dark .border-gray-600{border-color:#444!important}.dark .border-gray-300{border-color:#333!important}.dark .border-gray-200,.dark .border-gray-100{border-color:#2a2a2a!important}.dark .text-gray-900{color:#f5f5f5!important}.dark .text-gray-700{color:#e0e0e0!important}.dark .text-gray-600{color:#b0b0b0!important}.dark .text-gray-500{color:#909090!important}.dark .text-gray-400{color:#707070!important}.dark .text-gray-300{color:#d0d0d0!important}.dark .text-white{color:#fff!important}.dark .text-gray-800{color:#e0e0e0!important}.dark .text-gray-200{color:#d0d0d0!important}.dark .text-gray-100{color:#e0e0e0!important}.dark .bg-opacity-0{--tw-bg-opacity: 0 !important}.dark .bg-opacity-10{--tw-bg-opacity: .1 !important}.dark .bg-opacity-20{--tw-bg-opacity: .2 !important}.dark .bg-opacity-30{--tw-bg-opacity: .3 !important}.dark .bg-opacity-50{--tw-bg-opacity: .5 !important}.dark .hover\:bg-gray-100:hover{background-color:#2a2a2a!important}.dark .hover\:bg-gray-700:hover{background-color:#333!important}.dark .hover\:bg-gray-600:hover{background-color:#3a3a3a!important}.dark .hover\:bg-gray-200:hover,.dark .hover\:bg-gray-50:hover{background-color:#2a2a2a!important}.dark .bg-black:not(.bg-opacity-0):not(.bg-opacity-10):not(.bg-opacity-20):not(.bg-opacity-30){background-color:#0a0a0a!important}.dark .text-black{color:#fff!important}.dark .border-black{border-color:#2a2a2a!important}.dark .bg-blue-50,.dark .bg-blue-100{background-color:#2a2a2a!important}.dark .bg-blue-200{background-color:#3a3a3a!important}.dark .bg-blue-600{background-color:#3a3a3a!important}.dark .bg-blue-800{background-color:#2a2a2a!important}.dark .bg-blue-900{background-color:#1a1a1a!important}.dark .text-blue-300{color:#d0d0d0!important}.dark .text-blue-400{color:#e0e0e0!important}.dark .text-blue-500,.dark .text-blue-600{color:#f0f0f0!important}.dark .text-blue-700{color:#e0e0e0!important}.dark .border-blue-200{border-color:#2a2a2a!important}.dark .border-blue-500{border-color:#4a4a4a!important}.dark .border-blue-700{border-color:#333!important}.dark .hover\:bg-blue-600:hover{background-color:#4a4a4a!important}.dark .hover\:bg-blue-50:hover{background-color:#333!important}.dark .bg-green-50{background-color:#2a2a2a!important}.dark .text-green-600{color:#e0e0e0!important}.dark .bg-red-50{background-color:#2a2a2a!important}.dark .text-red-600{color:#f0a0a0!important}.dark .bg-yellow-50{background-color:#2a2a2a!important}.dark .text-yellow-600{color:#e0e0a0!important}.dark img{background-color:transparent!important}.dark input,.dark select,.dark textarea{background-color:#1a1a1a!important;border-color:#333!important;color:#e0e0e0!important}.dark input:focus,.dark select:focus,.dark textarea:focus{border-color:#4a4a4a!important;outline:none!important;--tw-ring-color: #4a4a4a !important}.dark input::-moz-placeholder{color:#707070!important}.dark input::placeholder{color:#707070!important}.dark button{color:#e0e0e0!important}.dark .bg-blue-500{background-color:#4a4a4a!important}.dark .hover\:bg-blue-600:hover{background-color:#5a5a5a!important}.dark .shadow-lg{box-shadow:0 10px 15px -3px #00000080,0 4px 6px -2px #0000004d!important}.dark .shadow-xl{box-shadow:0 20px 25px -5px #00000080,0 10px 10px -5px #0000004d!important}.dark .hover\:shadow-lg:hover{box-shadow:0 10px 15px -3px #00000080,0 4px 6px -2px #0000004d!important}.dark .ring-blue-500{--tw-ring-color: #4a4a4a !important}.dark .focus\:ring-blue-500:focus{--tw-ring-color: #4a4a4a !important}.dark .focus\:ring-2:focus{--tw-ring-offset-shadow: 0 0 0 0px #000 !important;--tw-ring-shadow: 0 0 0 2px #4a4a4a !important}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#0003;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#0000004d}.dark ::-webkit-scrollbar-track{background:#ffffff0d}.dark ::-webkit-scrollbar-thumb{background:#fff3;border-radius:4px}.dark ::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-400:hover{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-600:hover{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:bg-opacity-20:hover{--tw-bg-opacity: .2}.hover\:text-blue-500:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:bg-opacity-20{--tw-bg-opacity: .2}.group:hover .group-hover\:text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:border-blue-400:is(.dark *){--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.dark\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-red-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1))}.dark\:border-yellow-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3b82f633}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-900\/30:is(.dark *){background-color:#1e3a8a4d}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-indigo-900\/30:is(.dark *){background-color:#312e814d}.dark\:bg-purple-900\/30:is(.dark *){background-color:#581c874d}.dark\:bg-yellow-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-indigo-400:is(.dark *){--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.dark\:text-purple-400:is(.dark *){--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:text-yellow-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-blue-500\/30:hover:is(.dark *){background-color:#3b82f64d}.dark\:hover\:bg-gray-500:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-600:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-blue-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}} diff --git a/flypic/app/server/public/assets/layoutWorker-D6X91dDa.js b/flypic/app/server/public/assets/layoutWorker-D6X91dDa.js new file mode 100644 index 0000000..c128e29 --- /dev/null +++ b/flypic/app/server/public/assets/layoutWorker-D6X91dDa.js @@ -0,0 +1 @@ +(function(){"use strict";let c={containerWidth:0,targetHeight:0,imageCount:0,rows:[],pendingRow:[],pendingRowWidthSum:0};function W(n,o,l,i,s){const a=(n.length-1)*16;let e=(o-a)/l;i&&n.length<3&&(e=Math.min(e,1.2));const t=s*e;return n.map(u=>({...u,calculatedWidth:u.originalWidth*e,calculatedHeight:t}))}function A(n,o,l){if(!n.length||!o)return{rows:[],pendingRow:[],pendingRowWidthSum:0};const i=[];let s=[],a=0;for(let h=0;h=o*.95)d=!0;else{const w=n[h+1];if(w){const R=w.width/w.height,G=l*R;a+G+s.length*16>o*1.2&&(d=!0)}}if(d){const w=W(s,o,a,p,l);i.push(w),s=[],a=0}}return{rows:i,pendingRow:s,pendingRowWidthSum:a}}function x(n,o,l,i,s,a){if(!n.length){if(s.length>0){const r=W(s,o,a,!0,l);return{rows:[...i,r],pendingRow:[],pendingRowWidthSum:0}}return{rows:i,pendingRow:[],pendingRowWidthSum:0}}const h=[...i];let e=[...s],t=a;const u=i.reduce((r,g)=>r+g.length,0)+s.length+n.length;for(let r=0;rf+C.length,0)+h.length-i.length+e.length>=u;let m=!1;if(S)m=!0;else if(R>=o*.95)m=!0;else{const f=n[r+1];if(f){const C=f.width/f.height,I=l*C;t+I+e.length*16>o*1.2&&(m=!0)}}if(m){const f=W(e,o,t,S,l);h.push(f),e=[],t=0}}return{rows:h,pendingRow:e,pendingRowWidthSum:t}}function P(){c={containerWidth:0,targetHeight:0,imageCount:0,rows:[],pendingRow:[],pendingRowWidthSum:0}}self.onmessage=function(n){const{images:o,containerWidth:l,targetHeight:i,requestId:s,incremental:a,reset:h}=n.data;if(h){P(),self.postMessage({requestId:s,reset:!0});return}const e=performance.now();let t;const u=a&&c.containerWidth===l&&c.targetHeight===i&&o.length>c.imageCount;if(u){const g=o.slice(c.imageCount),p=c.rows.slice(0,-1),d=c.rows[c.rows.length-1]||[];t=x(g,l,i,p,c.pendingRow.length>0?c.pendingRow:d,c.pendingRowWidthSum>0?c.pendingRowWidthSum:d.reduce((w,R)=>w+R.originalWidth,0))}else t=A(o,l,i);c={containerWidth:l,targetHeight:i,imageCount:o.length,rows:t.rows,pendingRow:t.pendingRow,pendingRowWidthSum:t.pendingRowWidthSum};const r=performance.now()-e;self.postMessage({rows:t.rows,requestId:s,duration:r,imageCount:o.length,rowCount:t.rows.length,incremental:u})}})(); diff --git a/flypic/app/server/public/favicon.png b/flypic/app/server/public/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..d403d35137cc363870e3fa6a89dbdb55264fe755 GIT binary patch literal 4977 zcmaJ_c{G&$-yTHvy=2RvN69i9vdmC+X^TpriIE-$s}L&y0N^mt*ET&K zFaLg->5spEu+2vu4}xAgR$gX!S1(@_5e>NFf_Fj#4Lnh9Xj3%G#qahcqiS|MP$(|lKk}4S?@u#lp@%;BTNCNmL#0!g% z_>UzV6YPKl8QV;NkK_LSr!NdLm?nA1O$P~K@?RLp{h_7;9rl# zaWtZftE#EC?q9KvR|pArFE4^B2;}SQEAI=F#}nN^5ET^_5Eu%ALgkJTawI>T7m6&0 zBT4?Ppp7Ou6EOrY3?2vkt%!2MdwU@yj-CD|1y901vN+OTWjZbxh>RkDAoAefDg6yZ zBL9D=r{_Otl9ws^zkdHuVUoEY0Sz)mlkna|=i`HOmHZuwpsGbgqrC7$b3EST?<$(O zc;3 z(grI)Ai7{p7#OOnq@n@^Lo}5X6czvGYU7=~J<&L?zqu~|{IABt?pbmX=vfiFLF5_W!G1(7=AY?y+! z#$$Z*9&N3z*7;9v|7fUbu622DqQb#9X@}KC zS!=2&b5pBSSDq+S@MYaJ)8Zix2D8;S3gW2(bWF4;%;WMKA|I}kN`_7vU9a+-H7qNd zRaQ}1+x8zlt#n(q2+LIeB*T%$3AE}lpH)sN{F*#(#g1($h$r`BTbnDRT(%%akB*|ZVPAR&mrBV~TU+0ar zJm{PZIvU%#TWP{=mWn;u$ZlnT?8ijxu4)9xoMvkvPd$24{2gxjn6&CwU|1cFdmLT7 z-|u@^h^5W9+)rTVj4x-W_Wbxl16V=RvsB^{g!M;FS<`B`hHupENgYYGq(?lT{G+@x z7ywUtk!Jk^d#iPu@lR>iDc_dro-ZkB58^|#FzE)!g=a@?K{LuX559&46Sg@C<06h1 zu6F=9wRx4DXxS+Zhx0?)y=>?A_D)`-Ih}Dm?92<9n0OU_2F2RTPWtu5IXat(;cmmP z_AqLhy%e?bn=%R4eBT=&{Jv>(CH|@X1APmKi&+7trF^V+1751&sp4|W<|@*#Q3>Z> z{h2|8GSF#$i;0=Lex%1_vUfu;B1_Re6UP3MOD$V#rLd5~@$?eE`#|`%MNx`vAr$ez z#GA@Umo()YpMX~zc9-POd}7p|)T{639LWFD4%TSL9-5?|4~DKCHhX4w8zwSZ%6ecp z?`hgNWROmt*$;9!F{YqnX`xdjG1&MK@IidO?q;o8#xp-+H;9*SR^GKM&MoDO-(5cC z)3YOW;v|yc-CP6lDsbMCuBx0$A@9rL;SK+{_{n-{b)KUIu@!Y%|H)V4(b`3l+vEO2 z;|;+lyZeC@X4o5V?=N4_1qB5U4X>{3=AnkIt=V?1sZb%|uV;gPWi4BlD*u|HhK0>m z2dK-T-TDMAEM$}T$ece;4u|DWWDUnqzCTlhv6FNuAp=T^1NLQ<4g>HQ=eIK+CFP{7A_K|XKQn+mWq()KXlS+mV zcX46*6EjC&fdR`h`?^}}@&bOeT$eey+p081-&D8%^|HGEH!iV*J*(o=*)0|dwkY=- zgR(L6y1E}oDuTN8t(>*NYcaT|*YYRG2iilPYP{0bh0TVN6b0fsOUoUbapx^+wTF+# z3iTwH7%hm3%xTGSj>;_#5f&ct;AFaZElRusm zlS5;Dm6+ul@v|>TJ4?l1zgRaUZ2PMuH1;VlT{SSur?0)5IgE>a{qXx6bL4rm5uWcB zxRFX0hqh@c#qZxEdqJpi-7jz*HqOXsC#_Ff@#@%zxM9Di>4O9IXh&qnqq}=&-!;s>|I%0<6s@T$+r;xci9bEKRlPxsIPcX#k1Ld zu0D}z^J5z?d*#GO!9lQS+0X}Kz}g5b;b@ub=AETez-&h_v!E5-Mfqx&-sL&z_yuH) zDsiQCWTHOfk~gj^d*{$`Ip{qYIKR7pdE+$yt9Rwvt&O}iWx;HZ525w#S zfO3vXRDTwE)K$8&G9r3sF*iDcS|0V_7HGFvzM@RNSrOkNv3eBd5f@TqsIE2Uz(L1sU_xbnl^!d%msm;F``s}Y9L4RFD zIBsqCkk5F{e|~^=o;hDSVuK84^vr_nz7z`I>DU!i7VMYh8U^L$mDqmXtDSJm9NAlR zhKALq7zEU>(31yO^X&b zQltnor<}QPG`GPwiEI;)$B-964MFRTSxNYx-B)X&Hqw@j6v zlmw%nZ4gNx2eJ3w_9w7!;t|fSiWxqyAj8bj(92NQykT*L3LTIoU*ki}nyRN*Mx%aZ z&ub~|Gr;WHI8VM!2&pp_zO1I?<2^>2zjn!Q(<{pQw3!pr{BR<;k0b6U#{;b8y1!fL z$3A*n!PjzaH@q9-1Y2d28JoLJxcB3)R7{M-y=FhJ$Y_u>&86}AgNRzHo~gQ!S5?W@ zO07-td@qKf`QwJ(y+4X_rcDI9BdgG<6BKEV5GsnlCk;bmzttYcrQQ4@F$J7^+x}TZ z?4Wq!bBVxoO6)K<$C82EJVe-rwNjs_A;}+Bs!r_MT&9x@ALuj;q?KK?eH+Otz@|h)-f6GdTLmUiL~wS;Nb`9YgUH_1Wl(yhQRC^B;kqcFGA?)rY8U_X8g_W%F2% z3w|WZeAV=o2id;j)(>Jws_S(jmRf_C!YxhWE&-z%Tbg1-J`iZQwt?(9)f^WA;!e0v z3>Fj1E^>YfQqTOIslw`tAEkAezM?emPUo#(HbJ*8_LFR4+ahU>u$G|JEV)h@0Wx<~ z&XT}NeVxk>gR5@|ezEa^XCV+5F8)0?&Wc1^z&mFBkK-8$H|HrZ<=z-;p)Y*Tc{%5~ z*Cd@7YcGh01YW_T8*6Y{S%!IG78XJ8DH)gf%F=UAZmb)-w{)gH9VUv{$G{We%Wd%` zVLEJj;&hL{Jx}!W$!aFI(TT>)<(tcCDL1hd8^BJCedN;&G~v-klri)?#=P)o^R84A2lgU#R}h# zh>&|zQv(ul%;{}AR~gQ~Y?dzbb+@>pcKceTYDrHCNB!vWJ;|#!+8HHF`;tBL)DGSa z0jo{q=5od&B|b4#_ary18Oa+7&dgIFf*XigUc(=V^Q8CR_Ivy6^kV!wU#}YH+S1Z) zUlVA5ZsH3io->0%oD(h{ik65Nt2q|4Jba0*a_%H5No)!;tVNhBy@-vE53`e2VPSQg zSoW6?2tq|tR6U&ZPi;mWhC?5lpT>3hyhF1;d|ioHxb$p3mLsliquAYVH2%}r1vOV> z-tcJO3Qz65_*2pg2h^feSyn~Ct>VN^9DSO`>5IFUon^=RtOB$BFBH9mQ^|}?3P_Ao z;$@b(m#2G_4T6qK>z z@wS<%$Z^vc4(8PG4ft1pxO(rSPh0mmg137R0=m2l_h;~#tBBiki;FvKJ6@;v1?)w?F}XZxx437OxP4wAa!=&qPU zVe3D$x2OEP#O-=^?>3=mRdD*rs^^>zR~=%?YFvx4gTo!}aB1WVSl|J}i<)i@b|d8- zFZm1^2ez(G2)QL4U1aH_aLL^AhPlbTbAn%UUp%{W*miKgPi4oDYwT^{LRZws*XVTI zX^wl$X+viS=u7-}c1IZCA8s~e=Tui$I4Ev!Tw$D414Hnh>xgXVfv%|i+$y1o4l^P+E? zO;^*YP)kB2OB<{1s@_ssT29$hc+mb&%Y^y|`mU#CU#^Yy4USZ+Pw~xekR{Z!3WcwI0-givwDi-02iVGkS$6dGo|fKCwMQwr^Exp@0XR=*GX||`?SOsFV6j>^sG#)?@6JT1sr>nv z?8TJkKeQo-R$TDvx_!-cx}iBmq=kjnr9`@&xR$-v-S?wgTPa&@Y-Ki8xdjCfkVastt|-tRCmUxw53saGeG#eL*HFJnC-z3pDb&i>K@i3*CXzJO;@q7yIN5r5Z@ zVTt5bpJAk%2&rH_$Ql`x3J)k=c(5LTAl|5Tp2~L&zsyg62KkX8Z8PZRg+-ZMD#0<; z$^AV+qs(#fXlJ^>uLe8EO@z2B$CvO^OmwV!Yn#=?OA}1mY`HhdnbFcCsEJdv57z^F zC=Xw~qMn#~y9B8={_&cE|8|?P@f5%kU`Iz_Y+O?cIpT2yd^ + + + + + + + + + + + diff --git a/flypic/app/server/public/index.html b/flypic/app/server/public/index.html index 72ab21b..ee8c5fa 100644 --- a/flypic/app/server/public/index.html +++ b/flypic/app/server/public/index.html @@ -2,11 +2,11 @@ - + - FlyPic - 图片素材库管理 - - + FlyPic 飞图 - 图片素材库管理 + +
diff --git a/flypic/app/server/routes/image.js b/flypic/app/server/routes/image.js index 4ce645e..77b8e9f 100644 --- a/flypic/app/server/routes/image.js +++ b/flypic/app/server/routes/image.js @@ -4,25 +4,26 @@ const path = require('path'); const fs = require('fs'); const { exec } = require('child_process'); const dbPool = require('../database/dbPool'); +const { generateThumbnail } = require('../utils/thumbnail'); const { getLibrary } = require('../utils/config'); -// Get images with search and filters +// Get images with search and filters (supports pagination) router.get('/', (req, res) => { try { - const { libraryId, keywords, folder, formats, minSize, maxSize, startDate, endDate } = req.query; - + const { libraryId, keywords, folder, formats, minSize, maxSize, startDate, endDate, offset, limit } = req.query; + if (!libraryId) { return res.status(400).json({ error: 'Library ID is required' }); } - + const library = getLibrary(libraryId); if (!library) { return res.status(404).json({ error: 'Library not found' }); } - + // 使用连接池获取数据库连接 const db = dbPool.acquire(library.path); - + try { const filters = {}; if (folder) filters.folder = folder; @@ -31,10 +32,30 @@ router.get('/', (req, res) => { if (maxSize) filters.maxSize = parseInt(maxSize); if (startDate) filters.startDate = parseInt(startDate); if (endDate) filters.endDate = parseInt(endDate); - - const images = db.searchImages(keywords || '', filters); - - res.json({ images }); + + // 分页参数(可选) + let pagination = null; + if (offset !== undefined && limit !== undefined) { + pagination = { + offset: parseInt(offset, 10), + limit: parseInt(limit, 10) + }; + } + + const result = db.searchImages(keywords || '', filters, pagination); + + // 如果使用分页,返回分页格式;否则保持向后兼容 + if (pagination) { + res.json({ + images: result.images, + total: result.total, + offset: result.offset, + limit: result.limit, + hasMore: result.hasMore + }); + } else { + res.json({ images: result }); + } } finally { // 释放连接 dbPool.release(library.path); @@ -44,23 +65,75 @@ router.get('/', (req, res) => { } }); +// Get cache metadata (database modification time, counts) +router.get('/cache-meta', (req, res) => { + try { + const { libraryId } = req.query; + + if (!libraryId) { + return res.status(400).json({ error: 'Library ID is required' }); + } + + const library = getLibrary(libraryId); + if (!library) { + return res.status(404).json({ error: 'Library not found' }); + } + + const db = dbPool.acquire(library.path); + try { + const meta = db.getCacheMeta(); + res.json(meta); + } finally { + dbPool.release(library.path); + } + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + +// Get total image count +router.get('/count', (req, res) => { + try { + const { libraryId } = req.query; + + if (!libraryId) { + return res.status(400).json({ error: 'Library ID is required' }); + } + + const library = getLibrary(libraryId); + if (!library) { + return res.status(404).json({ error: 'Library not found' }); + } + + const db = dbPool.acquire(library.path); + + try { + const row = db.db.prepare('SELECT COUNT(*) as count FROM images').get(); + res.json({ count: row.count }); + } finally { + dbPool.release(library.path); + } + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + // Get folders router.get('/folders', (req, res) => { try { const { libraryId } = req.query; - + if (!libraryId) { return res.status(400).json({ error: 'Library ID is required' }); } - + const library = getLibrary(libraryId); if (!library) { return res.status(404).json({ error: 'Library not found' }); } - - // 使用连接池 + const db = dbPool.acquire(library.path); - + try { const folders = db.getFolderTree(); res.json({ folders }); @@ -73,23 +146,53 @@ router.get('/folders', (req, res) => { }); // Serve thumbnail -router.get('/thumbnail/:libraryId/:size/:filename', (req, res) => { +router.get('/thumbnail/:libraryId/:size/:filename', async (req, res) => { try { - const { libraryId, filename } = req.params; - + const { libraryId, size, filename } = req.params; + const library = getLibrary(libraryId); if (!library) { return res.status(404).json({ error: 'Library not found' }); } - - // 直接从 thumbnails 目录获取 - const thumbnailPath = path.join(library.path, '.flypic', 'thumbnails', filename); - - if (!fs.existsSync(thumbnailPath)) { + + // New structure: .flypic/thumbnails/ab/hash.webp + const thumbBase = path.join(library.path, '.flypic', 'thumbnails'); + const hash = filename.replace(/\.[^/.]+$/, ""); // remove extension if present + const shard1 = hash.slice(0, 2); + + const targetPath = path.join(thumbBase, shard1, filename); + + if (!fs.existsSync(targetPath)) { + // 按需生成:尝试通过文件名在数据库中定位原图并生成 + try { + const db = dbPool.acquire(library.path); + try { + const row = db.db.prepare('SELECT path, thumbnail_path FROM images WHERE thumbnail_path LIKE ?').get(`%/${filename}`); + if (row && row.path) { + const originalFull = path.join(library.path, row.path); + // 确保目标目录存在 + fs.mkdirSync(path.dirname(targetPath), { recursive: true }); + // 生成指定尺寸 (default 480) + await generateThumbnail(originalFull, targetPath, parseInt(size, 10) || 480); + } + } finally { + dbPool.release(library.path); + } + } catch (e) { + // 忽略生成失败 + } + } + + if (!fs.existsSync(targetPath)) { return res.status(404).json({ error: 'Thumbnail not found' }); } - - res.sendFile(thumbnailPath); + + // 设置缓存头,减少重复请求(缩略图内容不变) + res.set({ + 'Cache-Control': 'public, max-age=31536000, immutable', + 'Vary': 'Accept-Encoding' + }); + res.sendFile(targetPath); } catch (error) { res.status(500).json({ error: error.message }); } @@ -100,45 +203,85 @@ router.get('/original/:libraryId/*', (req, res) => { try { const { libraryId } = req.params; const imagePath = req.params[0]; - + const library = getLibrary(libraryId); if (!library) { return res.status(404).json({ error: 'Library not found' }); } - + const fullPath = path.join(library.path, imagePath); - + if (!fs.existsSync(fullPath)) { return res.status(404).json({ error: 'Image not found' }); } - + res.sendFile(fullPath); } catch (error) { res.status(500).json({ error: error.message }); } }); +// Open file in system default application +router.post('/:libraryId/open-file', (req, res) => { + try { + const { libraryId } = req.params; + const { path: filePath } = req.body; + + if (!filePath) { + return res.status(400).json({ error: 'Path is required' }); + } + + const library = getLibrary(libraryId); + if (!library) { + return res.status(404).json({ error: 'Library not found' }); + } + + const fullPath = path.join(library.path, filePath); + + if (!fs.existsSync(fullPath)) { + return res.status(404).json({ error: 'File not found' }); + } + + // 使用系统默认应用打开文件 + const command = process.platform === 'win32' + ? `start "" "${fullPath}"` + : process.platform === 'darwin' + ? `open "${fullPath}"` + : `xdg-open "${fullPath}"`; + + exec(command, (error) => { + if (error) { + console.error('打开文件失败:', error); + return res.status(500).json({ error: '打开文件失败' }); + } + res.json({ success: true }); + }); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + // Open folder in file explorer router.post('/:libraryId/open-folder', (req, res) => { try { const { path: imagePath } = req.body; - + if (!imagePath) { return res.status(400).json({ error: 'Path is required' }); } - + // 获取文件所在文件夹 const folderPath = path.dirname(imagePath); - + // Windows: 使用 explorer // Linux: 使用 xdg-open // macOS: 使用 open - const command = process.platform === 'win32' + const command = process.platform === 'win32' ? `explorer "${folderPath}"` : process.platform === 'darwin' - ? `open "${folderPath}"` - : `xdg-open "${folderPath}"`; - + ? `open "${folderPath}"` + : `xdg-open "${folderPath}"`; + exec(command, (error) => { if (error) { console.error('打开文件夹失败:', error); diff --git a/flypic/app/server/routes/library.js b/flypic/app/server/routes/library.js index 8da7ddf..f26e5b8 100644 --- a/flypic/app/server/routes/library.js +++ b/flypic/app/server/routes/library.js @@ -1,7 +1,6 @@ const express = require('express'); const router = express.Router(); const fs = require('fs'); -const path = require('path'); const { loadConfig, addLibrary, @@ -31,25 +30,25 @@ router.get('/', (req, res) => { router.post('/', (req, res) => { try { const { name, path } = req.body; - + if (!name || !path) { return res.status(400).json({ error: 'Name and path are required' }); } - + if (!fs.existsSync(path)) { return res.status(400).json({ error: 'Path does not exist' }); } - + const id = addLibrary(name, path); - + // Check if .flypic directory exists const flypicDir = require('path').join(path, '.flypic'); const hasExistingIndex = fs.existsSync(flypicDir); - - res.json({ - id, + + res.json({ + id, message: 'Library added successfully', - hasExistingIndex + hasExistingIndex }); } catch (error) { res.status(500).json({ error: error.message }); @@ -82,7 +81,7 @@ router.put('/:id', (req, res) => { try { const { id } = req.params; const updates = req.body; - + const success = updateLibrary(id, updates); if (success) { res.json({ message: 'Library updated successfully' }); @@ -98,29 +97,35 @@ router.put('/:id', (req, res) => { router.delete('/:id', async (req, res) => { try { const { id } = req.params; - + // 获取素材库信息 const config = loadConfig(); const library = config.libraries.find(lib => lib.id === id); - + if (!library) { return res.status(404).json({ error: 'Library not found' }); } - - // 关闭该素材库的数据库连接,释放文件锁 + const dbPool = require('../database/dbPool'); - console.log(`[Delete] Closing database connection for: ${library.path}`); + const fileWatcher = require('../utils/fileWatcher'); + const scanManager = require('../utils/scanManager'); + + // 1. 停止扫描并清理状态 + scanManager.clearState(id); + + // 2. 停止文件监控 + fileWatcher.unwatch(id); + + // 3. 关闭数据库连接 dbPool.close(library.path); - + // 等待一下,确保连接完全关闭 - await new Promise(resolve => setTimeout(resolve, 500)); - + await new Promise(resolve => setTimeout(resolve, 300)); + // 删除索引 removeLibrary(id); - - console.log(`✅ Library removed and database connection released: ${library.name}`); - - res.json({ + + res.json({ message: 'Library removed successfully', path: library.path }); @@ -131,29 +136,48 @@ router.delete('/:id', async (req, res) => { }); // Set current library -router.post('/:id/set-current', (req, res) => { +router.post('/:id/set-current', async (req, res) => { try { const { id } = req.params; const config = loadConfig(); const dbPool = require('../database/dbPool'); - + const scanManager = require('../utils/scanManager'); + // 获取旧的当前素材库 const oldLibraryId = config.currentLibraryId; if (oldLibraryId && oldLibraryId !== id) { const oldLibrary = config.libraries.find(lib => lib.id === oldLibraryId); if (oldLibrary) { - // 关闭旧素材库的数据库连接 - console.log(`[Switch] Closing old library connection: ${oldLibrary.name}`); + // 1. 停止扫描(如果正在进行),但保留暂停状态以便恢复 + if (scanManager.isScanning(oldLibraryId)) { + const state = scanManager.getState(oldLibraryId); + if (state.abortController) { + state.abortController.aborted = true; + } + } + + // 2. 关闭数据库连接 dbPool.close(oldLibrary.path); } } - + // 设置新的当前素材库 setCurrentLibrary(id); - + const newLibrary = config.libraries.find(lib => lib.id === id); - console.log(`[Switch] Switched to library: ${newLibrary?.name}`); - + + // 预热新数据库连接(避免第一个查询时才创建连接) + if (newLibrary) { + const db = dbPool.acquire(newLibrary.path); + // 执行一个简单查询来预热缓存 + try { + db.db.prepare('SELECT 1').get(); + } catch (e) { + // 忽略预热错误 + } + dbPool.release(newLibrary.path); + } + res.json({ message: 'Current library set successfully' }); } catch (error) { res.status(500).json({ error: error.message }); @@ -166,18 +190,49 @@ router.post('/:id/close-db', (req, res) => { const { id } = req.params; const config = loadConfig(); const library = config.libraries.find(lib => lib.id === id); - + if (!library) { return res.status(404).json({ error: 'Library not found' }); } - + const dbPool = require('../database/dbPool'); dbPool.close(library.path); - + res.json({ message: 'Database connection closed successfully' }); } catch (error) { res.status(500).json({ error: error.message }); } }); +// Release all resources for a library (database + file watcher) +router.post('/:id/release', (req, res) => { + try { + const { id } = req.params; + const config = loadConfig(); + const library = config.libraries.find(lib => lib.id === id); + + if (!library) { + return res.status(404).json({ error: 'Library not found' }); + } + + // 1. 关闭数据库连接 + const dbPool = require('../database/dbPool'); + dbPool.close(library.path); + + // 2. 停止文件监控 + const fileWatcher = req.app.get('fileWatcher'); + if (fileWatcher && fileWatcher.isWatching(id)) { + fileWatcher.unwatch(id); + } + + res.json({ + message: 'All resources released successfully', + library: library.name + }); + } catch (error) { + console.error('[Release] Error:', error); + res.status(500).json({ error: error.message }); + } +}); + module.exports = router; diff --git a/flypic/app/server/routes/scan.js b/flypic/app/server/routes/scan.js index 8bbaec9..abc374d 100644 --- a/flypic/app/server/routes/scan.js +++ b/flypic/app/server/routes/scan.js @@ -3,6 +3,7 @@ const router = express.Router(); const LibraryDatabase = require('../database/db'); const { getLibrary, updateLibrary } = require('../utils/config'); const { scanLibrary, syncLibrary } = require('../utils/scanner'); +const scanManager = require('../utils/scanManager'); // Start full scan router.post('/full', async (req, res) => { @@ -44,18 +45,26 @@ router.post('/full', async (req, res) => { } } else { // Start scan in background + console.log(`🔍 Starting background scan for library: ${libraryId}`); res.json({ message: 'Scan started' }); scanLibrary(library.path, db, (progress) => { + console.log(`📊 Progress: ${progress.current}/${progress.total} (${progress.percent}%)`); io.emit('scanProgress', { libraryId, ...progress }); - }).then(results => { + }, libraryId).then(results => { + console.log(`✅ Scan complete for library: ${libraryId}`, results); dbPool.release(library.path); - updateLibrary(libraryId, { lastScan: Date.now() }); - io.emit('scanComplete', { libraryId, results }); + if (!results.stopped) { + updateLibrary(libraryId, { lastScan: Date.now() }); + io.emit('scanComplete', { libraryId, results }); + } else { + io.emit('scanPaused', { libraryId, results }); + } }).catch(error => { + console.error(`❌ Scan error for library: ${libraryId}`, error); dbPool.release(library.path); io.emit('scanError', { libraryId, error: error.message }); }); @@ -101,13 +110,22 @@ router.post('/sync', async (req, res) => { } } else { // Start sync in background + console.log(`🔄 Starting background sync for library: ${libraryId}`); res.json({ message: 'Sync started' }); - syncLibrary(library.path, db).then(results => { + syncLibrary(library.path, db, false, (progress) => { + console.log(`📊 Sync progress: ${progress.current}/${progress.total} (${progress.percent}%)`); + io.emit('scanProgress', { + libraryId, + ...progress + }); + }).then(results => { + console.log(`✅ Sync complete for library: ${libraryId}`, results); dbPool.release(library.path); updateLibrary(libraryId, { lastScan: Date.now() }); io.emit('scanComplete', { libraryId, results }); }).catch(error => { + console.error(`❌ Sync error for library: ${libraryId}`, error); dbPool.release(library.path); io.emit('scanError', { libraryId, error: error.message }); }); @@ -118,4 +136,148 @@ router.post('/sync', async (req, res) => { } }); +// Fix folder paths in database (one-time migration) +router.post('/fix-folders', async (req, res) => { + try { + const { libraryId } = req.body; + + if (!libraryId) { + return res.status(400).json({ error: 'Library ID is required' }); + } + + const library = getLibrary(libraryId); + if (!library) { + return res.status(404).json({ error: 'Library not found' }); + } + + const db = dbPool.acquire(library.path); + + try { + const path = require('path'); + const images = db.getAllImages(); + let fixed = 0; + + for (const img of images) { + const expectedFolderRaw = path.dirname(img.path || ''); + const expectedFolder = expectedFolderRaw === '.' ? '' : expectedFolderRaw.replace(/\\/g, '/'); + const currentFolder = (img.folder || '').replace(/\\/g, '/'); + + if (expectedFolder !== currentFolder) { + db.updateImageFolder(img.path, expectedFolder); + fixed++; + } + } + + console.log(`✅ Fixed ${fixed} folder paths`); + res.json({ message: `Fixed ${fixed} folder paths`, fixed }); + } finally { + dbPool.release(library.path); + } + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + +// 停止扫描 +router.post('/stop', async (req, res) => { + try { + const { libraryId } = req.body; + + if (!libraryId) { + return res.status(400).json({ error: 'Library ID is required' }); + } + + if (!scanManager.isScanning(libraryId)) { + return res.status(400).json({ error: 'No scan in progress' }); + } + + // 设置停止标志(实际停止在下一个批次检查时) + const state = scanManager.getState(libraryId); + state.abortController.aborted = true; + + console.log(`⏸️ Stop requested for library: ${libraryId}`); + res.json({ message: 'Stop requested', libraryId }); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + +// 继续扫描 +router.post('/resume', async (req, res) => { + try { + const { libraryId } = req.body; + + if (!libraryId) { + return res.status(400).json({ error: 'Library ID is required' }); + } + + if (!scanManager.isPaused(libraryId)) { + return res.status(400).json({ error: 'Scan is not paused' }); + } + + const library = getLibrary(libraryId); + if (!library) { + return res.status(404).json({ error: 'Library not found' }); + } + + const pendingFiles = scanManager.resumeScan(libraryId); + if (pendingFiles.length === 0) { + return res.status(400).json({ error: 'No pending files to resume' }); + } + + const io = req.app.get('io'); + const dbPool = require('../database/dbPool'); + const db = dbPool.acquire(library.path); + + console.log(`▶️ Resuming scan for library: ${libraryId}, ${pendingFiles.length} files`); + res.json({ message: 'Scan resumed', pendingFiles: pendingFiles.length }); + + // 继续扫描 + scanLibrary(library.path, db, (progress) => { + io.emit('scanProgress', { + libraryId, + ...progress + }); + }, libraryId, pendingFiles).then(results => { + dbPool.release(library.path); + if (!results.stopped) { + updateLibrary(libraryId, { lastScan: Date.now() }); + io.emit('scanComplete', { libraryId, results }); + } else { + io.emit('scanPaused', { libraryId, results }); + } + }).catch(error => { + dbPool.release(library.path); + io.emit('scanError', { libraryId, error: error.message }); + }); + + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + +// 获取扫描状态 +router.get('/status/:libraryId', (req, res) => { + try { + const { libraryId } = req.params; + + // 注册素材库路径(用于持久化恢复) + const library = getLibrary(libraryId); + if (library) { + scanManager.registerLibraryPath(libraryId, library.path); + } + + const state = scanManager.getState(libraryId); + res.json({ + libraryId, + status: state.status, + progress: state.progress, + pendingCount: state.pendingFiles?.length || 0, + needsRescan: state.needsRescan || false // 标记是否需要重新扫描 + }); + } catch (error) { + res.status(500).json({ error: error.message }); + } +}); + module.exports = router; diff --git a/flypic/app/server/routes/watch.js b/flypic/app/server/routes/watch.js index 31e12eb..018cdad 100644 --- a/flypic/app/server/routes/watch.js +++ b/flypic/app/server/routes/watch.js @@ -7,14 +7,22 @@ router.post('/start/:libraryId', (req, res) => { const { libraryId } = req.params; const fileWatcher = req.app.get('fileWatcher'); const io = req.app.get('io'); - - fileWatcher.watch(libraryId, io); - - res.json({ - message: 'File watching started', + + // 立即返回响应,让文件监控在后台启动 + res.json({ + message: 'File watching starting', libraryId, isWatching: true }); + + // 异步启动监控(不阻塞响应) + setImmediate(() => { + try { + fileWatcher.watch(libraryId, io); + } catch (watchError) { + console.error(`Failed to start file watching for ${libraryId}:`, watchError.message); + } + }); } catch (error) { res.status(500).json({ error: error.message }); } @@ -25,10 +33,10 @@ router.post('/stop/:libraryId', (req, res) => { try { const { libraryId } = req.params; const fileWatcher = req.app.get('fileWatcher'); - + fileWatcher.unwatch(libraryId); - - res.json({ + + res.json({ message: 'File watching stopped', libraryId, isWatching: false @@ -43,10 +51,10 @@ router.get('/status/:libraryId', (req, res) => { try { const { libraryId } = req.params; const fileWatcher = req.app.get('fileWatcher'); - + const isWatching = fileWatcher.isWatching(libraryId); - - res.json({ + + res.json({ libraryId, isWatching }); @@ -60,8 +68,8 @@ router.get('/list', (req, res) => { try { const fileWatcher = req.app.get('fileWatcher'); const watchedLibraries = fileWatcher.getWatchedLibraries(); - - res.json({ + + res.json({ watchedLibraries, count: watchedLibraries.length }); diff --git a/flypic/app/server/server.js b/flypic/app/server/server.js index 0208c15..11ab316 100644 --- a/flypic/app/server/server.js +++ b/flypic/app/server/server.js @@ -9,12 +9,12 @@ const app = express(); const server = http.createServer(app); const io = new Server(server, { cors: { - origin: process.env.FRONTEND_DIST ? false : 'http://localhost:5173', + origin: process.env.FRONTEND_DIST ? false : ['http://localhost:5173', 'http://localhost:3000'], methods: ['GET', 'POST'] } }); -const PORT = process.env.TRIM_SERVICE_PORT || process.env.PORT || 3000; +const PORT = process.env.PORT || 15002; // Auto-detect frontend dist path let FRONTEND_DIST = process.env.FRONTEND_DIST; @@ -26,7 +26,7 @@ if (!FRONTEND_DIST) { path.join(__dirname, '../public'), path.join(__dirname, '../../frontend/dist') ]; - + for (const p of possiblePaths) { if (require('fs').existsSync(p)) { FRONTEND_DIST = p; @@ -34,7 +34,7 @@ if (!FRONTEND_DIST) { break; } } - + if (!FRONTEND_DIST) { console.log('⚠️ Frontend not found, tried:', possiblePaths); } @@ -49,7 +49,6 @@ const libraryRouter = require('./routes/library'); const imageRouter = require('./routes/image'); const scanRouter = require('./routes/scan'); const watchRouter = require('./routes/watch'); - app.use('/api/library', libraryRouter); app.use('/api/image', imageRouter); app.use('/api/scan', scanRouter); @@ -83,11 +82,110 @@ app.set('fileWatcher', fileWatcher); server.listen(PORT, () => { console.log(`🚀 FlyPic server running on http://localhost:${PORT}`); + + // 只为当前选中的素材库启动文件监控和快速同步 + const { loadConfig } = require('./utils/config'); + const config = loadConfig(); + const currentLibraryId = config.currentLibraryId; + const currentLibrary = config.libraries.find(lib => lib.id === currentLibraryId); + + if (currentLibrary) { + console.log(`📡 启动当前素材库监控: ${currentLibrary.name}`); + + // 启动文件监控 + try { + fileWatcher.watch(currentLibrary.id, io); + console.log(` ✅ 文件监控已启动`); + } catch (err) { + console.log(` ❌ 文件监控失败: ${err.message}`); + } + + // 快速同步检测离线变化 + console.log('🔄 检测离线期间的文件变化...'); + const { quickSync } = require('./utils/scanner'); + const dbPool = require('./database/dbPool'); + + (async () => { + try { + const db = dbPool.acquire(currentLibrary.path); + const results = await quickSync(currentLibrary.path, db); + dbPool.release(currentLibrary.path); + + const changes = results.added + results.deleted; + if (changes > 0) { + console.log(` 📊 ${currentLibrary.name}: +${results.added} -${results.deleted}`); + io.emit('scanComplete', { libraryId: currentLibrary.id, results }); + } else { + console.log(` ✅ ${currentLibrary.name}: 无变化`); + } + } catch (err) { + console.log(` ❌ ${currentLibrary.name}: ${err.message}`); + } + console.log('✅ 启动检查完成'); + })(); + } else { + console.log('📭 未选中素材库,等待用户操作...'); + } }); -// Cleanup on exit -process.on('SIGINT', () => { - console.log('\nShutting down...'); - fileWatcher.unwatchAll(); - process.exit(0); +// Graceful shutdown - 优雅关闭,释放所有资源 +const gracefulShutdown = (signal) => { + console.log(`\n🛑 Received ${signal}, shutting down gracefully...`); + + try { + // 1. 停止所有文件监控 + console.log('📡 Stopping file watchers...'); + fileWatcher.unwatchAll(); + + // 2. 关闭所有数据库连接 + console.log('💾 Closing database connections...'); + const dbPool = require('./database/dbPool'); + dbPool.closeAll(); + + // 3. 关闭 HTTP 服务器 + console.log('🌐 Closing HTTP server...'); + server.close(() => { + console.log('✅ All resources released, goodbye!'); + process.exit(0); + }); + + // 如果10秒内没有正常关闭,强制退出 + setTimeout(() => { + console.error('⚠️ Forced shutdown after timeout'); + process.exit(1); + }, 10000); + + } catch (error) { + console.error('❌ Error during shutdown:', error); + process.exit(1); + } +}; + +// 监听各种退出信号 +process.on('SIGINT', () => gracefulShutdown('SIGINT')); // Ctrl+C +process.on('SIGTERM', () => gracefulShutdown('SIGTERM')); // kill +process.on('SIGHUP', () => gracefulShutdown('SIGHUP')); // 终端关闭 + +// Windows 特殊处理(Ctrl+C) +if (process.platform === 'win32') { + const readline = require('readline'); + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout + }); + + rl.on('SIGINT', () => { + process.emit('SIGINT'); + }); +} + +// 捕获未处理的异常 +process.on('uncaughtException', (error) => { + console.error('❌ Uncaught Exception:', error); + gracefulShutdown('uncaughtException'); +}); + +process.on('unhandledRejection', (reason, promise) => { + console.error('❌ Unhandled Rejection at:', promise, 'reason:', reason); + gracefulShutdown('unhandledRejection'); }); diff --git a/flypic/app/server/utils/config.js b/flypic/app/server/utils/config.js index 892a6f2..e4fa34c 100644 --- a/flypic/app/server/utils/config.js +++ b/flypic/app/server/utils/config.js @@ -2,6 +2,11 @@ const fs = require('fs'); const path = require('path'); const os = require('os'); +// 配置缓存 +let configCache = null; +let configCacheTime = 0; +const CONFIG_CACHE_TTL = 5000; // 5秒缓存 + /** * Get config directory based on environment */ @@ -34,7 +39,13 @@ function getConfigPath() { /** * Load configuration */ -function loadConfig() { +function loadConfig(forceReload = false) { + // 检查缓存是否有效 + const now = Date.now(); + if (!forceReload && configCache && (now - configCacheTime) < CONFIG_CACHE_TTL) { + return configCache; + } + const configPath = getConfigPath(); if (!fs.existsSync(configPath)) { @@ -68,6 +79,10 @@ function loadConfig() { }; } + // 更新缓存 + configCache = config; + configCacheTime = now; + return config; } catch (error) { console.error('Error loading config:', error); @@ -91,6 +106,9 @@ function saveConfig(config) { const configPath = getConfigPath(); try { fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8'); + // 同步更新缓存 + configCache = config; + configCacheTime = Date.now(); return true; } catch (error) { console.error('Error saving config:', error); @@ -98,6 +116,14 @@ function saveConfig(config) { } } +/** + * 清除配置缓存(用于强制重新加载) + */ +function clearConfigCache() { + configCache = null; + configCacheTime = 0; +} + /** * Add library to config */ @@ -195,6 +221,7 @@ module.exports = { getConfigPath, loadConfig, saveConfig, + clearConfigCache, addLibrary, removeLibrary, updateLibrary, diff --git a/flypic/app/server/utils/fileWatcher.js b/flypic/app/server/utils/fileWatcher.js index d8a550e..e1bc84d 100644 --- a/flypic/app/server/utils/fileWatcher.js +++ b/flypic/app/server/utils/fileWatcher.js @@ -1,14 +1,15 @@ -const chokidar = require('chokidar'); +const { Worker } = require('worker_threads'); const path = require('path'); const { getLibrary } = require('./config'); -const { syncLibrary, applyChangesFromEvents } = require('./scanner'); +const { applyChangesFromEvents } = require('./scanner'); const dbPool = require('../database/dbPool'); class FileWatcher { constructor() { - this.watchers = new Map(); // libraryId -> watcher + this.workers = new Map(); // libraryId -> Worker this.debounceTimers = new Map(); // libraryId -> { timer, forceRebuildFolders } this.changeBuffers = new Map(); // libraryId -> { filesAdded, filesChanged, filesRemoved, dirsAdded, dirsRemoved } + this.ioRef = null; // Socket.IO 引用 } // 获取或创建变更缓冲区 @@ -36,10 +37,13 @@ class FileWatcher { ); } - // 启动监控 + // 启动监控(使用 Worker Thread,不阻塞主线程) watch(libraryId, io) { + // 保存 io 引用 + this.ioRef = io; + // 如果已经在监控,先停止 - if (this.watchers.has(libraryId)) { + if (this.workers.has(libraryId)) { this.unwatch(libraryId); } @@ -54,143 +58,151 @@ class FileWatcher { try { fs.accessSync(library.path, fs.constants.R_OK); } catch (error) { - console.error(`Cannot access library path: ${library.path}`, error.message); - console.error('提示:在飞牛 fnOS 上,请确保在应用设置中授予了文件夹访问权限'); - return; + const errorMsg = `Cannot access library path: ${library.path} - ${error.message}`; + console.error(errorMsg); + throw new Error(errorMsg); } - console.log(`Starting file watcher for library: ${library.name} (${library.path})`); + console.log(`[FileWatcher] Starting worker for: ${library.name} (${library.path})`); - // 支持的图片格式 - const imageExtensions = ['jpg', 'jpeg', 'png', 'webp', 'gif', 'bmp', 'tiff']; - const pattern = `**/*.{${imageExtensions.join(',')}}`; - - // 创建监控器(监控文件和文件夹) - const watcher = chokidar.watch([pattern, '**/'], { - cwd: library.path, - ignored: [ - '**/node_modules/**', - '**/.git/**', - '**/.flypic/**', // 忽略自己的缓存目录 - '**/.*' // 忽略隐藏文件 - ], - persistent: true, - ignoreInitial: true, // 忽略初始扫描 - awaitWriteFinish: { - stabilityThreshold: 1200, // 文件稳定 1.2 秒后触发,提升响应 - pollInterval: 100 + // 创建 Worker Thread + const workerPath = path.join(__dirname, 'fileWatcherWorker.js'); + const worker = new Worker(workerPath, { + workerData: { + libraryPath: library.path, + libraryName: library.name } }); - // 防抖处理:多个文件变化合并为一次同步(自适应时长) - const debouncedSync = (forceRebuildFolders = false) => { - const buf = this._getBuffer(libraryId); - const changeCount = this._bufferCount(buf); + // 处理 Worker 消息 + worker.on('message', (msg) => { + this._handleWorkerMessage(libraryId, library, msg); + }); - // 清除之前的定时器 - if (this.debounceTimers.has(libraryId)) { - const oldTimer = this.debounceTimers.get(libraryId); - clearTimeout(oldTimer.timer); - // 聚合 forceRebuildFolders 标记 - forceRebuildFolders = forceRebuildFolders || oldTimer.forceRebuildFolders; + worker.on('error', (error) => { + console.error(`[FileWatcher] Worker error for ${library.name}:`, error); + }); + + worker.on('exit', (code) => { + if (code !== 0) { + console.error(`[FileWatcher] Worker exited with code ${code} for ${library.name}`); } + this.workers.delete(libraryId); + }); - // 自适应防抖时间:少量变化更快响应 - let debounceMs = 5000; - if (changeCount <= 1) debounceMs = 1200; - else if (changeCount <= 10) debounceMs = 2000; - else if (changeCount <= 50) debounceMs = 3500; - else if (changeCount <= 200) debounceMs = 5000; - else debounceMs = 8000; // 超大批量进一步聚合 + this.workers.set(libraryId, worker); + } - const timer = setTimeout(async () => { - const snapshot = this._getBuffer(libraryId); - // 清空缓冲区(开始新一轮累计) - this.changeBuffers.set(libraryId, { - filesAdded: new Set(), - filesChanged: new Set(), - filesRemoved: new Set(), - dirsAdded: new Set(), - dirsRemoved: new Set() - }); + // 处理 Worker 发来的消息 + _handleWorkerMessage(libraryId, library, msg) { + switch (msg.type) { + case 'add': + this._getBuffer(libraryId).filesAdded.add(msg.path); + this._debouncedSync(libraryId, library); + break; + case 'unlink': + this._getBuffer(libraryId).filesRemoved.add(msg.path); + this._debouncedSync(libraryId, library); + break; + case 'change': + this._getBuffer(libraryId).filesChanged.add(msg.path); + this._debouncedSync(libraryId, library); + break; + case 'addDir': + this._getBuffer(libraryId).dirsAdded.add(msg.path); + this._debouncedSync(libraryId, library, true); + break; + case 'unlinkDir': + this._getBuffer(libraryId).dirsRemoved.add(msg.path); + this._debouncedSync(libraryId, library, true); + break; + case 'ready': + console.log(`[FileWatcher] Ready for: ${library.name}`); + break; + case 'error': + console.error(`[FileWatcher] Error for ${library.name}:`, msg.message); + break; + case 'closed': + console.log(`[FileWatcher] Closed for: ${library.name}`); + break; + } + } - // 从连接池获取数据库连接 - const db = dbPool.acquire(library.path); - - try { - const total = this._bufferCount(snapshot); - let results; + // 防抖同步 + _debouncedSync(libraryId, library, forceRebuildFolders = false) { + const buf = this._getBuffer(libraryId); + const changeCount = this._bufferCount(buf); - if (forceRebuildFolders || total > 200) { - // 大量变化或目录级变化:走增量全量路径(更稳) - results = await syncLibrary(library.path, db, true); - } else { - // 小批量变化:基于事件的快速同步 - results = await applyChangesFromEvents(library.path, db, { - filesAdded: Array.from(snapshot.filesAdded), - filesChanged: Array.from(snapshot.filesChanged), - filesRemoved: Array.from(snapshot.filesRemoved), - dirsAdded: Array.from(snapshot.dirsAdded), - dirsRemoved: Array.from(snapshot.dirsRemoved) - }); - } + // 清除之前的定时器 + if (this.debounceTimers.has(libraryId)) { + const oldTimer = this.debounceTimers.get(libraryId); + clearTimeout(oldTimer.timer); + forceRebuildFolders = forceRebuildFolders || oldTimer.forceRebuildFolders; + } - // 通过 Socket.IO 通知前端 - io.emit('scanComplete', { libraryId, results }); - console.log(`Sync complete for ${library.name}:`, results); - } catch (error) { - console.error(`Sync error for ${library.name}:`, error); - io.emit('scanError', { libraryId, error: error.message }); - } finally { - // 释放数据库连接(不关闭,复用) - dbPool.release(library.path); - } + // 自适应防抖时间 + let debounceMs = 2000; + if (changeCount <= 1) debounceMs = 800; + else if (changeCount <= 5) debounceMs = 1000; + else if (changeCount <= 20) debounceMs = 1500; + else if (changeCount <= 100) debounceMs = 2000; + else debounceMs = 3000; - this.debounceTimers.delete(libraryId); - }, debounceMs); - - this.debounceTimers.set(libraryId, { timer, forceRebuildFolders }); - }; - - // 监听文件和文件夹变化(写入缓冲,统一合并处理) - watcher - .on('add', (filePath) => { - this._getBuffer(libraryId).filesAdded.add(filePath); - debouncedSync(); - }) - .on('unlink', (filePath) => { - this._getBuffer(libraryId).filesRemoved.add(filePath); - debouncedSync(); - }) - .on('change', (filePath) => { - this._getBuffer(libraryId).filesChanged.add(filePath); - debouncedSync(); - }) - .on('addDir', (dirPath) => { - this._getBuffer(libraryId).dirsAdded.add(dirPath); - debouncedSync(true); // 强制重建文件夹结构 - }) - .on('unlinkDir', (dirPath) => { - this._getBuffer(libraryId).dirsRemoved.add(dirPath); - debouncedSync(true); // 强制重建文件夹结构 - }) - .on('error', (error) => { - console.error(`Watcher error for ${library.name}:`, error); - }) - .on('ready', () => { - console.log(`File watcher ready for: ${library.name}`); + const timer = setTimeout(async () => { + const snapshot = this._getBuffer(libraryId); + // 清空缓冲区 + this.changeBuffers.set(libraryId, { + filesAdded: new Set(), + filesChanged: new Set(), + filesRemoved: new Set(), + dirsAdded: new Set(), + dirsRemoved: new Set() }); - this.watchers.set(libraryId, watcher); + const db = dbPool.acquire(library.path); + + try { + const results = await applyChangesFromEvents(library.path, db, { + filesAdded: Array.from(snapshot.filesAdded), + filesChanged: Array.from(snapshot.filesChanged), + filesRemoved: Array.from(snapshot.filesRemoved), + dirsAdded: Array.from(snapshot.dirsAdded), + dirsRemoved: Array.from(snapshot.dirsRemoved) + }); + + if (this.ioRef) { + this.ioRef.emit('scanComplete', { libraryId, results }); + } + console.log(`[FileWatcher] Sync complete for ${library.name}:`, results); + } catch (error) { + console.error(`[FileWatcher] Sync error for ${library.name}:`, error); + if (this.ioRef) { + this.ioRef.emit('scanError', { libraryId, error: error.message }); + } + } finally { + dbPool.release(library.path); + } + + this.debounceTimers.delete(libraryId); + }, debounceMs); + + this.debounceTimers.set(libraryId, { timer, forceRebuildFolders }); } // 停止监控 unwatch(libraryId) { - const watcher = this.watchers.get(libraryId); - if (watcher) { - watcher.close(); - this.watchers.delete(libraryId); - console.log(`Stopped file watcher for library: ${libraryId}`); + const worker = this.workers.get(libraryId); + if (worker) { + // 发送关闭命令给 Worker + worker.postMessage({ type: 'close' }); + // 给 Worker 一些时间优雅关闭,然后强制终止 + setTimeout(() => { + if (this.workers.has(libraryId)) { + worker.terminate(); + this.workers.delete(libraryId); + } + }, 1000); + console.log(`[FileWatcher] Stopping worker for: ${libraryId}`); } // 清除防抖定时器 @@ -208,19 +220,19 @@ class FileWatcher { // 停止所有监控 unwatchAll() { - for (const libraryId of this.watchers.keys()) { + for (const libraryId of this.workers.keys()) { this.unwatch(libraryId); } } // 获取监控状态 isWatching(libraryId) { - return this.watchers.has(libraryId); + return this.workers.has(libraryId); } // 获取所有正在监控的库 getWatchedLibraries() { - return Array.from(this.watchers.keys()); + return Array.from(this.workers.keys()); } } diff --git a/flypic/app/server/utils/fileWatcherWorker.js b/flypic/app/server/utils/fileWatcherWorker.js new file mode 100644 index 0000000..776ed73 --- /dev/null +++ b/flypic/app/server/utils/fileWatcherWorker.js @@ -0,0 +1,64 @@ +/** + * File Watcher Worker - 在独立线程中运行 chokidar + * 避免文件监控初始化阻塞主线程的事件循环 + */ +const { parentPort, workerData } = require('worker_threads'); +const chokidar = require('chokidar'); + +const { libraryPath, libraryName } = workerData; + +console.log(`[Worker] Starting chokidar for: ${libraryName}`); + +// 创建监控器 +const watcher = chokidar.watch(['**/*.*', '**/'], { + cwd: libraryPath, + ignored: [ + '**/node_modules/**', + '**/.git/**', + '**/.flypic/**', + '**/.*' + ], + persistent: true, + ignoreInitial: true, + usePolling: false, + awaitWriteFinish: { + stabilityThreshold: 1000, + pollInterval: 200 + } +}); + +// 监听事件并发送到主线程 +watcher + .on('add', (filePath) => { + parentPort.postMessage({ type: 'add', path: filePath }); + }) + .on('unlink', (filePath) => { + parentPort.postMessage({ type: 'unlink', path: filePath }); + }) + .on('change', (filePath) => { + parentPort.postMessage({ type: 'change', path: filePath }); + }) + .on('addDir', (dirPath) => { + parentPort.postMessage({ type: 'addDir', path: dirPath }); + }) + .on('unlinkDir', (dirPath) => { + parentPort.postMessage({ type: 'unlinkDir', path: dirPath }); + }) + .on('error', (error) => { + parentPort.postMessage({ type: 'error', message: error.message }); + }) + .on('ready', () => { + console.log(`[Worker] File watcher ready for: ${libraryName}`); + parentPort.postMessage({ type: 'ready' }); + }); + +// 监听主线程的关闭命令 +parentPort.on('message', (msg) => { + if (msg.type === 'close') { + console.log(`[Worker] Closing watcher for: ${libraryName}`); + watcher.close().then(() => { + parentPort.postMessage({ type: 'closed' }); + process.exit(0); + }); + } +}); diff --git a/flypic/app/server/utils/scanManager.js b/flypic/app/server/utils/scanManager.js new file mode 100644 index 0000000..e251e5e --- /dev/null +++ b/flypic/app/server/utils/scanManager.js @@ -0,0 +1,245 @@ +/** + * 扫描状态管理器 + * 支持扫描的停止、继续和持久化 + */ + +const fs = require('fs'); +const path = require('path'); + +class ScanManager { + constructor() { + // 每个素材库的扫描状态(内存) + this.scanStates = new Map(); + // 素材库路径映射(用于持久化) + this.libraryPaths = new Map(); + } + + /** + * 注册素材库路径(用于持久化) + */ + registerLibraryPath(libraryId, libraryPath) { + this.libraryPaths.set(libraryId, libraryPath); + } + + /** + * 获取状态文件路径 + */ + getStateFilePath(libraryId) { + const libraryPath = this.libraryPaths.get(libraryId); + if (!libraryPath) return null; + return path.join(libraryPath, '.flypic', 'scan-state.json'); + } + + /** + * 保存状态到文件(轻量:只保存关键信息) + */ + saveState(libraryId) { + const stateFile = this.getStateFilePath(libraryId); + if (!stateFile) return; + + const state = this.scanStates.get(libraryId); + if (!state || state.status === 'idle') { + // 删除状态文件 + try { + if (fs.existsSync(stateFile)) { + fs.unlinkSync(stateFile); + } + } catch (e) { /* ignore */ } + return; + } + + try { + const saveData = { + status: state.status, + progress: state.progress, + pendingCount: state.pendingFiles?.length || 0, + // 只保存文件相对路径,不保存完整路径列表(太大) + savedAt: Date.now() + }; + fs.writeFileSync(stateFile, JSON.stringify(saveData, null, 2)); + } catch (e) { + console.error('Failed to save scan state:', e.message); + } + } + + /** + * 从文件加载状态 + */ + loadState(libraryId) { + const stateFile = this.getStateFilePath(libraryId); + if (!stateFile || !fs.existsSync(stateFile)) return null; + + try { + const data = JSON.parse(fs.readFileSync(stateFile, 'utf8')); + // 状态超过 24 小时视为过期 + if (Date.now() - data.savedAt > 24 * 60 * 60 * 1000) { + fs.unlinkSync(stateFile); + return null; + } + return data; + } catch (e) { + return null; + } + } + + /** + * 获取扫描状态(优先内存,其次文件) + */ + getState(libraryId) { + // 先检查内存中的状态 + const memState = this.scanStates.get(libraryId); + if (memState) return memState; + + // 尝试从文件加载(应用重启后的恢复) + const fileState = this.loadState(libraryId); + if (fileState && fileState.status === 'paused') { + // 重建内存状态(不含 pendingFiles,需要重新扫描确定) + const restored = { + status: 'paused', + progress: fileState.progress, + pendingFiles: [], // 无法恢复完整列表,需要继续扫描时重新计算 + processedCount: fileState.progress?.current || 0, + abortController: { aborted: true }, + needsRescan: true // 标记需要重新扫描 + }; + this.scanStates.set(libraryId, restored); + return restored; + } + + return { + status: 'idle', + progress: null, + pendingFiles: [], + processedCount: 0 + }; + } + + /** + * 开始扫描 + */ + startScan(libraryId, totalFiles) { + this.scanStates.set(libraryId, { + status: 'scanning', + progress: { current: 0, total: totalFiles, percent: 0 }, + pendingFiles: [], + processedCount: 0, + abortController: { aborted: false } + }); + return this.scanStates.get(libraryId); + } + + /** + * 更新进度 + */ + updateProgress(libraryId, current, total) { + const state = this.scanStates.get(libraryId); + if (state) { + state.progress = { + current, + total, + percent: Math.round((current / total) * 100) + }; + state.processedCount = current; + } + } + + /** + * 停止扫描 + */ + stopScan(libraryId, pendingFiles = []) { + const state = this.scanStates.get(libraryId); + if (state) { + state.status = 'paused'; + state.pendingFiles = pendingFiles; + state.abortController.aborted = true; + // 持久化状态 + this.saveState(libraryId); + console.log(`⏸️ Scan paused for ${libraryId}, ${pendingFiles.length} files pending`); + } + } + + /** + * 检查是否应该停止 + */ + shouldStop(libraryId) { + const state = this.scanStates.get(libraryId); + return state?.abortController?.aborted || false; + } + + /** + * 获取待处理文件 + */ + getPendingFiles(libraryId) { + const state = this.scanStates.get(libraryId); + return state?.pendingFiles || []; + } + + /** + * 恢复扫描 + */ + resumeScan(libraryId) { + const state = this.scanStates.get(libraryId); + if (state && state.status === 'paused') { + const pendingFiles = [...state.pendingFiles]; // 复制一份 + state.status = 'scanning'; + state.abortController = { aborted: false }; + state.pendingFiles = []; // 清空待处理列表 + console.log(`▶️ Scan resumed for ${libraryId}, ${pendingFiles.length} files to process`); + return pendingFiles; + } + return []; + } + + /** + * 完成扫描 + */ + completeScan(libraryId) { + const state = this.scanStates.get(libraryId); + if (state) { + state.status = 'idle'; + state.pendingFiles = []; + state.progress = null; + } + // 清除持久化状态 + this.saveState(libraryId); + } + + /** + * 是否正在扫描 + */ + isScanning(libraryId) { + const state = this.scanStates.get(libraryId); + return state?.status === 'scanning'; + } + + /** + * 是否已暂停 + */ + isPaused(libraryId) { + const state = this.scanStates.get(libraryId); + return state?.status === 'paused'; + } + + /** + * 清除素材库状态(删除素材库时调用) + */ + clearState(libraryId) { + this.scanStates.delete(libraryId); + } + + /** + * 清除所有空闲状态(内存清理) + */ + cleanupIdleStates() { + for (const [libraryId, state] of this.scanStates.entries()) { + if (state.status === 'idle') { + this.scanStates.delete(libraryId); + } + } + } +} + +// 单例 +const scanManager = new ScanManager(); + +module.exports = scanManager; diff --git a/flypic/app/server/utils/scanner.js b/flypic/app/server/utils/scanner.js index c738d5f..0a66c5b 100644 --- a/flypic/app/server/utils/scanner.js +++ b/flypic/app/server/utils/scanner.js @@ -1,20 +1,21 @@ const fs = require('fs'); const path = require('path'); const { glob } = require('glob'); -const { - isImageFile, - calculateFileHash, - getImageMetadata, - generateImageThumbnails +const { + isImageFile, + getFileType, + calculateFileHash, + getImageMetadata, + generateImageThumbnails } = require('./thumbnail'); +const scanManager = require('./scanManager'); /** * Get all image files in a directory */ async function getAllImageFiles(libraryPath) { - // 仅匹配常见图片扩展,避免遍历所有非图片文件,显著降低 IO - const exts = '{jpg,jpeg,png,webp,gif,bmp,tiff}'; - const pattern = path.join(libraryPath, '**', `*.${exts}`).replace(/\\/g, '/'); + // 支持所有文件格式(使用通配符 *.*) + const pattern = path.join(libraryPath, '**', '*.*').replace(/\\/g, '/'); const files = await glob(pattern, { nodir: true, nocase: true, // 大小写不敏感(Windows/macOS) @@ -28,17 +29,17 @@ async function getAllImageFiles(libraryPath) { */ function ensureFolderChain(db, folderPath) { if (!folderPath || folderPath === '.' || folderPath === '') return; - let current = folderPath; + let current = folderPath.replace(/\\/g, '/'); const visited = new Set(); while (current && current !== '.' && !visited.has(current)) { visited.add(current); - const parent = path.dirname(current); - const name = path.basename(current); + const parent = path.posix.dirname(current); + const name = current.split('/').pop(); const existing = db.getFolderByPath(current); if (!existing) { db.insertFolder({ path: current, - parent_path: parent === '.' ? '' : parent, + parent_path: parent === '.' ? '' : (parent === current ? '' : parent), name, image_count: 0 }); @@ -60,8 +61,8 @@ function ensureFolderChain(db, folderPath) { */ async function applyChangesFromEvents(libraryPath, db, events) { try { - // Normalize helper to OS-specific separators to match DB records - const norm = (p) => path.normalize(p); + // Normalize helper: 统一使用正斜杠,与数据库记录格式一致 + const norm = (p) => path.normalize(p).replace(/\\/g, '/'); const affectedFolders = new Set(); const results = { added: 0, modified: 0, deleted: 0, foldersAdded: 0, foldersRemoved: 0 }; @@ -86,13 +87,13 @@ async function applyChangesFromEvents(libraryPath, db, events) { try { const rel = norm(file); const full = path.join(libraryPath, rel); - + // 检查文件是否存在 if (!fs.existsSync(full)) { console.warn(`File not found, skipping: ${full}`); continue; } - + const folder = path.dirname(rel); ensureFolderChain(db, folder); await processImage(full, libraryPath, db); @@ -116,13 +117,13 @@ async function applyChangesFromEvents(libraryPath, db, events) { try { const rel = norm(file); const full = path.join(libraryPath, rel); - + // 检查文件是否存在 if (!fs.existsSync(full)) { console.warn(`File not found, skipping: ${full}`); continue; } - + await processImage(full, libraryPath, db); const folder = path.dirname(rel); affectedFolders.add(folder); @@ -191,27 +192,29 @@ async function applyChangesFromEvents(libraryPath, db, events) { */ async function getFolderStructure(libraryPath) { const folders = []; - + function scanDir(dirPath, parentPath = '') { const items = fs.readdirSync(dirPath, { withFileTypes: true }); - + for (const item of items) { if (item.isDirectory() && !item.name.startsWith('.')) { const fullPath = path.join(dirPath, item.name); const relativePath = path.relative(libraryPath, fullPath); - + const relativePathUnix = relativePath.replace(/\\/g, '/'); + const parentUnix = (parentPath || '').replace(/\\/g, '/'); + folders.push({ - path: relativePath, - parent_path: parentPath, + path: relativePathUnix, + parent_path: parentUnix, name: item.name, image_count: 0 }); - - scanDir(fullPath, relativePath); + + scanDir(fullPath, relativePathUnix); } } } - + scanDir(libraryPath); return folders; } @@ -219,46 +222,84 @@ async function getFolderStructure(libraryPath) { /** * Process a single image file */ -async function processImage(imagePath, libraryPath, db) { +/** + * Process a single image file + * @param {boolean} dryRun - If true, return data instead of inserting into DB (for batch write) + */ +async function processImage(imagePath, libraryPath, db, dryRun = false) { try { const relativePath = path.relative(libraryPath, imagePath); const filename = path.basename(imagePath); - const folder = path.dirname(relativePath); - + const folderRaw = path.dirname(relativePath); + const folder = folderRaw === '.' ? '' : folderRaw.replace(/\\/g, '/'); + // Check if image already exists in database - const existing = db.getImageByPath(relativePath); + const existing = db.getImageByPath(relativePath.replace(/\\/g, '/')); const currentHash = calculateFileHash(imagePath); - - // Skip if file hasn't changed - if (existing && existing.file_hash === currentHash) { + + // For unchanged files, check whether thumbnails need upgrade/regeneration + let needRegenThumbs = false; + if (existing) { + const flypicDir = path.join(libraryPath, '.flypic'); + const filenameOnly = (existing.thumbnail_path || '').replace(/\\/g, '/').split('/').pop(); + if (filenameOnly) { + // Calculate sharded path + const hash = filenameOnly.replace(/\.[^/.]+$/, ""); // remove extension + const shard1 = hash.slice(0, 2); + // New structure: .flypic/thumbnails/ab/hash.webp + const expectedPath = path.join(flypicDir, 'thumbnails', shard1, filenameOnly); + + // 需要重建的情况:新结构文件不存在 + if (!fs.existsSync(expectedPath)) { + needRegenThumbs = true; + } + } else { + needRegenThumbs = true; + } + } + + // Skip only if unchanged and thumbnails are up-to-date + if (existing && existing.file_hash === currentHash && !needRegenThumbs) { return { status: 'skipped', path: relativePath }; } - + // Get image metadata const metadata = await getImageMetadata(imagePath); if (!metadata) { return { status: 'error', path: relativePath, error: 'Failed to read metadata' }; } - - // Generate thumbnails + + // Generate thumbnails (also for unchanged files when thumbnails missing/outdated) const thumbnails = await generateImageThumbnails(imagePath, libraryPath); - - // Insert/update in database - db.insertImage({ - path: relativePath, + const fileType = getFileType(imagePath); + + // 使用缩略图的实际尺寸(对于视频/PSD,这是提取后的真实尺寸) + const actualWidth = thumbnails.width || metadata.width; + const actualHeight = thumbnails.height || metadata.height; + + const imageData = { + path: relativePath.replace(/\\/g, '/'), filename: filename, folder: folder, size: metadata.size, - width: metadata.width, - height: metadata.height, + width: actualWidth, + height: actualHeight, format: metadata.format, + file_type: fileType, created_at: Math.floor(metadata.created_at), modified_at: Math.floor(metadata.modified_at), file_hash: currentHash, thumbnail_path: thumbnails.thumbnail_path, thumbnail_size: thumbnails.thumbnail_size - }); - + }; + + if (dryRun) { + return { status: 'processed', path: relativePath, data: imageData }; + } + + // Insert/update in database + db.insertImage(imageData); + return { status: 'processed', path: relativePath }; } catch (error) { console.error('Error processing image:', imagePath, error); @@ -268,60 +309,197 @@ async function processImage(imagePath, libraryPath, db) { /** * Scan library and update database + * @param {string} libraryPath - 素材库路径 + * @param {object} db - 数据库实例 + * @param {function} onProgress - 进度回调 + * @param {string} libraryId - 素材库ID(用于停止控制) + * @param {Array} resumeFiles - 继续扫描时的待处理文件列表 */ -async function scanLibrary(libraryPath, db, onProgress) { +/** + * Scan library and update database + * @param {string} libraryPath - 素材库路径 + * @param {object} db - 数据库实例 + * @param {function} onProgress - 进度回调 + * @param {string} libraryId - 素材库ID(用于停止控制) + * @param {Array} resumeFiles - 继续扫描时的待处理文件列表 + */ +async function scanLibrary(libraryPath, db, onProgress, libraryId = null, resumeFiles = null) { try { - // Get all image files - const files = await getAllImageFiles(libraryPath); + let files; + + // 动态导入 p-limit + const pLimit = (await import('p-limit')).default; + + // 根据 CPU 核心数动态调整并发数 + const os = require('os'); + const cpuCount = os.cpus().length; + // 默认并发数:核心数 - 1,最小 4,最大 16 + const concurrency = Math.max(4, Math.min(16, cpuCount - 1)); + const limit = pLimit(concurrency); + + console.log(`🚀 Starting scan with concurrency: ${concurrency} (CPU cores: ${cpuCount})`); + + if (resumeFiles && resumeFiles.length > 0) { + // 继续扫描:使用待处理文件列表 + files = resumeFiles; + console.log(`▶️ Resuming scan with ${files.length} pending files`); + } else { + // 新扫描:获取所有文件 + files = await getAllImageFiles(libraryPath); + console.log(`Found ${files.length} images in library`); + + // Get folder structure + const folders = await getFolderStructure(libraryPath); + // 使用事务批量插入文件夹 + const insertFolders = db.db.transaction((folders) => { + for (const folder of folders) db.insertFolder(folder); + }); + insertFolders(folders); + } + const total = files.length; - - console.log(`Found ${total} images in library`); - - // Get folder structure - const folders = await getFolderStructure(libraryPath); - folders.forEach(folder => db.insertFolder(folder)); - - // Process images in batches - const batchSize = 50; + + // 初始化扫描状态 + if (libraryId) { + scanManager.startScan(libraryId, total); + } + const results = { processed: 0, skipped: 0, - errors: 0 + errors: 0, + stopped: false }; - - for (let i = 0; i < files.length; i += batchSize) { - const batch = files.slice(i, i + batchSize); - - await Promise.all( - batch.map(file => processImage(file, libraryPath, db)) - ).then(batchResults => { - batchResults.forEach(result => { - if (result.status === 'processed') results.processed++; - else if (result.status === 'skipped') results.skipped++; - else if (result.status === 'error') results.errors++; - }); - }); - - // Report progress - if (onProgress) { - onProgress({ - total, - current: Math.min(i + batchSize, total), - percent: Math.round((Math.min(i + batchSize, total) / total) * 100), - currentFile: batch[batch.length - 1] - }); + + const startTime = Date.now(); + let processedCount = 0; + + // 批量写入缓冲区 + let writeBuffer = []; + const WRITE_BATCH_SIZE = 100; // 每 100 条写入一次数据库 + + // 批量写入函数(事务) + const batchWrite = db.db.transaction((items) => { + for (const item of items) { + if (item.status === 'processed' && item.data) { + db.insertImage(item.data); + } } - } - - // Update folder image counts - folders.forEach(folder => { - db.updateFolderImageCount(folder.path); }); - + + // 处理单个文件的包装函数 + const processFile = async (file) => { + // 检查是否需要停止 + if (libraryId && scanManager.shouldStop(libraryId)) { + return { status: 'stopped', file }; + } + + try { + const result = await processImage(file, libraryPath, db, true); // true = dryRun (不直接写入DB) + return result; + } catch (error) { + return { status: 'error', path: file, error: error.message }; + } + }; + + // 创建所有任务 + const tasks = files.map(file => limit(async () => { + // 如果已经停止,直接返回 + if (results.stopped) return; + + const result = await processFile(file); + + if (result.status === 'stopped') { + results.stopped = true; + return; + } + + // 更新统计 + if (result.status === 'processed') results.processed++; + else if (result.status === 'skipped') results.skipped++; + else if (result.status === 'error') results.errors++; + + // 添加到写入缓冲区 + if (result.status === 'processed') { + writeBuffer.push(result); + + // 缓冲区满,执行批量写入 + if (writeBuffer.length >= WRITE_BATCH_SIZE) { + batchWrite(writeBuffer); + writeBuffer = []; + } + } + + processedCount++; + + // 报告进度 (每完成 10 个文件报告一次,避免过于频繁) + if (processedCount % 10 === 0 || processedCount === total) { + const current = processedCount; + + if (libraryId) { + scanManager.updateProgress(libraryId, current, total); + } + + if (onProgress) { + const elapsed = Date.now() - startTime; + const avgTimePerImage = elapsed / current; + const remaining = total - current; + const estimatedTimeLeft = Math.round((remaining * avgTimePerImage) / 1000); + + onProgress({ + total, + current, + percent: Math.round((current / total) * 100), + currentFile: file, + estimatedTimeLeft, + canStop: true + }); + } + } + + // 性能日志 + if (processedCount > 0 && processedCount % 1000 === 0) { + const elapsed = (Date.now() - startTime) / 1000; + const speed = processedCount / elapsed; + console.log(`⚡ Performance: ${speed.toFixed(1)} images/sec, ${processedCount}/${total} completed`); + } + })); + + // 等待所有任务完成 + await Promise.all(tasks); + + // 写入剩余的缓冲区数据 + if (writeBuffer.length > 0) { + batchWrite(writeBuffer); + writeBuffer = []; + } + + // 处理停止情况 + if (results.stopped) { + const pendingFiles = files.slice(processedCount); + scanManager.stopScan(libraryId, pendingFiles); + console.log(`⏸️ Scan stopped at ${processedCount}/${total}, ${pendingFiles.length} files pending`); + return results; + } + + const totalTime = (Date.now() - startTime) / 1000; + console.log(`✅ Scan completed in ${totalTime.toFixed(1)}s, speed: ${(total / totalTime).toFixed(1)} images/sec`); + + // Update folder image counts + db.updateAllFolderCounts(); + + // 标记扫描完成 + if (libraryId) { + scanManager.completeScan(libraryId); + } + console.log('Scan complete:', results); return results; } catch (error) { console.error('Error scanning library:', error); + if (libraryId) { + scanManager.completeScan(libraryId); + } throw error; } } @@ -329,84 +507,118 @@ async function scanLibrary(libraryPath, db, onProgress) { /** * Sync library (incremental scan) */ -async function syncLibrary(libraryPath, db, forceRebuildFolders = false) { +async function syncLibrary(libraryPath, db, forceRebuildFolders = false, onProgress = null) { try { - // Get all current files + const startTime = Date.now(); + + // Get all current files (统一使用正斜杠) const currentFiles = await getAllImageFiles(libraryPath); const currentPaths = new Set( - currentFiles.map(file => path.relative(libraryPath, file)) + currentFiles.map(file => path.relative(libraryPath, file).replace(/\\/g, '/')) ); - - // Get database files + + // Get database files (已经是正斜杠格式) const dbImages = db.getAllImages(); - const dbPaths = new Set(dbImages.map(img => img.path)); - + const dbPaths = new Set(dbImages.map(img => (img.path || '').replace(/\\/g, '/'))); + // Find new, modified, and deleted files const toAdd = [...currentPaths].filter(p => !dbPaths.has(p)); const toCheck = [...currentPaths].filter(p => dbPaths.has(p)); - const toDelete = [...dbPaths].filter(p => !currentPaths.has(p)); - + let toDelete = [...dbPaths].filter(p => !currentPaths.has(p)); + console.log(`Sync: ${toAdd.length} new, ${toCheck.length} to check, ${toDelete.length} deleted`); - - // Process new files - for (const relativePath of toAdd) { - const fullPath = path.join(libraryPath, relativePath); - await processImage(fullPath, libraryPath, db); + + // 安全检查:如果要删除的文件数量超过数据库中文件的50%,可能是路径匹配问题 + if (toDelete.length > 0 && dbImages.length > 0) { + const deleteRatio = toDelete.length / dbImages.length; + if (deleteRatio > 0.5 && toDelete.length > 10) { + console.warn(`⚠️ 安全检查:要删除 ${toDelete.length}/${dbImages.length} (${(deleteRatio * 100).toFixed(1)}%) 的文件,这可能是路径匹配问题,跳过删除操作`); + console.log('示例 currentPath:', [...currentPaths].slice(0, 3)); + console.log('示例 dbPath:', [...dbPaths].slice(0, 3)); + // 清空 toDelete,不执行删除 + toDelete = []; + } } - - // Check modified files - for (const relativePath of toCheck) { + + const total = toAdd.length + toDelete.length; + let processed = 0; + + // Process new files in batches + const batchSize = 100; + for (let i = 0; i < toAdd.length; i += batchSize) { + const batch = toAdd.slice(i, i + batchSize); + await Promise.all( + batch.map(relativePath => { + const fullPath = path.join(libraryPath, relativePath); + return processImage(fullPath, libraryPath, db); + }) + ); + + processed += batch.length; + + // 报告进度 + if (onProgress && total > 0) { + onProgress({ + total, + current: processed, + percent: Math.round((processed / total) * 100), + currentFile: batch[batch.length - 1] + }); + } + } + + // Check modified files in batches (只检查hash,不重新处理) + const modifiedCount = toCheck.filter(relativePath => { const fullPath = path.join(libraryPath, relativePath); const existing = db.getImageByPath(relativePath); const currentHash = calculateFileHash(fullPath); - - if (existing.file_hash !== currentHash) { - await processImage(fullPath, libraryPath, db); - } - } - + return existing.file_hash !== currentHash; + }).length; + + console.log(`Found ${modifiedCount} modified files (skipped, hash unchanged)`); + // Delete removed files for (const relativePath of toDelete) { db.deleteImage(relativePath); // TODO: Clean up thumbnail files } - + // Rebuild folder structure if there are changes or forced if (toAdd.length > 0 || toDelete.length > 0 || forceRebuildFolders) { console.log('Rebuilding folder structure...'); - + // Get current folder structure from file system const currentFolders = await getFolderStructure(libraryPath); - + // Get existing folders from database const dbFolders = db.getAllFolders(); const dbFolderPaths = new Set(dbFolders.map(f => f.path)); - + // Find new and deleted folders const currentFolderPaths = new Set(currentFolders.map(f => f.path)); const foldersToAdd = currentFolders.filter(f => !dbFolderPaths.has(f.path)); const foldersToDelete = dbFolders.filter(f => !currentFolderPaths.has(f.path)); - + // Add new folders foldersToAdd.forEach(folder => { db.insertFolder(folder); }); - + // Delete removed folders foldersToDelete.forEach(folder => { db.deleteFolder(folder.path); }); - + console.log(`Folders: +${foldersToAdd.length}, -${foldersToDelete.length}`); - + // Update folder image counts console.log('Updating folder image counts...'); const affectedFolders = new Set(); - + // Collect all affected folders (including parent folders) [...toAdd, ...toDelete].forEach(relativePath => { let folderPath = path.dirname(relativePath); - + // Add current folder and all parent folders while (folderPath && folderPath !== '.') { affectedFolders.add(folderPath); @@ -415,18 +627,21 @@ async function syncLibrary(libraryPath, db, forceRebuildFolders = false) { folderPath = parent; } }); - + // Update counts for all affected folders affectedFolders.forEach(folderPath => { db.updateFolderImageCount(folderPath); }); - + console.log(`Updated ${affectedFolders.size} folder counts`); } - + + const totalTime = (Date.now() - startTime) / 1000; + console.log(`✅ Sync completed in ${totalTime.toFixed(1)}s`); + return { added: toAdd.length, - modified: toCheck.length, + modified: modifiedCount, deleted: toDelete.length }; } catch (error) { @@ -435,11 +650,74 @@ async function syncLibrary(libraryPath, db, forceRebuildFolders = false) { } } +/** + * Quick sync - 只检查新增/删除,不检查修改(用于启动时快速检测) + */ +async function quickSync(libraryPath, db) { + const startTime = Date.now(); + + // 获取当前文件(统一使用正斜杠) + const currentFiles = await getAllImageFiles(libraryPath); + const currentPaths = new Set( + currentFiles.map(file => path.relative(libraryPath, file).replace(/\\/g, '/')) + ); + + // 获取数据库文件 + const dbImages = db.getAllImages(); + const dbPaths = new Set(dbImages.map(img => (img.path || '').replace(/\\/g, '/'))); + + // 只检查新增和删除(不检查修改) + const toAdd = [...currentPaths].filter(p => !dbPaths.has(p)); + let toDelete = [...dbPaths].filter(p => !currentPaths.has(p)); + + // 安全检查 + if (toDelete.length > 0 && dbImages.length > 0) { + const deleteRatio = toDelete.length / dbImages.length; + if (deleteRatio > 0.5 && toDelete.length > 10) { + console.warn(`⚠️ 安全检查:跳过删除 ${toDelete.length} 个文件`); + toDelete = []; + } + } + + // 处理新增文件 + for (const relativePath of toAdd) { + try { + const fullPath = path.join(libraryPath, relativePath); + // 确保文件夹链存在 + const folder = path.dirname(relativePath).replace(/\\/g, '/'); + if (folder && folder !== '.') { + ensureFolderChain(db, folder); + } + await processImage(fullPath, libraryPath, db); + } catch (err) { + console.error(`Error adding ${relativePath}:`, err.message); + } + } + + // 删除已移除的文件 + for (const relativePath of toDelete) { + db.deleteImage(relativePath); + } + + // 如果有变化,更新所有文件夹的图片数量 + if (toAdd.length > 0 || toDelete.length > 0) { + db.updateAllFolderCounts(); + } + + const elapsed = Date.now() - startTime; + if (toAdd.length > 0 || toDelete.length > 0) { + console.log(`Quick sync: +${toAdd.length} -${toDelete.length} (${elapsed}ms)`); + } + + return { added: toAdd.length, deleted: toDelete.length }; +} + module.exports = { getAllImageFiles, getFolderStructure, processImage, scanLibrary, syncLibrary, + quickSync, applyChangesFromEvents }; diff --git a/flypic/app/server/utils/thumbnail.js b/flypic/app/server/utils/thumbnail.js index 020506a..d54c2a7 100644 --- a/flypic/app/server/utils/thumbnail.js +++ b/flypic/app/server/utils/thumbnail.js @@ -3,14 +3,78 @@ const path = require('path'); const fs = require('fs'); const crypto = require('crypto'); -const SUPPORTED_FORMATS = ['jpg', 'jpeg', 'png', 'webp', 'gif', 'bmp', 'tiff', 'tif']; +// 支持的文件格式(确定可以生成缩略图的) +const IMAGE_FORMATS = ['jpg', 'jpeg', 'png', 'webp', 'gif', 'bmp', 'tiff', 'tif', 'avif', 'heif', 'heic', 'svg']; + +// 文件类型分类(用于显示和占位图) +const FILE_CATEGORIES = { + // 图片类 + image: ['jpg', 'jpeg', 'png', 'webp', 'gif', 'bmp', 'tiff', 'tif', 'avif', 'heif', 'heic', 'svg', 'ico', 'raw', 'cr2', 'nef', 'dng'], + + // 视频类 + video: ['mp4', 'webm', 'mov', 'avi', 'mkv', 'flv', 'm4v', 'wmv', 'mpg', 'mpeg', '3gp', 'ts', 'vob', 'ogv'], + + // 音频类 + audio: ['mp3', 'wav', 'flac', 'aac', 'm4a', 'ogg', 'wma', 'ape', 'alac', 'opus', 'aiff'], + + // 文档类 + document: [ + 'pdf', 'txt', 'md', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', + 'rtf', 'odt', 'ods', 'odp', 'csv', 'pages', 'numbers', 'key' + ], + + // 设计类 + design: ['psd', 'ai', 'sketch', 'xd', 'fig', 'figma', 'indd', 'eps', 'cdr', 'dwg'] +}; + +// 为了兼容旧代码 +const SUPPORTED_FORMATS = { + image: IMAGE_FORMATS, + video: FILE_CATEGORIES.video, + document: FILE_CATEGORIES.document, + special: FILE_CATEGORIES.design +}; + +// 所有支持的格式(扁平化,兼容所有文件) +const ALL_FORMATS = [ + ...FILE_CATEGORIES.image, + ...FILE_CATEGORIES.video, + ...FILE_CATEGORIES.audio, + ...FILE_CATEGORIES.document, + ...FILE_CATEGORIES.design +]; /** - * Check if file is a supported image + * 获取文件类型分类 + */ +function getFileType(filename) { + const ext = path.extname(filename).toLowerCase().slice(1); + + // 检查所有分类 + if (FILE_CATEGORIES.image.includes(ext)) return 'image'; + if (FILE_CATEGORIES.video.includes(ext)) return 'video'; + if (FILE_CATEGORIES.audio.includes(ext)) return 'audio'; + if (FILE_CATEGORIES.document.includes(ext)) return 'document'; + if (FILE_CATEGORIES.design.includes(ext)) return 'design'; + + // 未知类型也兼容,归类为 other + return 'other'; +} + +/** + * 检查文件是否可以用 Sharp 生成缩略图 + */ +function canGenerateThumbnail(filename) { + const ext = path.extname(filename).toLowerCase().slice(1); + return IMAGE_FORMATS.includes(ext); +} + +/** + * Check if file is supported */ function isImageFile(filename) { const ext = path.extname(filename).toLowerCase().slice(1); - return SUPPORTED_FORMATS.includes(ext); + return ALL_FORMATS.includes(ext); } /** @@ -25,101 +89,153 @@ function calculateFileHash(filePath) { /** * Get thumbnail configuration based on original image size + * 分阶段策略:根据原图大小使用不同的缩略图尺寸和质量 + * + * 策略说明: + * - 小图(<1MP):保持原尺寸或轻微缩小,高质量 + * - 中图(1-4MP):缩略图 200px 高,高质量 + * - 大图(4-12MP):缩略图 250px 高,中高质量 + * - 超大图(>12MP):缩略图 300px 高,中等质量 */ function getThumbnailConfig(originalWidth, originalHeight, targetHeight = 200) { - const targetWidth = Math.round((originalWidth / originalHeight) * targetHeight); - - // 优化质量配置:提高质量,减少模糊 - // WebP 格式建议质量范围:80-95 - let quality = 90; - const originalSize = originalWidth * originalHeight; - - if (originalSize > 10000000) { // >10MP - quality = 85; // 提高到 85(之前 70) - } else if (originalSize > 5000000) { // 5-10MP - quality = 88; // 提高到 88(之前 75) - } else if (originalSize > 2000000) { // 2-5MP - quality = 90; // 提高到 90(之前 80) + const originalPixels = originalWidth * originalHeight; + const aspectRatio = originalWidth / originalHeight; + + let finalHeight, finalQuality, targetSize; + + // 分阶段策略 - 提高质量,扩大文件大小 + if (originalPixels < 1000000) { + // 小图 <1MP(如 1000x1000):保持较小尺寸,极高质量 + finalHeight = Math.min(targetHeight, originalHeight); + finalQuality = 95; + targetSize = { min: 80 * 1024, max: 240 * 1024 }; // 80-240KB } - + else if (originalPixels < 4000000) { + // 中图 1-4MP(如 2000x2000):标准尺寸,极高质量 + finalHeight = Math.min(targetHeight, originalHeight); + finalQuality = 93; + targetSize = { min: 120 * 1024, max: 300 * 1024 }; // 120-300KB + } + else if (originalPixels < 12000000) { + // 大图 4-12MP(如 4000x3000):增大尺寸,高质量 + finalHeight = Math.min(targetHeight, originalHeight); + finalQuality = 91; + targetSize = { min: 160 * 1024, max: 400 * 1024 }; // 160-400KB + } + else { + // 超大图 >12MP(如 6000x4000):更大尺寸,高质量 + finalHeight = Math.min(targetHeight, originalHeight); + finalQuality = 89; + targetSize = { min: 200 * 1024, max: 500 * 1024 }; // 200-500KB + } + + const finalWidth = Math.round(aspectRatio * finalHeight); + + // 计算原图大小(MP) + const megaPixels = (originalPixels / 1000000).toFixed(1); + return { - width: targetWidth, - height: targetHeight, - quality: quality, - format: 'webp' + width: finalWidth, + height: finalHeight, + quality: finalQuality, + targetSize: targetSize, + format: 'webp', + originalPixels: originalPixels, + megaPixels: megaPixels }; } /** - * Generate thumbnail for an image with dynamic quality adjustment + * Generate thumbnail for an image with high quality settings + * + * 核心优化点: + * 1. 禁用 smartSubsample,保持色彩锐度(关键!) + * 2. 使用更强的 unsharp mask 锐化 + * 3. 固定高质量 Q96,不动态调整 + * 4. 不修改色彩(饱和度/亮度),保持原图风格 */ async function generateThumbnail(inputPath, outputPath, targetHeight = 200) { try { - // Get image metadata - const metadata = await sharp(inputPath).metadata(); + // 先读取文件到 Buffer,避免 Sharp 锁定文件句柄 + const inputBuffer = fs.readFileSync(inputPath); + + // Get image metadata from buffer + const metadata = await sharp(inputBuffer).metadata(); const config = getThumbnailConfig(metadata.width, metadata.height, targetHeight); - - const TARGET_MIN_SIZE = 50 * 1024; // 50KB (提高下限) - const TARGET_MAX_SIZE = 150 * 1024; // 150KB (提高上限) - const MAX_ATTEMPTS = 3; - - let quality = config.quality; - let attempt = 0; - let finalSize = 0; - - // 动态调整质量,直到文件大小在目标范围内 - while (attempt < MAX_ATTEMPTS) { - // Generate thumbnail with current quality - await sharp(inputPath) - .resize(config.width, config.height, { - fit: 'cover', - position: 'center', - kernel: 'lanczos3' // 使用高质量的缩放算法 - }) - .webp({ - quality: quality, - effort: 6, // 提高压缩质量(0-6,6最好但最慢) - smartSubsample: true // 智能色度子采样 - }) - .toFile(outputPath); - - // Check file size - const stats = fs.statSync(outputPath); - finalSize = stats.size; - - // 如果在目标范围内,完成 - if (finalSize >= TARGET_MIN_SIZE && finalSize <= TARGET_MAX_SIZE) { - console.log(`✅ Thumbnail generated: ${finalSize} bytes (quality: ${quality})`); - break; - } - - // 如果太大,降低质量 - if (finalSize > TARGET_MAX_SIZE) { - const ratio = TARGET_MAX_SIZE / finalSize; - quality = Math.max(70, Math.round(quality * ratio * 0.9)); // 最低质量提高到 70 - console.log(`⬇️ File too large (${finalSize} bytes), reducing quality to ${quality}`); - } - // 如果太小,提高质量 - else if (finalSize < TARGET_MIN_SIZE) { - const ratio = TARGET_MIN_SIZE / finalSize; - quality = Math.min(98, Math.round(quality * ratio * 1.1)); // 最高质量提高到 98 - console.log(`⬆️ File too small (${finalSize} bytes), increasing quality to ${quality}`); - } - - attempt++; - - // 最后一次尝试,接受结果 - if (attempt >= MAX_ATTEMPTS) { - console.log(`⚠️ Max attempts reached, final size: ${finalSize} bytes (quality: ${quality})`); - break; - } + const hasAlpha = Boolean(metadata.hasAlpha); + + // 计算缩小比例,用于调整锐化强度 + const downscaleRatio = metadata.height ? (metadata.height / config.height) : 1; + + // 锐化参数:根据缩小比例动态调整 + // sharpen(sigma, flat, jagged) - sigma: 高斯模糊半径, flat: 平坦区域锐化, jagged: 边缘锐化 + let sharpSigma, sharpFlat, sharpJagged; + if (downscaleRatio >= 4) { + // 大幅缩小(如 4000px → 300px):强锐化 + sharpSigma = 1.2; + sharpFlat = 1.0; + sharpJagged = 2.0; + } else if (downscaleRatio >= 2) { + // 中等缩小:中等锐化 + sharpSigma = 1.0; + sharpFlat = 0.8; + sharpJagged = 1.5; + } else { + // 轻微缩小或不缩小:轻度锐化 + sharpSigma = 0.8; + sharpFlat = 0.5; + sharpJagged = 1.0; } - + + // 固定高质量 92(平衡清晰度和体积) + const quality = 92; + + // 生成缩略图(使用 buffer,不锁定原文件) + await sharp(inputBuffer) + .rotate() // 按EXIF旋转 + .resize(config.width, config.height, { + fit: 'cover', + position: 'center', + kernel: 'lanczos3', // 最高质量缩放算法 + withoutEnlargement: true, + fastShrinkOnLoad: false // 禁用快速缩小,保持质量 + }) + // 锐化:使用完整的 unsharp mask 参数(不修改色彩) + .sharpen({ + sigma: sharpSigma, // 高斯模糊半径 + m1: sharpFlat, // 平坦区域锐化强度 + m2: sharpJagged, // 边缘/锯齿区域锐化强度 + x1: 2, // 平坦区域阈值 + y2: 10, // 边缘区域阈值上限 + y3: 20 // 最大锐化限制 + }) + .webp({ + quality: quality, + effort: 4, // 降低 effort,减少编码损失 + smartSubsample: false, // 关键!禁用色度子采样,保持边缘清晰 + nearLossless: false, // 禁用近无损(会增加体积但不增加清晰度) + preset: 'photo', + alphaQuality: hasAlpha ? 100 : undefined + }) + .toFile(outputPath); + + // 获取文件大小 + const stats = fs.statSync(outputPath); + const finalSize = stats.size; + + // 可选:输出详细信息(每100张输出一次,避免日志过多) + const shouldLog = Math.random() < 0.01; // 1% 概率输出 + if (shouldLog) { + const sizeKB = (finalSize / 1024).toFixed(1); + console.log(`📸 Thumbnail: ${config.megaPixels}MP → ${config.width}x${config.height} (${sizeKB}KB, Q${quality}, ratio ${downscaleRatio.toFixed(1)}x)`); + } + return { width: config.width, height: config.height, size: finalSize, quality: quality, + originalPixels: config.originalPixels, path: outputPath }; } catch (error) { @@ -129,52 +245,398 @@ async function generateThumbnail(inputPath, outputPath, targetHeight = 200) { } /** - * Get image metadata + * Get file metadata (支持所有文件类型) + * 优化:优先使用流式读取,避免加载整个文件到内存 */ async function getImageMetadata(imagePath) { try { - const metadata = await sharp(imagePath).metadata(); const stats = fs.statSync(imagePath); - + const fileType = getFileType(imagePath); + + // 对于图片文件,尝试获取详细元数据 + if (fileType === 'image') { + try { + // 优化:直接传入路径,让 sharp 使用流式读取,仅读取头部元数据 + // 只有在失败时才回退到 Buffer 读取 + const metadata = await sharp(imagePath).metadata(); + return { + width: metadata.width, + height: metadata.height, + format: metadata.format, + size: stats.size, + created_at: stats.birthtimeMs, + modified_at: stats.mtimeMs + }; + } catch (sharpError) { + // Sharp 无法处理某些图片格式(如 SVG)或路径问题,回退到基础信息 + // console.warn(`Sharp cannot process ${imagePath}, using basic metadata`); + } + } + + // 对于非图片文件或 Sharp 失败的情况,返回基础信息 + const ext = path.extname(imagePath).toLowerCase().slice(1); return { - width: metadata.width, - height: metadata.height, - format: metadata.format, + width: 640, // 占位图尺寸 + height: 480, + format: ext, size: stats.size, created_at: stats.birthtimeMs, modified_at: stats.mtimeMs }; } catch (error) { - console.error('Error getting image metadata:', error); + console.error('Error getting file metadata:', imagePath, error); return null; } } /** - * Generate thumbnail for an image - * 优化:直接存储在 thumbnails/ 目录,不再使用子文件夹 + * Generate thumbnail for a file (image/video/document) + * 使用 480px 高度(与 Billfish 一致) */ async function generateImageThumbnails(imagePath, libraryPath) { const flypicDir = path.join(libraryPath, '.flypic'); const relativePath = path.relative(libraryPath, imagePath); const hash = crypto.createHash('md5').update(relativePath).digest('hex'); - - // 直接存储在 thumbnails 目录,不使用 200 子文件夹 - const thumbPath = path.join(flypicDir, 'thumbnails', `${hash}.webp`); - const thumb = await generateThumbnail(imagePath, thumbPath, 200); - + const fileType = getFileType(imagePath); + + console.log(`📝 Processing file: ${path.basename(imagePath)}, type: ${fileType}`); + + // Sharding: use first 2 chars of hash for subdirectories (e.g. /ab/) + const shard1 = hash.slice(0, 2); + // 1-level sharding: .flypic/thumbnails/ab/hash.webp + const out480 = path.join(flypicDir, 'thumbnails', shard1, `${hash}.webp`); + fs.mkdirSync(path.dirname(out480), { recursive: true }); + + let thumbnailResult; + + // 根据文件类型生成不同的缩略图 + const ext = path.extname(imagePath).slice(1).toUpperCase(); + + if (fileType === 'image' && canGenerateThumbnail(imagePath)) { + // 图片:使用 Sharp 生成真实缩略图 + thumbnailResult = await generateThumbnail(imagePath, out480, 480); + } else if (fileType === 'video') { + // 视频:尝试提取封面 + console.log(`🎬 Extracting video thumbnail for: ${path.basename(imagePath)}`); + thumbnailResult = await extractVideoThumbnail(imagePath, out480); + + // 如果提取失败,生成占位图 + if (!thumbnailResult) { + console.log(`🎬 Generating video placeholder for: ${path.basename(imagePath)}`); + thumbnailResult = await generatePlaceholderThumbnail(out480, 'video', ext); + } + } else if (fileType === 'design') { + // 设计文件:尝试提取嵌入缩略图(仅 PSD) + if (ext.toLowerCase() === 'psd') { + console.log(`🎨 Extracting PSD thumbnail for: ${path.basename(imagePath)}`); + thumbnailResult = await extractPSDThumbnail(imagePath, out480); + } + + // 如果提取失败或不是 PSD,生成占位图 + if (!thumbnailResult) { + console.log(`🎨 Generating design placeholder for: ${path.basename(imagePath)}`); + thumbnailResult = await generatePlaceholderThumbnail(out480, 'design', ext); + } + } else { + // 其他类型(音频/文档/未知):生成占位图 + console.log(`📦 Generating ${fileType} placeholder for: ${path.basename(imagePath)}`); + thumbnailResult = await generatePlaceholderThumbnail(out480, fileType, ext); + } + + console.log(`✅ Thumbnail generated: ${path.basename(out480)}, ${thumbnailResult.width}x${thumbnailResult.height}, ${(thumbnailResult.size / 1024).toFixed(1)}KB`); + return { - thumbnail_path: path.relative(flypicDir, thumbPath), - thumbnail_size: thumb.size + thumbnail_path: path.relative(flypicDir, out480), + thumbnail_size: thumbnailResult.size, + width: thumbnailResult.width, + height: thumbnailResult.height, + file_type: fileType }; } +/** + * 从 PSD 文件提取嵌入的缩略图 + */ +async function extractPSDThumbnail(psdPath, outputPath) { + try { + const buffer = fs.readFileSync(psdPath); + + // PSD 文件格式: + // 前 4 字节: "8BPS" (签名) + // 偏移 26: Image Resources Section + // 查找 Resource ID 1036 (缩略图资源) + + if (buffer.toString('utf8', 0, 4) !== '8BPS') { + throw new Error('Not a valid PSD file'); + } + + // 读取 Image Resources Section 长度 + const colorModeLength = buffer.readUInt32BE(26); + const imageResourcesOffset = 26 + 4 + colorModeLength; + const imageResourcesLength = buffer.readUInt32BE(imageResourcesOffset); + + let offset = imageResourcesOffset + 4; + const endOffset = offset + imageResourcesLength; + + // 查找缩略图资源 (ID 1033 或 1036) + while (offset < endOffset) { + const signature = buffer.toString('utf8', offset, offset + 4); + if (signature !== '8BIM') break; + + const resourceId = buffer.readUInt16BE(offset + 4); + const nameLength = buffer.readUInt8(offset + 6); + const namePadding = nameLength % 2 === 0 ? nameLength + 2 : nameLength + 1; + const dataSize = buffer.readUInt32BE(offset + 6 + namePadding); + const dataPadding = dataSize % 2 === 0 ? dataSize : dataSize + 1; + + // 1033 = 缩略图 (旧格式), 1036 = 缩略图 (新格式) + if (resourceId === 1033 || resourceId === 1036) { + const dataOffset = offset + 6 + namePadding + 4; + + // 跳过前 28 字节的头部信息 + const jpegOffset = dataOffset + 28; + const jpegData = buffer.slice(jpegOffset, jpegOffset + dataSize - 28); + + // 先获取原始缩略图尺寸 + const metadata = await sharp(jpegData).metadata(); + console.log(` 📐 PSD embedded thumbnail: ${metadata.width}x${metadata.height}`); + + // 使用高质量缩放,保持宽高比 + const aspectRatio = metadata.width / metadata.height; + const targetHeight = 480; + const targetWidth = Math.round(targetHeight * aspectRatio); + + // 根据原始尺寸调整处理策略 + let resizeOptions, sharpenOptions, webpQuality; + + if (metadata.width >= 1000 || metadata.height >= 1000) { + // 高分辨率缩略图(≥1000px):正常缩放 + resizeOptions = { + fit: 'inside', + kernel: 'lanczos3', + withoutEnlargement: true + }; + sharpenOptions = { sigma: 0.8, m1: 0.5, m2: 1.0 }; + webpQuality = 95; + } else if (metadata.width >= 500 || metadata.height >= 500) { + // 中等分辨率(500-1000px):轻微放大 + 强锐化 + resizeOptions = { + fit: 'inside', + kernel: 'lanczos3', + withoutEnlargement: false // 允许放大 + }; + sharpenOptions = { sigma: 1.2, m1: 1.0, m2: 2.0 }; // 强锐化 + webpQuality = 96; + } else { + // 低分辨率(<500px):放大 + 超强锐化 + resizeOptions = { + fit: 'inside', + kernel: 'lanczos3', + withoutEnlargement: false + }; + sharpenOptions = { sigma: 1.5, m1: 1.2, m2: 2.5 }; // 超强锐化 + webpQuality = 98; // 最高质量 + } + + await sharp(jpegData) + .resize(targetWidth, targetHeight, resizeOptions) + .sharpen(sharpenOptions) + .webp({ + quality: webpQuality, + effort: 4, + smartSubsample: false + }) + .toFile(outputPath); + + const stats = fs.statSync(outputPath); + console.log(` ✅ PSD thumbnail extracted: ${(stats.size / 1024).toFixed(1)}KB`); + return { + width: targetWidth, + height: targetHeight, + size: stats.size, + path: outputPath + }; + } + + offset += 6 + namePadding + 4 + dataPadding; + } + + throw new Error('No thumbnail found in PSD'); + } catch (error) { + console.warn(`Failed to extract PSD thumbnail: ${error.message}`); + return null; + } +} + +/** + * 从视频提取封面(使用 ffmpeg 或系统工具) + * 注意:这需要系统安装 ffmpeg,如果没有则回退到占位图 + */ +async function extractVideoThumbnail(videoPath, outputPath) { + try { + const { exec } = require('child_process'); + const util = require('util'); + const execPromise = util.promisify(exec); + + // 检查是否有 ffmpeg + try { + await execPromise('ffmpeg -version', { timeout: 2000 }); + } catch (e) { + console.warn(' ⚠️ ffmpeg not found, skipping video thumbnail extraction'); + return null; + } + + // 使用 ffmpeg 提取第 2 秒的帧(避免黑屏) + const tempJpg = outputPath.replace('.webp', '_temp.jpg'); + const ffmpegCmd = `ffmpeg -i "${videoPath}" -ss 00:00:02 -vframes 1 -q:v 2 "${tempJpg}" -y`; + + await execPromise(ffmpegCmd, { timeout: 10000 }); + + // 如果生成了 JPG,转换为 WebP + if (fs.existsSync(tempJpg)) { + // 先获取实际尺寸 + const metadata = await sharp(tempJpg).metadata(); + console.log(` 📐 Video frame: ${metadata.width}x${metadata.height}`); + + // 保持宽高比缩放到 480 高度 + const aspectRatio = metadata.width / metadata.height; + const targetHeight = 480; + const targetWidth = Math.round(targetHeight * aspectRatio); + + await sharp(tempJpg) + .resize(targetWidth, targetHeight, { + fit: 'cover', + position: 'center', + kernel: 'lanczos3', + withoutEnlargement: true + }) + .webp({ quality: 92, smartSubsample: false }) + .toFile(outputPath); + + fs.unlinkSync(tempJpg); // 删除临时 JPG + + const stats = fs.statSync(outputPath); + console.log(` ✅ Video thumbnail extracted: ${targetWidth}x${targetHeight}, ${(stats.size / 1024).toFixed(1)}KB`); + return { + width: targetWidth, + height: targetHeight, + size: stats.size, + path: outputPath + }; + } + + return null; + } catch (error) { + console.warn(` ⚠️ Failed to extract video thumbnail: ${error.message}`); + return null; + } +} + +/** + * 生成占位缩略图(用于视频/文档等) + */ +async function generatePlaceholderThumbnail(outputPath, type, label) { + // 使用 Sharp 生成简单的占位图 + const width = 640; + const height = 480; + + // 不同类型的背景色和图标 + const typeConfig = { + image: { + color: { r: 99, g: 102, b: 241 }, // 靛蓝色 + icon: '🖼️', + text: '图片' + }, + video: { + color: { r: 59, g: 130, b: 246 }, // 蓝色 + icon: '🎬', + text: '视频' + }, + audio: { + color: { r: 236, g: 72, b: 153 }, // 粉色 + icon: '🎵', + text: '音频' + }, + document: { + color: { r: 16, g: 185, b: 129 }, // 绿色 + icon: '📄', + text: '文档' + }, + design: { + color: { r: 168, g: 85, b: 247 }, // 紫色 + icon: '🎨', + text: '设计' + }, + other: { + color: { r: 107, g: 114, b: 128 }, // 灰色 + icon: '📁', + text: '其他' + } + }; + + const config = typeConfig[type] || typeConfig.other; + + const color = config.color; + + // 创建渐变背景 + 图标 + 文件扩展名 + const svg = ` + + + + + + + + + + ${config.icon} + + + .${label.toLowerCase()} + + + ${config.text}文件 + + + 双击在默认应用中打开 + + + `; + + await sharp(Buffer.from(svg)) + .resize(640, 480) + .webp({ quality: 85 }) + .toFile(outputPath); + + const stats = fs.statSync(outputPath); + return { + width: 640, + height: 480, + size: stats.size, + path: outputPath + }; +} + +/** + * 获取文件类型对应的图标(Unicode) + */ +function getIconForType(type) { + const icons = { + video: '🎬', + document: '📄', + special: '🎨' + }; + return icons[type] || '📁'; +} + module.exports = { isImageFile, + getFileType, calculateFileHash, getThumbnailConfig, generateThumbnail, getImageMetadata, generateImageThumbnails, - SUPPORTED_FORMATS + SUPPORTED_FORMATS, + ALL_FORMATS }; diff --git a/flypic/app/ui/config b/flypic/app/ui/config index db9cd77..ebda836 100644 --- a/flypic/app/ui/config +++ b/flypic/app/ui/config @@ -2,10 +2,14 @@ ".url": { "flypic.Application": { "title": "FlyPic", - "icon": "images/icon_{0}.png", + "icon": "images/icon-{0}.png", "type": "url", "protocol": "http", - "port": "5002" + "port": "15002", + "allUsers": true, + "control": { + "portPerm": "editable" + } } } -} \ No newline at end of file +} diff --git a/flypic/cmd/install_init b/flypic/cmd/install_init index 4bb82ef..9516899 100644 --- a/flypic/cmd/install_init +++ b/flypic/cmd/install_init @@ -13,6 +13,21 @@ echo "数据共享路径: ${TRIM_DATA_SHARE_PATHS}" echo "应用目录: ${TRIM_APPDEST}" echo "数据目录: ${TRIM_PKGVAR}" echo "临时目录: ${TRIM_PKGTMP}" + +# 获取用户设置的端口(从安装向导) +APP_PORT="${wizard_app_port:-15002}" +echo "用户设置端口: ${APP_PORT}" + +# 更新 UI 配置中的端口 +UI_CONFIG="${TRIM_APPDEST}/ui/config" +if [ -f "$UI_CONFIG" ]; then + sed -i "s/\"port\": \"[0-9]*\"/\"port\": \"${APP_PORT}\"/" "$UI_CONFIG" + echo "已更新 UI 配置端口为: ${APP_PORT}" +fi + +# 保存端口配置供 main 脚本使用 +echo "APP_PORT=${APP_PORT}" > "${TRIM_PKGVAR}/port.conf" + echo "=== 安装初始化完成 ===" exit 0 diff --git a/flypic/cmd/main b/flypic/cmd/main index 1d2cf43..9cfe4c2 100644 --- a/flypic/cmd/main +++ b/flypic/cmd/main @@ -8,8 +8,16 @@ export PATH=/var/apps/nodejs_v22/target/bin:$PATH # 数据目录 DATA_DIR="${TRIM_DATA_SHARE_PATHS%%:*}" + +# 读取用户配置的端口(默认 5002) +PORT_CONF="${TRIM_PKGVAR}/port.conf" +if [ -f "$PORT_CONF" ]; then + source "$PORT_CONF" +fi +APP_PORT="${APP_PORT:-15002}" + # 启动命令 -CMD="DATA_DIR=${DATA_DIR} PORT=5002 node ${TRIM_APPDEST}/server/server.js" +CMD="DATA_DIR=${DATA_DIR} PORT=${APP_PORT} node ${TRIM_APPDEST}/server/server.js" log_msg() { local msg="$(date '+%Y-%m-%d %H:%M:%S') - $1" diff --git a/flypic/manifest b/flypic/manifest index bd75e53..7c86db1 100644 --- a/flypic/manifest +++ b/flypic/manifest @@ -1,6 +1,6 @@ appname=flypic version=0.1.0 -desc=轻量、快速、稳定的图片检索浏览应用 +desc=飞图 - 专为飞牛 fnOS 设计的轻量、快速、稳定的图像素材检索浏览应用,支持数十万级别图片流畅浏览,非侵入式设计,100% 开源免费 arch=x86_64 display_name=FlyPic maintainer=ZangXincz @@ -8,5 +8,5 @@ distributor=ZangXincz desktop_uidir=ui desktop_applaunchname=flypic.Application source=thirdparty -service_port=5002 +service_port=15002 install_dep_apps=nodejs_v22 diff --git a/flypic/wizard/install b/flypic/wizard/install new file mode 100644 index 0000000..5e31e6b --- /dev/null +++ b/flypic/wizard/install @@ -0,0 +1,31 @@ +[ + { + "stepTitle": "应用配置", + "items": [ + { + "type": "tips", + "helpText": "欢迎安装 FlyPic!请配置应用端口。" + }, + { + "type": "text", + "field": "wizard_app_port", + "label": "应用端口", + "initValue": "15002", + "rules": [ + { + "required": true, + "message": "请输入端口号" + }, + { + "pattern": "^[0-9]+$", + "message": "端口号必须是数字" + } + ] + }, + { + "type": "tips", + "helpText": "默认端口为 15002,如果该端口被占用,请修改为其他可用端口。" + } + ] + } +] diff --git a/frontend/index.html b/frontend/index.html index c92eeef..409d28d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,9 +2,9 @@ - + - FlyPic - 图片素材库管理 + FlyPic 飞图 - 图片素材库管理
diff --git a/frontend/public/favicon.png b/frontend/public/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..d403d35137cc363870e3fa6a89dbdb55264fe755 GIT binary patch literal 4977 zcmaJ_c{G&$-yTHvy=2RvN69i9vdmC+X^TpriIE-$s}L&y0N^mt*ET&K zFaLg->5spEu+2vu4}xAgR$gX!S1(@_5e>NFf_Fj#4Lnh9Xj3%G#qahcqiS|MP$(|lKk}4S?@u#lp@%;BTNCNmL#0!g% z_>UzV6YPKl8QV;NkK_LSr!NdLm?nA1O$P~K@?RLp{h_7;9rl# zaWtZftE#EC?q9KvR|pArFE4^B2;}SQEAI=F#}nN^5ET^_5Eu%ALgkJTawI>T7m6&0 zBT4?Ppp7Ou6EOrY3?2vkt%!2MdwU@yj-CD|1y901vN+OTWjZbxh>RkDAoAefDg6yZ zBL9D=r{_Otl9ws^zkdHuVUoEY0Sz)mlkna|=i`HOmHZuwpsGbgqrC7$b3EST?<$(O zc;3 z(grI)Ai7{p7#OOnq@n@^Lo}5X6czvGYU7=~J<&L?zqu~|{IABt?pbmX=vfiFLF5_W!G1(7=AY?y+! z#$$Z*9&N3z*7;9v|7fUbu622DqQb#9X@}KC zS!=2&b5pBSSDq+S@MYaJ)8Zix2D8;S3gW2(bWF4;%;WMKA|I}kN`_7vU9a+-H7qNd zRaQ}1+x8zlt#n(q2+LIeB*T%$3AE}lpH)sN{F*#(#g1($h$r`BTbnDRT(%%akB*|ZVPAR&mrBV~TU+0ar zJm{PZIvU%#TWP{=mWn;u$ZlnT?8ijxu4)9xoMvkvPd$24{2gxjn6&CwU|1cFdmLT7 z-|u@^h^5W9+)rTVj4x-W_Wbxl16V=RvsB^{g!M;FS<`B`hHupENgYYGq(?lT{G+@x z7ywUtk!Jk^d#iPu@lR>iDc_dro-ZkB58^|#FzE)!g=a@?K{LuX559&46Sg@C<06h1 zu6F=9wRx4DXxS+Zhx0?)y=>?A_D)`-Ih}Dm?92<9n0OU_2F2RTPWtu5IXat(;cmmP z_AqLhy%e?bn=%R4eBT=&{Jv>(CH|@X1APmKi&+7trF^V+1751&sp4|W<|@*#Q3>Z> z{h2|8GSF#$i;0=Lex%1_vUfu;B1_Re6UP3MOD$V#rLd5~@$?eE`#|`%MNx`vAr$ez z#GA@Umo()YpMX~zc9-POd}7p|)T{639LWFD4%TSL9-5?|4~DKCHhX4w8zwSZ%6ecp z?`hgNWROmt*$;9!F{YqnX`xdjG1&MK@IidO?q;o8#xp-+H;9*SR^GKM&MoDO-(5cC z)3YOW;v|yc-CP6lDsbMCuBx0$A@9rL;SK+{_{n-{b)KUIu@!Y%|H)V4(b`3l+vEO2 z;|;+lyZeC@X4o5V?=N4_1qB5U4X>{3=AnkIt=V?1sZb%|uV;gPWi4BlD*u|HhK0>m z2dK-T-TDMAEM$}T$ece;4u|DWWDUnqzCTlhv6FNuAp=T^1NLQ<4g>HQ=eIK+CFP{7A_K|XKQn+mWq()KXlS+mV zcX46*6EjC&fdR`h`?^}}@&bOeT$eey+p081-&D8%^|HGEH!iV*J*(o=*)0|dwkY=- zgR(L6y1E}oDuTN8t(>*NYcaT|*YYRG2iilPYP{0bh0TVN6b0fsOUoUbapx^+wTF+# z3iTwH7%hm3%xTGSj>;_#5f&ct;AFaZElRusm zlS5;Dm6+ul@v|>TJ4?l1zgRaUZ2PMuH1;VlT{SSur?0)5IgE>a{qXx6bL4rm5uWcB zxRFX0hqh@c#qZxEdqJpi-7jz*HqOXsC#_Ff@#@%zxM9Di>4O9IXh&qnqq}=&-!;s>|I%0<6s@T$+r;xci9bEKRlPxsIPcX#k1Ld zu0D}z^J5z?d*#GO!9lQS+0X}Kz}g5b;b@ub=AETez-&h_v!E5-Mfqx&-sL&z_yuH) zDsiQCWTHOfk~gj^d*{$`Ip{qYIKR7pdE+$yt9Rwvt&O}iWx;HZ525w#S zfO3vXRDTwE)K$8&G9r3sF*iDcS|0V_7HGFvzM@RNSrOkNv3eBd5f@TqsIE2Uz(L1sU_xbnl^!d%msm;F``s}Y9L4RFD zIBsqCkk5F{e|~^=o;hDSVuK84^vr_nz7z`I>DU!i7VMYh8U^L$mDqmXtDSJm9NAlR zhKALq7zEU>(31yO^X&b zQltnor<}QPG`GPwiEI;)$B-964MFRTSxNYx-B)X&Hqw@j6v zlmw%nZ4gNx2eJ3w_9w7!;t|fSiWxqyAj8bj(92NQykT*L3LTIoU*ki}nyRN*Mx%aZ z&ub~|Gr;WHI8VM!2&pp_zO1I?<2^>2zjn!Q(<{pQw3!pr{BR<;k0b6U#{;b8y1!fL z$3A*n!PjzaH@q9-1Y2d28JoLJxcB3)R7{M-y=FhJ$Y_u>&86}AgNRzHo~gQ!S5?W@ zO07-td@qKf`QwJ(y+4X_rcDI9BdgG<6BKEV5GsnlCk;bmzttYcrQQ4@F$J7^+x}TZ z?4Wq!bBVxoO6)K<$C82EJVe-rwNjs_A;}+Bs!r_MT&9x@ALuj;q?KK?eH+Otz@|h)-f6GdTLmUiL~wS;Nb`9YgUH_1Wl(yhQRC^B;kqcFGA?)rY8U_X8g_W%F2% z3w|WZeAV=o2id;j)(>Jws_S(jmRf_C!YxhWE&-z%Tbg1-J`iZQwt?(9)f^WA;!e0v z3>Fj1E^>YfQqTOIslw`tAEkAezM?emPUo#(HbJ*8_LFR4+ahU>u$G|JEV)h@0Wx<~ z&XT}NeVxk>gR5@|ezEa^XCV+5F8)0?&Wc1^z&mFBkK-8$H|HrZ<=z-;p)Y*Tc{%5~ z*Cd@7YcGh01YW_T8*6Y{S%!IG78XJ8DH)gf%F=UAZmb)-w{)gH9VUv{$G{We%Wd%` zVLEJj;&hL{Jx}!W$!aFI(TT>)<(tcCDL1hd8^BJCedN;&G~v-klri)?#=P)o^R84A2lgU#R}h# zh>&|zQv(ul%;{}AR~gQ~Y?dzbb+@>pcKceTYDrHCNB!vWJ;|#!+8HHF`;tBL)DGSa z0jo{q=5od&B|b4#_ary18Oa+7&dgIFf*XigUc(=V^Q8CR_Ivy6^kV!wU#}YH+S1Z) zUlVA5ZsH3io->0%oD(h{ik65Nt2q|4Jba0*a_%H5No)!;tVNhBy@-vE53`e2VPSQg zSoW6?2tq|tR6U&ZPi;mWhC?5lpT>3hyhF1;d|ioHxb$p3mLsliquAYVH2%}r1vOV> z-tcJO3Qz65_*2pg2h^feSyn~Ct>VN^9DSO`>5IFUon^=RtOB$BFBH9mQ^|}?3P_Ao z;$@b(m#2G_4T6qK>z z@wS<%$Z^vc4(8PG4ft1pxO(rSPh0mmg137R0=m2l_h;~#tBBiki;FvKJ6@;v1?)w?F}XZxx437OxP4wAa!=&qPU zVe3D$x2OEP#O-=^?>3=mRdD*rs^^>zR~=%?YFvx4gTo!}aB1WVSl|J}i<)i@b|d8- zFZm1^2ez(G2)QL4U1aH_aLL^AhPlbTbAn%UUp%{W*miKgPi4oDYwT^{LRZws*XVTI zX^wl$X+viS=u7-}c1IZCA8s~e=Tui$I4Ev!Tw$D414Hnh>xgXVfv%|i+$y1o4l^P+E? zO;^*YP)kB2OB<{1s@_ssT29$hc+mb&%Y^y|`mU#CU#^Yy4USZ+Pw~xekR{Z!3WcwI0-givwDi-02iVGkS$6dGo|fKCwMQwr^Exp@0XR=*GX||`?SOsFV6j>^sG#)?@6JT1sr>nv z?8TJkKeQo-R$TDvx_!-cx}iBmq=kjnr9`@&xR$-v-S?wgTPa&@Y-Ki8xdjCfkVastt|-tRCmUxw53saGeG#eL*HFJnC-z3pDb&i>K@i3*CXzJO;@q7yIN5r5Z@ zVTt5bpJAk%2&rH_$Ql`x3J)k=c(5LTAl|5Tp2~L&zsyg62KkX8Z8PZRg+-ZMD#0<; z$^AV+qs(#fXlJ^>uLe8EO@z2B$CvO^OmwV!Yn#=?OA}1mY`HhdnbFcCsEJdv57z^F zC=Xw~qMn#~y9B8={_&cE|8|?P@f5%kU`Iz_Y+O?cIpT2yd^ + + + + + + + + + + + diff --git a/frontend/vite.config.js b/frontend/vite.config.js index c352161..f545319 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -7,7 +7,7 @@ export default defineConfig({ port: 5173, proxy: { '/api': { - target: process.env.VITE_API_URL || 'http://localhost:3000', + target: process.env.VITE_API_URL || 'http://localhost:15002', changeOrigin: true } } diff --git a/scripts/build-fpk-docker.js b/scripts/build-fpk-docker.js index 694bbaa..96659d3 100644 --- a/scripts/build-fpk-docker.js +++ b/scripts/build-fpk-docker.js @@ -110,10 +110,14 @@ const uiConfig = { ".url": { "flypic.Application": { "title": "FlyPic", - "icon": "images/icon_{0}.png", + "icon": "images/icon-{0}.png", "type": "url", "protocol": "http", - "port": "5002" + "port": "15002", + "allUsers": true, + "control": { + "portPerm": "editable" + } } } }; diff --git a/scripts/build-fpk.js b/scripts/build-fpk.js index c9bc2d2..31f195f 100644 --- a/scripts/build-fpk.js +++ b/scripts/build-fpk.js @@ -72,10 +72,14 @@ const uiConfig = { ".url": { "flypic.Application": { "title": "FlyPic", - "icon": "images/icon_{0}.png", + "icon": "images/icon-{0}.png", "type": "url", "protocol": "http", - "port": "5002" + "port": "15002", + "allUsers": true, + "control": { + "portPerm": "editable" + } } } }; diff --git a/website/index.html b/website/index.html index 82f905f..f0d5c42 100644 --- a/website/index.html +++ b/website/index.html @@ -3,8 +3,8 @@ - FlyPic - 飞牛NAS图片检索浏览应用 - + FlyPic 飞图 - 飞牛NAS图片检索浏览应用 + @@ -47,9 +47,9 @@
🤖 完全由 AI 开发 · 专为飞牛 fnOS 设计
-

轻量、快速、稳定的
图像素材检索浏览应用

+

FlyPic 飞图
轻量、快速、稳定的图像素材检索浏览应用

- 支持 10万+ 级别图片流畅浏览,轻量快速。非侵入式设计, + 支持 数十万 级别图片流畅浏览,轻量快速。非侵入式设计, 不修改原文件结构。AI开发 100% 开源免费。

@@ -61,7 +61,7 @@
- 10万+ + 数十万 图片支持
@@ -72,6 +72,10 @@ 实时 文件监控
+
+ FN Connect + 远程访问 +
@@ -136,7 +140,7 @@

固定行高瀑布流

固定高度、宽度自适应的瀑布流布局,视觉整齐美观。支持缩略图大小调节(150-300px),适应不同浏览需求。

    -
  • 虚拟滚动技术,轻松浏览 10万+ 图片
  • +
  • 虚拟滚动技术,轻松浏览数十万图片
  • Web Worker 异步计算布局,不阻塞主线程
  • 智能分批加载,按需请求数据
@@ -470,6 +474,28 @@
+ +
+

+ + 安装提示 +

+
    +
  • + • + 自定义端口:安装时可自定义应用端口(默认 15002),避免与其他应用冲突 +
  • +
  • + • + 素材库路径:添加素材库时需输入飞牛文件系统的完整路径,如 /vol1/1000/图片库 +
  • +
  • + • + 文件夹权限:请确保应用对素材库文件夹有读取权限,可在飞牛应用设置中配置授权目录 +
  • +
+
+
@@ -482,7 +508,7 @@

添加素材库

-

点击左侧素材库下拉框,选择"添加新素材库",输入名称和路径

+

点击左侧素材库下拉框,选择"添加新素材库",输入名称和飞牛文件路径(如 /vol1/1000/图片)